


@font-face {
    font-family: 'Arad';
    src: url('../fonts/Arad-MediumDots2.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Arad';
    src: url('../fonts/Arad-BoldDots2.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}


:root {
    
    --bg-body:        #0a0a0f;
    --bg-grad-top:    #0d0d14;
    --bg-grad-bot:    #050508;
    --surface-1:      rgba(20, 22, 30, 0.78);
    --surface-2:      rgba(28, 30, 40, 0.85);
    --surface-3:      rgba(40, 44, 56, 0.9);
    --border-soft:    rgba(255, 255, 255, 0.07);
    --border-mid:     rgba(255, 255, 255, 0.13);
    --border-strong:  rgba(255, 255, 255, 0.22);

    --text-main:      #f1f3f8;
    --text-muted:     #8b94a6;
    --text-dim:       #5a627a;

    
    --accent:         #3b82f6;
    --accent-soft:    rgba(59, 130, 246, 0.15);
    --accent-mid:     rgba(59, 130, 246, 0.35);
    --accent-glow:    rgba(59, 130, 246, 0.5);
    --accent-fg:      #ffffff;

    
    --color-success:  #22c55e;
    --color-success-soft: rgba(34, 197, 94, 0.15);
    --color-danger:   #ef4444;
    --color-danger-soft:  rgba(239, 68, 68, 0.15);
    --color-warning:  #f59e0b;
    --color-warning-soft: rgba(245, 158, 11, 0.15);
    --color-info:     #06b6d4;
    --color-info-soft: rgba(6, 182, 212, 0.15);
    --color-purple:   #a855f7;
    --color-purple-soft: rgba(168, 85, 247, 0.15);

    
    --tl-red:    #ff5f56;
    --tl-yellow: #ffbd2e;
    --tl-green:  #27c93f;

    
    --radius-sm: 8px;
    --radius:    14px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    --shadow-1: 0 6px 18px rgba(0, 0, 0, 0.35);
    --shadow-2: 0 14px 40px rgba(0, 0, 0, 0.45);
}


[data-color="red"] {
    --accent:        #ef4444;
    --accent-soft:   rgba(239, 68, 68, 0.15);
    --accent-mid:    rgba(239, 68, 68, 0.35);
    --accent-glow:   rgba(239, 68, 68, 0.5);
    --accent-fg:     #fff;
}
[data-color="blue"] {
    --accent:        #3b82f6;
    --accent-soft:   rgba(59, 130, 246, 0.15);
    --accent-mid:    rgba(59, 130, 246, 0.35);
    --accent-glow:   rgba(59, 130, 246, 0.5);
    --accent-fg:     #fff;
}
[data-color="purple"] {
    --accent:        #a855f7;
    --accent-soft:   rgba(168, 85, 247, 0.15);
    --accent-mid:    rgba(168, 85, 247, 0.35);
    --accent-glow:   rgba(168, 85, 247, 0.5);
    --accent-fg:     #fff;
}
[data-color="yellow"] {
    --accent:        #facc15;
    --accent-soft:   rgba(250, 204, 21, 0.15);
    --accent-mid:    rgba(250, 204, 21, 0.35);
    --accent-glow:   rgba(250, 204, 21, 0.5);
    --accent-fg:     #1a1a1a;
}
[data-color="orange"] {
    --accent:        #f97316;
    --accent-soft:   rgba(249, 115, 22, 0.15);
    --accent-mid:    rgba(249, 115, 22, 0.35);
    --accent-glow:   rgba(249, 115, 22, 0.5);
    --accent-fg:     #fff;
}
[data-color="green"] {
    --accent:        #22c55e;
    --accent-soft:   rgba(34, 197, 94, 0.15);
    --accent-mid:    rgba(34, 197, 94, 0.35);
    --accent-glow:   rgba(34, 197, 94, 0.5);
    --accent-fg:     #fff;
}


[data-theme="light"] {
    --bg-body:       #f3f4f8;
    --bg-grad-top:   #ffffff;
    --bg-grad-bot:   #e8eaf2;
    --surface-1:     rgba(255, 255, 255, 0.85);
    --surface-2:     rgba(255, 255, 255, 0.95);
    --surface-3:     #ffffff;
    --border-soft:   rgba(0, 0, 0, 0.06);
    --border-mid:    rgba(0, 0, 0, 0.10);
    --border-strong: rgba(0, 0, 0, 0.20);
    --text-main:     #0f172a;
    --text-muted:    #475569;
    --text-dim:      #94a3b8;
}


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

html, body {
    font-family: 'Arad', 'Vazirmatn', 'Tahoma', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background: var(--bg-body);
    background-image:
        radial-gradient(1200px 600px at 90% -20%, var(--accent-soft), transparent 60%),
        radial-gradient(900px 500px at -10% 110%, var(--accent-soft), transparent 60%),
        linear-gradient(180deg, var(--bg-grad-top), var(--bg-grad-bot));
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    direction: rtl;
    line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; transition: 0.2s; }
a:hover { filter: brightness(1.15); }

::selection { background: var(--accent-mid); color: var(--text-main); }


::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--border-mid);
    border-radius: 8px;
}
::-webkit-scrollbar-thumb:hover { background: var(--accent-mid); }


#container { display: flex; flex-direction: column; width: 100%; min-height: 100vh; }

#main-content {
    margin-top: 76px;
    margin-right: 270px;
    padding: 28px;
    transition: margin 0.28s ease;
    min-height: calc(100vh - 76px);
}

.wrapper { max-width: 1500px; margin: 0 auto; width: 100%; }

@media (max-width: 992px) {
    #main-content { margin-right: 0 !important; padding: 18px; }
}


.app-header {
    position: fixed;
    top: 0; right: 0; left: 0;
    height: 64px;
    background: var(--surface-1);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border-soft);
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 22px;
}

.app-header__left { display: flex; align-items: center; gap: 16px; }

.btn-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    border: 1px solid var(--border-soft);
    background: transparent;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s;
    font-size: 16px;
}
.btn-icon:hover {
    color: var(--accent);
    border-color: var(--accent-mid);
    background: var(--accent-soft);
}

.app-logo {
    display: flex; align-items: center; gap: 10px;
    font-size: 17px; font-weight: 700;
    color: var(--text-main); text-decoration: none;
    letter-spacing: 0.3px;
}
.app-logo__mark {
    width: 36px; height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent), var(--accent-mid));
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--accent-fg);
    font-size: 17px;
    box-shadow: 0 6px 18px var(--accent-mid);
}
.app-logo span { color: var(--accent); }

.app-status-pill {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 12px;
    border: 1px solid var(--border-soft);
    border-radius: 999px;
    font-size: 12px;
    color: var(--text-muted);
    background: var(--surface-1);
}
.app-status-pill::before {
    content: "";
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--color-success);
    box-shadow: 0 0 8px var(--color-success);
    animation: pulse 1.8s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}

