/* =========================================================
   HAFEN-HUB · Cyber-Industrial Command Console
   ========================================================= */

/* Das hidden-Attribut MUSS immer gewinnen – sonst überdeckt z. B.
   der (leere) Modal-Layer dauerhaft die ganze Seite. */
[hidden] { display: none !important; }

:root {
    /* Flächen */
    --bg:        #080b11;
    --bg-2:      #0b0f17;
    --panel:     #0f1521;
    --panel-2:   #131b2a;
    --raised:    #182233;
    --line:      #1d2839;
    --line-soft: #161f2d;

    /* Text */
    --text:      #cdd8e6;
    --text-dim:  #8a99ad;
    --muted:     #5d6b7e;

    /* Akzente */
    --accent:    #2dd4bf;   /* Teal */
    --accent-2:  #38bdf8;   /* Sky  */
    --accent-dim:#1b6f66;
    --gold:      #f5b942;   /* Coins */
    --ok:        #45d9a0;
    --warn:      #f0a64a;
    --danger:    #f0556b;

    /* Maße */
    --r:    14px;
    --r-sm: 9px;
    --side: 244px;
    --gap:  18px;

    --font-sans: "Segoe UI", Roboto, Helvetica, Arial, system-ui, sans-serif;
    --font-mono: ui-monospace, "JetBrains Mono", "SFMono-Regular", "Cascadia Code", Menlo, Consolas, monospace;

    --shadow:    0 10px 30px -12px rgba(0,0,0,.7);
    --shadow-lg: 0 24px 60px -18px rgba(0,0,0,.85);
    --glow:      0 0 0 1px rgba(45,212,191,.4), 0 0 22px -4px rgba(45,212,191,.45);
}

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

html, body { height: 100%; }

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

