/* ============================================================
   Tune Order System — dark high-tech theme
   Palette: deep slate base, cyan + neon-green accents.
   ============================================================ */

:root {
    --bg:        #0a0e14;
    --bg-2:      #0f151f;
    --panel:     #121a26;
    --panel-2:   #16202e;
    --border:    #1e2b3d;
    --border-lit:#2a3d55;

    --text:      #dbe6f0;
    --text-dim:  #8095ab;
    --text-faint:#5b6b7f;

    --cyan:      #33d6ff;
    --cyan-dim:  #1a9fc4;
    --green:     #3ef2a1;
    --green-dim: #1fae72;
    --amber:     #ffcb57;
    --red:       #ff6b7d;

    --glow-cyan: 0 0 0 1px rgba(51,214,255,.35), 0 0 18px rgba(51,214,255,.15);
    --glow-green:0 0 0 1px rgba(62,242,161,.35), 0 0 18px rgba(62,242,161,.15);

    --radius: 12px;
    --font: "Inter", "Segoe UI", Roboto, system-ui, -apple-system, sans-serif;
    --mono: "JetBrains Mono", "Fira Code", ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font);
    color: var(--text);
    background:
        radial-gradient(1100px 500px at 80% -10%, rgba(51,214,255,.07), transparent 60%),
        radial-gradient(900px 500px at 0% 110%, rgba(62,242,161,.06), transparent 55%),
        radial-gradient(700px 400px at 50% 50%, rgba(51,214,255,.025), transparent 70%),
        linear-gradient(rgba(51,214,255,.017) 1px, transparent 1px),
        linear-gradient(90deg, rgba(51,214,255,.017) 1px, transparent 1px),
        var(--bg);
    background-size: auto, auto, auto, 44px 44px, 44px 44px, auto;
    background-attachment: fixed;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

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

/* ---------- Layout ---------- */
.topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 22px;
    background: linear-gradient(180deg, rgba(18,26,38,.9), rgba(10,14,20,.7));
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(6px);
    position: sticky; top: 0; z-index: 40;
}
.brand {
    display: flex; align-items: center; gap: 10px;
    font-weight: 700; letter-spacing: .5px; font-size: 1.05rem;
}
.brand .dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--green); box-shadow: var(--glow-green);
}
.brand .accent { color: var(--cyan); }
.top-right { display: flex; align-items: center; gap: 14px; }
.nav-links { display: flex; align-items: center; gap: 18px; }
.nav-links .who { color: var(--text-dim); font-size: .85rem; }
.nav-toggle {
    display: none; background: transparent; border: 1px solid var(--border);
    color: var(--text); border-radius: 9px; padding: 6px 11px; font-size: 1.1rem;
    line-height: 1; cursor: pointer;
}
.nav-toggle:hover { border-color: var(--cyan-dim); }