@media (max-width: 768px) {
    .app-status-pill { display: none; }
}


.profile-wrap { position: relative; }
.profile-trigger {
    display: flex; align-items: center; gap: 10px;
    padding: 5px 10px 5px 5px;
    border-radius: 999px;
    border: 1px solid transparent;
    cursor: pointer;
    background: transparent;
    color: var(--text-main);
    transition: 0.2s;
}
.profile-trigger:hover, .profile-wrap.open .profile-trigger {
    border-color: var(--border-soft);
    background: var(--surface-1);
}
.profile-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-mid));
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--accent-fg); font-weight: 700;
    border: 2px solid var(--accent-mid);
}
.profile-info { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.profile-info b { font-size: 13px; font-weight: 700; }
.profile-info small { font-size: 11px; color: var(--text-muted); }

@media (max-width: 600px) {
    .profile-info { display: none; }
}

.profile-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    min-width: 240px;
    background: var(--surface-2);
    border: 1px solid var(--border-soft);
    border-radius: 16px;
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-2);
    padding: 10px;
    opacity: 0; transform: translateY(-8px) scale(0.97);
    pointer-events: none;
    transition: 0.18s ease;
    z-index: 1100;
}
.profile-wrap.open .profile-menu {
    opacity: 1; transform: translateY(0) scale(1); pointer-events: auto;
}
.profile-menu__head {
    text-align: center;
    padding: 14px 10px 10px;
    border-bottom: 1px solid var(--border-soft);
    margin-bottom: 8px;
}
.profile-menu__head b { display: block; font-size: 14px; }
.profile-menu__head small { color: var(--text-muted); font-size: 11px; }

.profile-menu a, .profile-menu button {
    display: flex; align-items: center; gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--text-main);
    font-size: 13px;
    text-decoration: none;
    border: 0; background: transparent;
    cursor: pointer;
    transition: 0.15s;
    text-align: right;
    font-family: inherit;
}
.profile-menu a:hover, .profile-menu button:hover {
    background: var(--accent-soft);
    color: var(--accent);
}
.profile-menu .menu-danger { color: var(--color-danger); }
.profile-menu .menu-danger:hover { background: var(--color-danger-soft); color: var(--color-danger); }
.profile-menu hr {
    border: 0; height: 1px;
    background: var(--border-soft);
    margin: 6px 4px;
}


.theme-swatches {
    display: flex; gap: 8px;
    padding: 8px 12px 4px;
    flex-wrap: wrap;
    justify-content: center;
}
.swatch {
    width: 26px; height: 26px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: 0.2s;
    position: relative;
}
.swatch:hover { transform: scale(1.1); }
.swatch.active {
    border-color: #fff;
    box-shadow: 0 0 0 2px var(--text-muted);
}
.swatch[data-color="red"]    { background: #ef4444; }
.swatch[data-color="blue"]   { background: #3b82f6; }
.swatch[data-color="purple"] { background: #a855f7; }
.swatch[data-color="yellow"] { background: #facc15; }
.swatch[data-color="orange"] { background: #f97316; }
.swatch[data-color="green"]  { background: #22c55e; }


.app-sidebar {
    position: fixed;
    top: 64px; right: 0; bottom: 0;
    width: 270px;
    background: var(--surface-1);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-left: 1px solid var(--border-soft);
    z-index: 1002;
    overflow-y: auto;
    padding: 18px 14px;
    transition: transform 0.28s ease;
}
.sidebar-section-label {
    font-size: 10px; letter-spacing: 1px;
    color: var(--text-dim);
    padding: 0 8px 8px;
    text-transform: uppercase;
}
.sidebar-menu { list-style: none; padding: 0; margin: 0 0 14px; }
.sidebar-menu li { margin-bottom: 4px; }
.sidebar-menu a {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 14px;
    color: var(--text-muted);
    border-radius: 12px;
    font-size: 14px;
    font-weight: 400;
    transition: 0.18s;
    text-decoration: none;
    position: relative;
}
.sidebar-menu a .menu-symbol {
    display: inline-flex; width: 22px; height: 22px;
    align-items: center; justify-content: center;
    color: var(--text-dim);
    font-size: 13px; font-weight: 700;
    flex-shrink: 0;
    transition: 0.18s;
}
.sidebar-menu a i {
    width: 22px; text-align: center; font-size: 16px;
    color: var(--text-dim);
    transition: 0.18s;
}
.sidebar-menu a:hover {
    background: var(--surface-2);
    color: var(--text-main);
}
.sidebar-menu a.active {
    background: var(--accent-soft);
    color: var(--accent);
}
.sidebar-menu a.active i,
.sidebar-menu a.active .menu-symbol { color: var(--accent); }
.sidebar-menu a.active::before {
    content: ""; position: absolute;
    right: -14px; top: 50%; transform: translateY(-50%);
    width: 4px; height: 22px;
    background: var(--accent);
    border-radius: 2px 0 0 2px;
}

.sidebar-overlay {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
    z-index: 1000;
    opacity: 0; pointer-events: none;
    transition: opacity 0.25s;
}

@media (max-width: 992px) {
    .app-sidebar { transform: translateX(100%); }
    body.sidebar-open .app-sidebar { transform: translateX(0); }
    body.sidebar-open .sidebar-overlay { opacity: 1; pointer-events: auto; }
}
@media (min-width: 993px) {
    body.sidebar-collapsed .app-sidebar { transform: translateX(100%); }
    body.sidebar-collapsed #main-content { margin-right: 0; }
}


.page-head {
    display: flex; flex-wrap: wrap; gap: 10px;
    align-items: center; justify-content: space-between;
    margin-bottom: 22px;
}
.page-head__title {
    font-size: 22px; font-weight: 700;
    display: flex; align-items: center; gap: 12px;
}
.page-head__title .symbol {
    color: var(--accent);
    font-family: 'Arad', monospace;
}
.page-head__title i,
.page-head__title .svg-icon,
.page-head__title .page-head__icon {
    color: var(--accent);
    width: 30px !important;
    height: 30px !important;
    stroke-width: 2.2;
    flex-shrink: 0;
    padding: 6px;
    background: var(--accent-soft);
    border-radius: 10px;
    box-sizing: content-box;
}
.page-head__sub {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 4px;
}


.card {
    background: var(--surface-1);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    padding: 22px;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-1);
}
.card + .card { margin-top: 22px; }

.card__head {
    display: flex; align-items: center; justify-content: space-between;
    border-bottom: 1px solid var(--border-soft);
    padding-bottom: 14px;
    margin-bottom: 18px;
    flex-wrap: wrap;
    gap: 10px;
}
.card__title {
    font-size: 16px; font-weight: 700;
    display: flex; align-items: center; gap: 10px;
}
.card__title .symbol { color: var(--accent); }
.card__title i,
.card__title .svg-icon {
    color: var(--accent);
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}


.terminal {
    background: var(--surface-1);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-2);
}
.terminal__bar {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.025);
    border-bottom: 1px solid var(--border-soft);
}
[data-theme="light"] .terminal__bar {
    background: rgba(0, 0, 0, 0.03);
}
.terminal__lights { display: inline-flex; gap: 6px; }
.terminal__lights i {
    width: 11px; height: 11px;
    border-radius: 50%;
    background: var(--tl-red);
}
.terminal__lights i:nth-child(2) { background: var(--tl-yellow); }
.terminal__lights i:nth-child(3) { background: var(--tl-green); }
.terminal__url {
    color: var(--text-muted);
    font-size: 12px;
    font-family: 'Arad', monospace;
    direction: ltr;
}
.terminal__body { padding: 22px; }


.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 22px;
}
@media (max-width: 1100px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 580px)  { .stats-grid { grid-template-columns: 1fr; } }

.stat-card {
    background: var(--surface-1);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: 0.25s;
    backdrop-filter: blur(10px);
    overflow: hidden;
    position: relative;
}
.stat-card::before {
    content: ""; position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--accent-soft), transparent 60%);
    opacity: 0; transition: 0.3s;
    pointer-events: none;
}
.stat-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent-mid);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}
.stat-card:hover::before { opacity: 1; }

