/* ============================================================
   Admin panel — Corporate navy theme (same family as public CV)
   ============================================================ */
:root {
    --navy-950: #071022;
    --navy-900: #0A1830;
    --navy-800: #0E2242;
    --navy-700: #14305C;
    --navy-600: #1B3E78;
    --blue: #2563EB;
    --blue-dark: #1D4ED8;
    --sky: #38BDF8;
    --bg: #F2F5FA;
    --card: #FFFFFF;
    --ink: #141F38;
    --muted: #5B6B8C;
    --line: #E3E9F4;
    --red: #DC2626;
    --green: #16A34A;
    --amber: #D97706;
    --radius: 14px;
    --shadow: 0 12px 34px rgba(10, 24, 48, .09);
    --shadow-soft: 0 4px 14px rgba(10, 24, 48, .06);
    --sidebar-w: 256px;
}

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

body {
    font-family: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}

/* ---------------- Login ---------------- */
.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(800px 400px at 85% -10%, rgba(56, 189, 248, .16), transparent 60%),
        radial-gradient(700px 420px at -5% 20%, rgba(37, 99, 235, .14), transparent 55%),
        linear-gradient(160deg, var(--navy-800), var(--navy-950));
}

.login-wrap { width: 100%; max-width: 400px; }

.login-brand { text-align: center; color: #fff; margin-bottom: 22px; }
.login-logo {
    width: 62px;
    height: 62px;
    margin: 0 auto 12px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, var(--blue), var(--sky));
    box-shadow: 0 12px 28px rgba(37, 99, 235, .45);
}
.login-brand h1 { font-size: 22px; font-weight: 800; }
.login-brand p { font-size: 13px; color: rgba(255, 255, 255, .7); margin-top: 2px; }

.login-card { padding: 28px; display: flex; flex-direction: column; gap: 16px; }

.login-back { text-align: center; font-size: 13px; font-weight: 600; color: var(--muted); }
.login-back:hover { color: var(--blue); }

