/* ═══════════════════════════════════════════════════
   AES-256 Dashboard — style.css
   Dark + Light Theme Support
═══════════════════════════════════════════════════ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ──── DARK THEME (default) ──── */
:root {
    --bg: #090b10;
    --surf: #0e1118;
    --card: #13161f;
    --hover: #191d28;
    --border: #1e2231;
    --border2: #262b3d;
    --text: #eef0f8;
    --sub: #9098b5;
    --muted: #5c637f;
    --ind: #6366f1;
    --ind-l: #818cf8;
    --ind-g: rgba(99, 102, 241, .18);
    --cyan: #22d3ee;
    --violet: #a78bfa;
    --orange: #fb923c;
    --rose: #fb7185;
    --green: #4ade80;
    --yellow: #fbbf24;
    --shadow: 0 4px 24px rgba(0, 0, 0, .45);
    --sw: 252px;
    --th: 58px;
    --r: 12px;
    --rs: 8px;
    color-scheme: dark;
}

/* ──── LIGHT THEME ──── */
[data-theme="light"] {
    --bg: #f1f3f9;
    --surf: #ffffff;
    --card: #ffffff;
    --hover: #f5f6fb;
    --border: #e2e5ef;
    --border2: #d0d4e8;
    --text: #1a1d2e;
    --sub: #4b5280;
    --muted: #8890b0;
    --ind: #4f52e0;
    --ind-l: #6366f1;
    --ind-g: rgba(99, 102, 241, .10);
    --cyan: #0891b2;
    --violet: #7c3aed;
    --orange: #ea6c1a;
    --rose: #e11d48;
    --green: #16a34a;
    --yellow: #d97706;
    --shadow: 0 4px 24px rgba(80, 90, 140, .10);
    color-scheme: light;
}

/* ──── COMPACT MODE ──── */
body.compact {
    --sw: 200px;
    --th: 48px;
    --r: 8px;
}

body.compact {
    font-size: 13px;
}

body.compact .card {
    padding: 15px;
}

body.compact .sidebar-item {
    padding: 10px 15px;
}

body.compact .stat-card {
    padding: 10px;
}

body.compact .info-table th,
body.compact .info-table td {
    padding: 8px 10px;
}

/* ──── ACCENT PICKER ──── */
.accent-picker {
    display: flex;
    gap: 12px;
    margin-top: 10px;
}

.accent-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    transition: all .2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
}

.accent-dot:hover {
    transform: scale(1.15);
}

.accent-dot.active {
    border-color: var(--text);
    box-shadow: 0 0 0 2px var(--bg);
}

.dot-indigo {
    background: #6366f1;
}

.dot-cyan {
    background: #22d3ee;
}

.dot-emerald {
    background: #10b981;
}

.dot-rose {
    background: #f43f5e;
}

.dot-amber {
    background: #f59e0b;
}

/* ──── REDUCED MOTION ──── */
body.reduced-motion * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
}

html,
body {
    height: 100%;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
    transition: background .3s, color .3s;
}

/* ──── SCROLLBAR ──── */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border2);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--muted);
}

/* ──── SIDEBAR ──── */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sw);
    background: var(--surf);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 200;
    transition: transform .28s cubic-bezier(.4, 0, .2, 1), background .3s, border-color .3s;
}

.sidebar-brand {
    padding: 16px 14px 12px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 11px;
}

.brand-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--ind), var(--violet));
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-icon svg {
    width: 18px;
    height: 18px;
    stroke: #fff;
}

.brand-title {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .4px;
}

.brand-sub {
    font-size: 11px;
    color: var(--muted);
}

nav {
    flex: 1;
    overflow-y: auto;
    padding: 10px 10px 4px;
}

.nav-label {
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--muted);
    padding: 8px 10px 4px;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 12px;
    border: none;
    border-radius: var(--rs);
    background: transparent;
    color: var(--sub);
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: background .15s, color .15s;
}

.nav-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    opacity: .65;
    transition: opacity .15s;
}

.nav-btn:hover {
    background: var(--hover);
    color: var(--text);
}

.nav-btn:hover svg {
    opacity: 1;
}

.nav-btn.active {
    background: var(--ind-g);
    color: var(--ind-l);
}

.nav-btn.active svg {
    stroke: var(--ind-l);
    opacity: 1;
}

