@font-face {
    font-family: 'B Yekan';
    src: url('/fonts/BYekan.woff') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg: #0a0a14;
    --bg-deep: #07070f;
    --surface: #141420;
    --surface-hover: #1c1c2c;
    --border: #26263a;
    --accent: #f78b26;
    --accent-hover: #ffa054;
    --accent-secondary: #f78b26;
    --accent-secondary-hover: #ffa054;
    --text: #e0e0e8;
    --text-dim: #8888a0;
    --font-fa: 'B Yekan', tahoma, arial, sans-serif;
    --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, monospace;
    /* Color aliases for unified CSS compatibility */
    --color-bg: var(--bg);
    --color-surface: var(--surface);
    --color-surface-hover: var(--surface-hover);
    --color-border: var(--border);
    --color-accent: var(--accent);
    --color-accent-hover: var(--accent-hover);
    --color-text: var(--text);
    --color-text-dim: var(--text-dim);
    --color-success: #f78b26;
    --color-danger: #ef4444;
    --color-warning: #fbbf24;
    --color-info: #60a5fa;
}

html[data-theme="light"] {
    --bg: #f1f2f7;
    --bg-deep: #ffffff;
    --surface: #ffffff;
    --surface-hover: #eef0f6;
    --border: #d9dde8;
    --text: #1c1d28;
    --text-dim: #5d6278;
    --color-bg: var(--bg);
    --color-surface: var(--surface);
    --color-surface-hover: var(--surface-hover);
    --color-border: var(--border);
    --color-text: var(--text);
    --color-text-dim: var(--text-dim);
}
html[data-theme="light"] .navbar {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(247, 248, 253, 0.98));
    border-bottom-color: rgba(20, 24, 40, 0.08);
    backdrop-filter: blur(6px) saturate(120%);
    box-shadow: 0 1px 0 rgba(20, 24, 40, 0.04), 0 8px 24px rgba(20, 24, 40, 0.08);
}
html[data-theme="light"] .navbar.scrolled {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(250, 251, 254, 0.995));
    border-bottom-color: rgba(247, 139, 38, 0.25);
}
html[data-theme="light"] .nav-links .nav-link-item,
html[data-theme="light"] .nav-links .dropdown-toggle { color: #2c3142; }
html[data-theme="light"] .nav-links .dropdown-menu {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(250, 251, 254, 0.99));
    border-color: rgba(20, 24, 40, 0.1);
    box-shadow: 0 20px 50px rgba(20, 24, 40, 0.18);
}
html[data-theme="light"] .dropdown-menu .dropdown-item { color: #4a5068; }
html[data-theme="light"] .nav-links {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 249, 253, 0.99));
}
html[data-theme="light"] .hamburger span { background: #2c3142; }
html[data-theme="light"] .theme-toggle { background: rgba(20, 24, 40, 0.04); }
html[data-theme="light"] .topbar {
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid var(--border);
}
html[data-theme="light"] .topbar > a { color: var(--text); }
html[data-theme="light"] .topbar-nav a { color: var(--text-dim); }

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: var(--font-fa);
    background: radial-gradient(1200px 500px at 50% -10%, rgba(247, 139, 38, 0.05), transparent 60%), var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #2e2e46; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

.user-topbar {
    display: flex; justify-content: flex-end;
    background: linear-gradient(180deg, rgba(7, 7, 13, 0.98), rgba(12, 12, 22, 0.98));
    border-bottom: 1px solid rgba(247, 139, 38, 0.16);
    padding: 0.28rem 1.5rem;
    font-family: var(--font-mono);
    position: relative; z-index: 101;
}
.user-topbar-inner { display: flex; align-items: center; gap: 0.25rem; }
.user-topbar-link {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.18rem 0.55rem; border-radius: 6px;
    font-size: 0.66rem; font-weight: 600; letter-spacing: 0.05em;
    color: #9a9aac; text-decoration: none; white-space: nowrap;
    transition: color 0.2s ease, background 0.2s ease;
}
.user-topbar-link:hover { color: var(--accent); background: rgba(247, 139, 38, 0.1); }
.user-topbar-link svg { width: 11px; height: 11px; flex-shrink: 0; }
.user-topbar-admin { color: #ff8a5c; }
.user-topbar-admin:hover { color: var(--accent); }
@media (max-width: 768px) {
    .user-topbar { justify-content: center; padding: 0.26rem 0.75rem; }
    .user-topbar-label { display: none; }
    .user-topbar-link { padding: 0.22rem 0.6rem; }
}

/* ===== NAVBAR (site header) ===== */
.navbar {
    background: rgba(20, 20, 32, 0.9);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 1000;
    backdrop-filter: blur(16px);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.02), 0 8px 24px rgba(0, 0, 0, 0.35);
    transition: background 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}
.navbar.scrolled {
    background: linear-gradient(180deg, rgba(20, 20, 36, 0.985), rgba(12, 12, 20, 0.99));
    border-bottom-color: rgba(247, 139, 38, 0.16);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03), 0 16px 44px rgba(0, 0, 0, 0.52);
}
.navbar-inner {
    max-width: 900px; margin: 0 auto; padding: 0 1.25rem;
    display: flex; flex-direction: row; align-items: center;
    justify-content: space-between; height: 56px;
    transition: height 0.35s ease;
}
.navbar.scrolled .navbar-inner { height: 50px; }
.logo {
    font-size: 1.2rem; font-weight: 700; color: var(--text);
    text-decoration: none; display: flex; align-items: center;
    gap: 0.2rem; font-family: var(--font-mono); direction: ltr;
}
.logo-icon { color: var(--accent); font-size: 0.9rem; }
.logo-dot { color: var(--accent); }

