/* ==========================================================================
   JAPAN MASTER — ADMIN CMS PORTAL STYLES
   ========================================================================== */

:root {
    --bg-dark: #0a0c13;
    --bg-card: rgba(18, 22, 34, 0.78);
    --bg-card-hover: rgba(26, 32, 48, 0.92);
    --bg-card-subtle: rgba(255, 255, 255, 0.03);
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-focus: rgba(236, 72, 153, 0.45);
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    --accent-sakura: #ff7597;
    --accent-sakura-glow: rgba(255, 117, 151, 0.25);
    --accent-emerald: #10b981;
    --accent-emerald-glow: rgba(16, 185, 129, 0.2);
    --accent-amber: #f59e0b;
    --accent-indigo: #6366f1;
    --accent-cyan: #06b6d4;
    --danger: #ef4444;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --font-main: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-jp: 'Noto Sans JP', sans-serif;
    --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 25px rgba(255, 117, 151, 0.18);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    background-image: 
        radial-gradient(ellipse at 15% 10%, rgba(236, 72, 153, 0.07) 0%, transparent 45%),
        radial-gradient(ellipse at 85% 85%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(16, 185, 129, 0.03) 0%, transparent 60%);
    background-attachment: fixed;
}

/* ================= UTILITY & BASE ================= */
.hidden {
    display: none !important;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    outline: none;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

a {
    color: inherit;
    text-decoration: none;
}

/* ================= AUTH VIEWS ================= */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    position: relative;
    z-index: 10;
}

.auth-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card), var(--shadow-glow);
    padding: 2.75rem 2.25rem;
    max-width: 480px;
    width: 100%;
    text-align: center;
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-badge-icon {
    width: 68px;
    height: 68px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    background: linear-gradient(135deg, rgba(255, 117, 151, 0.15), rgba(99, 102, 241, 0.15));
    border: 1px solid rgba(255, 117, 151, 0.3);
    box-shadow: 0 0 20px rgba(255, 117, 151, 0.2);
}

.auth-badge-icon.error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(245, 158, 11, 0.15));
    border-color: rgba(239, 68, 68, 0.4);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.2);
}

.auth-title {
    font-size: 1.65rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #fff, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.55;
    margin-bottom: 1.75rem;
}

.auth-notice-box {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
    margin-bottom: 1.75rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: left;
}

.auth-notice-box strong {
    color: var(--accent-sakura);
    display: block;
    margin-bottom: 0.25rem;
}

.auth-notice-box code {
    background: rgba(0, 0, 0, 0.35);
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    color: #f8fafc;
    font-family: monospace;
    font-size: 0.9em;
}

.btn-google {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.85rem;
    width: 100%;
    padding: 0.9rem 1.4rem;
    background: #ffffff;
    color: #1e293b;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
    transition: all 0.25s ease;
}

.btn-google:hover {
    background: #f1f5f9;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.15);
}

.btn-google svg {
    width: 20px;
    height: 20px;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1.25rem;
    margin-top: 0.85rem;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    font-size: 0.9rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

/* Spinner */
.spinner {
    width: 44px;
    height: 44px;
    border: 3px solid rgba(255, 117, 151, 0.2);
    border-top-color: var(--accent-sakura);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1.25rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ================= DASHBOARD HEADER ================= */
.admin-header {
    background: rgba(15, 18, 28, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0.85rem 1.5rem;
}

.header-inner {
    max-width: 1440px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.brand-group {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.brand-icon {
    font-size: 1.85rem;
}

.brand-titles h1 {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.badge-live-env {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-emerald);
    border: 1px solid rgba(16, 185, 129, 0.3);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.15rem 0.55rem;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.badge-live-env::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--accent-emerald);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent-emerald);
    animation: pulseGlow 1.8s infinite;
}

@keyframes pulseGlow {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.8); }
}

.brand-titles p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.header-user-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-pill {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    padding: 0.35rem 0.85rem;
    border-radius: 100px;
    font-size: 0.85rem;
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--accent-sakura);
}

.user-email {
    font-weight: 500;
    color: #e2e8f0;
}

.btn-header-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.95rem;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-header-link:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-logout {
    padding: 0.45rem 0.85rem;
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.22);
    color: #fca5a5;
}

/* ================= MAIN CONTENT ================= */
.admin-main {
    max-width: 1440px;
    width: 100%;
    margin: 0 auto;
    padding: 1.75rem 1.5rem 4rem;
    flex: 1;
}