.sidebar-footer {
    padding: 10px 14px 12px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.key-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--muted);
}

.key-indicator svg {
    width: 15px;
    height: 15px;
    stroke: var(--rose);
    transition: stroke .3s;
}

.key-indicator.ok svg {
    stroke: var(--cyan);
}

/* Storage usage mini bar */
.storage-mini {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--muted);
}

.storage-mini-bar {
    flex: 1;
    height: 3px;
    background: var(--border2);
    border-radius: 2px;
    overflow: hidden;
}

.storage-mini-fill {
    height: 100%;
    background: var(--ind);
    border-radius: 2px;
    transition: width .5s, background .3s;
}

/* ──── LAYOUT ──── */
.layout {
    margin-left: var(--sw);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ──── TOPBAR ──── */
.topbar {
    height: var(--th);
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 12px;
    background: var(--surf);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background .3s, border-color .3s;
}

.hamburger {
    display: none;
    background: none;
    border: none;
    color: var(--sub);
    cursor: pointer;
    padding: 6px;
}

.hamburger svg {
    width: 20px;
    height: 20px;
}

.topbar-title {
    flex: 1;
    font-size: 15px;
    font-weight: 600;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-algo {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11.5px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    background: var(--ind-g);
    color: var(--ind-l);
    border: 1px solid rgba(99, 102, 241, .22);
    letter-spacing: .5px;
}

.topbar-key-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--rose);
    transition: background .3s, box-shadow .3s;
}

.topbar-key-dot.ok {
    background: var(--cyan);
    box-shadow: 0 0 8px var(--cyan);
}

/* Theme Toggle Button */
.theme-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--hover);
    color: var(--sub);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s;
}

.theme-btn svg {
    width: 16px;
    height: 16px;
    transition: transform .4s;
}

.theme-btn:hover {
    border-color: var(--ind);
    color: var(--ind-l);
}

.theme-btn:hover svg {
    transform: rotate(20deg);
}

/* ──── MAIN ──── */
.main {
    flex: 1;
    padding: 26px;
    overflow-y: auto;
}

/* ──── TABS ──── */
.tab {
    display: none;
    animation: fadeUp .25s ease;
}

.tab.active {
    display: block;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-head {
    margin-bottom: 22px;
}

.page-head h1 {
    font-size: 21px;
    font-weight: 700;
    margin-bottom: 4px;
}

.page-head p {
    color: var(--muted);
    font-size: 13.5px;
}

/* ──── CARDS ──── */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 20px;
    transition: border-color .2s, background .3s;
    box-shadow: var(--shadow);
}

.card:hover {
    border-color: var(--border2);
}

.card-hd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 10px;
}

.card-hd h3 {
    font-size: 14.5px;
    font-weight: 600;
    white-space: nowrap;
}

/* ──── STAT ROW ──── */
.stat-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: transform .2s, box-shadow .2s, background .3s;
    box-shadow: var(--shadow);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, .2);
}

.stat-icon-wrap {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon-wrap svg {
    width: 19px;
    height: 19px;
}

.c-indigo .stat-icon-wrap {
    background: rgba(99, 102, 241, .13);
}

.c-indigo .stat-icon-wrap svg {
    stroke: var(--ind-l);
}

.c-indigo .stat-val {
    color: var(--ind-l);
}

.c-cyan .stat-icon-wrap {
    background: rgba(34, 211, 238, .12);
}

.c-cyan .stat-icon-wrap svg {
    stroke: var(--cyan);
}

.c-cyan .stat-val {
    color: var(--cyan);
}

.c-violet .stat-icon-wrap {
    background: rgba(167, 139, 250, .12);
}

.c-violet .stat-icon-wrap svg {
    stroke: var(--violet);
}

.c-violet .stat-val {
    color: var(--violet);
}

.c-orange .stat-icon-wrap {
    background: rgba(251, 146, 60, .11);
}

.c-orange .stat-icon-wrap svg {
    stroke: var(--orange);
}

.c-orange .stat-val {
    color: var(--orange);
}

.stat-label {
    font-size: 11.5px;
    color: var(--muted);
    margin-bottom: 4px;
}

.stat-val {
    font-size: 22px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    white-space: nowrap;
}

/* ──── DASH GRID ──── */
.dash-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 18px;
}

.chart-wrap {
    position: relative;
    height: 210px;
    margin: 8px 0;
}

