/* =============================================
   THESERJS ADMIN — admin.css
   ============================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg:       #080808;
    --bg-s:     #0d0d0d;
    --bg-card:  #111111;
    --border:   rgba(255,255,255,.07);
    --border-h: rgba(255,255,255,.15);
    --text:     #e8e8e8;
    --muted:    #888;
    --green:    #00cc6a;
    --green-d:  rgba(0,204,106,.1);
    --purple:   #a855f7;
    --purple-d: rgba(168,85,247,.1);
    --red:      #f87171;
    --red-d:    rgba(248,113,113,.1);
    --mono:     'Space Mono', monospace;
    --sans:     'Space Grotesk', sans-serif;
    --radius:   10px;
    --ease:     cubic-bezier(.4,0,.2,1);
}

html { font-size: 14px; }
body { font-family: var(--sans); background: var(--bg); color: var(--text); min-height: 100vh; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: var(--sans); }
input, textarea, select { font-family: var(--sans); }
img { max-width: 100%; }

/* ── scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-s); }
::-webkit-scrollbar-thumb { background: #222; border-radius: 3px; }

/* ══════════════════════════════════
   AUTH / LOGIN
══════════════════════════════════ */
#login-screen {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh;
    background: radial-gradient(ellipse 60% 50% at 50% 0%, rgba(0,204,106,.06) 0%, transparent 70%);
}
.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2.5rem 2rem;
    width: 360px;
    display: flex; flex-direction: column; gap: 1.5rem;
}
.login-logo { text-align: center; font-family: var(--mono); font-size: 1.1rem; color: var(--text); letter-spacing: .15em; }
.login-logo span { color: var(--green); }
.login-card h2 { font-size: 1.3rem; text-align: center; }
.login-error {
    background: var(--red-d); border: 1px solid var(--red);
    color: var(--red); border-radius: 8px;
    padding: .6rem 1rem; font-size: .82rem; display: none;
}
.login-error.show { display: block; }

/* ══════════════════════════════════
   LAYOUT
══════════════════════════════════ */
#app { display: none; min-height: 100vh; }
#app.show { display: flex; }

/* sidebar */
.sidebar {
    width: 220px; flex-shrink: 0;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
    position: sticky; top: 0; height: 100vh;
    overflow-y: auto;
}
.sidebar-top {
    padding: 1.5rem 1.2rem 1rem;
    border-bottom: 1px solid var(--border);
}
.sidebar-logo { font-family: var(--mono); font-size: .85rem; letter-spacing: .1em; }
.sidebar-logo span { color: var(--green); }
.sidebar-user { font-size: .72rem; color: var(--muted); margin-top: .25rem; }

.sidebar-nav { flex: 1; padding: .8rem .6rem; display: flex; flex-direction: column; gap: .2rem; }
.nav-item {
    display: flex; align-items: center; gap: .65rem;
    padding: .6rem .75rem; border-radius: 8px;
    color: var(--muted); font-size: .82rem; font-weight: 500;
    border: 1px solid transparent;
    transition: background .15s, color .15s, border-color .15s;
}
.nav-item:hover { background: rgba(255,255,255,.04); color: var(--text); }
.nav-item.active { background: var(--green-d); color: var(--green); border-color: rgba(0,204,106,.2); }
.nav-icon { font-size: .95rem; width: 18px; text-align: center; flex-shrink: 0; }
.nav-divider { height: 1px; background: var(--border); margin: .5rem 0; }

.sidebar-bottom { padding: .8rem .6rem; border-top: 1px solid var(--border); }

/* main */
.main { flex: 1; overflow-x: hidden; }
.topbar {
    height: 52px; padding: 0 1.5rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 10;
}
.topbar-title { font-size: .95rem; font-weight: 600; }
.page-content { padding: 1.5rem; max-width: 900px; }