/* ---------------- Alerts ---------------- */
.alert {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 13.5px;
    font-weight: 500;
    border: 1px solid transparent;
    margin-bottom: 18px;
}
.alert-success { color: #14532D; background: #F0FDF4; border-color: #BBF7D0; }
.alert-error   { color: #7F1D1D; background: #FEF2F2; border-color: #FECACA; }
.alert-info    { color: #1E3A8A; background: #EFF6FF; border-color: #BFDBFE; }
.alert-warning { color: #78350F; background: #FFFBEB; border-color: #FDE68A; }

/* ---------------- Sidebar ---------------- */
.adm-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    background: linear-gradient(170deg, var(--navy-700) 0%, var(--navy-900) 45%, var(--navy-950) 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    z-index: 60;
    transition: transform .25s ease;
}

.adm-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 22px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
}
.adm-logo {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 15px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--blue), var(--sky));
    box-shadow: 0 8px 18px rgba(37, 99, 235, .4);
}
.adm-brand strong { display: block; font-size: 14.5px; }
.adm-brand span { display: block; font-size: 11.5px; color: rgba(255, 255, 255, .6); }

.adm-nav { display: flex; flex-direction: column; gap: 3px; padding: 14px 12px; overflow-y: auto; }
.adm-nav a {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 500;
    color: rgba(255, 255, 255, .72);
    transition: all .15s ease;
}
.adm-nav a svg { width: 18px; height: 18px; flex-shrink: 0; }
.adm-nav a:hover { color: #fff; background: rgba(255, 255, 255, .07); }
.adm-nav a.active {
    color: #fff;
    background: linear-gradient(90deg, rgba(37, 99, 235, .6), rgba(56, 189, 248, .2));
    box-shadow: inset 3px 0 0 var(--sky);
}

.adm-nav-bottom { margin-top: auto; border-top: 1px solid rgba(255, 255, 255, .1); }
.adm-nav-bottom a.logout { color: rgba(255, 255, 255, .6); }
.adm-nav-bottom a.logout:hover { color: #FCA5A5; background: rgba(220, 38, 38, .15); }

/* ---------------- Mobile controls ---------------- */
.adm-toggle {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 80;
    display: none;
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 11px;
    cursor: pointer;
    color: #fff;
    background: linear-gradient(135deg, var(--navy-700), var(--navy-900));
    box-shadow: 0 8px 20px rgba(10, 24, 48, .3);
}
.adm-toggle svg { width: 21px; height: 21px; }
.adm-overlay {
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(7, 16, 34, .5);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
}

/* ---------------- Main ---------------- */
.adm-main { margin-left: var(--sidebar-w); padding: 26px 30px 60px; }

.adm-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}
.adm-title { font-size: 22px; font-weight: 800; color: var(--navy-900); }
.adm-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* ---------------- Stat cards ---------------- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 20px;
}
.stat-card { display: flex; align-items: center; gap: 14px; padding: 18px 20px; }
.stat-ico {
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 13px;
}
.stat-ico svg { width: 22px; height: 22px; }
.ico-blue   { color: var(--blue);    background: rgba(37, 99, 235, .1); }
.ico-sky    { color: #0284C7;        background: rgba(14, 165, 233, .12); }
.ico-indigo { color: #4F46E5;        background: rgba(99, 102, 241, .12); }
.ico-violet { color: #7C3AED;        background: rgba(139, 92, 246, .12); }

.stat-label { font-size: 11.5px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); }
.stat-value { font-size: 24px; font-weight: 800; color: var(--navy-900); line-height: 1.2; }
.stat-value small { font-size: 12.5px; font-weight: 600; color: var(--muted); }

/* ---------------- Panels ---------------- */
.dash-grid {
    display: grid;
    grid-template-columns: 1.25fr 1fr;
    gap: 18px;
    margin-bottom: 20px;
}
.panel { padding: 20px 22px; margin-bottom: 20px; }
.dash-grid .panel { margin-bottom: 0; }

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.panel-head h3 { font-size: 14.5px; font-weight: 700; color: var(--navy-900); }
.link { font-size: 12.5px; font-weight: 600; color: var(--blue); }
.link:hover { text-decoration: underline; }

.empty {
    padding: 22px 0;
    text-align: center;
    font-size: 13.5px;
    color: var(--muted);
    background: var(--bg);
    border: 1px dashed var(--line);
    border-radius: 12px;
}

/* Bar chart */
.bars { display: flex; flex-direction: column; gap: 14px; }
.bar-row { display: flex; flex-direction: column; gap: 6px; }
.bar-meta { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; }
.bar-name { color: var(--ink); font-weight: 600; }
.bar-val { color: var(--blue); font-weight: 700; white-space: nowrap; }
.bar-track {
    height: 9px;
    border-radius: 99px;
    background: #EEF2F9;
    overflow: hidden;
}
.bar-fill {
    height: 100%;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--blue), var(--sky));
    transition: width .6s ease;
}

/* Donut */
.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut { flex-shrink: 0; }
.donut-legend { list-style: none; display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 160px; }
.donut-legend li { display: flex; align-items: center; gap: 9px; font-size: 12.5px; }
.donut-legend .dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.donut-legend .lg-name { color: var(--ink); flex: 1; }
.donut-legend .lg-val { font-weight: 700; color: var(--navy-900); }

/* ---------------- Tables ---------------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
    text-align: left;
    padding: 10px 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--muted);
    border-bottom: 2px solid var(--line);
    white-space: nowrap;
}
.table td {
    padding: 11px 12px;
    border-bottom: 1px solid #EDF1F8;
    vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: #F8FAFE; }
.table-sm td { padding: 8px 10px; }

.td-time { white-space: nowrap; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.td-actions { white-space: nowrap; }

.badge-tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .5px;
    color: var(--blue-dark);
    background: rgba(37, 99, 235, .08);
    border: 1px solid rgba(37, 99, 235, .2);
    white-space: nowrap;
}

/* ---------------- Buttons ---------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 11px;
    font-size: 13.5px;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all .16s ease;
    white-space: nowrap;
}
.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--blue), var(--blue-dark));
    box-shadow: 0 6px 16px rgba(37, 99, 235, .3);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(37, 99, 235, .36); }
.btn-outline { color: var(--blue); border-color: rgba(37, 99, 235, .4); background: #fff; }
.btn-outline:hover { background: rgba(37, 99, 235, .06); }
.btn-ghost { color: var(--muted); border-color: var(--line); background: #fff; }
.btn-ghost:hover { color: var(--ink); border-color: #cbd5e1; }
.btn-danger { color: #fff; background: var(--red); }
.btn-danger:hover { background: #B91C1C; }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 12.5px; }
.btn-xs { padding: 5px 10px; font-size: 11.5px; border-radius: 8px; }

.icon-btn {
    width: 26px;
    height: 26px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fff;
    color: var(--muted);
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    transition: all .15s ease;
}
.icon-btn:hover:not(:disabled) { color: var(--blue); border-color: var(--blue); background: rgba(37, 99, 235, .06); }
.icon-btn:disabled { opacity: .35; cursor: not-allowed; }

/* ---------------- Forms ---------------- */
.form-panel { margin-bottom: 20px; }
.form-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}
.form-cols-3 { grid-template-columns: repeat(3, 1fr); }
.form-narrow { max-width: 560px; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field.grow { flex: 1; margin-bottom: 0; }
.field label { font-size: 12.5px; font-weight: 700; color: var(--navy-800); }
.field input,
.field textarea,
.field select {
    width: 100%;
    padding: 10px 13px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #FBFCFE;
    font-size: 13.5px;
    font-family: inherit;
    color: var(--ink);
    transition: all .15s ease;
}
.field textarea { resize: vertical; }
.field input:focus,
.field textarea:focus,
.field select:focus {
    outline: none;
    border-color: var(--blue);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .14);
}
.hint { font-size: 12px; color: var(--muted); }
.hint-inline { font-weight: 400; color: var(--muted); }