@media (max-width: 720px) {
    .topbar { padding: 12px 16px; }
    .nav-toggle { display: block; }
    .topbar .nav-links {
        position: absolute; top: calc(100% + 8px); right: 12px; z-index: 55;
        flex-direction: column; align-items: flex-start; gap: 4px;
        background: linear-gradient(180deg, var(--panel), var(--panel-2));
        border: 1px solid var(--border-lit); border-radius: 12px; padding: 10px 12px;
        min-width: 190px; box-shadow: 0 24px 60px rgba(0,0,0,.6); display: none;
    }
    .topbar .nav-links.open { display: flex; }
    .topbar .nav-links a { padding: 8px 6px; width: 100%; }
    .topbar .nav-links .who { padding: 6px; border-top: 1px solid var(--border); width: 100%; }
    .notif-panel { right: -40px; }
    .wrap { padding: 20px 14px 60px; }
    .tiles { grid-template-columns: repeat(2, 1fr); }
    .row > .panel { flex-basis: 100%; }

    /* Keep wide tables inside their panel instead of stretching the page */
    .panel { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .panel > table { min-width: 520px; }
    .info-grid { grid-template-columns: 110px 1fr; }
}

.wrap { max-width: 1180px; margin: 0 auto; padding: 26px 22px 60px; }

.page-title {
    font-size: 1.5rem; font-weight: 700; margin: 4px 0 2px;
}
.page-sub { color: var(--text-dim); margin: 0 0 22px; font-size: .92rem; }

/* ---------- Stat tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 14px; margin-bottom: 26px; }
.tile {
    background: linear-gradient(180deg, var(--panel), var(--panel-2));
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: 16px 18px; position: relative; overflow: hidden;
}
.tile::before {
    content:""; position:absolute; left:0; top:0; bottom:0; width:3px;
    background: var(--cyan);
}
.tile.green::before { background: var(--green); }
.tile.amber::before { background: var(--amber); }
.tile .n { font-size: 1.9rem; font-weight: 700; font-family: var(--mono); }
.tile .l { color: var(--text-dim); font-size: .78rem; text-transform: uppercase; letter-spacing: 1px; margin-top: 2px; }
.tile.balance .n { color: var(--green); }

/* ---------- Panels ---------- */
.panel {
    background: linear-gradient(180deg, var(--panel), var(--panel-2));
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: 20px; margin-bottom: 22px;
}
.panel h2 {
    margin: 0 0 16px; font-size: 1.05rem; font-weight: 700;
    display: flex; align-items: center; gap: 9px;
}
.panel h2::before {
    content:""; width: 7px; height: 18px; border-radius: 2px;
    background: linear-gradient(var(--cyan), var(--cyan-dim));
    box-shadow: var(--glow-cyan);
}

.row { display: flex; gap: 18px; flex-wrap: wrap; }
.row > .panel { flex: 1 1 340px; }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th {
    text-align: left; color: var(--text-dim); font-weight: 600;
    text-transform: uppercase; font-size: .72rem; letter-spacing: 1px;
    padding: 10px 12px; border-bottom: 1px solid var(--border);
}
td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:hover td { background: rgba(51,214,255,.03); }
.mono { font-family: var(--mono); }
.dim { color: var(--text-dim); }
.right { text-align: right; }

/* ---------- Status badges ---------- */
.badge {
    display: inline-block; padding: 3px 10px; border-radius: 999px;
    font-size: .72rem; font-weight: 600; letter-spacing: .3px;
    border: 1px solid var(--border-lit); white-space: nowrap;
}
.badge.pending_quote { color: var(--amber); border-color: rgba(255,203,87,.4); background: rgba(255,203,87,.08); }
.badge.quoted        { color: var(--cyan); border-color: rgba(51,214,255,.4); background: rgba(51,214,255,.08); }
.badge.submitted     { color: var(--cyan); border-color: rgba(51,214,255,.4); background: rgba(51,214,255,.08); }
.badge.accepted      { color: var(--green); border-color: rgba(62,242,161,.4); background: rgba(62,242,161,.08); }
.badge.in_progress   { color: var(--green); border-color: rgba(62,242,161,.4); background: rgba(62,242,161,.08); }
.badge.completed     { color: #9fe8c6; border-color: rgba(62,242,161,.25); background: rgba(62,242,161,.05); }
.badge.revision_requested { color: var(--amber); border-color: rgba(255,203,87,.4); background: rgba(255,203,87,.08); }
.badge.cancelled, .badge.declined { color: var(--text-faint); border-color: var(--border); }

/* ---------- Forms ---------- */
label { display: block; font-size: .82rem; color: var(--text-dim); margin: 12px 0 6px; }
input, select, textarea {
    width: 100%; padding: 11px 13px; color: var(--text);
    background: var(--bg-2); border: 1px solid var(--border);
    border-radius: 9px; font-family: var(--font); font-size: .92rem;
    transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--cyan-dim); box-shadow: var(--glow-cyan);
}
textarea { resize: vertical; min-height: 80px; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
    padding: 10px 16px; border-radius: 9px; font-weight: 600; font-size: .88rem;
    border: 1px solid var(--border-lit); background: var(--panel-2); color: var(--text);
    transition: transform .08s, box-shadow .15s, border-color .15s, background .15s;
}
.btn:hover { border-color: var(--cyan-dim); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary {
    background: linear-gradient(180deg, var(--cyan), var(--cyan-dim));
    color: #041016; border: none; box-shadow: var(--glow-cyan);
}
.btn.green {
    background: linear-gradient(180deg, var(--green), var(--green-dim));
    color: #04170f; border: none; box-shadow: var(--glow-green);
}
.btn.ghost { background: transparent; }
.btn.danger { color: var(--red); border-color: rgba(255,107,125,.4); background: rgba(255,107,125,.06); }
.btn.sm { padding: 6px 11px; font-size: .8rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Auth screens ---------- */
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth-card {
    width: 100%; max-width: 400px;
    background: linear-gradient(180deg, var(--panel), var(--panel-2));
    border: 1px solid var(--border); border-radius: 16px; padding: 34px 30px;
    box-shadow: 0 30px 80px rgba(0,0,0,.5);
}
.auth-card .brand { justify-content: center; font-size: 1.3rem; margin-bottom: 6px; }
.auth-card .tag { text-align: center; color: var(--text-dim); font-size: .85rem; margin-bottom: 22px; }

/* ---------- Misc ---------- */
.notice {
    padding: 11px 14px; border-radius: 9px; font-size: .88rem; margin: 8px 0 0;
    border: 1px solid transparent;
}
.notice.err { color: var(--red); border-color: rgba(255,107,125,.4); background: rgba(255,107,125,.07); }
.notice.ok  { color: var(--green); border-color: rgba(62,242,161,.4); background: rgba(62,242,161,.07); }
.empty { color: var(--text-faint); text-align: center; padding: 30px; font-size: .9rem; }
.pill-link { cursor: pointer; color: var(--cyan); font-size: .82rem; }
.hidden { display: none !important; }
.spacer { height: 10px; }
.inline-code {
    font-family: var(--mono); font-size: .8rem; background: var(--bg-2);
    border: 1px solid var(--border); padding: 8px 10px; border-radius: 8px;
    word-break: break-all; display: block; margin-top: 6px; color: var(--cyan);
}
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.filter-bar .chip {
    padding: 7px 14px; border-radius: 999px; cursor: pointer; font-size: .82rem;
    border: 1px solid var(--border); color: var(--text-dim); background: var(--panel-2);
    user-select: none;
}
.filter-bar .chip.active { color: #041016; background: var(--cyan); border-color: var(--cyan); font-weight: 600; }

/* ---------- Modal ---------- */
.modal-back {
    position: fixed; inset: 0; background: rgba(4,7,11,.7);
    display: grid; place-items: center; z-index: 50; padding: 20px;
    backdrop-filter: blur(3px);
}
.dialog-back {
    position: fixed; inset: 0; background: rgba(4,7,11,.72);
    display: grid; place-items: center; z-index: 200; padding: 20px;
    backdrop-filter: blur(3px);
}
.dialog {
    width: 100%; max-width: 420px;
    background: linear-gradient(180deg, var(--panel), var(--panel-2));
    border: 1px solid var(--border-lit); border-radius: 14px; padding: 22px;
    box-shadow: 0 30px 90px rgba(0,0,0,.6);
}
.dialog h3 { margin: 0 0 6px; font-size: 1.05rem; }
.dialog p { margin: 0; color: var(--text-dim); font-size: .92rem; line-height: 1.45; white-space: pre-wrap; }

/* ---------- Message thread ---------- */
.msg-thread {
    min-height: 260px; max-height: 460px; overflow-y: auto; display: flex; flex-direction: column;
    gap: 8px; padding: 8px; background: var(--bg-2); border: 1px solid var(--border);
    border-radius: 9px;
}
.msg { max-width: 85%; padding: 8px 11px; border-radius: 11px; }
.msg .msg-meta { font-size: .68rem; color: var(--text-faint); margin-bottom: 3px; }
.msg .msg-body { font-size: .88rem; white-space: pre-wrap; word-break: break-word; }
.msg-other { align-self: flex-start; background: var(--panel-2); border: 1px solid var(--border); }
.msg-mine { align-self: flex-end; background: rgba(51,214,255,.09); border: 1px solid var(--cyan-dim); }
.modal {
    width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto;
    background: linear-gradient(180deg, var(--panel), var(--panel-2));
    border: 1px solid var(--border-lit); border-radius: 14px; padding: 24px;
    box-shadow: 0 30px 90px rgba(0,0,0,.6);
}
.modal h3 { margin: 0 0 4px; font-size: 1.15rem; }
.modal .close { float: right; cursor: pointer; color: var(--text-dim); font-size: 1.3rem; line-height: 1; }
.timeline { list-style: none; padding: 0; margin: 10px 0 0; }
.timeline li { padding: 9px 0 9px 18px; border-left: 2px solid var(--border-lit); position: relative; }
.timeline li::before {
    content:""; position: absolute; left: -5px; top: 14px;
    width: 8px; height: 8px; border-radius: 50%; background: var(--cyan);
}
.timeline .t { font-size: .75rem; color: var(--text-faint); font-family: var(--mono); }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 6px 14px; font-size: .88rem; margin: 8px 0; }
.kv .k { color: var(--text-dim); }

/* ---------- Faceted catalog list ---------- */
.tune-item {
    padding: 9px 11px; border-radius: 8px; cursor: pointer;
    border: 1px solid transparent; margin-bottom: 4px; transition: background .12s, border-color .12s;
}
.tune-item:hover { background: rgba(51,214,255,.05); }
.tune-item.selected { border-color: var(--cyan); background: rgba(51,214,255,.1); }

/* ---------- Catalog file tree ---------- */
.tree-controls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.tree-node { position: relative; }
.tree-children { border-left: 1px solid var(--border); margin-left: 7px; }
.tree-folder {
    display: flex; align-items: center; gap: 8px; cursor: pointer;
    padding: 6px 8px; border-radius: 6px; user-select: none;
}
.tree-folder:hover { background: rgba(51,214,255,.05); }
.tree-folder .chev { color: var(--cyan); font-size: .72rem; width: 12px; display: inline-block; }
.tree-folder .folder-icon { color: var(--cyan); opacity: .8; }
.folder-label { font-weight: 600; color: var(--text); }
.folder-count {
    color: var(--text-faint); font-size: .72rem; font-family: var(--mono);
    background: var(--bg-2); border: 1px solid var(--border); border-radius: 999px; padding: 0 7px;
}
.tree-node.collapsed > .tree-children { display: none; }
.tree-leaf {
    display: flex; align-items: center; gap: 10px; padding: 7px 8px;
    border-radius: 6px; border: 1px solid transparent;
}
.tree-leaf:hover { background: rgba(255,255,255,.02); }
.tree-leaf .leaf-icon { color: var(--text-faint); font-size: .7rem; }
.tree-leaf .leaf-main { flex: 1; min-width: 0; }
.tree-leaf .leaf-price { color: var(--text-dim); text-align: right; white-space: nowrap; }
.tree-leaf .leaf-actions { display: flex; gap: 9px; white-space: nowrap; }
.leaf-badge {
    display: inline-block; font-size: .62rem; padding: 1px 7px; border-radius: 6px;
    border: 1px solid var(--border-lit); color: var(--text-dim); margin-left: 6px; vertical-align: middle;
}
.tree-leaf.selectable { cursor: pointer; }
.tree-leaf.selectable:hover { background: rgba(51,214,255,.05); }
.tree-leaf.selected { border-color: var(--cyan); background: rgba(51,214,255,.1); }

/* ---------- Tabs ---------- */
.tabs {
    display: flex; gap: 4px; flex-wrap: wrap;
    border-bottom: 1px solid var(--border); margin: 20px 0 22px;
}
.tab-btn {
    background: transparent; border: none; color: var(--text-dim);
    padding: 11px 18px; cursor: pointer; font-size: .92rem; font-weight: 600;
    border-bottom: 2px solid transparent; margin-bottom: -1px;
    display: flex; align-items: center; gap: 8px; transition: color .15s;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--cyan); border-bottom-color: var(--cyan); }
.tab-count {
    background: var(--panel-2); border: 1px solid var(--border); border-radius: 999px;
    font-size: .7rem; padding: 1px 8px; color: var(--text-dim); font-family: var(--mono);
}
.tab-btn.active .tab-count { border-color: var(--cyan-dim); color: var(--cyan); }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: tabfade .2s ease; }
@keyframes tabfade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Definition-style info grid */
.info-grid { display: grid; grid-template-columns: 130px 1fr; gap: 10px 16px; font-size: .9rem; }
.info-grid .k { color: var(--text-faint); }
.info-grid .v { color: var(--text); }

/* ---------- Status stepper ---------- */
.stepper { display: flex; align-items: flex-start; margin: 12px 0 20px; }
.stepper .step { flex: 1; text-align: center; position: relative; padding: 0 4px; }
.stepper .step .dot {
    display: block; width: 14px; height: 14px; border-radius: 50%; margin: 0 auto;
    border: 2px solid var(--border-lit); background: var(--panel-2); position: relative; z-index: 1;
}
.stepper .step .lbl {
    display: block; font-size: .72rem; color: var(--text-faint);
    white-space: nowrap; margin-top: 9px; letter-spacing: .2px;
}
.stepper .step.done .dot { background: var(--green); border-color: var(--green); }
.stepper .step.current .dot { background: var(--cyan); border-color: var(--cyan); box-shadow: var(--glow-cyan); }
.stepper .step.done .lbl, .stepper .step.current .lbl { color: var(--text); }
.stepper .step:not(:first-child)::before {
    content: ''; position: absolute; top: 8px; left: -50%; width: 100%; height: 2px;
    background: var(--border-lit); z-index: 0;
}
.stepper .step.done::before, .stepper .step.current::before { background: var(--green); }

/* Wallet balance hero */
.wallet-hero {
    display: flex; align-items: baseline; gap: 12px; padding: 6px 0 4px;
}
.wallet-hero .amt { font-size: 2.4rem; font-weight: 700; color: var(--green); font-family: var(--mono); }
.wallet-hero .lbl { color: var(--text-dim); font-size: .9rem; }
.notif-wrap { position: relative; }
.notif-bell {
    position: relative; background: transparent; border: 1px solid var(--border);
    color: var(--text); border-radius: 9px; padding: 6px 10px; cursor: pointer;
    font-size: 1rem; line-height: 1; transition: border-color .15s, background .15s;
}
.notif-bell:hover { border-color: var(--cyan-dim); background: var(--panel-2); }
.notif-badge {
    position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px;
    padding: 0 5px; border-radius: 999px; background: var(--red); color: #170406;
    font-size: .68rem; font-weight: 700; display: flex; align-items: center;
    justify-content: center; box-shadow: 0 0 0 2px var(--bg);
}
.notif-panel {
    position: absolute; right: 0; top: calc(100% + 10px); width: 360px; max-width: 86vw;
    max-height: 460px; overflow: hidden; z-index: 60;
    background: linear-gradient(180deg, var(--panel), var(--panel-2));
    border: 1px solid var(--border-lit); border-radius: 12px;
    box-shadow: 0 26px 70px rgba(0,0,0,.6); display: flex; flex-direction: column;
}
.notif-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 14px; border-bottom: 1px solid var(--border); font-weight: 600;
}
.notif-list { overflow-y: auto; }
.notif-item {
    display: flex; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border);
    cursor: pointer; transition: background .12s;
}
.notif-item:hover { background: rgba(51,214,255,.04); }
.notif-item.unread { background: rgba(51,214,255,.06); }
.notif-item .dot {
    width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex-shrink: 0;
    background: var(--cyan); box-shadow: var(--glow-cyan);
}
.notif-item.read .dot { background: transparent; box-shadow: none; }
.notif-item .n-body { flex: 1; min-width: 0; }
.notif-item .n-title { font-weight: 600; font-size: .88rem; }
.notif-item .n-text { color: var(--text-dim); font-size: .8rem; margin-top: 2px; }
.notif-item .n-time { color: var(--text-faint); font-size: .72rem; font-family: var(--mono); margin-top: 3px; }
.notif-type {
    font-size: .6rem; text-transform: uppercase; letter-spacing: .5px; padding: 1px 6px;
    border-radius: 5px; border: 1px solid var(--border-lit); color: var(--text-dim); margin-left: 6px;
}

