/* ─────────────────────────────────────────────
   stil.css — Admin + Müşteri paneli ortak stiller
   ───────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

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

:root {
    --bg-primary:    #10100f;
    --bg-secondary:  #202020;
    --bg-tertiary:   #161614;
    --text-primary:  #f0efeb;
    --text-secondary:#a0a09a;
    --text-tertiary: #6b6b65;
    --border:        rgba(255,255,255,0.08);
    --border-md:     rgba(255,255,255,0.15);
    --accent:        #245268;
    --accent-dark:   #1a3d4f;
    --accent-light:  #0e2330;
    --accent-text:   #7bbcd4;
    --purple:        #9B94E8;
    --purple-dark:   #AFA9EC;
    --purple-light:  #2a2840;
    --purple-text:   #AFA9EC;
    --success-bg:    #1a2e10;
    --success-text:  #97C459;
    --warning-bg:    #2e2010;
    --warning-text:  #FAC775;
    --danger-bg:     #2e1010;
    --danger-text:   #F09595;
    --info-bg:       #0e1e30;
    --info-text:     #85B7EB;
    --radius-md:     8px;
    --radius-lg:     12px;
}

body.light {
    --bg-primary:    #ffffff;
    --bg-secondary:  #f3f4f6;
    --bg-tertiary:   #f9fafb;
    --text-primary:  #111827;
    --text-secondary:#4b5563;
    --text-tertiary: #9ca3af;
    --border:        rgba(0,0,0,0.08);
    --border-md:     rgba(0,0,0,0.15);
    --accent:        #7bbcd4;
    --accent-dark:   #245268;
    --accent-light:  rgba(123, 188, 212, 0.15);
    --accent-text:   #163c4e;
    --purple:        #6366f1;
    --purple-dark:   #4f46e5;
    --purple-light:  #e0e7ff;
    --purple-text:   #4338ca;
    --success-bg:    #dcfce7;
    --success-text:  #15803d;
    --warning-bg:    #fef9c3;
    --warning-text:  #a16207;
    --danger-bg:     #fee2e2;
    --danger-text:   #b91c1c;
    --info-bg:       #e0f2fe;
    --info-text:     #0369a1;
}

html, body {
    height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    line-height: 1.6;
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* ── Layout ── */
.panel-wrap { display: flex; height: 100vh; overflow: hidden; }