/* Stat row */
.stats-banner {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1.1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    backdrop-filter: blur(12px);
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.15);
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
}

.stat-icon.hira { background: rgba(255, 117, 151, 0.12); color: var(--accent-sakura); border-color: rgba(255, 117, 151, 0.25); }
.stat-icon.kata { background: rgba(99, 102, 241, 0.12); color: var(--accent-indigo); border-color: rgba(99, 102, 241, 0.25); }
.stat-icon.kanji { background: rgba(245, 158, 11, 0.12); color: var(--accent-amber); border-color: rgba(245, 158, 11, 0.25); }
.stat-icon.cloud { background: rgba(16, 185, 129, 0.12); color: var(--accent-emerald); border-color: rgba(16, 185, 129, 0.25); }

.stat-meta {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: #ffffff;
}

/* Tab Navigation */
.tabs-container {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 0.75rem;
    margin-bottom: 1.5rem;
    overflow-x: auto;
}

.tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.65rem 1.25rem;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.04);
}

.tab-btn.active {
    color: #ffffff;
    background: rgba(255, 117, 151, 0.12);
    border-color: rgba(255, 117, 151, 0.35);
    box-shadow: 0 0 15px rgba(255, 117, 151, 0.15);
}

.tab-btn .tab-count {
    background: rgba(255, 255, 255, 0.08);
    padding: 0.15rem 0.5rem;
    border-radius: 100px;
    font-size: 0.75rem;
}

.tab-btn.active .tab-count {
    background: var(--accent-sakura);
    color: #111;
    font-weight: 700;
}

/* Search and Filters Bar */
.filter-toolbar {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.95rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
    backdrop-filter: blur(12px);
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 260px;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dim);
    pointer-events: none;
    font-size: 0.95rem;
}

.search-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 0.65rem 1rem 0.65rem 2.6rem;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.search-input:focus {
    border-color: var(--accent-sakura);
    box-shadow: 0 0 12px var(--accent-sakura-glow);
    background: rgba(0, 0, 0, 0.5);
    outline: none;
}

.filter-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.filter-pill {
    padding: 0.5rem 0.9rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.filter-pill:hover {
    background: rgba(255, 255, 255, 0.09);
    color: var(--text-main);
}

.filter-pill.active {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.45);
    color: #e0e7ff;
}

.filter-select {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.85rem;
    padding: 0.5rem 0.85rem;
    outline: none;
    cursor: pointer;
}

.filter-select:focus {
    border-color: var(--accent-sakura);
}

/* ================= CARDS GRID ================= */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 1.25rem;
}

.char-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(12px);
    transition: all 0.25s ease;
    position: relative;
}

.char-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 117, 151, 0.35);
    box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.6), 0 0 20px rgba(255, 117, 151, 0.1);
}

.char-card.is-overridden {
    border-color: rgba(16, 185, 129, 0.4);
    box-shadow: 0 4px 20px -5px rgba(16, 185, 129, 0.15);
}

.char-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.15rem;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border-subtle);
}

.char-glyph-box {
    display: flex;
    align-items: baseline;
    gap: 0.55rem;
}

.char-glyph {
    font-family: var(--font-jp);
    font-size: 2.1rem;
    font-weight: 700;
    line-height: 1;
    color: #ffffff;
}

.char-romaji {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--accent-sakura);
}

.char-meta-badges {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.badge-cloud-status {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: 100px;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.badge-cloud-status.cloud {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-cloud-status.default {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-dim);
    border: 1px solid var(--border-subtle);
}

/* Image preview section */
.char-card-media {
    position: relative;
    height: 175px;
    background: #06070a;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: zoom-in;
}

.char-card-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.char-card:hover .char-card-img {
    transform: scale(1.04);
}

.no-image-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    color: var(--text-dim);
    font-size: 0.8rem;
}

.no-image-icon {
    font-size: 2rem;
    opacity: 0.4;
}

.media-hover-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 600;
    gap: 0.45rem;
}

.char-card-media:hover .media-hover-overlay {
    opacity: 1;
}

/* Card details */
.char-card-body {
    padding: 1rem 1.15rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 0.65rem;
}