.stat-card__icon {
    width: 52px; height: 52px;
    border-radius: 14px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 22px;
    color: #fff;
    flex-shrink: 0;
}

.stat-card__icon.icon-green .svg-icon { width: 36px; height: 36px; }
.stat-card__icon.icon-green { width: 58px; height: 58px; border-radius: 15px; }
.icon-blue   { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.icon-purple { background: linear-gradient(135deg, #a855f7, #6d28d9); }
.icon-green  { background: linear-gradient(135deg, #22c55e, #15803d); }
.icon-rose   { background: linear-gradient(135deg, #f43f5e, #be123c); }
.icon-orange { background: linear-gradient(135deg, #f97316, #c2410c); }
.icon-cyan   { background: linear-gradient(135deg, #06b6d4, #0e7490); }
.icon-accent { background: linear-gradient(135deg, var(--accent), var(--accent-mid)); }

.stat-card__info { text-align: left; flex: 1; padding-right: 14px; }
.stat-card__value {
    font-size: 22px; font-weight: 700;
    color: var(--text-main);
    display: block;
    line-height: 1.2;
}
.stat-card__value small { font-size: 12px; color: var(--text-muted); font-weight: 400; }
.stat-card__label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}


.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 18px;
    border-radius: 12px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-main);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    text-decoration: none;
    white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }

.btn-primary {
    background: var(--accent);
    color: var(--accent-fg);
    box-shadow: 0 5px 18px var(--accent-mid);
}
.btn-primary:hover {
    filter: brightness(1.07);
    box-shadow: 0 7px 22px var(--accent-glow);
    color: var(--accent-fg);
}

.btn-outline {
    border-color: var(--border-mid);
    color: var(--text-main);
    background: var(--surface-1);
}
.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-soft);
}

.btn-success {
    background: var(--color-success);
    color: #fff;
    box-shadow: 0 4px 14px rgba(34, 197, 94, 0.3);
}
.btn-success:hover { filter: brightness(1.07); color: #fff; }

.btn-danger {
    background: var(--color-danger);
    color: #fff;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
}
.btn-danger:hover { filter: brightness(1.07); color: #fff; }

.btn-soft-success {
    background: var(--color-success-soft);
    color: var(--color-success);
    border-color: rgba(34, 197, 94, 0.25);
}
.btn-soft-success:hover { background: var(--color-success); color: #fff; }

.btn-soft-danger {
    background: var(--color-danger-soft);
    color: var(--color-danger);
    border-color: rgba(239, 68, 68, 0.25);
}
.btn-soft-danger:hover { background: var(--color-danger); color: #fff; }

.btn-soft-warning {
    background: var(--color-warning-soft);
    color: var(--color-warning);
    border-color: rgba(245, 158, 11, 0.25);
}
.btn-soft-warning:hover { background: var(--color-warning); color: #fff; }

.btn-soft-info {
    background: var(--color-info-soft);
    color: var(--color-info);
    border-color: rgba(6, 182, 212, 0.25);
}
.btn-soft-info:hover { background: var(--color-info); color: #fff; }

.btn-soft-purple {
    background: var(--color-purple-soft);
    color: var(--color-purple);
    border-color: rgba(168, 85, 247, 0.25);
}
.btn-soft-purple:hover { background: var(--color-purple); color: #fff; }

.btn-sm { padding: 7px 12px; font-size: 12px; }
.btn-block { width: 100%; }


.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid var(--border-soft);
    background: transparent;
    color: var(--text-muted);
    font-size: 12px; font-weight: 600;
    cursor: pointer;
    transition: 0.18s;
    text-decoration: none;
}
.chip .symbol {
    color: var(--text-dim);
    font-family: 'Arad', monospace;
    font-weight: 700;
}
.chip .svg-icon {
    color: var(--text-dim);
    transition: color 0.18s;
}
.chip:hover {
    color: var(--accent);
    border-color: var(--accent-mid);
    background: var(--accent-soft);
}
.chip:hover .symbol,
.chip:hover .svg-icon { color: var(--accent); }
.chip.is-active {
    color: var(--accent);
    border-color: var(--accent-mid);
    background: var(--accent-soft);
}
.chip.is-active .symbol { color: var(--accent); }


.form-group { margin-bottom: 18px; }
.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
}
.form-control {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--border-soft);
    background: rgba(255, 255, 255, 0.025);
    color: var(--text-main);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: 0.2s;
}
[data-theme="light"] .form-control { background: rgba(0,0,0,0.025); }
.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
    background: rgba(255, 255, 255, 0.05);
}
.form-control::placeholder { color: var(--text-dim); }

select.form-control {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%238b94a6' d='M6 8L0 0h12z'/></svg>");
    background-repeat: no-repeat;
    background-position: left 14px center;
    padding-left: 36px;
}
select.form-control option { background: #1a1d28; color: #fff; }
[data-theme="light"] select.form-control option { background: #fff; color: #000; }

textarea.form-control { min-height: 110px; resize: vertical; font-family: 'Arad', monospace; }

.form-row { display: flex; flex-wrap: wrap; gap: 14px; }
.form-row .form-group { flex: 1; min-width: 220px; }


.input-icon-wrap {
    position: relative;
    display: flex; align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    transition: 0.2s;
    padding: 0 12px;
}
.input-icon-wrap:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.input-icon-wrap i,
.input-icon-wrap svg {
    color: var(--text-muted);
    font-size: 16px;
    flex-shrink: 0;
}
.input-icon-wrap .form-control {
    border: 0; background: transparent; padding: 12px 8px;
    box-shadow: none;
}
.input-icon-wrap .form-control:focus { box-shadow: none; }
.toggle-pass {
    background: transparent; border: 0;
    color: var(--text-muted);
    cursor: pointer; padding: 6px;
    display: inline-flex; align-items: center;
    transition: 0.2s;
}
.toggle-pass:hover { color: var(--accent); }


.badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid transparent;
    white-space: nowrap;
}
.badge-success { background: var(--color-success-soft); color: var(--color-success); border-color: rgba(34, 197, 94, 0.25); }
.badge-danger  { background: var(--color-danger-soft);  color: var(--color-danger);  border-color: rgba(239, 68, 68, 0.25); }
.badge-warning { background: var(--color-warning-soft); color: var(--color-warning); border-color: rgba(245, 158, 11, 0.25); }
.badge-info    { background: var(--color-info-soft);    color: var(--color-info);    border-color: rgba(6, 182, 212, 0.25); }
.badge-purple  { background: var(--color-purple-soft);  color: var(--color-purple);  border-color: rgba(168, 85, 247, 0.25); }
.badge-cyan    { background: var(--color-info-soft);    color: var(--color-info);    border-color: rgba(6, 182, 212, 0.25); }
.badge-gray    { background: rgba(148, 163, 184, 0.13); color: #94a3b8;              border-color: rgba(148, 163, 184, 0.25); }
.badge-active  { background: var(--color-success-soft); color: var(--color-success); border-color: rgba(34, 197, 94, 0.25); }
.badge-block   { background: var(--color-danger-soft);  color: var(--color-danger);  border-color: rgba(239, 68, 68, 0.25); }
.badge-unpaid  { background: var(--color-warning-soft); color: var(--color-warning); border-color: rgba(245, 158, 11, 0.25); }
.badge-accent  { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-mid); }


.alert {
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid;
    display: flex; align-items: center; gap: 10px;
    font-size: 13px;
    margin-bottom: 16px;
}
.alert-error  { background: var(--color-danger-soft); color: var(--color-danger); border-color: rgba(239, 68, 68, 0.3); }
.alert-info   { background: var(--color-info-soft); color: var(--color-info); border-color: rgba(6, 182, 212, 0.3); }
.alert-success{ background: var(--color-success-soft); color: var(--color-success); border-color: rgba(34, 197, 94, 0.3); }


.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table.dataTable, table.app-table {
    width: 100% !important;
    border-collapse: collapse !important;
    color: var(--text-main) !important;
}
table.dataTable thead th, table.app-table thead th {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    font-weight: 600;
    text-align: right !important;
    padding: 14px 16px !important;
    border-bottom: 1px solid var(--border-soft) !important;
    font-size: 13px;
    position: relative;
}
table.dataTable tbody td, table.app-table tbody td {
    padding: 14px 16px !important;
    border-bottom: 1px solid var(--border-soft) !important;
    font-size: 13px;
    vertical-align: middle;
}
table.dataTable tbody tr, table.app-table tbody tr { background: transparent !important; transition: 0.15s; }
table.dataTable tbody tr:hover, table.app-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.025) !important;
}
[data-theme="light"] table.dataTable tbody tr:hover { background: rgba(0,0,0,0.03) !important; }


.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-soft);
    color: var(--text-main);
    border-radius: 10px;
    padding: 7px 10px;
    outline: none;
    font-family: inherit;
    font-size: 13px;
}
.dataTables_wrapper .dataTables_filter input:focus,
.dataTables_wrapper .dataTables_length select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.dataTables_wrapper .dataTables_filter input { margin-right: 12px !important; }
.dataTables_wrapper .dataTables_length select {
    appearance: none;
    -webkit-appearance: none;
    text-align: center;
    width: 60px;
}
.dataTables_wrapper .dataTables_length select option { background: #1a1d28; color: #fff; }
[data-theme="light"] .dataTables_wrapper .dataTables_length select option { background: #fff; color: #000; }

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_processing,
.dataTables_wrapper .dataTables_info {
    color: var(--text-muted) !important;
    font-size: 13px;
    margin-bottom: 14px;
}

.dataTables_wrapper .bottom {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border-soft);
    flex-wrap: wrap;
    gap: 10px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    color: var(--text-main) !important;
    border-radius: 8px !important;
    padding: 6px 12px !important;
    margin: 0 2px !important;
    border: 1px solid transparent !important;
    background: transparent !important;
    cursor: pointer;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--accent-soft) !important;
    color: var(--accent) !important;
    border-color: var(--accent-mid) !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--accent) !important;
    color: var(--accent-fg) !important;
    border-color: var(--accent) !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
    color: var(--text-dim) !important;
    background: transparent !important;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    .dataTables_wrapper .bottom { flex-direction: column; align-items: stretch; }
    .dataTables_wrapper .dataTables_paginate { display: flex; justify-content: center; flex-wrap: wrap; }
}

.track-id {
    font-family: 'Arad', monospace;
    background: rgba(255, 255, 255, 0.04);
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.18s;
    direction: ltr;
    display: inline-block;
}
.track-id:hover { background: var(--accent-soft); color: var(--accent); }


.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: none;
    align-items: center; justify-content: center;
    opacity: 0;
    transition: opacity 0.25s;
    padding: 16px;
}
.modal-overlay.active { display: flex; opacity: 1; }
.modal-box {
    background: var(--surface-2);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    padding: 0;                       
    width: 100%;
    max-width: 460px;
    max-height: 92vh;                 
    display: flex;
    flex-direction: column;
    overflow: hidden;                 
    transform: scale(0.94);
    transition: transform 0.25s;
    box-shadow: var(--shadow-2);
}
.modal-overlay.active .modal-box { transform: scale(1); }
.modal-head {
    display: flex; justify-content: space-between; align-items: center;
    padding: 22px 26px 14px;
    border-bottom: 1px solid var(--border-soft);
    background: var(--surface-2);
    position: sticky; top: 0; z-index: 2;
    flex-shrink: 0;
}
.modal-head__title { font-size: 16px; font-weight: 700; }

.modal-box > form,
.modal-box > .modal-body {
    padding: 18px 26px 22px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1 1 auto;
    min-height: 0;
}
.modal-foot {
    padding: 14px 26px;
    border-top: 1px solid var(--border-soft);
    display: flex; gap: 10px; justify-content: flex-end;
    background: rgba(0,0,0,0.15);
    flex-shrink: 0;
}
.modal-close {
    background: transparent; border: 0;
    color: var(--text-muted);
    font-size: 22px; cursor: pointer;
    width: 32px; height: 32px;
    border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
    transition: 0.2s;
}
.modal-close:hover { background: var(--color-danger-soft); color: var(--color-danger); }


.profile-card {
    background: var(--surface-1);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    padding: 26px;
    text-align: center;
    margin-bottom: 22px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    backdrop-filter: blur(10px);
}
.avatar-circle {
    width: 92px; height: 92px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-mid));
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 36px;
    color: var(--accent-fg);
    box-shadow: 0 10px 24px var(--accent-mid);
}
.profile-card h1 { font-size: 22px; font-weight: 700; }
.profile-card p { color: var(--text-muted); font-size: 13px; }
.tg-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 16px;
    background: #229ED9;
    color: #fff;
    border-radius: 999px;
    font-size: 13px;
    transition: 0.2s;
    text-decoration: none;
}
.tg-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(34, 158, 217, 0.4); color: #fff; }

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
    margin-bottom: 22px;
}
.info-row {
    display: flex; justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px dashed var(--border-soft);
    font-size: 13px;
}
.info-row:last-child { border-bottom: 0; }
.info-label { color: var(--text-muted); }
.info-value { font-weight: 600; }

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}