.nav-links { display: flex; flex-wrap: nowrap; gap: 1rem; align-items: center; }
.nav-links .nav-link-item,
.nav-links .dropdown-toggle {
    font-family: var(--font-fa);
    font-size: 0.9rem; font-weight: 600; letter-spacing: 0.005em;
    color: #c9c9da; padding: 0.5rem 0.85rem; border-radius: 10px;
    border: none; background: transparent; text-decoration: none;
    transition: color 0.22s ease, background 0.22s ease;
}
.nav-links .nav-link-item:hover,
.nav-links .dropdown-toggle:hover {
    color: var(--accent); background: rgba(247, 139, 38, 0.08);
}
.nav-links .nav-link-item.active { color: var(--accent); font-weight: 600; }

.dropdown { position: relative; z-index: 1001; }
.dropdown-toggle {
    display: inline-flex; align-items: center; gap: 0.4rem; cursor: pointer;
}
.dropdown-toggle svg { transition: transform 0.2s ease; }
.dropdown.open .dropdown-toggle svg { transform: rotate(180deg); }
.dropdown-menu { z-index: 1002;
    position: absolute; top: calc(100% + 8px); left: 0; right: auto;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 10px; padding: 0.4rem; min-width: 200px;
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: all 0.2s ease; box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
}
.dropdown.open .dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-item {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.55rem 0.7rem; color: var(--text-dim);
    text-decoration: none; font-size: 0.82rem; border-radius: 6px;
    transition: all 0.15s ease; font-family: var(--font-mono); direction: ltr;
}
.dropdown-item:hover, .dropdown-item.active { background: rgba(247, 139, 38, 0.15); color: var(--accent); }
.tool-icon { font-size: 0.7rem; color: var(--accent); width: 18px; text-align: center; flex-shrink: 0; }

.hamburger {
    display: none; flex-direction: column; gap: 5px;
    background: none; border: none; cursor: pointer;
    padding: 4px; z-index: 1001;
}
.hamburger span {
    display: block; width: 22px; height: 2px;
    background: var(--text); transition: all 0.3s ease; border-radius: 2px;
}
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