.inline-form { display: flex; align-items: flex-start; gap: 10px; }
.inline { display: inline-flex; gap: 4px; }
.inline-form + .inline-form, .inline-form .field { margin-top: 0; }
.add-skill { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }

.photo-preview { margin-top: 8px; }
.photo-preview img {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--line);
}

.thumb {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    object-fit: cover;
    border: 1px solid var(--line);
    display: block;
    background: var(--bg);
}
.thumb-none { color: var(--muted); font-size: 14px; display: inline-block; padding: 4px 6px; }

.photo-upload-preview {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 4px 0 14px;
    padding: 12px 14px;
    background: var(--bg);
    border: 1px dashed var(--line);
    border-radius: 12px;
}
.photo-upload-preview img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: var(--shadow-soft);
}
.photo-upload-preview.sq img { border-radius: 12px; }
.preview-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--red);
    cursor: pointer;
}
.preview-toggle input { accent-color: var(--red); width: 15px; height: 15px; }

.row-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* Toggle switch */
.toggle-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13.5px; color: var(--ink); }
.toggle input { display: none; }
.toggle-track {
    width: 38px;
    height: 22px;
    border-radius: 99px;
    background: #D4DCE9;
    position: relative;
    transition: background .18s ease;
    flex-shrink: 0;
}
.toggle-track::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, .2);
    transition: transform .18s ease;
}
.toggle input:checked + .toggle-track { background: linear-gradient(90deg, var(--blue), var(--sky)); }
.toggle input:checked + .toggle-track::after { transform: translateX(16px); }

/* Category panels (skills page) */
.cat-panel { margin-bottom: 18px; }
.cat-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.cat-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cat-title h3 { font-size: 15px; font-weight: 700; color: var(--navy-900); }
.count-chip {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--blue-dark);
    background: rgba(37, 99, 235, .08);
    border: 1px solid rgba(37, 99, 235, .2);
    padding: 3px 10px;
    border-radius: 999px;
}

.sticky-actions {
    position: sticky;
    bottom: 14px;
    display: flex;
    gap: 10px;
    padding: 14px 18px;
    background: rgba(255, 255, 255, .9);
    backdrop-filter: blur(8px);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-top: 20px;
}

/* ---------------- Responsive ---------------- */
@media (max-width: 1100px) {
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .dash-grid { grid-template-columns: 1fr; }
    .dash-grid .panel { margin-bottom: 18px; }
    .form-cols-3 { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
    .adm-sidebar { transform: translateX(-100%); box-shadow: 18px 0 40px rgba(7, 16, 34, .25); }
    body.nav-open .adm-sidebar { transform: translateX(0); }
    body.nav-open .adm-overlay { opacity: 1; pointer-events: auto; }
    .adm-toggle { display: grid; place-items: center; }
    .adm-main { margin-left: 0; padding: 76px 16px 48px; }
    .form-cols { grid-template-columns: 1fr; }
    .inline-form { flex-wrap: wrap; }
}