.login-page {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
    position: relative;
}
.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--surface-2);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-xl);
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-2);
    overflow: hidden;
}
.login-terminal-bar {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.025);
    border-bottom: 1px solid var(--border-soft);
}
.login-terminal-bar .terminal__url { font-size: 12px; }
.login-body { padding: 36px 30px 30px; text-align: center; }
.login-body h2 { font-size: 24px; font-weight: 700; margin-bottom: 6px; }
.login-body > p { color: var(--text-muted); font-size: 13px; margin-bottom: 26px; }
.login-body .form-group { text-align: right; }
.login-body .btn-primary { width: 100%; padding: 13px 18px; font-size: 14px; }

.ip-card {
    width: 100%;
    max-width: 520px;
    background: var(--surface-2);
    border: 1px solid var(--accent);
    border-radius: var(--radius-xl);
    text-align: center;
    padding: 32px 28px;
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-2);
}
.ip-card h2 { font-size: 22px; margin: 14px 0 10px; }
.ip-card p { color: var(--text-muted); font-size: 13px; line-height: 1.8; }
.ip-card .ip-box {
    margin-top: 22px;
    padding: 16px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px dashed var(--accent);
    border-radius: 12px;
    color: var(--accent);
    font-family: 'Arad', monospace;
    direction: ltr;
    font-size: 16px;
    word-break: break-all;
}