.sidebar {
    width: 245px;
    flex-shrink: 0;
    background: var(--bg-secondary);
    border-right: 0.5px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar-logo {
    padding: 18px 16px 14px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 0.5px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.site-logo {
    display: block;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
}
.site-logo-fallback {
    color: var(--accent-text);
}
.sidebar-logo-img {
    width: 150px;
    max-width: 100%;
    height: 42px;
}

.sidebar-nav { padding: 8px 0; flex: 1; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    border-left: 2px solid transparent;
}

.nav-item:hover { background: var(--bg-tertiary); color: var(--text-primary); }

.nav-item.active {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-weight: 500;
    border-left-color: var(--accent);
}

.nav-item i { font-size: 16px; }

.sidebar-bottom {
    padding: 12px 16px;
    border-top: 0.5px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.sidebar-profile-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}
.sidebar-profile-link {
    min-width: 0;
    text-decoration: none;
    display: block;
    padding: 4px;
    border-radius: var(--radius-md);
    transition: background 0.15s;
}
.sidebar-profile-link:hover { background: var(--bg-tertiary); }
.sidebar-profile-name,
.sidebar-profile-username {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sidebar-profile-name {
    font-size: 13px;
    color: #cbcbcb;
    margin-bottom: 1px;
}
.sidebar-profile-username {
    font-size: 12px;
    color: var(--text-secondary);
}
.sidebar-credit-pill {
    width: fit-content;
    padding: 2px 6px;
    font-size: 11px;
}

.main-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 18px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ── Kartlar ── */
.card {
    background: var(--bg-primary);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 11px;
    margin-bottom: 12px;
}

.card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.page-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    line-height: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Metrik kartlar ── */
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }

.metric {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.metric-label { font-size: 13px; color: var(--text-secondary); }
.metric-val   { font-size: 24px; font-weight: 600; color: var(--text-primary); }
.metric-val.purple { color: var(--accent-text); }

/* ── Tablo ── */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
    text-align: left;
    font-weight: 500;
    color: var(--text-secondary);
    padding: 0 10px 10px 0;
    border-bottom: 0.5px solid var(--border);
}
td {
    padding: 9px 10px 9px 0;
    border-bottom: 0.5px solid var(--border);
    color: var(--text-primary);
    vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr.arsiv td { opacity: 0.4; }

/* ── Butonlar ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 32px;
    box-sizing: border-box;
    padding: 6px 14px;
    border-radius: 6px;
    background: var(--bg-secondary);
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    color: var(--text-secondary);
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}
.btn i { line-height: 1; }
.btn:hover { 
    background: var(--bg-tertiary); 
    color: var(--text-primary);
}
.btn:active {
    transform: scale(0.98);
}

.btn.primary { 
    background: var(--text-primary);
    color: var(--bg-primary);
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(240, 239, 235, 0.18), 0 0 0 1px rgba(255,255,255,0.08);
}
.btn.primary:hover { 
    background: #ffffff;
    color: #10100f;
    box-shadow: 0 6px 18px rgba(240, 239, 235, 0.26), 0 0 0 1px rgba(255,255,255,0.14);
}

body.light .btn.primary {
    background: var(--text-primary);
    color: #ffffff;
    box-shadow: 0 3px 12px rgba(17, 24, 39, 0.18), 0 0 0 1px rgba(0,0,0,0.04);
}
body.light .btn.primary:hover {
    background: #000000;
    color: #ffffff;
}

.btn.ghost { 
    background: transparent;
    color: var(--text-secondary); 
    box-shadow: none;
}
.btn.ghost:hover { 
    background: var(--bg-secondary); 
    color: var(--text-primary); 
}

.btn.danger { background: rgba(240, 149, 149, 0.1); color: var(--danger-text); }
.btn.danger:hover { background: rgba(240, 149, 149, 0.2); }
.btn.success { background: rgba(151, 196, 89, 0.1); color: var(--success-text); }
.btn.success:hover { background: rgba(151, 196, 89, 0.2); }
body.light .btn.success { background: rgb(153 225 53 / 58%); color: #114c27; }
body.light .btn.success:hover { background: rgb(153 225 53 / 72%); color: #114c27; }
.btn.warning { background: rgba(250, 199, 117, 0.1); color: var(--warning-text); }
.btn.warning:hover { background: rgba(250, 199, 117, 0.2); }

.btn:disabled { opacity: 0.35; cursor: not-allowed; pointer-events: none; transform: none !important; box-shadow: none !important; }

.btn.lg { 
    padding: 8px 18px; 
    font-size: 13px; 
    font-weight: 600; 
}

/* ── Rozet ── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}
.badge.beklemede  { background: var(--warning-bg);  color: var(--warning-text); }
.badge.isleniyor  { background: #212425; color: #2eaaef; }
.badge.tamamlandi { background: #064425; color: #7ae9a3; }
body.light .badge.isleniyor  { background: #5ad6ff; color: #053e5e; }
body.light .badge.tamamlandi { background: #19e17d; color: #114c27; }
.badge.hata       { background: var(--danger-bg);   color: var(--danger-text); }
.badge.iptal      { background: var(--danger-bg);   color: var(--danger-text); }
.badge.arsiv      { background: var(--bg-secondary); color: var(--text-tertiary); }

/* ── Formlar ── */
.form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.form-group label { font-size: 12px; font-weight: 500; color: var(--text-secondary); }
.form-group input,
.form-group select,
.form-group textarea {
    padding: 8px 10px;
    border: 0.5px solid var(--border-md);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: border-color 0.15s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--accent); }

.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }

/* ── Upload alanı ── */
.upload-area {
    border: 1px dashed var(--border-md);
    border-radius: var(--radius-md);
    padding: 36px 16px;
    text-align: center;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.upload-area:hover, .upload-area.dragover {
    background: var(--accent-light);
    border-color: var(--accent);
}
.upload-area i { font-size: 36px; color: var(--accent-text); display: block; margin-bottom: 10px; }
.upload-title  { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.upload-sub    { font-size: 12px; color: var(--text-secondary); }

.upload-clear-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    display: none;
    align-items: center;
    justify-content: center;
    background: var(--danger);
    border: none;
    border-radius: 6px;
    color: #ffffff;
    cursor: pointer;
    z-index: 2;
    transition: opacity 0.2s;
    opacity: 0.8;
    padding: 0;
}
.upload-clear-btn:hover {
    opacity: 1;
}
.upload-clear-btn i {
    font-size: 16px !important;
    color: #ffffff !important;
    margin: 0 !important;
    display: inline-block !important;
}

/* ── Kredi pill ── */
.credit-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--accent-light);
    color: var(--accent-text);
    border-radius: 20px;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 600;
}