.mnemonic-heading {
    font-size: 0.92rem;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.mnemonic-heading .heading-icon {
    font-size: 0.95rem;
}

.mnemonic-snippet {
    font-size: 0.83rem;
    color: var(--text-muted);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.4em;
}

.char-card-footer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-card-edit {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.6rem 0.9rem;
    background: linear-gradient(135deg, rgba(255, 117, 151, 0.15), rgba(236, 72, 153, 0.2));
    border: 1px solid rgba(255, 117, 151, 0.35);
    color: #ff94b1;
    font-size: 0.84rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.btn-card-edit:hover {
    background: linear-gradient(135deg, rgba(255, 117, 151, 0.28), rgba(236, 72, 153, 0.35));
    color: #ffffff;
    box-shadow: 0 0 15px rgba(255, 117, 151, 0.25);
    transform: translateY(-1px);
}

.btn-card-revert {
    padding: 0.6rem 0.75rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #f87171;
    font-size: 0.84rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.btn-card-revert:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

/* ================= MODAL DIALOGS ================= */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(3, 4, 8, 0.82);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-window {
    background: rgba(18, 22, 34, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8), 0 0 30px rgba(255, 117, 151, 0.15);
    max-width: 680px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    transform: scale(0.96) translateY(10px);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .modal-window {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.75rem;
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    background: rgba(18, 22, 34, 0.98);
    backdrop-filter: blur(10px);
    z-index: 10;
}

.modal-header-titles {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.modal-char-badge {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, rgba(255, 117, 151, 0.2), rgba(99, 102, 241, 0.2));
    border: 1px solid rgba(255, 117, 151, 0.4);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-family: var(--font-jp);
    font-weight: 700;
}

.modal-header-titles h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff;
}

.modal-header-titles p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.btn-modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-modal-close:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

.modal-body {
    padding: 1.5rem 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Image comparison view inside modal */
.modal-comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 580px) {
    .modal-comparison-grid {
        grid-template-columns: 1fr;
    }
}

.preview-box {
    background: #06070a;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.preview-box-label {
    padding: 0.45rem 0.85rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.preview-viewport {
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    position: relative;
}

.preview-viewport img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Upload Dropzone */
.upload-dropzone {
    border: 2px dashed rgba(255, 117, 151, 0.35);
    border-radius: var(--radius-md);
    padding: 1.5rem 1rem;
    text-align: center;
    cursor: pointer;
    background: rgba(255, 117, 151, 0.03);
    transition: all 0.2s ease;
}

.upload-dropzone:hover, .upload-dropzone.dragover {
    border-color: var(--accent-sakura);
    background: rgba(255, 117, 151, 0.08);
    box-shadow: 0 0 20px var(--accent-sakura-glow);
}

.dropzone-icon {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
}

.dropzone-text {
    font-size: 0.92rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 0.25rem;
}

.dropzone-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.file-info-badge {
    margin-top: 0.65rem;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.25rem 0.75rem;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 100px;
    font-size: 0.78rem;
    color: #34d399;
}

.or-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-dim);
    font-size: 0.8rem;
    text-transform: uppercase;
}

.or-divider::before, .or-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-subtle);
}

/* Form inputs */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.form-label {
    font-size: 0.84rem;
    font-weight: 600;
    color: #e2e8f0;
}

.form-input, .form-textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.2s ease;
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

.form-input:focus, .form-textarea:focus {
    border-color: var(--accent-sakura);
    box-shadow: 0 0 12px var(--accent-sakura-glow);
    background: rgba(0, 0, 0, 0.5);
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.15rem 1.75rem;
    border-top: 1px solid var(--border-subtle);
    background: rgba(18, 22, 34, 0.98);
    position: sticky;
    bottom: 0;
    z-index: 10;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--accent-sakura), #ec4899);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.92rem;
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 15px rgba(236, 72, 153, 0.3);
    transition: all 0.2s ease;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(236, 72, 153, 0.45);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Lightbox Modal */