.errpage {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
}
.errpage .terminal { max-width: 520px; width: 100%; }
.errpage h1 {
    font-size: 90px;
    background: linear-gradient(135deg, var(--accent), var(--color-danger));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    line-height: 1;
}
.errpage p { color: var(--text-muted); font-size: 14px; margin: 12px 0 22px; }


.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--color-success); }
.text-danger { color: var(--color-danger); }
.text-accent { color: var(--accent); }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }


.text-link { color: var(--accent); text-decoration: none; }
.text-link:hover { text-decoration: underline; }


.svg-icon {
    width: 18px;
    height: 18px;
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
    color: inherit;
    stroke: currentColor;
    fill: none;
    transition: color .15s ease, transform .15s ease;
}
.svg-icon.svg-xs  { width: 13px; height: 13px; stroke-width: 2.4; }
.svg-icon.svg-sm  { width: 15px; height: 15px; }
.svg-icon.svg-md  { width: 20px; height: 20px; }
.svg-icon.svg-lg  { width: 26px; height: 26px; }
.svg-icon.svg-xl  { width: 36px; height: 36px; stroke-width: 1.6; }
.svg-icon.svg-2xl { width: 56px; height: 56px; stroke-width: 1.4; }
.svg-icon.spin    { animation: svg-spin 1.2s linear infinite; }
@keyframes svg-spin { to { transform: rotate(360deg); } }


.svg-icon + * { margin-inline-start: 6px; }
* + .svg-icon { margin-inline-start: 6px; }


.btn .svg-icon,
.chip .svg-icon,
.btn-icon .svg-icon,
.menu-symbol + .svg-icon { margin-inline-start: 0; }
.btn .svg-icon + *,
.chip .svg-icon + * { margin-inline-start: 8px; }


button, input, select, textarea, .btn, .form-control,
.app-table, .dataTable, .modal-box, .alert, .badge, .chip,
.profile-info, .profile-info b, .profile-info small,
.profile-menu, .profile-menu *, .stat-card *, .page-head *,
.sidebar-menu, .sidebar-menu *, .card *, .terminal *,
.app-header, .app-header *, .app-logo, .app-status-pill {
    font-family: 'Arad', 'Vazirmatn', 'Tahoma', sans-serif;
}

.terminal__url,
.menu-symbol,
.symbol,
.page-head .symbol,
.card__title .symbol,
code, kbd, pre, .mono, .ltr-num {
    font-family: 'JetBrains Mono', 'Fira Code', 'Menlo', 'Consolas', 'Courier New', monospace !important;
    letter-spacing: 0;
}

.stat-card__value, .ltr-num {
    direction: ltr;
    text-align: right;
    unicode-bidi: isolate;
}

html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }


.kb-page {
    max-width: 1100px;
    margin: 90px auto 40px;
    padding: 0 16px;
}
.kb-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}
.kb-hero__text h1 {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 800;
    color: var(--text-main);
    display: flex; align-items: center; gap: 10px;
}
.kb-hero__text h1 .svg-icon { color: var(--accent); }
.kb-hero__text p { margin: 0; color: var(--text-muted); font-size: 13px; line-height: 1.8; }
.kb-hero__actions { display: flex; gap: 8px; flex-wrap: wrap; }


.kb-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--surface-3);
    border: 1px solid var(--border-mid);
    color: var(--text-main);
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    display: flex; align-items: center; gap: 8px;
    box-shadow: var(--shadow-2);
    z-index: 9999;
    opacity: 0;
    transition: all .3s ease;
    pointer-events: none;
}
.kb-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.kb-toast.success { border-color: var(--color-success); color: var(--color-success); }
.kb-toast.error   { border-color: var(--color-danger);  color: var(--color-danger); }


.kb-preview-wrap {
    background: var(--surface-1);
    border: 1px solid var(--border-soft);
    border-radius: 18px;
    padding: 18px;
    margin-bottom: 20px;
}
.kb-preview-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 14px;
    color: var(--text-muted); font-size: 12px;
}
.kb-preview-head .dot { width:6px; height:6px; border-radius:50%; background: var(--color-success); display:inline-block; margin-inline-end:6px; }