/* ── Bildirim ── */
.alert {
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 13px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.alert.success { background: var(--success-bg); color: var(--success-text); }
.alert.danger  { background: var(--danger-bg);  color: var(--danger-text); }
.alert.info    { background: var(--info-bg);     color: var(--info-text); }
.alert.warning { background: var(--warning-bg);  color: var(--warning-text); }

/* ── Duyuru Panosu (Announcement Banner) ── */
.duyuru-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
    font-weight: 500;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
    margin-bottom: 6px;
    width: 100%;
}

/* Default Dark Theme / body.dark */
body:not(.light) .duyuru-banner,
body.dark .duyuru-banner {
    background: rgba(230, 180, 30, 0.07);
    border: 1px solid rgba(230, 180, 30, 0.35);
    color: #ffd875;
    box-shadow: 0 4px 20px rgba(230, 180, 30, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

body:not(.light) .duyuru-banner a,
body.dark .duyuru-banner a {
    color: #ffffff;
    text-decoration: underline;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 3px;
    font-weight: 700;
    transition: color 0.15s ease;
}

body:not(.light) .duyuru-banner a:hover,
body.dark .duyuru-banner a:hover {
    color: #ffe0a0;
}

/* Light Theme overrides */
body.light .duyuru-banner {
    background: rgba(212, 153, 0, 0.07);
    border: 1px solid rgba(212, 153, 0, 0.3);
    color: #8c6700;
    box-shadow: 0 4px 16px rgba(212, 153, 0, 0.06);
}

body.light .duyuru-banner a {
    color: #705200;
    text-decoration: underline;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 3px;
    font-weight: 700;
    transition: color 0.15s ease;
}

body.light .duyuru-banner a:hover {
    color: #4f3a00;
}


/* ── Section header ── */
.section-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--bg-primary);
    margin: -18px -24px 0;
    padding: 0 24px;
    min-height: 60px;
    border-bottom: 0.5px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

/* ── Filter butonlar (Segmented Control tarzı) ── */
.filter-row { 
    display: inline-flex; 
    gap: 4px; 
    flex-wrap: wrap; 
    background: var(--bg-tertiary);
    padding: 4px;
    border-radius: 8px;
    border: 1px solid var(--border);
}
.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.filter-btn:hover { color: var(--text-primary); }
.filter-btn.active {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-weight: 600;
    box-shadow: 0 2px 5px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.06);
}
.filter-btn i { font-size: 16px; }

.support-page-grid {
    display: grid;
    grid-template-columns: minmax(280px, 380px) minmax(360px, 1fr);
    gap: 16px;
    align-items: start;
}

@media (max-width: 900px) {
    .support-page-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Kullanıcı satırı ── */
.user-row { display: flex; align-items: center; gap: 8px; }

/* ── Giriş sayfası ── */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
}
.login-shell {
    width: min(100% - 32px, 640px);
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
}
.login-intro {
    width: 100%;
    background: var(--bg-primary);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    text-align: center;
}
.login-intro-eyebrow {
    color: var(--accent-text);
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 0;
}
.login-intro h1 {
    font-size: 17px;
    line-height: 1.35;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}