/* ══════════════════════════════════
   FORMS & INPUTS
══════════════════════════════════ */
.form-group { display: flex; flex-direction: column; gap: .4rem; }
.form-label { font-size: .72rem; font-family: var(--mono); color: var(--muted); letter-spacing: .1em; text-transform: uppercase; }
.form-input, .form-textarea, .form-select {
    background: var(--bg-s);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    padding: .65rem .85rem;
    font-size: .88rem;
    outline: none;
    width: 100%;
    transition: border-color .15s;
}
.form-input:focus, .form-textarea:focus, .form-select:focus { border-color: var(--green); }
.form-textarea { resize: vertical; min-height: 90px; }
.form-select option { background: var(--bg-card); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }

.range-wrap { display: flex; align-items: center; gap: .75rem; }
input[type=range] {
    flex: 1; accent-color: var(--green);
    height: 4px; cursor: pointer;
}
.range-val { font-family: var(--mono); font-size: .8rem; color: var(--green); width: 32px; text-align: right; }

/* toggle */
.toggle-wrap { display: flex; align-items: center; gap: .75rem; cursor: pointer; }
.toggle-box {
    width: 40px; height: 22px; border-radius: 999px;
    background: var(--bg-s); border: 1px solid var(--border);
    position: relative; transition: background .2s;
    flex-shrink: 0;
}
.toggle-box::after {
    content: ''; position: absolute; top: 2px; left: 2px;
    width: 16px; height: 16px; border-radius: 50%;
    background: var(--muted); transition: transform .2s, background .2s;
}
.toggle-box.on { background: var(--green-d); border-color: var(--green); }
.toggle-box.on::after { transform: translateX(18px); background: var(--green); }
.toggle-label { font-size: .85rem; color: var(--muted); }

/* ══════════════════════════════════
   BUTTONS
══════════════════════════════════ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    padding: .55rem 1.1rem; border-radius: 8px;
    font-size: .82rem; font-weight: 600;
    border: 1px solid transparent;
    transition: opacity .15s, transform .1s;
}
.btn:active { transform: scale(.97); }
.btn-primary   { background: var(--green); color: #000; }
.btn-primary:hover { opacity: .88; }
.btn-outline   { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--border-h); background: rgba(255,255,255,.04); }
.btn-danger    { background: var(--red-d); border-color: var(--red); color: var(--red); }
.btn-danger:hover { background: rgba(248,113,113,.2); }
.btn-purple    { background: var(--purple-d); border-color: var(--purple); color: var(--purple); }
.btn-purple:hover { background: rgba(168,85,247,.2); }
.btn-sm { padding: .35rem .7rem; font-size: .76rem; border-radius: 6px; }
.btn-icon { padding: .4rem; border-radius: 6px; font-size: 1rem; }

/* ══════════════════════════════════
   CARDS & SECTIONS
══════════════════════════════════ */
.section-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 1.2rem;
}
.section-title { font-size: 1rem; font-weight: 700; display: flex; align-items: center; gap: .5rem; }
.section-title::before {
    content: ''; display: inline-block;
    width: 3px; height: 1em; background: var(--green); border-radius: 2px;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.2rem;
    transition: border-color .15s;
}
.card:hover { border-color: var(--border-h); }

/* save bar */
.save-bar {
    display: flex; align-items: center; justify-content: flex-end; gap: .75rem;
    margin-top: 1.5rem; padding-top: 1.2rem;
    border-top: 1px solid var(--border);
}
.save-msg { font-size: .8rem; color: var(--green); opacity: 0; transition: opacity .3s; }
.save-msg.show { opacity: 1; }