.kb-rows {
    display: flex;
    flex-direction: column;
    gap: 10px;
}


.kb-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    background: var(--surface-2);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.kb-row:hover { border-color: var(--border-mid); }
.kb-row.drag-over { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.kb-row.dragging  { opacity: 0.4; }

.kb-row__handle {
    color: var(--text-dim);
    cursor: grab;
    padding: 6px;
    display: flex;
    align-items: center;
    border-radius: 6px;
    transition: background .15s ease;
}
.kb-row__handle:hover { color: var(--accent); background: var(--accent-soft); }
.kb-row__handle:active { cursor: grabbing; }

.kb-row__btns {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    min-height: 40px;
    align-items: center;
}
.kb-row__actions {
    display: flex; gap: 4px;
}


.kb-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 14px;
    border-radius: 10px;
    border: 1px solid var(--border-mid);
    background: var(--surface-3);
    color: var(--text-main);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s ease;
    font-family: 'Arad', sans-serif;
    user-select: none;
    max-width: 100%;
}
.kb-btn:hover { border-color: var(--accent); }
.kb-btn.dragging { opacity: 0.4; }
.kb-btn .kb-btn__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }
.kb-btn .kb-btn__remove {
    margin-inline-start: 4px;
    width: 18px; height: 18px;
    border-radius: 50%;
    display: grid; place-items: center;
    background: rgba(0,0,0,0.25);
    color: var(--text-muted);
    border: 0;
    cursor: pointer;
    transition: all .15s ease;
    padding: 0;
}
.kb-btn .kb-btn__remove:hover {
    background: var(--color-danger);
    color: #fff;
}
.kb-btn .kb-btn__remove .svg-icon { width: 11px; height: 11px; stroke-width: 2.5; margin: 0; }


.kb-btn[data-style="primary"] {
    background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 75%, #000));
    color: var(--accent-fg);
    border-color: var(--accent);
}
.kb-btn[data-style="success"] {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #fff;
    border-color: #16a34a;
}
.kb-btn[data-style="danger"] {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    border-color: #dc2626;
}
.kb-btn[data-style="primary"]:hover,
.kb-btn[data-style="success"]:hover,
.kb-btn[data-style="danger"]:hover { filter: brightness(1.12); }


.kb-add-btn {
    padding: 9px 12px;
    border-radius: 10px;
    border: 1px dashed var(--border-mid);
    background: transparent;
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    transition: all .15s ease;
    display: inline-flex; align-items: center; gap: 6px;
}
.kb-add-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-soft);
}


.kb-icon-btn {
    width: 32px; height: 32px;
    border-radius: 8px;
    background: transparent;
    border: 1px solid var(--border-soft);
    color: var(--text-muted);
    cursor: pointer;
    display: grid; place-items: center;
    transition: all .15s ease;
}
.kb-icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.kb-icon-btn.danger:hover { border-color: var(--color-danger); color: var(--color-danger); background: var(--color-danger-soft); }


.kb-add-row {
    width: 100%;
    padding: 16px;
    border-radius: var(--radius);
    border: 1.5px dashed var(--border-mid);
    background: transparent;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s ease;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    margin-top: 14px;
    font-family: 'Arad', sans-serif;
}
.kb-add-row:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-soft);
}


.kb-empty {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-muted);
    font-size: 14px;
}
.kb-empty .svg-icon { color: var(--text-dim); margin-bottom: 14px; }


.kb-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 16px;
    opacity: 0;
    transition: opacity .2s ease;
    backdrop-filter: blur(4px);
}
.kb-modal.open { display: flex; opacity: 1; }
.kb-modal__box {
    width: 100%; max-width: 480px;
    background: var(--surface-2);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-2);
    overflow: hidden;
    transform: scale(0.95);
    transition: transform .2s ease;
}
.kb-modal.open .kb-modal__box { transform: scale(1); }
.kb-modal__head {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border-soft);
    display: flex; align-items: center; gap: 10px;
    font-weight: 700; color: var(--text-main); font-size: 15px;
}
.kb-modal__head .svg-icon { color: var(--accent); }
.kb-modal__body { padding: 22px; }
.kb-modal__foot {
    padding: 14px 22px;
    border-top: 1px solid var(--border-soft);
    display: flex; gap: 10px; justify-content: flex-end;
    background: rgba(0,0,0,0.15);
}
.kb-field { margin-bottom: 18px; }
.kb-field:last-child { margin-bottom: 0; }
.kb-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.kb-field > label::before {
    content: "> ";
    color: var(--accent);
    font-family: monospace;
}
.kb-field input[type="text"] {
    width: 100%;
    padding: 11px 14px;
    background: var(--surface-1);
    border: 1px solid var(--border-mid);
    border-radius: 10px;
    color: var(--text-main);
    font-family: 'Arad', sans-serif;
    font-size: 14px;
    transition: border-color .15s ease, box-shadow .15s ease;
    box-sizing: border-box;
}
.kb-field input[type="text"]:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}