.chart-wrap canvas {
    width: 100% !important;
    height: 100% !important;
}

.chart-ph {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    gap: 10px;
}

.chart-ph p {
    font-size: 13px;
    text-align: center;
}

.chart-legend {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--sub);
    margin-top: 4px;
}

.leg-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: inline-block;
}

.live-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
    background: rgba(34, 211, 238, .1);
    color: var(--cyan);
    display: flex;
    align-items: center;
    gap: 5px;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: .6;
    }
}

.live-badge svg {
    animation: blink 1.5s infinite;
}

@keyframes blink {

    0%,
    100% {
        fill: var(--cyan);
    }

    50% {
        fill: transparent;
    }
}

/* ──── INFO TABLE ──── */
.info-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.info-table tr {
    border-bottom: 1px solid var(--border);
}

.info-table tr:last-child {
    border-bottom: none;
}

.info-table td {
    padding: 8px 10px;
    vertical-align: middle;
}

.info-table td:first-child {
    color: var(--sub);
    width: 50%;
}

.info-table td:last-child {
    font-weight: 500;
}

.info-note {
    margin-top: 14px;
    padding: 12px 14px;
    background: var(--ind-g);
    border: 1px solid rgba(99, 102, 241, .2);
    border-radius: 9px;
    font-size: 12.5px;
    color: var(--sub);
    line-height: 1.65;
}

.info-note-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: var(--ind-l);
    margin-bottom: 6px;
}

.info-note em {
    color: var(--orange);
    font-style: normal;
    font-weight: 600;
}

.info-note code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--cyan);
}

/* ──── ACTIVITY FEED ──── */
.feed-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 36px;
    color: var(--muted);
    font-size: 13px;
}

.feed-empty svg {
    opacity: .3;
}

.feed-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 10px;
    border-radius: 8px;
    transition: background .15s;
}

.feed-item:hover {
    background: var(--hover);
}

.fi-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.fi-icon.enc {
    background: rgba(99, 102, 241, .12);
}

.fi-icon.enc svg {
    stroke: var(--ind-l);
}

.fi-icon.dec {
    background: rgba(34, 211, 238, .11);
}

.fi-icon.dec svg {
    stroke: var(--cyan);
}

.fi-icon.batch {
    background: rgba(251, 146, 60, .11);
}

.fi-icon.batch svg {
    stroke: var(--orange);
}

.fi-icon svg {
    width: 14px;
    height: 14px;
}

.fi-body {
    flex: 1;
    min-width: 0;
}

.fi-title {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fi-sub {
    font-size: 11.5px;
    color: var(--muted);
    margin-top: 2px;
}

.fi-right {
    text-align: right;
    flex-shrink: 0;
}

.fi-lat {
    font-size: 12px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--ind-l);
    font-weight: 600;
}

.fi-time {
    font-size: 11px;
    color: var(--muted);
}

/* ──── TWO-COL ──── */
.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

/* ──── FORMS ──── */
.fg {
    margin-bottom: 14px;
}

.fg label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .6px;
    margin-bottom: 6px;
}

.fg-meta {
    display: flex;
    justify-content: space-between;
    font-size: 11.5px;
    color: var(--muted);
    margin-top: 5px;
}

input[type=text],
input[type=password],
textarea {
    width: 100%;
    background: var(--hover);
    border: 1px solid var(--border);
    border-radius: var(--rs);
    padding: 10px 12px;
    color: var(--text);
    font-size: 13.5px;
    font-family: 'Inter', sans-serif;
    outline: none;
    resize: vertical;
    transition: border-color .2s, box-shadow .2s, background .3s, color .3s;
}

input[type=text]:focus,
input[type=password]:focus,
textarea:focus {
    border-color: var(--ind);
    box-shadow: 0 0 0 3px var(--ind-g);
}

.mono {
    font-family: 'JetBrains Mono', monospace !important;
    font-size: 12.5px !important;
}

.out-area {
    background: var(--hover);
    border-color: var(--border);
    color: var(--sub);
    min-height: 120px;
}