/* ============================================================
   Polish layer — depth, motion, refinement
   ============================================================ */

/* Selection + focus accessibility */
::selection { background: rgba(51,214,255,.28); }
:focus-visible { outline: 2px solid var(--cyan-dim); outline-offset: 2px; border-radius: 6px; }

/* Slim styled scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--border-lit) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--border-lit); border-radius: 99px; border: 2px solid var(--bg); }
*::-webkit-scrollbar-thumb:hover { background: var(--cyan-dim); }

/* Page title: gradient ink */
.page-title {
    font-size: 1.6rem; letter-spacing: -.02em;
    background: linear-gradient(120deg, var(--text) 55%, var(--cyan) 130%);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}

/* Staggered page-load reveal */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.wrap > * { animation: rise .45s cubic-bezier(.16,1,.3,1) backwards; }
.wrap > *:nth-child(1) { animation-delay: .02s; }
.wrap > *:nth-child(2) { animation-delay: .06s; }
.wrap > *:nth-child(3) { animation-delay: .10s; }
.wrap > *:nth-child(4) { animation-delay: .14s; }
.wrap > *:nth-child(5) { animation-delay: .18s; }
.wrap > *:nth-child(6) { animation-delay: .22s; }

/* Tiles: hover lift + accent wash */
.tile {
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
    background:
        radial-gradient(220px 120px at 0% 0%, rgba(51,214,255,.07), transparent 65%),
        linear-gradient(180deg, var(--panel), var(--panel-2));
}
.tile.green {
    background:
        radial-gradient(220px 120px at 0% 0%, rgba(62,242,161,.08), transparent 65%),
        linear-gradient(180deg, var(--panel), var(--panel-2));
}
.tile.amber {
    background:
        radial-gradient(220px 120px at 0% 0%, rgba(255,203,87,.08), transparent 65%),
        linear-gradient(180deg, var(--panel), var(--panel-2));
}
.tile:hover {
    transform: translateY(-3px);
    border-color: var(--border-lit);
    box-shadow: 0 14px 34px rgba(0,0,0,.35);
}
.tile::before { box-shadow: 0 0 14px rgba(51,214,255,.5); }
.tile.green::before { box-shadow: 0 0 14px rgba(62,242,161,.5); }
.tile.amber::before { box-shadow: 0 0 14px rgba(255,203,87,.5); }
.tile .n { letter-spacing: -.01em; }