.login-intro p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.7;
    max-width: 560px;
}
.login-intro-list {
    display: flex;
    gap: 8px;
    margin-top: 2px;
    flex-wrap: wrap;
    justify-content: center;
}
.login-intro-list div {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
    font-size: 12px;
    background: var(--bg-secondary);
    border: 0.5px solid var(--border);
    border-radius: 999px;
    padding: 5px 9px;
}
.login-intro-list i {
    color: var(--accent-text);
    font-size: 18px;
}
.login-card {
    width: 100%;
    max-width: 340px;
    align-self: center;
    background: var(--bg-primary);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px 28px;
}
.login-logo {
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 24px;
    color: var(--text-primary);
}
.login-logo-img {
    width: 210px;
    max-width: 100%;
    height: 76px;
    margin: 0 auto;
}
.login-logo span { color: var(--accent-text); }
.contact-float {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}
.contact-float-options {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    pointer-events: none;
}
.contact-float-option,
.contact-float-main {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 14px;
    border: 0;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
    transition: transform .16s ease, opacity .16s ease, box-shadow .16s ease, background .16s ease;
}
.contact-float-option {
    opacity: 0;
    transform: translateY(10px) scale(0.96);
}
.contact-float.open .contact-float-option {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}
.contact-float-option.mail {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}
.contact-float-option.whatsapp {
    background: #25d366;
    color: #06130a;
}
.contact-float-main {
    background: var(--text-primary);
    color: var(--bg-primary);
    box-shadow: 0 4px 14px rgba(240, 239, 235, 0.18), 0 0 0 1px rgba(255,255,255,0.08);
}
body.light .contact-float-main {
    background: var(--text-primary);
    color: #ffffff;
    box-shadow: 0 3px 12px rgba(17, 24, 39, 0.18), 0 0 0 1px rgba(0,0,0,0.04);
}
.contact-float-option:hover,
.contact-float-main:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.28);
}
body.dark .contact-float-main:hover {
    background: #ffffff;
    color: #10100f;
}
body.light .contact-float-main:hover {
    background: #000000;
    color: #ffffff;
}
.contact-float-option i,
.contact-float-main i {
    font-size: 20px;
}

@media (max-width: 520px) {
    .contact-float {
        right: 14px;
        bottom: 14px;
    }
    .contact-float-main span {
        display: none;
    }
}

@media (max-width: 760px) {
    .login-shell {
        width: min(100% - 28px, 380px);
    }
    .login-intro {
        padding: 16px;
    }
    .login-intro h1 {
        font-size: 16px;
    }
}

/* ── Checkbox ── */
.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 14px;
    cursor: pointer;
}
.checkbox-row input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: var(--purple);
    cursor: pointer;
}

/* ── Modal ── */
.modal-bg {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    /* overflow:hidden olan parent'ların fixed positioning'i kırmasını önle */
    transform: translateZ(0);
}
.modal-bg.open { display: flex; }
.modal {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 24px;
    width: 100%;
    max-width: 460px;
    border: 0.5px solid var(--border);
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    z-index: 10000;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.modal-title { font-size:15px; font-weight:600; margin-bottom:16px; display:flex; align-items:center; gap:8px; }
.modal-footer { display:flex; justify-content:flex-end; gap:8px; margin-top:16px; }

.lang-switch {
    display: flex;
    width: fit-content;
    gap: 3px;
    padding: 2px;
    margin-bottom: 10px;
    border: 0.5px solid var(--border);
    border-radius: 8px;
    background: var(--bg-tertiary);
}
.lang-switch a {
    width: 31px;
    height: 21px;
    padding: 4px;
    border-radius: 6px;
    color: var(--text-secondary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.lang-switch a.active {
    background: var(--accent);
    color: var(--accent-text);
}
.lang-switch img {
    width: 21px;
    height: 14px;
    display: block;
    border-radius: 3px;
    box-shadow: 0 0 0 0.5px rgba(255,255,255,0.22);
}
.login-lang {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 20;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .sidebar { width: 56px; }
    .sidebar-logo span,
    .nav-item span,
    .sidebar-user span { display: none; }
    .main-content { padding: 16px; }
}

/* ──────────────────────────────────────────────────────────
   Premium Sidebar Profile Popover & Theme/Language Overhaul
   ────────────────────────────────────────────────────────── */
.sidebar-bottom {
    position: relative;
    padding: 16px 12px;
    border-top: 0.5px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-credit-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.sidebar-profile-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-lg);
    background: var(--bg-primary);
    border: 0.5px solid var(--border);
    cursor: pointer;
    width: 100%;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}
.sidebar-profile-trigger:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-md);
}
.sidebar-profile-trigger.active {
    box-shadow: 0 0 0 2px var(--accent-light);
    border-color: var(--accent);
    background: var(--bg-tertiary);
}