/* ──── BUTTONS ──── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 9px;
    border: none;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: all .2s;
}

.btn svg {
    flex-shrink: 0;
}

.w100 {
    width: 100%;
    margin-top: 4px;
}

.flex1 {
    flex: 1;
}

.btn-primary {
    background: var(--ind);
    color: #fff;
}

.btn-primary:hover {
    background: var(--ind-l);
    box-shadow: 0 4px 20px var(--ind-g);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: none;
}

.btn-primary:disabled {
    opacity: .5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: rgba(34, 211, 238, .1);
    color: var(--cyan);
    border: 1px solid rgba(34, 211, 238, .22);
}

.btn-secondary:hover {
    background: rgba(34, 211, 238, .18);
    transform: translateY(-1px);
}

.btn-secondary:disabled {
    opacity: .5;
    cursor: not-allowed;
    transform: none;
}

.btn-outline {
    background: transparent;
    color: var(--sub);
    border: 1px solid var(--border);
}

.btn-outline:hover {
    border-color: var(--ind);
    color: var(--ind-l);
}

.btn-danger {
    background: rgba(251, 113, 133, .1);
    color: var(--rose);
    border: 1px solid rgba(251, 113, 133, .22);
}

.btn-danger:hover {
    background: rgba(251, 113, 133, .2);
    transform: translateY(-1px);
}

.btn-link {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 12px;
    cursor: pointer;
    transition: color .2s;
}

.btn-link:hover {
    color: var(--rose);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 7px;
}

.icon-btn {
    background: var(--hover);
    border: 1px solid var(--border);
    border-radius: 7px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--sub);
    transition: all .2s;
    flex-shrink: 0;
}

.icon-btn:hover {
    border-color: var(--ind);
    color: var(--ind-l);
}

.row-gap {
    display: flex;
    gap: 8px;
    align-items: center;
}

.add-data-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    margin-top: 6px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

/* ──── RESULT GRID ──── */
.result-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 12px;
}

.rg-item {
    background: var(--hover);
    border-radius: 8px;
    padding: 9px 11px;
    transition: background .3s;
}

.rg-label {
    font-size: 10.5px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 4px;
}

.rg-val {
    font-size: 13px;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rg-val.good {
    color: var(--cyan);
}

.rg-val.bad {
    color: var(--rose);
}

/* ──── SIZE COMPARISON TABLE ──── */
.cmp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-bottom: 10px;
}

.cmp-table th {
    text-align: left;
    padding: 8px 12px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--muted);
    border-bottom: 1px solid var(--border2);
}

.cmp-table td {
    padding: 9px 12px;
    border-bottom: 1px solid var(--border);
}

.cmp-table tr:last-child td {
    border-bottom: none;
}

.cmp-table td:not(:first-child) {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12.5px;
}

.cmp-table .row-orig td {
    color: var(--text);
}

.cmp-table .row-enc td {
    color: var(--ind-l);
}

.cmp-table .row-dec td {
    color: var(--cyan);
}

.cmp-note {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 12.5px;
    line-height: 1.65;
}

.cmp-note.good {
    background: rgba(74, 222, 128, .07);
    border: 1px solid rgba(74, 222, 128, .2);
    color: var(--green);
}

.cmp-note.bad {
    background: rgba(251, 115, 133, .07);
    border: 1px solid rgba(251, 115, 133, .2);
    color: var(--rose);
}

.cmp-note.info {
    background: var(--ind-g);
    border: 1px solid rgba(99, 102, 241, .2);
    color: var(--sub);
}

/* ──── BATCH ITEMS ──── */
.batch-item {
    border-radius: 9px;
    padding: 13px 15px;
    margin-bottom: 8px;
    border-left: 3px solid var(--border2);
    background: var(--hover);
    transition: background .3s;
}

.batch-item.ok {
    border-left-color: var(--cyan);
}

.batch-item.fail {
    border-left-color: var(--rose);
}

.bi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.bi-title {
    font-size: 13px;
    font-weight: 600;
}

.bi-status {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
}

.bi-status.ok {
    background: rgba(34, 211, 238, .12);
    color: var(--cyan);
}

.bi-status.fail {
    background: rgba(251, 115, 133, .12);
    color: var(--rose);
}

.bi-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 11.5px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--sub);
}

.bi-raw {
    margin-top: 7px;
    font-size: 11px;
    color: var(--muted);
    font-family: 'JetBrains Mono', monospace;
    word-break: break-all;
    max-height: 36px;
    overflow: hidden;
}

.badge-count {
    font-size: 11.5px;
    color: var(--sub);
    font-weight: 500;
}