/* Panels: crisp top highlight + gentle hover border */
.panel { position: relative; transition: border-color .2s ease; }
.panel::after {
    content: ""; position: absolute; left: 14px; right: 14px; top: 0; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(219,230,240,.10), transparent);
    pointer-events: none;
}
.panel:hover { border-color: #223349; }

/* Tables: smoother hover, subtle divider fade */
td { transition: background .12s ease; }
tbody tr:hover td { background: rgba(51,214,255,.05); }
tbody tr:last-child td { border-bottom: none; }

/* Buttons: lift + brighter glow on hover */
.btn { will-change: transform; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,0,0,.3); }
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn.primary:hover { box-shadow: 0 0 0 1px rgba(51,214,255,.5), 0 0 26px rgba(51,214,255,.28), 0 6px 18px rgba(0,0,0,.3); }
.btn.green:hover { box-shadow: 0 0 0 1px rgba(62,242,161,.5), 0 0 26px rgba(62,242,161,.28), 0 6px 18px rgba(0,0,0,.3); }
.btn.danger:hover { background: rgba(255,107,125,.14); border-color: rgba(255,107,125,.6); }

/* Badges: status dot */
.badge { padding-left: 8px; }
.badge::before {
    content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
    margin-right: 6px; vertical-align: 1px; background: currentColor;
    box-shadow: 0 0 8px currentColor;
}
.badge.cancelled::before, .badge.declined::before { box-shadow: none; }

