/* ==========================================================================
   DISK.PK AdminWeb — theme
   Data-protection brand: deep slate sidebar, electric-cyan actions,
   emerald for "protected", amber for "attention", red for "at risk".
   ========================================================================== */

:root {
    --dk-navy:        #101a2e;
    --dk-navy-soft:   #16233d;
    --dk-line:        #1e2d4a;
    --dk-cyan:        #00b8d4;
    --dk-cyan-dark:   #0091aa;
    --dk-emerald:     #0e7c6b;
    --dk-amber:       #b45309;
    --dk-red:         #b91c1c;
    --dk-ink:         #0f172a;
    --dk-muted:       #64748b;
    --dk-bg:          #f4f6fa;
    --dk-card:        #ffffff;
    --dk-border:      #e2e8f0;
    --dk-radius:      12px;
    --dk-sidebar-w:   258px;
}

* { box-sizing: border-box; }

body {
    background: var(--dk-bg);
    color: var(--dk-ink);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14.5px;
    margin: 0;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--dk-cyan-dark); text-decoration: none; }
a:hover { color: var(--dk-cyan); text-decoration: underline; }

.text-navy { color: var(--dk-navy) !important; }
.text-cyan { color: var(--dk-cyan-dark) !important; }

/* ------------------------------------------------------------- sidebar --- */