/* ──── FILE DOWNLOAD ──── */
.file-dl-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.file-dl {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--hover);
    border: 1px solid var(--border2);
    border-radius: 8px;
    padding: 9px 14px;
    cursor: pointer;
    font-size: 12.5px;
    font-weight: 500;
    transition: all .2s;
    color: var(--sub);
    text-decoration: none;
}

.file-dl:hover {
    border-color: var(--ind);
    color: var(--ind-l);
}

.file-dl svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.file-dl.enc svg {
    stroke: var(--ind-l);
}

.file-dl.dec svg {
    stroke: var(--cyan);
}

/* ──── LOG ──── */
.log-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.filter-btn {
    padding: 5px 12px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted);
    font-size: 12px;
    cursor: pointer;
    transition: all .15s;
}

.filter-btn:hover {
    border-color: var(--ind);
    color: var(--ind-l);
}

.filter-btn.active {
    background: var(--ind-g);
    border-color: rgba(99, 102, 241, .3);
    color: var(--ind-l);
}

.log-terminal {
    background: var(--hover);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 16px;
    min-height: 180px;
    max-height: 520px;
    overflow-y: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    line-height: 1.8;
    transition: background .3s;
}

[data-theme="light"] .log-terminal {
    background: #f8f9fd;
}

.log-ph {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--muted);
    min-height: 140px;
}

.log-ph p {
    font-size: 13px;
}

.log-line {
    padding: 1px 0;
}

.log-ts {
    color: var(--muted);
}

.log-type {
    font-weight: 700;
    padding: 0 4px;
}

.log-type.enc {
    color: var(--ind-l);
}

.log-type.dec {
    color: var(--cyan);
}

.log-type.batch {
    color: var(--orange);
}

.log-type.avg {
    color: var(--yellow);
}

.log-type.json {
    color: var(--violet);
}

.log-ms {
    color: var(--text);
    font-weight: 700;
}

/* ──── DATA LOG ENTRIES ──── */
#dataLogList {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dl-entry {
    background: var(--hover);
    border-radius: 10px;
    padding: 14px 16px;
    border-left: 3px solid var(--border2);
    transition: background .3s;
}

.dl-entry.enc {
    border-left-color: var(--ind-l);
}

.dl-entry.dec {
    border-left-color: var(--cyan);
}

.dl-entry.batch {
    border-left-color: var(--orange);
}

.dl-ts {
    font-size: 11px;
    color: var(--muted);
    font-family: 'JetBrains Mono', monospace;
    margin-bottom: 5px;
}

.dl-type {
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 8px;
}

.dl-type.enc {
    color: var(--ind-l);
}

.dl-type.dec {
    color: var(--cyan);
}

.dl-type.batch {
    color: var(--orange);
}

.dl-details {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.dl-d {
    font-size: 12px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--sub);
}

.dl-d strong {
    color: var(--text);
}

.dl-section {
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .5px;
    margin: 6px 0 4px;
    width: 100%;
}

/* ──── SETTINGS ──── */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.key-input-row {
    display: flex;
    gap: 8px;
}

.key-input-row input {
    flex: 1;
}

.key-bar-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.key-bar {
    flex: 1;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}

.key-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width .3s, background .3s;
    background: var(--rose);
    width: 0%;
}

#keyBarText {
    font-size: 11px;
    color: var(--muted);
    white-space: nowrap;
    font-family: 'JetBrains Mono', monospace;
}

.drop-zone {
    border: 2px dashed var(--border2);
    border-radius: 10px;
    padding: 28px;
    text-align: center;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    transition: all .2s;
    margin-bottom: 12px;
    color: var(--muted);
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--ind);
    background: var(--ind-g);
    color: var(--ind-l);
}

.drop-zone p {
    font-size: 13px;
}

.status-cell {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--rose);
}

.status-cell.ok {
    color: var(--cyan);
}

.divider {
    height: 1px;
    background: var(--border);
    margin: 16px 0;
}

.key-default-preview {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11.5px;
    color: var(--muted);
    margin-top: 8px;
    word-break: break-all;
    background: var(--hover);
    border-radius: 6px;
    padding: 6px 10px;
}

/* ──── STORAGE PANEL ──── */
.storage-card {
    border: 1px solid rgba(251, 146, 60, .2);
    background: rgba(251, 146, 60, .04);
}