.theme-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; flex-shrink: 0;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 10px; color: var(--text-dim); cursor: pointer;
    transition: color 0.25s ease, border-color 0.25s ease, background 0.25s ease, transform 0.2s ease;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); background: rgba(247, 139, 38, 0.08); }
.theme-toggle:active { transform: scale(0.94); }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
html[data-theme="light"] .theme-toggle .icon-sun { display: block; }
html[data-theme="light"] .theme-toggle .icon-moon { display: none; }
.nav-theme-toggle { margin: 0 0.15rem; }

@media (max-width: 768px) {
    .navbar-inner { height: 52px; }
    .navbar.scrolled .navbar-inner { height: 48px; }
    .hamburger { display: flex; }
    .nav-links {
        display: none; position: absolute; top: 100%; left: 0; right: 0;
        max-height: calc(100vh - 56px); overflow-y: auto;
        background: var(--bg-deep); padding: 1rem; z-index: 1002;
        border-top: 1px solid var(--border);
        box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
    }
    .nav-links.open { display: block; }
    .nav-links .dropdown-menu {
        position: static; opacity: 1; visibility: visible; transform: none;
        box-shadow: none; border: none; padding: 0.4rem 0 0.4rem 0.8rem;
        background: transparent; min-width: auto; display: none;
    }
    .nav-links .dropdown.open .dropdown-menu { display: block; }
    .nav-links .dropdown-toggle {
        width: 100%; justify-content: space-between; border-color: transparent;
        padding: 0.7rem; font-size: 0.95rem;
    }
    .nav-links .nav-dropdown { width: 100%; }
    .nav-links .dropdown-item { padding: 0.65rem 0.8rem; font-size: 0.9rem; }
    .nav-links .nav-link-item {
        display: flex; align-items: center; width: 100%;
        padding: 0.7rem; font-size: 0.95rem;
    }
}