/* Atmosphäre: Grid + Glow */
body::before {
    content: "";
    position: fixed; inset: 0; z-index: -2;
    background:
        radial-gradient(900px 600px at 12% -5%, rgba(45,212,191,.10), transparent 60%),
        radial-gradient(700px 500px at 100% 0%, rgba(56,189,248,.07), transparent 55%),
        var(--bg);
}
body::after {
    content: "";
    position: fixed; inset: 0; z-index: -1; opacity: .5;
    background-image:
        linear-gradient(rgba(140,160,190,.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(140,160,190,.035) 1px, transparent 1px);
    background-size: 46px 46px;
    -webkit-mask-image: radial-gradient(circle at 30% 0%, #000, transparent 85%);
            mask-image: radial-gradient(circle at 30% 0%, #000, transparent 85%);
}

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

.muted { color: var(--muted); }
.mono  { font-family: var(--font-mono); }

code {
    font-family: var(--font-mono);
    background: var(--raised);
    padding: .08em .42em;
    border-radius: 5px;
    color: var(--accent);
    font-size: .9em;
}

/* ========================= Layout ========================= */
.app {
    display: grid;
    grid-template-columns: var(--side) 1fr;
    min-height: 100vh;
}

.sidebar {
    background: linear-gradient(180deg, var(--bg-2), var(--bg));
    border-right: 1px solid var(--line);
    display: flex; flex-direction: column;
    padding: 20px 14px;
    position: sticky; top: 0; height: 100vh;
}

.brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px 22px; }
.brand-mark { font-size: 26px; filter: drop-shadow(0 0 10px rgba(45,212,191,.55)); }
.brand-mark.big { font-size: 46px; }
.brand-name {
    font-family: var(--font-mono);
    font-weight: 700; font-size: 17px; letter-spacing: .5px;
    color: #eaf2fb;
}

.nav { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: var(--r-sm);
    color: var(--text-dim); font-family: var(--font-mono);
    font-size: 13.5px; letter-spacing: .3px;
    transition: .14s; position: relative;
}
.nav-item:hover { background: var(--panel); color: var(--text); text-decoration: none; }
.nav-item.active {
    background: linear-gradient(90deg, rgba(45,212,191,.16), rgba(45,212,191,.02));
    color: #eafffb;
}
.nav-item.active::before {
    content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px;
    background: var(--accent); border-radius: 0 3px 3px 0;
    box-shadow: 0 0 12px var(--accent);
}
.nav-ico { width: 20px; text-align: center; font-size: 15px; }

.sidebar-foot { border-top: 1px solid var(--line-soft); padding-top: 14px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 6px 8px; }
.avatar {
    width: 38px; height: 38px; flex: none; border-radius: 10px;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #04161a; font-weight: 800; font-family: var(--font-mono);
}
.avatar.sm { width: 32px; height: 32px; border-radius: 8px; font-size: 14px; }
.user-meta { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.user-name { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: var(--muted); font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .5px; }

.main { display: flex; flex-direction: column; min-width: 0; }

.topbar {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; gap: 16px;
    padding: 0 26px; height: 64px;
    background: rgba(8,11,17,.82);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}
.page-title {
    font-family: var(--font-mono); font-size: 17px; font-weight: 600;
    letter-spacing: .4px; flex: 1;
}
.topbar-right { display: flex; align-items: center; gap: 14px; }

.coin-pill {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 14px; border-radius: 999px;
    background: linear-gradient(135deg, rgba(245,185,66,.16), rgba(245,185,66,.04));
    border: 1px solid rgba(245,185,66,.32);
    font-family: var(--font-mono); font-weight: 700; color: var(--gold);
    font-variant-numeric: tabular-nums;
}
.coin-pill.bump { animation: bump .5s ease; }
@keyframes bump { 0%{transform:scale(1)} 35%{transform:scale(1.18)} 100%{transform:scale(1)} }

.icon-btn {
    background: var(--panel); border: 1px solid var(--line);
    color: var(--text); width: 40px; height: 40px; border-radius: 10px;
    cursor: pointer; font-size: 18px; display: grid; place-items: center;
    transition: .14s;
}
.icon-btn:hover { border-color: var(--accent-dim); color: #fff; }
.menu-toggle { display: none; }

.menu { position: relative; }
.dropdown {
    position: absolute; right: 0; top: calc(100% + 8px);
    background: var(--panel-2); border: 1px solid var(--line);
    border-radius: var(--r-sm); box-shadow: var(--shadow-lg);
    min-width: 200px; padding: 6px; z-index: 50;
}
.dropdown-item {
    display: block; width: 100%; text-align: left;
    padding: 10px 12px; border-radius: 7px; border: none; cursor: pointer;
    background: none; color: var(--text); font-size: 14px; font-family: var(--font-sans);
}
.dropdown-item:hover { background: var(--raised); text-decoration: none; }

.content { padding: 26px; max-width: 1320px; width: 100%; }

/* ========================= Bausteine ========================= */
.panel {
    background: linear-gradient(180deg, var(--panel), var(--panel-2));
    border: 1px solid var(--line);
    border-radius: var(--r);
    padding: 20px;
    box-shadow: var(--shadow);
}
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.panel-head h2, .panel h2 { font-family: var(--font-mono); font-size: 15px; font-weight: 600; letter-spacing: .3px; }
.panel h3 { font-family: var(--font-mono); font-size: 13.5px; font-weight: 600; margin-bottom: 12px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .6px; }
.link-sm { font-size: 12.5px; font-family: var(--font-mono); color: var(--text-dim); }
.link-sm:hover { color: var(--accent); }

.toolbar {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    margin-bottom: 22px;
}
.toolbar > :first-child { margin-right: auto; }

.btn {
    font-family: var(--font-mono); font-size: 13px; font-weight: 600;
    letter-spacing: .4px; text-transform: uppercase;
    padding: 10px 18px; border-radius: var(--r-sm);
    border: 1px solid var(--line); background: var(--raised); color: var(--text);
    cursor: pointer; transition: .15s; white-space: nowrap;
}
.btn:hover { border-color: var(--accent-dim); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.primary {
    background: linear-gradient(135deg, var(--accent), #16b3a3);
    color: #04161a; border: none; box-shadow: 0 6px 18px -8px var(--accent);
}
.btn.primary:hover { box-shadow: var(--glow); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); border-color: rgba(240,85,107,.3); }
.btn.danger:hover { background: rgba(240,85,107,.12); border-color: var(--danger); }
.btn.block { width: 100%; justify-content: center; text-align: center; }
.btn.disabled, .btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.search-wrap { position: relative; flex: 1; max-width: 380px; }
.search-ico { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); opacity: .5; font-size: 14px; }
.search-wrap input { padding-left: 38px; }

input, textarea, select {
    width: 100%; font-family: var(--font-sans); font-size: 14px;
    background: var(--bg-2); border: 1px solid var(--line);
    color: var(--text); border-radius: var(--r-sm); padding: 10px 13px;
    transition: .14s; outline: none;
}
input:focus, textarea:focus, select:focus {
    border-color: var(--accent); box-shadow: 0 0 0 3px rgba(45,212,191,.13);
}
textarea { resize: vertical; line-height: 1.5; }
select { cursor: pointer; }
::placeholder { color: var(--muted); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field-inline { display: flex; align-items: center; gap: 10px; }
.field-label { font-size: 11.5px; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .6px; color: var(--text-dim); }

.badge {
    font-family: var(--font-mono); font-size: 10.5px; text-transform: uppercase;
    letter-spacing: .5px; padding: 3px 8px; border-radius: 6px;
    background: var(--raised); color: var(--text-dim); border: 1px solid var(--line-soft);
}
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; }
.dot.online      { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.dot.offline     { background: var(--danger); }
.dot.maintenance { background: var(--warn); box-shadow: 0 0 8px var(--warn); }
.dot.planned     { background: var(--accent-2); }

.empty { color: var(--muted); padding: 14px 2px; }
.loading { color: var(--muted); padding: 30px; text-align: center; font-family: var(--font-mono); }
.hint { font-size: 12.5px; margin-top: 14px; }

/* ========================= Login ========================= */
.login-body { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.login-bg { position: fixed; inset: 0; z-index: -1; }
.login-wrap { width: 100%; max-width: 410px; text-align: center; }
.login-card {
    background: linear-gradient(180deg, var(--panel), var(--panel-2));
    border: 1px solid var(--line); border-radius: 20px; padding: 38px 34px;
    box-shadow: var(--shadow-lg);
}
.login-brand h1 { font-family: var(--font-mono); font-size: 24px; margin-top: 8px; letter-spacing: .5px; }
.login-form { display: flex; flex-direction: column; gap: 15px; margin-top: 26px; text-align: left; }
.login-hint { font-size: 11.5px; margin-top: 20px; line-height: 1.5; }
.login-foot { margin-top: 18px; font-size: 12px; }
.alert { padding: 11px 14px; border-radius: var(--r-sm); font-size: 13.5px; margin-top: 18px; text-align: left; }
.alert.error { background: rgba(240,85,107,.12); border: 1px solid rgba(240,85,107,.35); color: #ffb3bd; }

/* ========================= Dashboard ========================= */
.dash { display: flex; flex-direction: column; gap: var(--gap); }
.hero { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.hero-greet { font-size: 21px; }
.btn.bonus {
    background: linear-gradient(135deg, var(--gold), #e09a26); color: #2a1c02;
    border: none; box-shadow: 0 8px 22px -8px var(--gold);
}
.btn.bonus:hover:not(.disabled) { box-shadow: 0 0 22px -4px var(--gold); }

.stat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--gap); }
.stat-card {
    background: linear-gradient(180deg, var(--panel), var(--panel-2));
    border: 1px solid var(--line); border-radius: var(--r); padding: 18px;
    display: flex; flex-direction: column; gap: 4px; transition: .16s; color: var(--text);
}
.stat-card:hover { transform: translateY(-3px); border-color: var(--accent-dim); text-decoration: none; box-shadow: var(--shadow); }
.stat-ico { font-size: 18px; opacity: .8; }
.stat-num { font-family: var(--font-mono); font-size: 30px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 12px; color: var(--text-dim); font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .5px; }
.stat-card.accent { border-color: rgba(245,185,66,.3); }
.stat-card.accent .stat-num { color: var(--gold); }

.dash-cols { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }

.mini-notes { display: grid; gap: 10px; }
.mini-note {
    display: flex; flex-direction: column; gap: 3px;
    padding: 12px 14px; border-radius: var(--r-sm);
    background: var(--bg-2); border-left: 3px solid var(--accent); color: var(--text);
}
.mini-note:hover { background: var(--raised); text-decoration: none; }
.mini-note span { font-size: 12.5px; color: var(--muted); }
.mini-note.c-cyan { border-color: var(--accent-2); }
.mini-note.c-amber { border-color: var(--gold); }
.mini-note.c-green { border-color: var(--ok); }
.mini-note.c-pink { border-color: #f06595; }
.mini-note.c-slate { border-color: #5d6b7e; }

.srv-mini { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.srv-mini li { display: flex; align-items: center; gap: 10px; padding: 9px 6px; border-bottom: 1px solid var(--line-soft); }
.srv-mini li:last-child { border-bottom: none; }
.srv-name { font-weight: 600; font-size: 13.5px; }
.srv-ip { color: var(--text-dim); font-size: 12.5px; margin-left: auto; }

.quick-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.quick-link {
    display: flex; flex-direction: column; gap: 2px; padding: 12px 14px;
    background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-sm); color: var(--text);
}
.quick-link:hover { border-color: var(--accent-dim); text-decoration: none; transform: translateY(-2px); }
.ql-title { font-weight: 600; font-size: 13.5px; }
.ql-cat { font-size: 11px; color: var(--muted); font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .4px; }

/* ========================= Notizen ========================= */
.notes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--gap); align-items: start; }
.note {
    background: linear-gradient(180deg, var(--panel), var(--panel-2));
    border: 1px solid var(--line); border-radius: var(--r);
    padding: 14px; display: flex; flex-direction: column; gap: 8px;
    border-top: 3px solid var(--note-accent, #5d6b7e); transition: .15s;
}
.note:hover { box-shadow: var(--shadow); }
.note.c-slate { --note-accent: #5d6b7e; }
.note.c-cyan  { --note-accent: var(--accent-2); }
.note.c-amber { --note-accent: var(--gold); }
.note.c-green { --note-accent: var(--ok); }
.note.c-pink  { --note-accent: #f06595; }
.note.pinned  { box-shadow: 0 0 0 1px var(--accent-dim), var(--shadow); }
.note-top { display: flex; gap: 8px; align-items: center; }
.note-title { font-weight: 700; font-size: 15px; border: none; background: none; padding: 4px 2px; font-family: var(--font-sans); }
.note-title:focus { box-shadow: none; border-bottom: 1px solid var(--line); }
.note-pin { background: none; border: none; cursor: pointer; font-size: 15px; opacity: .4; flex: none; transition: .14s; }
.note-pin:hover { opacity: 1; }
.note.pinned .note-pin { opacity: 1; filter: drop-shadow(0 0 6px var(--accent)); }
.note-body { border: none; background: none; min-height: 100px; font-size: 13.5px; padding: 2px; color: var(--text-dim); }
.note-body:focus { box-shadow: none; }
.note-foot { display: flex; align-items: center; justify-content: space-between; padding-top: 4px; border-top: 1px solid var(--line-soft); }
.color-dots { display: flex; gap: 6px; }
.cdot { width: 17px; height: 17px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; }
.cdot.c-slate { background: #5d6b7e; } .cdot.c-cyan { background: var(--accent-2); }
.cdot.c-amber { background: var(--gold); } .cdot.c-green { background: var(--ok); }
.cdot.c-pink { background: #f06595; }
.cdot.sel { border-color: #fff; transform: scale(1.15); }
.note-actions { display: flex; align-items: center; gap: 10px; }
.note-saved { font-size: 10.5px; color: var(--muted); font-family: var(--font-mono); opacity: 0; transition: .3s; }
.note-saved.show { opacity: 1; color: var(--ok); }
.note-del { background: none; border: none; cursor: pointer; opacity: .4; font-size: 14px; }
.note-del:hover { opacity: 1; }

/* ========================= Boards (Kanban) ========================= */
.board-switch { display: flex; align-items: center; gap: 10px; }
.board { display: flex; gap: var(--gap); align-items: flex-start; overflow-x: auto; padding-bottom: 12px; }
.column {
    background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r);
    width: 290px; flex: none; display: flex; flex-direction: column; max-height: 74vh;
}
.column.drag-over { border-color: var(--accent); box-shadow: var(--glow); }
.col-head { display: flex; align-items: center; gap: 8px; padding: 13px 14px; border-bottom: 1px solid var(--line-soft); }
.col-name { font-family: var(--font-mono); font-weight: 600; font-size: 13.5px; flex: 1; background: none; border: none; padding: 2px; }
.col-count { font-size: 11px; color: var(--muted); font-family: var(--font-mono); background: var(--raised); padding: 2px 7px; border-radius: 6px; }
.col-del { background: none; border: none; color: var(--muted); cursor: pointer; opacity: .5; font-size: 13px; }
.col-del:hover { opacity: 1; color: var(--danger); }
.col-cards { padding: 10px; display: flex; flex-direction: column; gap: 9px; overflow-y: auto; flex: 1; min-height: 24px; }
.card {
    background: linear-gradient(180deg, var(--panel), var(--panel-2));
    border: 1px solid var(--line); border-radius: var(--r-sm);
    padding: 11px 13px; cursor: grab; transition: .12s; position: relative;
}
.card:hover { border-color: var(--accent-dim); }
.card.dragging { opacity: .4; cursor: grabbing; }
.card-title { font-weight: 600; font-size: 13.5px; }
.card-desc { font-size: 12px; color: var(--muted); margin-top: 3px; white-space: pre-wrap; }
.card-label { display: inline-block; margin-top: 7px; font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: .5px; padding: 2px 7px; border-radius: 5px; background: rgba(45,212,191,.14); color: var(--accent); }
.col-add { margin: 0 10px 12px; padding: 9px; border: 1px dashed var(--line); border-radius: var(--r-sm); background: none; color: var(--text-dim); cursor: pointer; font-family: var(--font-mono); font-size: 12.5px; transition: .14s; }
.col-add:hover { border-color: var(--accent-dim); color: var(--accent); }
.add-col-btn {
    width: 280px; flex: none; min-height: 64px; border: 1px dashed var(--line);
    border-radius: var(--r); background: rgba(255,255,255,.012); color: var(--text-dim);
    cursor: pointer; font-family: var(--font-mono); font-size: 13px; transition: .14s;
}
.add-col-btn:hover { border-color: var(--accent-dim); color: var(--accent); }

/* ========================= Server ========================= */
.server-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: var(--gap); }
.server-card {
    background: linear-gradient(180deg, var(--panel), var(--panel-2));
    border: 1px solid var(--line); border-radius: var(--r); padding: 18px; transition: .15s;
    display: flex; flex-direction: column; gap: 12px;
}
.server-card:hover { border-color: var(--accent-dim); box-shadow: var(--shadow); }
.sc-head { display: flex; align-items: center; gap: 10px; }
.sc-name { font-family: var(--font-mono); font-weight: 700; font-size: 15px; flex: 1; }
.sc-ip { font-family: var(--font-mono); font-size: 13px; color: var(--accent); background: var(--bg-2); padding: 6px 10px; border-radius: var(--r-sm); border: 1px solid var(--line-soft); display: flex; align-items: center; justify-content: space-between; }
.copy-ip { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 12px; }
.copy-ip:hover { color: var(--accent); }
.sc-specs { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 14px; font-size: 12.5px; }
.spec { display: flex; gap: 7px; }
.spec b { color: var(--text-dim); font-family: var(--font-mono); font-weight: 500; font-size: 11px; text-transform: uppercase; min-width: 42px; }
.sc-foot { display: flex; align-items: center; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.sc-meta { display: flex; align-items: center; gap: 8px; flex: 1; font-size: 12px; color: var(--text-dim); }
.row-actions { display: flex; gap: 4px; }
.mini-btn { background: var(--raised); border: 1px solid var(--line); color: var(--text-dim); width: 30px; height: 30px; border-radius: 7px; cursor: pointer; font-size: 13px; transition: .14s; }
.mini-btn:hover { color: #fff; border-color: var(--accent-dim); }
.mini-btn.del:hover { color: var(--danger); border-color: var(--danger); }

.server-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.server-table th { text-align: left; font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); }
.server-table td { padding: 11px 12px; border-bottom: 1px solid var(--line-soft); }
.server-table tr:hover td { background: var(--panel); }
.server-table .mono { color: var(--accent); }

/* ========================= Links ========================= */
.link-cat { margin-bottom: 26px; }
.link-cat h3 { font-family: var(--font-mono); font-size: 13px; text-transform: uppercase; letter-spacing: .6px; color: var(--text-dim); margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }
.link-cat h3::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.link-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.link-card {
    display: flex; align-items: center; gap: 12px; padding: 13px 15px;
    background: linear-gradient(180deg, var(--panel), var(--panel-2));
    border: 1px solid var(--line); border-radius: var(--r); transition: .14s;
}
.link-card:hover { border-color: var(--accent-dim); transform: translateY(-2px); }
.link-fav { width: 36px; height: 36px; flex: none; border-radius: 9px; background: var(--raised); display: grid; place-items: center; font-family: var(--font-mono); font-weight: 700; color: var(--accent); }
.link-body { flex: 1; min-width: 0; }
.link-body a { font-weight: 600; font-size: 14px; color: var(--text); }
.link-body a:hover { color: var(--accent); }
.link-url { font-size: 11.5px; color: var(--muted); font-family: var(--font-mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-desc { font-size: 12px; color: var(--text-dim); }

/* ========================= Shop ========================= */
.shop-intro { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; flex-wrap: wrap; }
.shop-balance { text-align: right; }
.big-coins { font-family: var(--font-mono); font-size: 26px; font-weight: 700; color: var(--gold); display: block; }
.shop-tabs, .slot-side { gap: 8px; }
.shop-tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.tab { font-family: var(--font-mono); font-size: 13px; padding: 8px 16px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--panel); color: var(--text-dim); cursor: pointer; transition: .14s; }
.tab.active { background: var(--raised); color: var(--accent); border-color: var(--accent-dim); }

.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--gap); }
.shop-item {
    background: linear-gradient(180deg, var(--panel), var(--panel-2));
    border: 1px solid var(--line); border-radius: var(--r); padding: 18px;
    display: flex; flex-direction: column; gap: 10px; transition: .15s; position: relative; overflow: hidden;
}
.shop-item:hover { border-color: var(--accent-dim); transform: translateY(-3px); box-shadow: var(--shadow); }
.si-icon { font-size: 34px; }
.si-cat { position: absolute; top: 14px; right: 14px; }
.si-name { font-family: var(--font-mono); font-weight: 700; font-size: 15px; }
.si-desc { font-size: 12.5px; color: var(--muted); flex: 1; }
.si-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.si-price { font-family: var(--font-mono); font-weight: 700; color: var(--gold); font-size: 16px; }
.si-owned { position: absolute; top: 0; left: 0; background: var(--ok); color: #052b1f; font-family: var(--font-mono); font-size: 10px; font-weight: 700; padding: 3px 10px; border-bottom-right-radius: 8px; }
.btn.buy { padding: 8px 16px; }

.inv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.inv-card { display: flex; align-items: center; gap: 12px; padding: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); }
.inv-icon { font-size: 26px; }
.inv-name { font-weight: 600; font-size: 13.5px; }
.inv-meta { font-size: 11.5px; color: var(--muted); font-family: var(--font-mono); }

/* ========================= Slots ========================= */
.slots-layout { display: grid; grid-template-columns: 1fr 320px; gap: var(--gap); align-items: start; }
.slot-machine { background: linear-gradient(180deg, #11182a, #0c1320); }
.machine-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.machine-balance strong { font-family: var(--font-mono); font-size: 20px; color: var(--gold); }

.reels {
    display: flex; gap: 12px; justify-content: center; position: relative;
    background: radial-gradient(circle at 50% 40%, rgba(45,212,191,.08), transparent 70%);
    padding: 22px; border-radius: var(--r); border: 1px solid var(--line);
}
.reel {
    width: 110px; height: 120px; overflow: hidden; border-radius: var(--r-sm);
    background: linear-gradient(180deg, #060a11, #0d1420);
    border: 1px solid var(--line);
    box-shadow: inset 0 14px 22px -14px #000, inset 0 -14px 22px -14px #000;
    position: relative;
}
.reel-strip { display: flex; flex-direction: column; }
.reel-strip span { height: 120px; display: grid; place-items: center; font-size: 60px; }
.reel.spinning .reel-strip { transition: transform 1.1s cubic-bezier(.13,.9,.2,1); }
.reel::before, .reel::after { content: ""; position: absolute; left: 0; right: 0; height: 28px; z-index: 2; pointer-events: none; }
.reel::before { top: 0; background: linear-gradient(#0a0f1a, transparent); }
.reel::after { bottom: 0; background: linear-gradient(transparent, #0a0f1a); }
.payline { position: absolute; left: 18px; right: 18px; top: 50%; height: 2px; background: linear-gradient(90deg, transparent, rgba(245,185,66,.5), transparent); }
.reels.win { animation: winflash .5s ease 3; }
@keyframes winflash { 50% { box-shadow: var(--glow); } }

.win-display {
    text-align: center; font-family: var(--font-mono); font-size: 16px;
    margin: 20px 0; min-height: 26px; color: var(--text-dim); transition: .2s; font-weight: 600;
}
.win-display.win { color: var(--gold); font-size: 22px; text-shadow: 0 0 18px rgba(245,185,66,.6); }
.win-display.lose { color: var(--muted); }
.win-display.jackpot { color: var(--accent); font-size: 26px; text-shadow: 0 0 22px var(--accent); }

.bet-controls { display: flex; flex-direction: column; gap: 14px; align-items: center; }
.bet-amount { display: flex; align-items: center; gap: 14px; }
.bet-step { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--raised); color: var(--text); font-size: 22px; cursor: pointer; transition: .14s; }
.bet-step:hover { border-color: var(--accent-dim); color: var(--accent); }
.bet-value { text-align: center; min-width: 110px; }
.bet-value strong { font-family: var(--font-mono); font-size: 26px; color: var(--gold); display: block; }
.bet-presets { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.chip { font-family: var(--font-mono); font-size: 13px; padding: 7px 15px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--text-dim); cursor: pointer; transition: .14s; }
.chip:hover { border-color: var(--gold); color: var(--gold); }
.btn.spin {
    font-size: 16px; padding: 15px 50px; letter-spacing: 1px; margin-top: 6px;
    background: linear-gradient(135deg, var(--gold), #e0941f); color: #2a1a02; border: none;
    box-shadow: 0 10px 30px -10px var(--gold);
}
.btn.spin:hover:not(:disabled) { box-shadow: 0 0 30px -4px var(--gold); transform: translateY(-2px); }
.btn.spin:disabled { opacity: .6; }

.paytable { width: 100%; border-collapse: collapse; font-family: var(--font-mono); font-size: 13px; }
.paytable td { padding: 6px 4px; border-bottom: 1px solid var(--line-soft); }
.paytable .pay { text-align: right; color: var(--gold); font-weight: 700; }
.spin-history { list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; }
.spin-history li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 7px; background: var(--bg-2); font-family: var(--font-mono); }
.spin-history .reels-mini { font-size: 15px; }
.spin-history .net.plus { color: var(--ok); margin-left: auto; }
.spin-history .net.minus { color: var(--muted); margin-left: auto; }

/* ========================= Admin ========================= */
.user-table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.user-table th { text-align: left; font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); padding: 13px 16px; background: var(--bg-2); border-bottom: 1px solid var(--line); }
.user-table td { padding: 13px 16px; border-bottom: 1px solid var(--line-soft); font-size: 13.5px; vertical-align: middle; }
.user-table tr:last-child td { border-bottom: none; }
.user-table tr:hover td { background: var(--panel-2); }
.role-tag { font-family: var(--font-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; padding: 3px 9px; border-radius: 6px; }
.role-tag.admin { background: rgba(45,212,191,.15); color: var(--accent); }
.role-tag.user { background: var(--raised); color: var(--text-dim); }
.u-coins { font-family: var(--font-mono); color: var(--gold); }
.u-name b { font-family: var(--font-mono); }

/* ========================= Toast & Modal ========================= */
.toast-host { position: fixed; bottom: 22px; right: 22px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
    background: var(--panel-2); border: 1px solid var(--line); border-left: 3px solid var(--accent);
    padding: 13px 18px; border-radius: var(--r-sm); box-shadow: var(--shadow-lg);
    font-size: 13.5px; min-width: 240px; max-width: 360px;
    animation: toastin .25s ease; display: flex; gap: 10px; align-items: center;
}
.toast.ok { border-left-color: var(--ok); }
.toast.err { border-left-color: var(--danger); }
.toast.win { border-left-color: var(--gold); }
.toast.out { animation: toastout .3s ease forwards; }
@keyframes toastin { from { transform: translateX(30px); opacity: 0; } }
@keyframes toastout { to { transform: translateX(30px); opacity: 0; } }

.modal-host { position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; padding: 20px; background: rgba(4,7,12,.72); backdrop-filter: blur(4px); }
.modal {
    background: linear-gradient(180deg, var(--panel), var(--panel-2));
    border: 1px solid var(--line); border-radius: var(--r); width: 100%; max-width: 480px;
    box-shadow: var(--shadow-lg); animation: modalin .22s ease; max-height: 90vh; overflow-y: auto;
}
@keyframes modalin { from { transform: translateY(16px) scale(.98); opacity: 0; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-family: var(--font-mono); font-size: 16px; }
.modal-close { background: none; border: none; color: var(--muted); font-size: 22px; cursor: pointer; line-height: 1; }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { padding: 16px 22px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ========================= Responsive ========================= */
@media (max-width: 980px) {
    .stat-grid { grid-template-columns: repeat(3, 1fr); }
    .dash-cols, .slots-layout { grid-template-columns: 1fr; }
    .slot-side { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
}
@media (max-width: 760px) {
    .app { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed; left: 0; top: 0; bottom: 0; width: 260px; z-index: 100;
        transform: translateX(-100%); transition: transform .25s ease;
    }
    .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
    .menu-toggle { display: grid; }
    .content { padding: 18px; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .form-row { grid-template-columns: 1fr; }
    .scrim { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 99; }
}
@media (max-width: 480px) {
    .slot-side { grid-template-columns: 1fr; }
    .reel { width: 88px; height: 100px; }
    .reel-strip span { height: 100px; font-size: 48px; }
}