.storage-bar-wrap {
    margin: 12px 0;
}

.storage-bar-wrap label {
    font-size: 11px;
    color: var(--muted);
    margin-bottom: 5px;
    display: block;
}

.storage-bar {
    height: 8px;
    background: var(--border2);
    border-radius: 4px;
    overflow: hidden;
}

.storage-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width .5s, background .5s;
}

.storage-items {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 12px 0;
}

.si-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--hover);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12.5px;
    transition: background .3s;
}

.si-row:hover {
    background: var(--border2);
}

.si-icon {
    flex-shrink: 0;
    opacity: .6;
}

.si-icon svg {
    width: 14px;
    height: 14px;
}

.si-name {
    flex: 1;
    font-weight: 500;
}

.si-size {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11.5px;
    color: var(--muted);
}

.si-del {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 2px 5px;
    border-radius: 4px;
    transition: color .2s;
}

.si-del:hover {
    color: var(--rose);
}

.si-del svg {
    width: 13px;
    height: 13px;
}

.storage-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--muted);
    margin-top: 4px;
}

.storage-total strong {
    color: var(--text);
}

.del-all-row {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    flex-wrap: wrap;
}

/* ──── TOAST ──── */
.toast {
    position: fixed;
    bottom: 22px;
    right: 22px;
    background: var(--card);
    border: 1px solid var(--border2);
    color: var(--text);
    padding: 11px 18px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .35);
    opacity: 0;
    transform: translateY(10px);
    transition: all .28s;
    pointer-events: none;
    z-index: 999;
    max-width: 340px;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.ok {
    border-left: 3px solid var(--cyan);
}

.toast.er {
    border-left: 3px solid var(--rose);
}

.toast.in {
    border-left: 3px solid var(--ind);
}

/* ──── LOADING ──── */
.loading-cover {
    position: fixed;
    inset: 0;
    background: rgba(9, 11, 16, .75);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
    flex-direction: column;
    gap: 14px;
}

[data-theme="light"] .loading-cover {
    background: rgba(241, 243, 249, .75);
}

.spin {
    width: 42px;
    height: 42px;
    border: 3px solid var(--border2);
    border-top-color: var(--ind);
    border-radius: 50%;
    animation: rot .65s linear infinite;
}

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

.spin-text {
    color: var(--sub);
    font-size: 13.5px;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    z-index: 190;
}

/* ──── MISC ──── */
code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11.5px;
    background: var(--hover);
    padding: 2px 5px;
    border-radius: 4px;
}

/* ──── RESPONSIVE ──── */
@media(max-width:1100px) {
    .stat-row {
        grid-template-columns: 1fr 1fr;
    }

    .dash-grid {
        grid-template-columns: 1fr;
    }
}

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

    .settings-grid {
        grid-template-columns: 1fr;
    }

    .result-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media(max-width:768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 8px 0 30px rgba(0, 0, 0, .5);
    }

    .sidebar-overlay.vis {
        display: block;
    }

    .layout {
        margin-left: 0;
    }

    .hamburger {
        display: flex;
    }

    .stat-row {
        grid-template-columns: 1fr 1fr;
    }

    .main {
        padding: 16px;
    }
}

@media(max-width:500px) {
    .stat-row {
        grid-template-columns: 1fr;
    }

    .result-grid {
        grid-template-columns: 1fr;
    }

    .file-dl-row {
        flex-direction: column;
    }

    .del-all-row {
        flex-direction: column;
    }
}

/* ═══════════════════════════════════════════════════
   AES-256 Dashboard v2.0 — Premium Upgrades
═══════════════════════════════════════════════════ */

/* ─── LANDING PAGE ─── */
.landing-page {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.landing-bg {
    position: absolute;
    inset: 0;
    z-index: -1;
}

.blob {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--ind-g) 0%, transparent 70%);
    filter: blur(80px);
    border-radius: 50%;
    animation: blobFloat 20s infinite alternate;
}

.blob-1 {
    top: -200px;
    left: -200px;
    opacity: 0.6;
}

.blob-2 {
    bottom: -200px;
    right: -200px;
    background: radial-gradient(circle, rgba(34, 211, 238, 0.15) 0%, transparent 70%);
}