.topbar {
    background: rgba(16, 16, 28, 0.92);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1.5rem;
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 100;
    backdrop-filter: blur(14px);
}
.topbar > a {
    color: var(--text); text-decoration: none; font-weight: 700; font-size: 0.9rem;
    font-family: var(--font-mono); direction: ltr; transition: color 0.2s ease;
}
.topbar > a span { color: var(--accent); }
.topbar > a:hover { color: var(--accent); }
.topbar-nav { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.topbar-nav a { color: #888; font-size: 0.75rem; font-weight: 400; text-decoration: none; padding: 0.2rem 0.3rem; transition: color 0.2s ease; }
.topbar-nav a:hover { color: var(--accent); }
.topbar-nav a.active { color: var(--accent); font-weight: 600; }

.topbar-nav .nav-dropdown { position: relative; }
.topbar-nav .dropdown-toggle {
    background: none; border: 1px solid var(--border); color: #888;
    font-family: inherit; font-size: 0.75rem; font-weight: 400;
    padding: 0.2rem 0.3rem; border-radius: 6px; cursor: pointer;
    display: flex; align-items: center; gap: 0.35rem;
    transition: color 0.2s ease, border-color 0.2s ease;
}
.topbar-nav .dropdown-toggle:hover { color: var(--accent); border-color: rgba(247, 139, 38, 0.4); }
.topbar-nav .dropdown-toggle svg { transition: transform 0.2s ease; }
.topbar-nav .nav-dropdown.open .dropdown-toggle svg { transform: rotate(180deg); }
.topbar-nav .dropdown-menu {
    position: absolute; top: calc(100% + 8px); right: 0;
    background: #141420; border: 1px solid var(--border); border-radius: 8px;
    padding: 0.4rem; min-width: 190px; z-index: 200;
    opacity: 0; visibility: hidden; transform: translateY(-6px);
    transition: all 0.2s ease; box-shadow: 0 16px 40px rgba(0, 0, 0,0.5);
}
.topbar-nav .nav-dropdown.open .dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.topbar-nav .dropdown-item {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.5rem 0.65rem; color: #888; font-size: 0.75rem;
    text-decoration: none; border-radius: 6px; white-space: nowrap;
    transition: all 0.15s ease;
}
.topbar-nav .dropdown-item:hover, .topbar-nav .dropdown-item.active { color: var(--accent); background: rgba(247, 139, 38, 0.07); }
.topbar-nav .nav-link-item { color: #888; font-size: 0.75rem; font-weight: 400; text-decoration: none; padding: 0.2rem 0.3rem; transition: color 0.2s ease; display: flex; align-items: center; gap: 0.3rem; }
.topbar-nav .nav-link-item:hover, .topbar-nav .nav-link-item.active { color: var(--accent); font-weight: 600; }
.topbar-nav .tool-icon { font-size: 0.7rem; color: var(--accent); }

.container { max-width: 900px; margin: 2rem auto; padding: 0 1rem; }
.page-title { font-size: 1.3rem; font-weight: 700; margin-bottom: 0.3rem; }
.page-sub { font-size: 0.78rem; color: var(--text-dim); margin-bottom: 1.5rem; }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0,0.3);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.card:hover { border-color: rgba(247, 139, 38, 0.35); box-shadow: 0 6px 24px rgba(0, 0, 0,0.45); }

.alert { padding: 0.7rem 1rem; border-radius: 8px; font-size: 0.78rem; margin-bottom: 1.2rem; }
.alert-success { background: rgba(247, 139, 38,0.1); border: 1px solid rgba(247, 139, 38,0.3); color: #f78b26; }
.alert-error { background: rgba(239, 68, 68,0.1); border: 1px solid rgba(239, 68, 68,0.3); color: #ef4444; }
.alert-info { background: rgba(96, 165, 250,0.1); border: 1px solid rgba(96, 165, 250,0.3); color: #60a5fa; }
.alert-warn { background: rgba(251, 191, 36,0.1); border: 1px solid rgba(251, 191, 36,0.3); color: #fbbf24; }

.btn {
    padding: 0.6rem 1.2rem; border: none; border-radius: 8px;
    font-family: var(--font-mono); font-size: 0.78rem; font-weight: 600;
    cursor: pointer; transition: all 0.2s ease; display: inline-block;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(247, 139, 38, 0.35); }
.btn-lg { padding: 0.8rem 1.5rem; font-size: 0.85rem; }
.btn-sm { padding: 0.5rem 0.9rem; font-size: 0.72rem; }

.form-card { padding: 1.2rem; margin-bottom: 1.5rem; }

@keyframes submenuIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 600px) {
    .topbar { flex-direction: column; gap: 0.5rem; padding: 0.6rem 1rem; }
    .topbar-nav { justify-content: center; gap: 0.7rem; }
    .topbar-nav a { font-size: 0.7rem; }
    .topbar-nav .dropdown-menu {
        position: static; opacity: 1; visibility: visible; transform: none;
        box-shadow: none; border: none; background: transparent;
        padding: 0.2rem 0 0.2rem 0.5rem; min-width: auto; display: none;
    }
    .topbar-nav .nav-dropdown.open .dropdown-menu { display: block; }
}

/* ===== MOBILE POLISH (user pages) ===== */
html, body { overflow-x: clip; }

/* touch-friendly tap targets in top nav */
@media (max-width: 600px) {
    .topbar-nav a, .topbar-nav .nav-link-item, .topbar-nav .dropdown-toggle {
        padding: 0.4rem 0.45rem; min-height: 40px;
        display: inline-flex; align-items: center;
    }
    /* orders / services card rows: wrap instead of overflow */
    .order-card, .svc-card { flex-wrap: wrap; gap: 0.7rem; }
    .order-card .order-img, .svc-card .svc-img { width: 44px; height: 44px; }
    /* monitoring uptime bar: scroll horizontally instead of overflowing */
    .bar { overflow-x: auto; padding-bottom: 2px; }
    /* prevent iOS auto-zoom on inputs */
    input[type="text"], input[type="email"], input[type="password"],
    input[type="number"], input[type="url"], input[type="datetime-local"],
    select, textarea { font-size: 16px; }
}

/* ===== FOOTER ===== */
.site-footer {
    background: rgba(16, 16, 28, 0.92);
    border-top: 1px solid var(--border);
    margin-top: 2.5rem; padding: 1.5rem 0 1rem;
}
.site-footer .container { max-width: 900px; margin: 0 auto; padding: 0 1rem; }
.footer-grid { display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; align-items: center; }
.footer-brand a { color: var(--text); text-decoration: none; font-weight: 700; font-size: 0.9rem; font-family: var(--font-mono); direction: ltr; }
.footer-brand a span { color: var(--accent); }
.footer-brand p { color: var(--text-dim); font-size: 0.72rem; margin-top: 0.4rem; }
.footer-links { display: flex; gap: 1rem; flex-wrap: wrap; }
.footer-links a { color: var(--text-dim); font-size: 0.75rem; text-decoration: none; transition: color 0.2s ease; }
.footer-links a:hover { color: var(--accent); }
.footer-copy { color: #55556a; font-size: 0.65rem; text-align: center; margin-top: 1.2rem; border-top: 1px solid var(--border); padding-top: 0.8rem; }

/* =====================================================
   LIGHT MODE — overrides for inline-styled standalone pages
   (this file loads after inline <style> blocks)
   ===================================================== */
html[data-theme="light"] body { background: #f1f2f7; color: #2c3142; }
html[data-theme="light"] .topbar { background: rgba(255, 255, 255, 0.95); border-bottom-color: #d9dde8; }
html[data-theme="light"] .topbar a { color: #2c3142; }
html[data-theme="light"] .topbar-nav a { color: #5d6278; }
html[data-theme="light"] .page-sub,
html[data-theme="light"] .hint,
html[data-theme="light"] .empty-msg,
html[data-theme="light"] .empty-note,
html[data-theme="light"] .last-check,
html[data-theme="light"] .closed-note,
html[data-theme="light"] .no-pkg,
html[data-theme="light"] .card-box-label,
html[data-theme="light"] .plan-info-title { color: #5d6278; }
html[data-theme="light"] .card-box,
html[data-theme="light"] .plan-card,
html[data-theme="light"] .pkg-card,
html[data-theme="light"] .order-card,
html[data-theme="light"] .form-card,
html[data-theme="light"] .maint-row,
html[data-theme="light"] .info-box,
html[data-theme="light"] .badges,
html[data-theme="light"] .img-preview { background: #ffffff; border-color: #d9dde8; }
html[data-theme="light"] .form-input {
    background: #f7f8fc; border-color: #d9dde8; color: #2c3142;
}
html[data-theme="light"] .form-input:focus { border-color: #f78b26; }
html[data-theme="light"] .form-input::placeholder { color: #9aa1b5; }
html[data-theme="light"] .tab { border-color: #d9dde8; color: #5d6278; }
html[data-theme="light"] .alert { color: #2c3142; }
html[data-theme="light"] .order-status { color: #2c3142; }
html[data-theme="light"] .msg-author,
html[data-theme="light"] .msg-body,
html[data-theme="light"] .msg-time { color: #2c3142; }
html[data-theme="light"] .msg-user,
html[data-theme="light"] .msg-admin { border-color: #d9dde8; }
html[data-theme="light"] .back-link,
html[data-theme="light"] .order-title,
html[data-theme="light"] .plan-title { color: #2c3142; }
html[data-theme="light"] .site-footer { background: rgba(246, 247, 252, 0.95); border-top-color: #d9dde8; }
html[data-theme="light"] .site-footer .footer-brand a { color: #2c3142; }
html[data-theme="light"] .site-footer .footer-links a { color: #5d6278; }
html[data-theme="light"] .footer-copy { color: #7a8194; }
html[data-theme="light"] body,
html[data-theme="light"] .topbar,
html[data-theme="light"] .topbar a,
html[data-theme="light"] .topbar-nav a,
html[data-theme="light"] .plan-card,
html[data-theme="light"] .card-box,
html[data-theme="light"] .pkg-card,
html[data-theme="light"] .order-card,
html[data-theme="light"] .form-card,
html[data-theme="light"] .tab,
html[data-theme="light"] .maint-row,
html[data-theme="light"] .msg-user,
html[data-theme="light"] .msg-admin,
html[data-theme="light"] .form-input,
html[data-theme="light"] .badges,
html[data-theme="light"] .info-box,
html[data-theme="light"] .img-preview,
html[data-theme="light"] .method-option { box-shadow: none !important; }

/* --- dynamic site logo in standalone topbars --- */
.brand-logo-img { height: 24px; width: auto; border-radius: 5px; vertical-align: middle; }

/* ===== هدر: گروه لوگو+منو کنار هم، ورود/تم سمت مقابل + عرض هماهنگ با لندینگ ===== */
@media (min-width: 769px) {
    .navbar-inner { justify-content: flex-start; gap: 1.25rem; }
    .nav-links { flex: 1; min-width: 0; }
    .nav-links .nav-link-item[href$="/login"] { margin-inline-start: auto; }
}
@media (min-width: 1200px) { .navbar-inner { max-width: 1400px; } }
@media (min-width: 1600px) { .navbar-inner { max-width: 1680px; } }

/* ===== TEMPLATE SYSTEM (صفحات standalone) ===== */
html[data-template="classic"] {
    --accent: #f78b26; --accent-hover: #ffa054; --accent-secondary: #ffa054; --accent-secondary-hover: #fed7aa;
}
html[data-template="ocean"] {
    --bg: #0a1220; --bg-deep: #070d18; --surface: #122036; --surface-hover: #182a45;
    --border: #203654; --accent: #3b82f6; --accent-hover: #60a5fa;
    --text: #e6edf7; --text-dim: #8fa3c0;
}
html[data-template="ocean"][data-theme="light"] {
    --bg: #f0f5fb; --bg-deep: #ffffff; --surface: #ffffff; --surface-hover: #e8eef7;
    --border: #d4dfec; --accent: #2563eb; --accent-hover: #3b82f6;
    --text: #16233a; --text-dim: #5a6b85;
}
html[data-template="paper"] {
    --bg: #171a1f; --bg-deep: #12151a; --surface: #242932; --surface-hover: #2c323d;
    --border: #3a414e; --accent: #14b8a6; --accent-hover: #2dd4bf;
    --text: #e8eaee; --text-dim: #9aa2ad;
}
html[data-template="paper"][data-theme="light"] {
    --bg: #f7f6f3; --bg-deep: #ffffff; --surface: #ffffff; --surface-hover: #f0eee9;
    --border: #e0ddd5; --accent: #0d9488; --accent-hover: #14b8a6;
    --text: #26241f; --text-dim: #6b675e;
}
html[data-template="violet"] {
    --bg: #110f1c; --bg-deep: #0c0a14; --surface: #1d1930; --surface-hover: #251f3d;
    --border: #2f2750; --accent: #f78b26; --accent-hover: #ffa054;
    --text: #eae6f7; --text-dim: #a49bc0;
}
html[data-template="violet"][data-theme="light"] {
    --bg: #f5f3fb; --bg-deep: #ffffff; --surface: #ffffff; --surface-hover: #edeaf6;
    --border: #d8d2ea; --accent: #e8590c; --accent-hover: #f78b26;
    --text: #221d35; --text-dim: #5f5878;
}
html[data-template="neon"] {
    --bg: #06080c; --bg-deep: #04060a; --surface: #0e1218; --surface-hover: #141a24;
    --border: #1d2433; --accent: #00f0ff; --accent-hover: #7df9ff;
    --text: #e6f8ff; --text-dim: #7fa8c8;
    --radius: 14px;
}
html[data-template="neon"][data-theme="light"] {
    --bg: #f5faff; --bg-deep: #ffffff; --surface: #ffffff; --surface-hover: #eef7ff;
    --border: #cce9ff; --accent: #00b4d8; --accent-hover: #0096b7;
    --text: #02162b; --text-dim: #3d5a78;
}

/* ===== Neon template modern look ===== */
html[data-template="neon"] {
    --radius: 14px;
    font-feature-settings: "ss01" on;
}
html[data-template="neon"] .btn,
html[data-template="neon"] .form-input,
html[data-template="neon"] .form-select,
html[data-template="neon"] .form-textarea,
html[data-template="neon"] .card,
html[data-template="neon"] .card-body,
html[data-template="neon"] .order-card,
html[data-template="neon"] .plan-card,
html[data-template="neon"] .pkg-card,
html[data-template="neon"] .form-card,
html[data-template="neon"] .tab,
html[data-template="neon"] .info-box,
html[data-template="neon"] .badges,
html[data-template="neon"] .msg-user,
html[data-template="neon"] .msg-admin {
    border-radius: var(--radius);
}
html[data-template="neon"] .btn-primary,
html[data-template="neon"] .theme-toggle,
html[data-template="neon"] .nav-links .dropdown-menu {
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
}
html[data-template="neon"] .btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    box-shadow: 0 0 18px rgba(0, 240, 255, 0.25);
}
html[data-template="neon"] .btn-primary:hover {
    box-shadow: 0 0 28px rgba(0, 240, 255, 0.45);
    transform: translateY(-1px);
}
html[data-template="neon"] .card,
html[data-template="neon"] .plan-card,
html[data-template="neon"] .pkg-card,
html[data-template="neon"] .order-card,
html[data-template="neon"] .form-card {
    border: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(255, 255, 255,0.04), rgba(255, 255, 255,0.02));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
html[data-template="neon"][data-theme="light"] .card,
html[data-template="neon"][data-theme="light"] .plan-card,
html[data-template="neon"][data-theme="light"] .pkg-card,
html[data-template="neon"][data-theme="light"] .order-card,
html[data-template="neon"][data-theme="light"] .form-card {
    background: linear-gradient(180deg, rgba(255, 255, 255,0.85), rgba(255, 255, 255,0.65));
    border: 1px solid var(--border);
    box-shadow: 0 10px 30px rgba(0, 180, 216, 0.08);
}
html[data-template="neon"] .navbar,
html[data-template="neon"] .topbar {
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
}
/* حالت لاگین: لینک ورود موجود نیست — خود دکمه تم به لبه‌ی مقابل برود */
@media (min-width: 769px) {
    .nav-links:not(:has(.nav-link-item[href$="/login"])) .nav-theme-toggle { margin-inline-start: auto; }
}

/* لوگوی دراور فقط در موبایل (هماهنگ با app.css) */
.drawer-logo { display: none; }
@media (max-width: 768px) {
    .drawer-logo {
        display: flex; align-items: center;
        padding: 0 0.2rem 0.9rem; margin-bottom: 0.4rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        cursor: pointer;
    }
    .nav-links::before { display: none; }
}
html[data-theme="light"] .drawer-logo { border-bottom-color: rgba(20, 24, 40, 0.1); }

/* ===== کارت‌های داشبورد کاربری ===== */
.stats-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.8rem; margin-bottom: 1.2rem; }
.mini-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 0.9rem 1rem; }
.mini-card .label { font-size: 0.66rem; color: var(--text-dim); margin-bottom: 0.35rem; }
.mini-card .value { font-size: 1.25rem; font-weight: 800; font-family: var(--font-mono); direction: ltr; text-align: right; line-height: 1.2; }
.mini-card .sub { font-size: 0.62rem; color: var(--text-dim); margin-top: 0.25rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.9rem; margin-bottom: 0.9rem; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 1rem 1.1rem; }
.card h2 { font-size: 0.82rem; color: var(--accent); margin-bottom: 0.6rem; font-weight: 700; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 0.7rem; padding: 0.5rem 0; border-bottom: 1px dashed var(--border); font-size: 0.74rem; }
.row:last-child { border-bottom: none; }
.pill { display: inline-block; font-size: 0.6rem; padding: 0.12rem 0.5rem; border-radius: 20px; font-weight: 700; white-space: nowrap; }
.pill-green { background: rgba(247, 139, 38,0.12); color: #f78b26; }
.pill-amber { background: rgba(251, 191, 36,0.12); color: #fbbf24; }
.pill-gray { background: rgba(136, 136, 160,0.12); color: #8888a0; }
.pill-blue { background: rgba(96, 165, 250,0.12); color: #60a5fa; }
.pill-red { background: rgba(248, 113, 113,0.12); color: #f87171; }
.empty { color: var(--text-dim); font-size: 0.72rem; text-align: center; padding: 0.8rem 0; }
.actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.7rem; }
.btn { display: inline-block; padding: 0.45rem 0.9rem; border-radius: 8px; font-size: 0.72rem; font-weight: 700; text-decoration: none; border: 1px solid var(--border); color: var(--text); background: var(--surface-hover); transition: all 0.2s; cursor: pointer; font-family: var(--font-fa); }
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover, var(--accent)); color: #fff; }
.page-sub { font-size: 0.74rem; color: var(--text-dim); margin-bottom: 1.2rem; }
@media (max-width: 900px) {
    .stats-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-2 { grid-template-columns: 1fr; }
}

/* ===== داشبورد ادمین - حالت روشن ===== */
html[data-theme="light"] .dash-header {
    background: linear-gradient(180deg, #fffffff7, #f7f8fdfa);
    border-bottom-color: #14182814;
    -webkit-backdrop-filter: blur(6px) saturate(120%);
    backdrop-filter: blur(6px) saturate(120%);
    box-shadow: 0 1px #1418280a, 0 6px 18px #14182814;
}
html[data-theme="light"] .dash-logo,
html[data-theme="light"] .dash-logo .dash-logo-text {
    color: var(--color-text);
}
html[data-theme="light"] .dash-header .theme-toggle,
html[data-theme="light"] .dash-notif {
    background: #1418280a;
}
html[data-theme="light"] .dash-logo-icon,
html[data-theme="light"] .dash-logo-menu {
    background: #fff;
}
html[data-theme="light"] .dash-theme-toggle {
    background: #1418280a;
    border-color: #1418281f;
    color: var(--color-text-dim);
}
html[data-theme="light"] .dash-theme-toggle:hover {
    background: #4ade8014;
    border-color: var(--color-accent);
    color: var(--color-accent);
}

/* ===== حالت روشن برای dropdownهای ادمین ===== */
html[data-theme="light"] .dash-logo-menu {
    background: #fff;
    border: 1px solid var(--color-border);
    box-shadow: 0 20px 48px var(--color-text-dim);
    filter: none;
}
html[data-theme="light"] .dash-logo-menu-item {
    color: var(--color-text-dim);
}
html[data-theme="light"] .dash-logo-menu-item:hover {
    background: var(--color-accent-dim);
    color: var(--color-accent);
}
html[data-theme="light"] .dash-logo-menu-logout:hover {
    background: rgba(248, 113, 113, 0.1);
    color: #f87171;
}
html[data-theme="light"] .dash-notif-wrap .notif-dropdown {
    background: #fff;
    border: 1px solid var(--color-border);
    box-shadow: 0 20px 48px var(--color-text-dim);
}
html[data-theme="light"] .avatar-circle {
    background: linear-gradient(135deg, var(--color-charcoal-500), var(--color-charcoal-700));
    color: var(--color-accent);
}
html[data-theme="light"] .dash-avatar:hover {
    border-color: var(--color-accent);
    background: var(--color-accent-dim);
}