.dk-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--dk-sidebar-w);
    background: var(--dk-navy);
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    z-index: 1040;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #33415a transparent;
}
.dk-sidebar::-webkit-scrollbar { width: 6px; }
.dk-sidebar::-webkit-scrollbar-thumb { background: #33415a; border-radius: 3px; }

.dk-brand {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: 1.15rem 1.1rem;
    border-bottom: 1px solid var(--dk-line);
    color: #fff;
    text-decoration: none;
    position: sticky;
    top: 0;
    background: var(--dk-navy);
    z-index: 2;
}
.dk-brand:hover { color: #fff; text-decoration: none; }
.dk-brand-mark {
    width: 38px; height: 38px;
    display: grid; place-items: center;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--dk-cyan), #0072a3);
    color: #04121c;
    flex: 0 0 38px;
}
.dk-brand-mark svg { display: block; }
.dk-brand-title { font-weight: 800; letter-spacing: .06em; font-size: .95rem; display: block; line-height: 1.1; }
.dk-brand-sub   { font-size: .68rem; color: #7c93b4; letter-spacing: .16em; text-transform: uppercase; }

.dk-nav { padding: .6rem 0 1.2rem; flex: 1; }

.dk-nav-section {
    padding: 1rem 1.15rem .35rem;
    font-size: .64rem;
    letter-spacing: .17em;
    text-transform: uppercase;
    color: #62789a;
    font-weight: 700;
}

.dk-nav-item {
    display: flex;
    align-items: center;
    gap: .68rem;
    padding: .55rem 1.15rem;
    color: #b6c6dc;
    text-decoration: none;
    font-size: .875rem;
    border-left: 3px solid transparent;
    transition: background .12s, color .12s;
}
.dk-nav-item:hover { background: var(--dk-navy-soft); color: #fff; text-decoration: none; }
.dk-nav-item.active {
    background: var(--dk-navy-soft);
    color: #fff;
    border-left-color: var(--dk-cyan);
    font-weight: 600;
}
.dk-nav-item i:first-child { width: 18px; font-size: 1rem; text-align: center; opacity: .95; }
.dk-nav-label { flex: 1; }
.dk-nav-caret { font-size: .7rem; opacity: .55; }

.dk-nav-phase {
    font-size: .58rem;
    font-weight: 700;
    letter-spacing: .06em;
    background: #26364f;
    color: #8fa6c4;
    border-radius: 20px;
    padding: .1rem .42rem;
}

.dk-nav-sub { background: #0c1526; padding: .2rem 0 .35rem; }
.dk-nav-sub-item {
    display: block;
    padding: .34rem 1.15rem .34rem 3rem;
    color: #8ea3c0;
    font-size: .81rem;
    text-decoration: none;
}
.dk-nav-sub-item:hover { color: #fff; background: #121e33; text-decoration: none; }
.dk-nav-sub-item.active { color: var(--dk-cyan); font-weight: 600; }

.dk-sidebar-foot {
    padding: .8rem 1.15rem;
    border-top: 1px solid var(--dk-line);
    font-size: .7rem;
    color: #62789a;
}

.dk-backdrop {
    position: fixed; inset: 0;
    background: rgba(4, 10, 20, .55);
    z-index: 1035;
    display: none;
}
.dk-backdrop.show { display: block; }

/* -------------------------------------------------------------- layout --- */

.dk-main { margin-left: var(--dk-sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }

.dk-topbar {
    background: #fff;
    border-bottom: 1px solid var(--dk-border);
    padding: .6rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 1020;
}
.dk-burger {
    display: none;
    background: none; border: 0;
    font-size: 1.3rem; color: var(--dk-navy);
    padding: .2rem .4rem; cursor: pointer;
}
.dk-topbar-spacer { flex: 1; }

.dk-content { padding: 1.25rem; flex: 1; }
@media (min-width: 1400px) { .dk-content { padding: 1.5rem 2rem; } }

.dk-page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.1rem;
}
.dk-page-title { font-size: 1.3rem; font-weight: 700; color: var(--dk-navy); margin: 0 0 .15rem; }
.dk-page-sub   { color: var(--dk-muted); font-size: .84rem; margin: 0; max-width: 62ch; }

.dk-breadcrumb { font-size: .76rem; color: var(--dk-muted); margin-bottom: .5rem; }
.dk-breadcrumb a { color: var(--dk-muted); }
.dk-breadcrumb a:hover { color: var(--dk-cyan-dark); }

/* --------------------------------------------------------------- cards --- */

.dk-card {
    background: var(--dk-card);
    border: 1px solid var(--dk-border);
    border-radius: var(--dk-radius);
    padding: 1.05rem 1.15rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.dk-card-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: .75rem;
    margin: -.15rem 0 .85rem;
    padding-bottom: .6rem;
    border-bottom: 1px solid var(--dk-border);
}
.dk-card-head h2 { font-size: .95rem; font-weight: 700; color: var(--dk-navy); margin: 0; }
.dk-card.p-0 .dk-card-head { margin: 0; padding: .95rem 1.1rem; }

a.dk-card { display: block; color: inherit; transition: border-color .15s, box-shadow .15s, transform .15s; }
a.dk-card:hover {
    text-decoration: none;
    border-color: var(--dk-cyan);
    box-shadow: 0 4px 14px rgba(0, 184, 212, .12);
    transform: translateY(-1px);
}

/* --------------------------------------------------------------- tiles --- */

.dk-stat { display: flex; align-items: center; gap: .85rem; }
.dk-stat-icon {
    width: 44px; height: 44px; flex: 0 0 44px;
    border-radius: 11px;
    display: grid; place-items: center;
    font-size: 1.15rem; color: #fff;
}
.tile-cyan    { background: linear-gradient(135deg, #00b8d4, #0072a3); }
.tile-emerald { background: linear-gradient(135deg, #10a37f, #0b6b5a); }
.tile-navy    { background: linear-gradient(135deg, #334f74, #1d2c47); }
.tile-amber   { background: linear-gradient(135deg, #f59e0b, #b45309); }
.tile-red     { background: linear-gradient(135deg, #ef4444, #991b1b); }
.tile-slate   { background: linear-gradient(135deg, #94a3b8, #64748b); }

.dk-stat-value { font-size: 1.4rem; font-weight: 700; line-height: 1.1; color: var(--dk-navy); }
.dk-stat-label { font-size: .74rem; color: var(--dk-muted); text-transform: uppercase; letter-spacing: .05em; }

/* --------------------------------------------------------------- pills --- */

.dk-pill {
    display: inline-block;
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .02em;
    padding: .16rem .55rem;
    border-radius: 20px;
    color: var(--pill, #64748b);
    background: color-mix(in srgb, var(--pill, #64748b) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--pill, #64748b) 28%, transparent);
    white-space: nowrap;
}

/* -------------------------------------------------------------- tables --- */

.dk-table { width: 100%; margin: 0; font-size: .855rem; border-collapse: collapse; }
.dk-table th {
    background: #f8fafc;
    color: var(--dk-muted);
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    font-weight: 700;
    padding: .6rem .8rem;
    border-bottom: 1px solid var(--dk-border);
    text-align: left;
    white-space: nowrap;
}
.dk-table td { padding: .62rem .8rem; border-bottom: 1px solid #eef2f7; vertical-align: middle; }
.dk-table tbody tr:last-child td { border-bottom: 0; }
.dk-table tbody tr:hover { background: #f9fbfd; }
.dk-table-wrap { overflow-x: auto; border-radius: var(--dk-radius); }

.dk-empty { text-align: center; padding: 2.5rem 1rem; color: var(--dk-muted); }
.dk-empty i { font-size: 2rem; opacity: .35; display: block; margin-bottom: .5rem; }

/* --------------------------------------------------------------- forms --- */

.form-label { font-size: .8rem; font-weight: 600; color: #334155; margin-bottom: .25rem; }
.form-control, .form-select {
    font-size: .875rem;
    border-color: #cbd5e1;
    border-radius: 9px;
    padding: .45rem .7rem;
}
.form-control:focus, .form-select:focus {
    border-color: var(--dk-cyan);
    box-shadow: 0 0 0 .18rem rgba(0, 184, 212, .18);
}
.form-text { font-size: .75rem; color: var(--dk-muted); }

.btn { font-size: .865rem; border-radius: 9px; padding: .45rem .95rem; font-weight: 600; }
.btn-primary {
    background: var(--dk-cyan-dark);
    border-color: var(--dk-cyan-dark);
}
.btn-primary:hover, .btn-primary:focus {
    background: var(--dk-cyan);
    border-color: var(--dk-cyan);
}
.btn-navy { background: var(--dk-navy); border-color: var(--dk-navy); color: #fff; }
.btn-navy:hover { background: #1c2c48; border-color: #1c2c48; color: #fff; }
.btn-sm { font-size: .78rem; padding: .3rem .65rem; }

.dk-required::after { content: " *"; color: var(--dk-red); }

/* ----------------------------------------------------------- auth pages --- */

.dk-auth {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 2rem 1rem;
    background:
        radial-gradient(1100px 520px at 12% -12%, #1b3355 0%, transparent 62%),
        radial-gradient(900px 480px at 96% 108%, #073c48 0%, transparent 58%),
        var(--dk-navy);
}
.dk-auth-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 16px;
    padding: 1.9rem 1.75rem;
    box-shadow: 0 22px 60px rgba(2, 8, 20, .45);
}
.dk-auth-brand { text-align: center; margin-bottom: 1.35rem; }
.dk-auth-brand .dk-brand-mark { margin: 0 auto .6rem; width: 46px; height: 46px; }
.dk-auth-brand h1 { font-size: 1.12rem; font-weight: 800; color: var(--dk-navy); margin: 0; letter-spacing: .04em; }
.dk-auth-brand p { font-size: .76rem; color: var(--dk-muted); margin: .15rem 0 0; }
.dk-auth-foot { text-align: center; margin-top: 1.4rem; font-size: .74rem; color: #8fa6c4; }
.dk-auth-foot a { color: #b6c6dc; }

.dk-otp-input {
    font-size: 1.7rem;
    letter-spacing: .55em;
    text-align: center;
    font-weight: 700;
    padding-left: .55em;
}

/* ------------------------------------------------------- password meter --- */

.dk-pw-rules { list-style: none; padding: 0; margin: .5rem 0 0; font-size: .765rem; }
.dk-pw-rules li { color: var(--dk-muted); padding: .1rem 0; }
.dk-pw-rules li::before { content: "○ "; }
.dk-pw-rules li.ok { color: var(--dk-emerald); }
.dk-pw-rules li.ok::before { content: "● "; }

/* -------------------------------------------------------------- alerts --- */

.alert { border-radius: 10px; font-size: .855rem; border: 1px solid transparent; padding: .7rem .95rem; }
.alert-success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.alert-danger  { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.alert-info    { background: #ecfeff; border-color: #a5f3fc; color: #155e75; }

/* ---------------------------------------------------------- placeholder --- */

.dk-placeholder {
    text-align: center;
    padding: 3rem 1.5rem;
    border: 2px dashed var(--dk-border);
    border-radius: var(--dk-radius);
    background: #fff;
}
.dk-placeholder i { font-size: 2.4rem; color: #94a3b8; }
.dk-placeholder h2 { font-size: 1.05rem; color: var(--dk-navy); margin: .8rem 0 .35rem; font-weight: 700; }
.dk-placeholder p { color: var(--dk-muted); font-size: .85rem; max-width: 46ch; margin: 0 auto; }

/* ------------------------------------------------------------ responsive --- */

@media (max-width: 991.98px) {
    .dk-sidebar { transform: translateX(-100%); transition: transform .22s ease; }
    .dk-sidebar.open { transform: translateX(0); }
    .dk-main { margin-left: 0; }
    .dk-burger { display: inline-block; }
    .dk-content { padding: 1rem .9rem; }
    .dk-page-title { font-size: 1.15rem; }
}

@media (max-width: 575.98px) {
    body { font-size: 14px; }
    .dk-card { padding: .9rem; border-radius: 10px; }
    .dk-stat-icon { width: 38px; height: 38px; flex: 0 0 38px; font-size: 1rem; }
    .dk-stat-value { font-size: 1.2rem; }
    .dk-auth-card { padding: 1.5rem 1.25rem; }
}

@media print {
    .dk-sidebar, .dk-topbar, .dk-backdrop, .btn { display: none !important; }
    .dk-main { margin-left: 0; }
    .dk-card { border: 1px solid #ccc; box-shadow: none; }
}

/* ----------------------------------------------------------- invoice --- */
/* The invoice is a real document: on paper it drops the admin furniture and
   prints as a clean page rather than a screenshot of an app. */
@media print {
    .dk-sidebar, .dk-topbar, .dk-breadcrumb, .d-print-none,
    footer, .alert-dismissible { display: none !important; }
    .dk-main { margin: 0 !important; }
    .dk-content { padding: 0 !important; }
    .dk-invoice { border: 0 !important; box-shadow: none !important; padding: 0 !important; }
    body { background: #fff !important; font-size: 12pt; }
    a { color: #000 !important; text-decoration: none !important; }
}