@keyframes blobFloat {
    from {
        transform: translate(0, 0) scale(1);
    }

    to {
        transform: translate(100px, 50px) scale(1.1);
    }
}

.landing-content {
    max-width: 800px;
    text-align: center;
    padding: 20px;
    animation: fadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.landing-badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 30px;
    background: var(--ind-g);
    color: var(--ind-l);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 24px;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.landing-title {
    font-size: clamp(40px, 8vw, 72px);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 24px;
    letter-spacing: -2px;
}

.landing-title span {
    background: linear-gradient(135deg, var(--ind-l), var(--cyan));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.landing-desc {
    font-size: 18px;
    color: var(--sub);
    line-height: 1.6;
    margin-bottom: 40px;
    max-width: 600px;
    margin-inline: auto;
}

.landing-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-bottom: 60px;
}

.l-btn {
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    border: none;
}

.l-btn-primary {
    background: var(--ind);
    color: #fff;
    box-shadow: 0 10px 30px var(--ind-g);
}

.l-btn-primary:hover {
    background: var(--ind-l);
    transform: translateY(-2px);
    box-shadow: 0 15px 40px var(--ind-g);
}

.l-btn-outline {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border2);
}

.l-btn-outline:hover {
    background: var(--hover);
    border-color: var(--ind);
}

.landing-stats {
    display: flex;
    gap: 60px;
    justify-content: center;
}

.l-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.l-stat strong {
    font-size: 24px;
    color: var(--text);
}

.l-stat span {
    font-size: 13px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.landing-footer {
    position: absolute;
    bottom: 30px;
    color: var(--muted);
    font-size: 12px;
}

/* ─── MODAL SYSTEM ─── */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.3s forwards;
}

.modal-card {
    background: var(--card);
    border: 1px solid var(--border2);
    border-radius: 20px;
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
    animation: modalSlide 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes modalSlide {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-hd {
    padding: 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    background: var(--card);
    z-index: 10;
}

.modal-title-group {
    display: flex;
    align-items: center;
    gap: 16px;
}

.modal-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-icon svg {
    width: 22px;
    height: 22px;
}

.modal-icon.enc {
    background: rgba(99, 102, 241, .15);
}

.modal-icon.enc svg {
    stroke: var(--ind-l);
}

.modal-icon.dec {
    background: rgba(34, 211, 238, .15);
}

.modal-icon.dec svg {
    stroke: var(--cyan);
}

.modal-hd h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 2px;
}

.modal-hd p {
    font-size: 12px;
    color: var(--muted);
}

.modal-body {
    padding: 24px;
}

.modal-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.m-item {
    background: var(--hover);
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.m-item label {
    display: block;
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.m-item .v {
    font-size: 14px;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
}

.m-data-block {
    margin-bottom: 20px;
}

.m-data-hd {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.m-data-hd label {
    font-size: 12px;
    font-weight: 600;
    color: var(--sub);
}

.modal-body textarea {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    color: var(--text);
    font-size: 13px;
    resize: none;
}

.m-analysis {
    background: var(--ind-g);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.m-analysis-title {
    font-weight: 600;
    color: var(--ind-l);
    margin-bottom: 10px;
    font-size: 14px;
}

.m-list {
    list-style: none;
    padding: 0;
}

.m-list li {
    font-size: 13px;
    margin-bottom: 6px;
    color: var(--sub);
    display: flex;
    gap: 8px;
}

.m-list li::before {
    content: "•";
    color: var(--ind-l);
    font-weight: bold;
}

.close-btn {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: all 0.2s;
}

.close-btn:hover {
    background: var(--hover);
    color: var(--rose);
}

/* ─── FILE UI ─── */
.file-drop-zone {
    border: 2px dashed var(--border2);
    border-radius: 16px;
    padding: 40px 20px;
    text-align: center;
    transition: all 0.2s;
    background: var(--bg);
    margin-bottom: 10px;
}

.file-drop-zone.dragover {
    border-color: var(--ind);
    background: var(--ind-g);
}

.drop-text {
    margin-top: 16px;
}

.drop-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}

.drop-text span {
    font-size: 12px;
    color: var(--muted);
}

.file-info-chip {
    margin-top: 20px;
    padding: 8px 16px;
    background: var(--ind-g);
    border: 1px solid var(--ind-l);
    border-radius: 30px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
}

#fileName {
    font-weight: 600;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#fileSize {
    font-size: 11px;
    color: var(--ind-l);
    opacity: 0.8;
}

.copy-small {
    background: var(--hover);
    border: 1px solid var(--border);
    color: var(--sub);
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
}

.copy-small:hover {
    border-color: var(--ind);
    color: var(--ind-l);
}

.file-history-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100px;
    color: var(--muted);
    font-size: 13px;
    border: 1px dashed var(--border);
    border-radius: var(--r);
}

.w100 {
    width: 100%;
}

/* Custom Scrollbar for Modal content */
.modal-card::-webkit-scrollbar {
    width: 6px;
}

.modal-card::-webkit-scrollbar-thumb {
    background: var(--border2);
    border-radius: 10px;
}

/* ─── SETTINGS & COMPONENT HELPERS ─── */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 15px;
}

.check-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 13px;
}