.kb-color-picker {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
.kb-color-opt {
    position: relative;
    cursor: pointer;
}
.kb-color-opt input { position: absolute; opacity: 0; pointer-events: none; }
.kb-color-opt__card {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas:
        "swatch name"
        "swatch hint";
    align-items: center;
    column-gap: 12px;
    row-gap: 2px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1.5px solid var(--border-soft);
    background: var(--surface-1);
    transition: all .15s ease;
    min-height: 64px;
    box-sizing: border-box;
}
.kb-color-opt:hover .kb-color-opt__card { border-color: var(--border-mid); }
.kb-color-opt input:checked + .kb-color-opt__card {
    border-color: var(--accent);
    background: var(--accent-soft);
    box-shadow: 0 0 0 2px var(--accent-glow);
}
.kb-color-opt__swatch {
    grid-area: swatch;
    align-self: center;
    width: 44px; height: 44px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.12);
    flex-shrink: 0;
}
.kb-color-opt[data-color="default"] .kb-color-opt__swatch { background: var(--surface-3); }
.kb-color-opt[data-color="primary"] .kb-color-opt__swatch { background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 75%, #000)); }
.kb-color-opt[data-color="success"] .kb-color-opt__swatch { background: linear-gradient(135deg, #22c55e, #16a34a); }
.kb-color-opt[data-color="danger"]  .kb-color-opt__swatch { background: linear-gradient(135deg, #ef4444, #dc2626); }
.kb-color-opt__name {
    grid-area: name;
    font-size: 13px; font-weight: 600;
    color: var(--text-main);
    line-height: 1.25;
    align-self: end;
}
.kb-color-opt__hint {
    grid-area: hint;
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.25;
    align-self: start;
}


@media (max-width: 600px) {
    .kb-page { margin-top: 80px; padding: 0 12px; }
    .kb-row { grid-template-columns: auto 1fr; }
    .kb-row__actions { grid-column: 2 / 3; justify-self: end; }
    .kb-btn { font-size: 12px; padding: 8px 12px; }
    .kb-btn .kb-btn__label { max-width: 120px; }
    .kb-color-picker { grid-template-columns: 1fr 1fr; gap: 8px; }
    
    .kb-color-opt__card {
        padding: 8px 10px;
        min-height: 56px;
        column-gap: 10px;
    }
    .kb-color-opt__swatch { width: 38px; height: 38px; border-radius: 8px; }
    .kb-color-opt__name { font-size: 12px; }
    .kb-color-opt__hint { font-size: 10px; }
    
    .kb-modal { padding: 10px; align-items: flex-end; }
    .kb-modal__box { max-width: 100%; border-radius: 18px 18px 14px 14px; }
    .kb-modal__head { padding: 14px 16px; font-size: 14px; }
    .kb-modal__body { padding: 16px; }
    .kb-modal__foot { padding: 12px 16px; }
    .kb-field > label { font-size: 11px; }
}


@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (max-width: 480px) {
    .app-header, .app-sidebar, .profile-menu, .modal-box {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
}


.mdt-wrap { width: 100%; }
.mdt-controls {
    display: flex; align-items: center; justify-content: flex-end;
    gap: 12px; margin-bottom: 14px; flex-wrap: wrap;
}
.mdt-search {
    color: var(--text-muted);
    font-size: 13px;
    display: inline-flex; align-items: center; gap: 8px;
    font-family: 'Arad', sans-serif;
}
.mdt-search input {
    padding: 8px 12px;
    background: var(--surface-2);
    border: 1px solid var(--border-mid);
    border-radius: 8px;
    color: var(--text-main);
    font-family: 'Arad', sans-serif;
    font-size: 13px;
    min-width: 220px;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.mdt-search input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.mdt-sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-inline-end: 22px !important;
}
.mdt-sortable::after {
    content: "";
    position: absolute;
    inset-inline-end: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0; height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid var(--text-dim);
    opacity: 0.5;
    transition: opacity .15s ease;
}
.mdt-sortable.mdt-sort-asc::after {
    border-top: 0;
    border-bottom: 4px solid var(--accent);
    opacity: 1;
}
.mdt-sortable.mdt-sort-desc::after {
    border-top-color: var(--accent);
    opacity: 1;
}
.mdt-sortable:hover::after { opacity: 1; }

.mdt-foot {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; margin-top: 16px; flex-wrap: wrap;
    color: var(--text-muted); font-size: 12px;
    font-family: 'Arad', sans-serif;
}
.mdt-info { flex: 0 1 auto; }

.mdt-pager {
    display: flex; gap: 4px; flex-wrap: wrap;
}
.mdt-page {
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-soft);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-family: 'Arad', sans-serif;
    font-size: 12px;
    transition: all .15s ease;
    min-width: 32px;
    text-align: center;
}
.mdt-page:hover:not(.disabled):not(.active) {
    border-color: var(--accent);
    color: var(--accent);
}
.mdt-page.active {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-fg);
    cursor: default;
}
.mdt-page.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.mdt-dots { padding: 0 4px; color: var(--text-dim); }

.mdt-empty {
    text-align: center !important;
    padding: 40px 20px !important;
    color: var(--text-muted) !important;
    font-style: italic;
}

@media (max-width: 600px) {
    .mdt-search input { min-width: 0; flex: 1; width: 100%; }
    .mdt-controls { justify-content: stretch; }
    .mdt-foot { flex-direction: column; align-items: stretch; gap: 10px; }
    .mdt-pager { justify-content: center; }
}


.mc-chart {
    width: 100%;
    position: relative;
    overflow: visible;
}
.mc-chart svg { display: block; }
.mc-hit { cursor: crosshair; }
.mc-hit:hover { fill: rgba(255,255,255,0.02); }

.mc-tooltip {
    position: absolute;
    pointer-events: none;
    background: var(--surface-3);
    border: 1px solid var(--accent);
    color: var(--text-main);
    padding: 8px 12px;
    border-radius: 8px;
    font-family: 'Arad', sans-serif;
    font-size: 12px;
    line-height: 1.6;
    white-space: nowrap;
    box-shadow: var(--shadow-1);
    z-index: 5;
}
.mc-tooltip b {
    color: var(--accent);
    display: block;
    font-size: 11px;
    margin-bottom: 2px;
    font-weight: 700;
}


.kb-field label {
    display: flex !important;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}
.kb-field label small { font-size: 11px; font-weight: 400; }


.kb-combo { position: relative; }
.kb-combo input {
    width: 100%;
    padding: 11px 14px;
    background: var(--surface-1);
    border: 1px solid var(--border-mid);
    border-radius: 10px;
    color: var(--text-main);
    font-family: 'Arad', sans-serif;
    font-size: 14px;
    transition: border-color .15s ease, box-shadow .15s ease;
    box-sizing: border-box;
}
.kb-combo input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.kb-combo__results {
    position: absolute;
    inset-inline-start: 0;
    inset-inline-end: 0;
    top: calc(100% + 4px);
    z-index: 10;
    max-height: 240px;
    overflow-y: auto;
    background: var(--surface-3);
    border: 1px solid var(--border-mid);
    border-radius: 10px;
    box-shadow: var(--shadow-2);
    padding: 4px;
}
.kb-combo__results[hidden] { display: none; }
.kb-combo__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 8px 12px;
    background: transparent;
    border: 0;
    border-radius: 6px;
    color: var(--text-main);
    font-family: 'Arad', sans-serif;
    font-size: 13px;
    text-align: start;
    cursor: pointer;
    transition: background .12s ease;
}
.kb-combo__item:hover {
    background: var(--accent-soft);
    color: var(--accent);
}
.kb-combo__label { flex: 1 1 auto; }
.kb-combo__key {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--text-dim);
    background: rgba(0,0,0,0.25);
    padding: 2px 6px;
    border-radius: 4px;
    direction: ltr;
}
.kb-combo__item:hover .kb-combo__key { color: var(--accent); background: rgba(0,0,0,0.2); }
.kb-combo__empty {
    padding: 14px;
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
}


.kb-btn { padding-inline-end: 6px; }
.kb-btn__key {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    padding: 2px 5px;
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.3);
    color: rgba(255, 255, 255, 0.55);
    direction: ltr;
    line-height: 1;
    margin-inline-start: 4px;
    flex-shrink: 0;
}
.kb-btn[data-style="primary"] .kb-btn__key,
.kb-btn[data-style="success"] .kb-btn__key,
.kb-btn[data-style="danger"]  .kb-btn__key {
    background: rgba(0, 0, 0, 0.25);
    color: rgba(255, 255, 255, 0.7);
}


.kb-select {
    width: 100%;
    padding: 11px 14px;
    background: var(--surface-1);
    border: 1px solid var(--border-mid);
    border-radius: 10px;
    color: var(--text-main);
    font-family: 'Arad', sans-serif;
    font-size: 14px;
    transition: border-color .15s ease, box-shadow .15s ease;
    box-sizing: border-box;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b94a6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
    background-repeat: no-repeat;
    background-position: left 14px center;
    background-size: 16px;
    padding-inline-start: 38px;
}
.kb-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.kb-select optgroup {
    background: var(--surface-3);
    color: var(--accent);
    font-weight: 700;
    font-style: normal;
}
.kb-select option {
    background: var(--surface-1);
    color: var(--text-main);
    padding: 8px;
}


.kb-pool {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    min-height: 60px;
    padding: 14px;
    background: rgba(0,0,0,0.2);
    border: 1.5px dashed var(--border-soft);
    border-radius: 12px;
    transition: border-color .15s ease, background .15s ease;
}
.kb-pool.drag-over {
    border-color: var(--color-danger);
    background: var(--color-danger-soft);
}
.kb-pool-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 4px 4px 12px;
    background: var(--surface-3);
    border: 1px solid var(--border-mid);
    border-radius: 10px;
    cursor: grab;
    transition: all .15s ease;
    user-select: none;
}
.kb-pool-item:hover {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.kb-pool-item:active { cursor: grabbing; }
.kb-pool-item.dragging { opacity: 0.4; }
.kb-pool-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
}
.kb-pool-add {
    width: 26px; height: 26px;
    border-radius: 50%;
    border: 0;
    background: var(--accent-soft);
    color: var(--accent);
    cursor: pointer;
    display: grid; place-items: center;
    transition: all .15s ease;
    padding: 0;
}
.kb-pool-add:hover {
    background: var(--accent);
    color: var(--accent-fg);
}
.kb-pool-add .svg-icon { margin: 0; }