.sidebar-profile-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-light);
    color: var(--accent-text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    border: 0.5px solid rgba(123, 188, 212, 0.2);
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.sidebar-profile-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
    text-align: left;
}
.sidebar-profile-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}
.sidebar-profile-username {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
    margin-top: 2px;
}

.sidebar-profile-arrow {
    color: var(--text-tertiary);
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}
.sidebar-profile-trigger.active .sidebar-profile-arrow {
    transform: rotate(180deg);
    color: var(--text-primary);
}

/* Popover container */
.profile-popover {
    position: fixed;
    bottom: 74px;
    left: 12px;
    width: 208px;
    background: var(--bg-primary);
    border: 0.5px solid var(--border-md);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.95);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.profile-popover.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.popover-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 8px;
    border-bottom: 0.5px solid var(--border);
}
.popover-header-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.popover-header-name {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.popover-header-username {
    font-size: 11px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.popover-divider {
    height: 0.5px;
    background: var(--border);
    margin: 2px 0;
}

.popover-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 12.5px;
    cursor: pointer;
    transition: all 0.15s ease;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    box-sizing: border-box;
}
.popover-item i {
    font-size: 15px;
    color: var(--text-tertiary);
    transition: color 0.15s ease;
}
.popover-item:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}
.popover-item:hover i {
    color: var(--text-primary);
}

.popover-item.danger {
    color: var(--text-secondary);
}
.popover-item.danger:hover {
    background: var(--danger-bg);
    color: var(--danger-text);
}
.popover-item.danger:hover i {
    color: var(--danger-text);
}

/* popover control rows */
.popover-control-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.popover-theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-secondary);
    border: 0.5px solid var(--border);
    padding: 4px 10px;
    border-radius: 12px;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 11px;
    font-family: inherit;
    transition: all 0.15s ease;
}
.popover-theme-toggle:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-md);
}
.popover-theme-toggle i {
    font-size: 13px;
}

.popover-lang-switch {
    display: flex;
    background: var(--bg-secondary);
    border: 0.5px solid var(--border);
    padding: 2px;
    border-radius: 12px;
    gap: 2px;
}
.popover-lang-switch a {
    font-size: 10.5px;
    font-weight: 600;
    text-decoration: none;
    color: var(--text-secondary);
    padding: 2px 8px;
    border-radius: 9px;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.popover-lang-switch a.active {
    background: var(--accent);
    color: var(--accent-text);
}
.popover-lang-switch a:hover:not(.active) {
    color: var(--text-primary);
}

.popover-credit-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 0.5px solid var(--border);
}
.popover-credit-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--text-secondary);
}
.popover-credit-label i {
    color: var(--accent-text);
}
.popover-credit-value {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
}
.popover-credit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-light);
    color: var(--accent-text);
    text-decoration: none;
    font-weight: bold;
    font-size: 11px;
    transition: all 0.15s ease;
}
.popover-credit-btn:hover {
    background: var(--accent);
    color: var(--accent-text);
}