/* ─── MOBILE MEDIA QUERIES (OVERRIDE & ENHANCE) ─── */
@media (max-width: 768px) {
    .landing-stats {
        gap: 30px;
        flex-wrap: wrap;
    }

    .modal-card {
        max-width: 95%;
        border-radius: 16px;
    }

    .modal-grid {
        grid-template-columns: 1fr;
    }

    .modal-hd {
        padding: 16px;
    }

    .modal-body {
        padding: 16px;
    }

    .landing-title {
        font-size: 40px;
    }
}

@media (max-width: 500px) {
    .landing-page {
        justify-content: flex-start;
        padding-top: 60px;
        overflow-y: auto;
    }

    .landing-content {
        padding: 24px;
    }

    .landing-badge {
        font-size: 11px;
        margin-bottom: 16px;
    }

    .landing-title {
        font-size: 32px;
        margin-bottom: 16px;
    }

    .landing-desc {
        font-size: 15px;
        margin-bottom: 30px;
    }

    .landing-actions {
        flex-direction: column;
        width: 100%;
        gap: 12px;
    }

    .l-btn {
        width: 100%;
        justify-content: center;
    }

    .landing-stats {
        gap: 20px;
        justify-content: space-around;
        width: 100%;
    }

    .l-stat strong {
        font-size: 18px;
    }

    .l-stat span {
        font-size: 10px;
    }

    .settings-grid {
        grid-template-columns: 1fr;
    }

    .two-col {
        grid-template-columns: 1fr;
    }

    .modal-hd h3 {
        font-size: 16px;
    }

    .modal-icon {
        width: 36px;
        height: 36px;
    }

    .modal-icon svg {
        width: 18px;
        height: 18px;
    }

    .blob {
        width: 300px;
        height: 300px;
    }

    .main {
        padding: 12px;
    }

    .card {
        padding: 16px;
    }

    textarea {
        font-size: 14px !important;
        line-height: 1.6;
        padding: 14px !important;
    }

    .btn,
    .l-btn {
        min-height: 48px;
        /* Better for thumbs */
    }

    .nav-btn {
        padding: 12px 14px;
    }

    .topbar {
        padding: 0 12px;
    }

    .modal-body textarea {
        height: 120px;
    }

    /* ─── DEEP MOBILE REFINEMENTS ─── */
    .topbar-algo {
        display: none;
    }

    .topbar-right {
        gap: 8px;
    }

    .stat-row {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .stat-card {
        padding: 12px;
        gap: 10px;
    }

    .stat-icon-wrap {
        width: 32px;
        height: 32px;
    }

    .stat-icon-wrap svg {
        width: 16px;
        height: 16px;
    }

    .stat-label {
        font-size: 10px;
    }

    .stat-val {
        font-size: 14px;
    }

    .info-table,
    .cmp-table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .bi-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px !important;
    }

    .add-data-row {
        flex-direction: column;
        gap: 10px;
    }

    .add-data-row .btn {
        width: 100%;
    }
}

@media (max-width: 360px) {
    .stat-row {
        grid-template-columns: 1fr;
    }

    .topbar-title {
        font-size: 13px;
    }

    .stat-card {
        padding: 10px;
    }
}

@media (max-width: 550px) {
    .settings-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .storages-row {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px;
    }

    .del-all-row {
        flex-direction: column;
        gap: 10px;
    }

    .del-all-row .btn {
        width: 100%;
        justify-content: center;
    }

    .storage-total {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
}