.lightbox-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 3000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.lightbox-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-img-wrapper {
    max-width: 90vw;
    max-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: var(--radius-md);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.lightbox-caption {
    margin-top: 1rem;
    font-size: 0.95rem;
    color: #ffffff;
    text-align: center;
}

.lightbox-close-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.lightbox-close-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Toast notifications */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 4000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    background: rgba(18, 22, 34, 0.95);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.85rem 1.25rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: #ffffff;
    animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    max-width: 380px;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(20px) scale(0.9); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.toast.success {
    border-color: rgba(16, 185, 129, 0.4);
}

.toast.error {
    border-color: rgba(239, 68, 68, 0.4);
}

.toast-icon {
    font-size: 1.2rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;
        align-items: flex-start;
    }
    .header-user-actions {
        width: 100%;
        justify-content: space-between;
    }
    .filter-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .cards-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   VOCABULARY & SENTENCES CMS STYLES
   ========================================================================== */
.vocab-section {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

.vocab-creator-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.75rem 2rem;
    box-shadow: var(--shadow-card);
    transition: border-color 0.25s ease;
}

.vocab-creator-card:focus-within {
    border-color: rgba(56, 189, 248, 0.4);
}

.creator-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-subtle);
    flex-wrap: wrap;
    gap: 1rem;
}

.creator-header-titles {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.creator-badge-icon {
    font-size: 2rem;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: var(--radius-md);
    padding: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.creator-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.25rem;
}

.creator-header p {
    font-size: 0.88rem;
    color: var(--text-muted);
}

.vocab-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-translate-row {
    width: 100%;
}

.translate-input-wrapper {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.4rem;
}

.translate-input-wrapper .form-input {
    flex: 1;
    font-size: 1.05rem;
    padding: 0.85rem 1.15rem;
}

.btn-translate-action {
    background: linear-gradient(135deg, #0284c7, #2563eb);
    color: #ffffff;
    font-weight: 600;
    font-size: 0.92rem;
    padding: 0.85rem 1.35rem;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.25);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-translate-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
    filter: brightness(1.1);
}

.btn-translate-action:active {
    transform: translateY(0);
}

.btn-translate-action.loading {
    opacity: 0.75;
    pointer-events: none;
}

.form-grid-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1rem;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.required-star {
    color: #f43f5e;
}

.form-input, .form-select {
    width: 100%;
    background: rgba(10, 12, 19, 0.75);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-main);
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.2s ease;
}

.form-input:focus, .form-select:focus {
    border-color: rgba(56, 189, 248, 0.55);
    background: rgba(15, 23, 42, 0.85);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.form-input.jp-font {
    font-family: var(--font-jp);
    font-size: 1.15rem;
    font-weight: 500;
}

.creator-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.85rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.btn-creator-primary {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.85rem 1.6rem;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.25);
}

.btn-creator-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 22px rgba(16, 185, 129, 0.4);
    filter: brightness(1.1);
}

.btn-creator-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-creator-secondary:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Karty słownictwa w gridzie */
.vocab-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
}

.vocab-card {
    background: var(--bg-card);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.35rem 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.vocab-card:hover {
    transform: translateY(-4px);
    border-color: rgba(56, 189, 248, 0.35);
    box-shadow: 0 12px 28px -10px rgba(0, 0, 0, 0.6), 0 0 20px rgba(56, 189, 248, 0.12);
}

.vocab-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.85rem;
}

.vocab-badges {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.badge-vocab-category {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.badge-vocab-type {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.badge-vocab-source {
    font-size: 0.7rem;
    color: var(--text-dim);
}

.vocab-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 1rem;
}

.vocab-card-ja {
    font-family: var(--font-jp);
    font-size: 1.75rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.25;
}

.vocab-card-reading {
    font-family: var(--font-jp);
    font-size: 0.95rem;
    color: var(--accent-sakura);
    font-weight: 500;
}

.vocab-card-romaji {
    font-size: 0.85rem;
    color: var(--text-dim);
    font-style: italic;
}

.vocab-card-pl {
    margin-top: 0.4rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: #e2e8f0;
    line-height: 1.35;
    padding-top: 0.4rem;
    border-top: 1px dashed rgba(255, 255, 255, 0.07);
}

.vocab-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-subtle);
}

.vocab-card-actions {
    display: flex;
    gap: 0.45rem;
}

.btn-card-action {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    padding: 0.38rem 0.65rem;
    font-size: 0.82rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.btn-card-action:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.btn-card-action.danger:hover {
    background: rgba(239, 68, 68, 0.18);
    border-color: rgba(239, 68, 68, 0.35);
    color: #fca5a5;
}

.btn-card-action.speak:hover {
    background: rgba(56, 189, 248, 0.18);
    border-color: rgba(56, 189, 248, 0.35);
    color: #38bdf8;
}