/* ══════════════════════════════════
   SKILL / PROJECT LIST ITEMS
══════════════════════════════════ */
.item-list { display: flex; flex-direction: column; gap: .6rem; }
.item-row {
    display: flex; align-items: center; gap: .75rem;
    background: var(--bg-s); border: 1px solid var(--border);
    border-radius: 8px; padding: .7rem 1rem;
    transition: border-color .15s;
}
.item-row:hover { border-color: var(--border-h); }
.drag-handle { color: var(--muted); cursor: grab; font-size: .9rem; flex-shrink: 0; }
.drag-handle:active { cursor: grabbing; }
.item-icon { font-size: 1.1rem; width: 24px; text-align: center; flex-shrink: 0; }
.item-info { flex: 1; min-width: 0; }
.item-name { font-size: .85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-sub  { font-size: .72rem; color: var(--muted); margin-top: .1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-badge {
    font-family: var(--mono); font-size: .65rem;
    padding: .2rem .55rem; border-radius: 3px;
    border: 1px solid var(--border); color: var(--muted);
    flex-shrink: 0;
}
.item-actions { display: flex; gap: .35rem; flex-shrink: 0; }

/* ── skill progress mini bar ── */
.mini-bar { height: 3px; background: var(--border); border-radius: 2px; margin-top: .35rem; overflow: hidden; }
.mini-fill { height: 100%; background: var(--green); border-radius: 2px; transition: width .4s; }

/* ══════════════════════════════════
   MODAL / DRAWER
══════════════════════════════════ */
.overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.7); backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    z-index: 100; opacity: 0; pointer-events: none;
    transition: opacity .2s;
    padding: 1rem;
}
.overlay.open { opacity: 1; pointer-events: all; }
.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    width: 100%; max-width: 540px;
    max-height: 90vh; overflow-y: auto;
    padding: 1.5rem;
    transform: scale(.95) translateY(10px);
    transition: transform .2s;
    display: flex; flex-direction: column; gap: 1rem;
}
.overlay.open .modal { transform: scale(1) translateY(0); }
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding-bottom: .8rem; border-bottom: 1px solid var(--border);
}
.modal-title { font-size: .95rem; font-weight: 700; }
.modal-close { background: none; border: none; color: var(--muted); font-size: 1.3rem; line-height: 1; padding: .2rem; transition: color .15s; }
.modal-close:hover { color: var(--text); }
.modal-footer { display: flex; justify-content: flex-end; gap: .75rem; padding-top: .8rem; border-top: 1px solid var(--border); }

/* ══════════════════════════════════
   STAT CARDS (dashboard)
══════════════════════════════════ */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .8rem; margin-bottom: 1.5rem; }
.stat-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1rem;
    display: flex; flex-direction: column; gap: .3rem;
}
.stat-card-label { font-family: var(--mono); font-size: .65rem; color: var(--muted); letter-spacing: .12em; }
.stat-card-val { font-size: 1.6rem; font-weight: 700; color: var(--green); }

/* ══════════════════════════════════
   TAGS INPUT (stack)
══════════════════════════════════ */
.tags-wrap {
    display: flex; flex-wrap: wrap; gap: .4rem; align-items: center;
    background: var(--bg-s); border: 1px solid var(--border);
    border-radius: 8px; padding: .5rem .75rem;
    min-height: 40px; cursor: text;
    transition: border-color .15s;
}
.tags-wrap:focus-within { border-color: var(--green); }
.tag-item {
    display: inline-flex; align-items: center; gap: .3rem;
    background: var(--purple-d); border: 1px solid rgba(168,85,247,.3);
    color: var(--purple); border-radius: 4px;
    padding: .18rem .55rem; font-family: var(--mono); font-size: .7rem;
}
.tag-remove { background: none; border: none; color: var(--purple); line-height: 1; padding: 0; font-size: .85rem; opacity: .7; }
.tag-remove:hover { opacity: 1; }
.tag-input { background: none; border: none; outline: none; color: var(--text); font-size: .82rem; min-width: 80px; flex: 1; }

/* ══════════════════════════════════
   NOTICE / EMPTY
══════════════════════════════════ */
.empty-state {
    text-align: center; padding: 3rem 1rem; color: var(--muted);
    font-size: .85rem; font-family: var(--mono);
}
.notice {
    border-radius: 8px; padding: .7rem 1rem;
    font-size: .82rem; margin-bottom: 1rem;
    display: flex; align-items: center; gap: .5rem;
}
.notice-info  { background: rgba(0,204,106,.07); border: 1px solid rgba(0,204,106,.2); color: var(--green); }

/* ══════════════════════════════════
   RESPONSIVE
══════════════════════════════════ */
@media (max-width: 720px) {
    .sidebar { display: none; }
    .form-row, .form-row-3 { grid-template-columns: 1fr; }
    .page-content { padding: 1rem; }
}