.kb-pool-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    color: var(--color-success);
    font-size: 14px;
    font-weight: 600;
    padding: 16px;
}
.kb-pool-empty .svg-icon { color: var(--color-success); }


.kb-row__hint {
    width: 100%;
    padding: 8px;
    color: var(--text-dim);
    font-size: 12px;
    text-align: center;
    font-style: italic;
    border: 1px dashed transparent;
    border-radius: 8px;
    transition: border-color .15s ease;
}
.kb-row.drag-over .kb-row__hint {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-soft);
}


@media (max-width: 768px) {
    
    .table-wrap {
        overflow-x: visible;
        background: transparent;
        border: 0;
    }

    .app-table, table.dataTable {
        border: 0 !important;
        background: transparent !important;
        width: 100%;
    }
    .app-table thead, table.dataTable thead { display: none; }

    .app-table tbody, table.dataTable tbody { display: block; }

    .app-table tr, table.dataTable tbody tr {
        display: block;
        background: var(--surface-2) !important;
        border: 1px solid var(--border-soft);
        border-radius: 14px;
        padding: 14px 16px;
        margin-bottom: 12px;
        box-shadow: var(--shadow-1);
        position: relative;
    }
    .app-table tr:hover, table.dataTable tbody tr:hover {
        background: var(--surface-2) !important;
        border-color: var(--accent);
    }

    .app-table td, table.dataTable tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 0;
        border: 0;
        border-bottom: 1px dashed var(--border-soft);
        text-align: right;
        gap: 12px;
        flex-wrap: wrap;
        min-height: 32px;
        line-height: 1.6;
    }
    .app-table td:last-child, table.dataTable tbody td:last-child {
        border-bottom: 0;
        padding-top: 12px;
        margin-top: 4px;
        justify-content: stretch;
    }
    .app-table td::before, table.dataTable tbody td::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--text-muted);
        font-size: 12px;
        flex-shrink: 0;
    }
    .app-table td[data-label=""]::before,
    .app-table td:not([data-label])::before,
    table.dataTable tbody td[data-label=""]::before,
    table.dataTable tbody td:not([data-label])::before {
        display: none;
    }
    
    .app-table td.cell-actions, table.dataTable tbody td.cell-actions {
        justify-content: stretch;
    }
    .app-table td.cell-actions > *, table.dataTable tbody td.cell-actions > * {
        width: 100%;
        justify-content: center;
    }
    
    .app-table tr.mdt-empty-row, table.dataTable tbody tr.mdt-empty-row {
        text-align: center;
    }
    .mdt-empty {
        text-align: center !important;
        justify-content: center !important;
        border-bottom: 0 !important;
    }
    .mdt-empty::before { display: none !important; }
}


:root {
    --chart-grid: rgba(255, 255, 255, 0.06);
    --chart-axis: var(--text-muted);
}
[data-theme="light"] {
    --chart-grid: rgba(0, 0, 0, 0.07);
    --chart-axis: #475569;
}

.chart-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 16px;
    padding: 0 4px;
}
.chart-toolbar .grow { flex: 1 1 auto; }
.chart-range-btn {
    padding: 7px 14px;
    border-radius: 8px;
    border: 1px solid var(--border-soft);
    background: var(--surface-2);
    color: var(--text-muted);
    font-family: 'Arad', sans-serif;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s ease;
}
.chart-range-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.chart-range-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-fg);
    cursor: default;
}
.chart-custom-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px 4px 4px;
    background: var(--surface-2);
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 12px;
    transition: border-color .15s ease;
}
.chart-custom-wrap:focus-within {
    border-color: var(--accent);
}
.chart-custom-wrap input {
    width: 60px;
    padding: 5px 8px;
    background: var(--surface-1);
    border: 1px solid var(--border-soft);
    border-radius: 6px;
    color: var(--text-main);
    font-family: 'Arad', sans-serif;
    font-size: 12px;
    text-align: center;
}
.chart-custom-wrap input:focus {
    outline: none;
    border-color: var(--accent);
}
.chart-custom-wrap button {
    padding: 5px 12px;
    background: var(--accent);
    color: var(--accent-fg);
    border: 0;
    border-radius: 6px;
    font-family: 'Arad', sans-serif;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
.chart-custom-wrap button:hover { filter: brightness(1.1); }
.chart-loading {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(10, 10, 15, 0.6);
    backdrop-filter: blur(2px);
    color: var(--accent);
    font-size: 13px;
    z-index: 10;
    border-radius: 12px;
}
[data-theme="light"] .chart-loading { background: rgba(255, 255, 255, 0.7); }
.chart-loading.show { display: flex; }

@media (max-width: 480px) {
    .chart-range-btn { padding: 6px 10px; font-size: 11px; }
    .chart-custom-wrap input { width: 50px; }
}