/* Responsive Overrides */
@media (max-width: 768px) {
    .sidebar-bottom {
        padding: 16px 8px;
        align-items: center;
    }
    .sidebar-profile-trigger {
        padding: 0;
        width: 36px;
        height: 36px;
        border-radius: 50%;
        justify-content: center;
        background: var(--bg-primary);
        border: 0.5px solid var(--border);
    }
    .sidebar-profile-trigger:hover {
        background: var(--bg-tertiary);
    }
    .sidebar-profile-trigger .sidebar-profile-details,
    .sidebar-profile-trigger .sidebar-profile-arrow,
    .sidebar-bottom .sidebar-credit-container {
        display: none !important;
    }
    .profile-popover {
        position: fixed;
        bottom: 16px;
        left: 72px;
        right: auto;
        width: 230px;
        transform: translateX(10px) scale(0.95);
    }
    .profile-popover.open {
        transform: translateX(0) scale(1);
    }
}

/* ──────────────────────────────────────────────────────────
   Themed Logo Switching
   ────────────────────────────────────────────────────────── */
.logo-light-theme {
    display: none !important;
}
.logo-dark-theme {
    display: block !important;
}

body.light .logo-light-theme {
    display: block !important;
}
body.light .logo-dark-theme {
    display: none !important;
}

/* Tutorial Box & Lightbox */
.tutorial-box {
    background: var(--bg-secondary);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
}
.tutorial-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    gap: 20px;
}
.tutorial-steps {
    display: none;
    padding: 0 16px 16px 16px;
    border-top: 1px solid var(--border);
    margin-top: 4px;
}
.tutorial-steps.active {
    display: block;
}
.tutorial-steps ul {
    margin: 0;
    padding-left: 20px;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.6;
}
.tutorial-steps li {
    margin-bottom: 8px;
}
.tutorial-steps-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--accent-text);
    cursor: pointer;
    font-weight: 500;
    margin-top: 8px;
    transition: color 0.2s;
}
.tutorial-steps-toggle:hover {
    color: var(--accent);
}
.tutorial-steps-toggle i {
    transition: transform 0.3s;
}
.tutorial-steps-toggle.active i {
    transform: rotate(180deg);
}
.tutorial-text h4 {
    margin: 0 0 6px 0;
    font-size: 14px;
    color: var(--text-primary);
}
.tutorial-text p {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}
.tutorial-thumb {
    position: relative;
    width: 130px;
    height: 74px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    flex-shrink: 0;
    border: 1px solid var(--border);
}
.tutorial-thumb img,
.tutorial-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}
.tutorial-thumb:hover img,
.tutorial-thumb:hover video {
    transform: scale(1.05);
}
.play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 32px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    backdrop-filter: blur(4px);
    z-index: 2;
    transition: all 0.2s ease;
}
.tutorial-thumb:hover .play-icon {
    background: var(--accent-text);
    color: #fff;
    transform: translate(-50%, -50%) scale(1.1);
}

.lightbox-modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(8px);
    z-index: 100000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.lightbox-modal.active {
    display: flex;
    animation: fadeIn 0.2s ease-out forwards;
}
.lightbox-content {
    position: relative;
    max-width: 900px;
    width: 100%;
    text-align: center;
}
.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}
.lightbox-close:hover {
    opacity: 1;
}
.preview-lightbox-content {
    max-width: min(1200px, 96vw);
}
.preview-toolbar {
    position: absolute;
    top: -46px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px;
    background: rgba(18, 18, 18, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
.preview-tool-btn {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.preview-tool-btn:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.25);
}
.preview-zoom-label {
    min-width: 48px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    text-align: center;
}
.preview-viewer {
    width: min(1200px, 96vw);
    height: min(86vh, 900px);
    overflow: hidden;
    border-radius: 10px;
    background: #111;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    cursor: grab;
    touch-action: none;
}
.preview-viewer.dragging {
    cursor: grabbing;
}
.preview-viewer img {
    display: block;
    max-width: none;
    max-height: none;
    width: auto;
    height: auto;
    background: #fff;
    user-select: none;
    transform-origin: 0 0;
    will-change: transform;
}
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

@media (max-width: 600px) {
    .tutorial-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .tutorial-thumb {
        width: 100%;
        height: 140px;
    }
}