/* Brand: breathing status dot */
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 1px rgba(62,242,161,.35), 0 0 10px rgba(62,242,161,.35); } 50% { box-shadow: 0 0 0 1px rgba(62,242,161,.55), 0 0 20px rgba(62,242,161,.6); } }
.brand .dot { animation: pulse 2.6s ease-in-out infinite; }

/* Nav links: soft pill hover */
.nav-links a { padding: 7px 11px; border-radius: 8px; color: var(--text-dim); transition: color .15s, background .15s; }
.nav-links a:hover { color: var(--text); background: rgba(51,214,255,.07); text-decoration: none; }

/* Tabs: hover tint */
.tab-btn { border-radius: 8px 8px 0 0; }
.tab-btn:hover { background: rgba(51,214,255,.05); }

/* Notification bell: nudge on hover */
.notif-bell:hover .bell-ico { display: inline-block; animation: ring .5s ease; }
@keyframes ring { 0% { transform: rotate(0); } 30% { transform: rotate(-14deg); } 60% { transform: rotate(10deg); } 100% { transform: rotate(0); } }

/* Modals & dialogs: entrance */
@keyframes popIn { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
.modal, .dialog, .notif-panel { animation: popIn .22s cubic-bezier(.16,1,.3,1); }
.modal-back, .dialog-back { animation: rise .18s ease; }

/* Auth card: glow ring */
.auth-card {
    box-shadow: 0 30px 80px rgba(0,0,0,.5), 0 0 0 1px rgba(51,214,255,.06), 0 0 60px rgba(51,214,255,.05);
    animation: rise .5s cubic-bezier(.16,1,.3,1);
}

/* Empty states: softer */
.empty { border: 1px dashed var(--border-lit); border-radius: 10px; }

/* Stepper: connecting line glow on done */
.stepper .step.done::before, .stepper .step.current::before { box-shadow: 0 0 8px rgba(62,242,161,.35); }

/* Message bubbles: entrance */
.msg { animation: rise .25s ease backwards; }

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Disabled form controls: visibly dimmed */
input:disabled, select:disabled, textarea:disabled {
    opacity: .4; cursor: not-allowed;
}

/* Top-level catalog groups render as their own sub-containers */
#tree > .tree-node {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(255,255,255,.015), transparent 40%), var(--bg-2);
    margin-bottom: 12px;
    overflow: hidden;
}
#tree > .tree-node > .tree-folder {
    background: rgba(51,214,255,.05);
    border-bottom: 1px solid var(--border);
    padding-top: 10px; padding-bottom: 10px;
    font-size: .98rem;
}
#tree > .tree-node.collapsed > .tree-folder { border-bottom: none; }
#tree > .tree-node > .tree-children {
    border-left: none;
    margin-left: 0;
    padding: 6px 8px 8px;
}

/* Revision step: amber to signal customer-flagged rework */
.stepper .step.revision.current .dot { background: var(--amber); box-shadow: 0 0 8px rgba(255,196,0,.5); }
.stepper .step.revision.current .lbl { color: var(--amber); }
