/* DRS Boss Menu — tablet UI */
:root {
    --backdrop: rgba(5, 6, 10, 0.55);
    --bezel: #0b0c11;
    --bezel-edge: #262833;
    --screen: #0d0f17;
    --window: #121420;
    --card: #181a28;
    --row: #161826;
    --line: #242739;
    --line-soft: #1d2030;
    --white: #f3f4fa;
    --text: #d7d9e6;
    --muted: #868aa3;
    --accent: #8b8ff8;
    --accent-strong: #6d71f0;
    --accent-soft: rgba(139, 143, 248, 0.16);
    --danger: #ff6b66;
    --danger-soft: rgba(255, 107, 102, 0.14);
    --success: #4ade80;
    --success-soft: rgba(74, 222, 128, 0.13);
    --warning: #fbbf24;
    --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: "Manrope", "Segoe UI", sans-serif; }
body { height: 100vh; width: 100vw; overflow: hidden; background: transparent; color: var(--text); }
.hidden { display: none !important; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

#app {
    position: fixed; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: var(--backdrop);
}

/* ------------------------------------------------------------ device */

.tablet {
    position: relative;
    width: min(1180px, 94vw);
    height: min(740px, 88vh);
    padding: 16px;
    border-radius: 42px;
    background: linear-gradient(145deg, #1a1c24 0%, var(--bezel) 38%, var(--bezel) 70%, #16171e 100%);
    box-shadow:
        0 0 0 1.5px var(--bezel-edge),
        0 0 0 5px #07080b,
        0 50px 120px -30px rgba(0, 0, 0, 0.9),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    animation: tablet-in 0.38s cubic-bezier(0.2, 0.9, 0.25, 1.05);
}
@keyframes tablet-in {
    from { opacity: 0; transform: translateY(40px) scale(0.97); }
    to { opacity: 1; transform: none; }
}
.tablet-camera {
    position: absolute; top: 5px; left: 50%; transform: translateX(-50%);
    width: 7px; height: 7px; border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #3b4160, #0a0b10 70%);
    box-shadow: 0 0 0 1.5px #15161c;
}
.tablet-button { position: absolute; background: #1b1d25; border-radius: 3px; }
.tablet-button-power { top: -4px; right: 120px; width: 56px; height: 4px; }
.tablet-button-vol { right: -4px; top: 110px; width: 4px; height: 70px; }

.screen {
    position: relative;
    width: 100%; height: 100%;
    border-radius: 28px;
    overflow: hidden;
    display: flex; flex-direction: column;
    background:
        radial-gradient(900px 500px at 8% -10%, rgba(139, 143, 248, 0.20), transparent 60%),
        radial-gradient(700px 420px at 105% 110%, rgba(94, 234, 212, 0.07), transparent 60%),
        var(--screen);
}

/* ------------------------------------------------------------ status bar */

.statusbar {
    height: 34px; flex: none;
    display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: 10px;
    padding: 0 22px;
    font-size: 12.5px; font-weight: 700; color: var(--white);
}
.sb-time { font-variant-numeric: tabular-nums; }
.sb-date { color: var(--muted); font-weight: 600; }
.sb-center { justify-self: center; color: var(--muted); font-weight: 600; letter-spacing: 0.02em; }
.sb-icons { display: flex; align-items: center; gap: 7px; }
.sb-icons svg { width: 15px; height: 15px; }
.sb-battery {
    position: relative; width: 24px; height: 12px; border-radius: 3.5px;
    border: 1.5px solid rgba(243, 244, 250, 0.7); padding: 1.5px;
}
.sb-battery::after { content: ""; position: absolute; right: -4px; top: 3px; width: 2px; height: 4px; border-radius: 0 1px 1px 0; background: rgba(243, 244, 250, 0.7); }
.sb-battery-level { display: block; height: 100%; width: 87%; border-radius: 1.5px; background: var(--white); }
.sb-pct { font-variant-numeric: tabular-nums; }

.screen-body { flex: 1; min-height: 0; display: flex; gap: 14px; padding: 4px 16px 26px 12px; }

/* ------------------------------------------------------------ dock */

.dock {
    flex: none; width: 96px;
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 6px 0;
    overflow-y: auto;
}
.dock::-webkit-scrollbar { width: 0; }
.dock-brand { padding: 4px 0 12px; }
.dock-logo {
    display: grid; place-items: center;
    width: 50px; height: 50px; border-radius: 15px;
    font-weight: 800; font-size: 14px; letter-spacing: 0.06em; color: #fff;
    background: linear-gradient(145deg, var(--accent), var(--accent-strong));
    box-shadow: 0 10px 24px -8px rgba(109, 113, 240, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.tab-btn {
    width: 84px;
    display: flex; flex-direction: column; align-items: center; gap: 5px;
    padding: 7px 4px;
    border-radius: 16px;
    transition: background 0.15s;
}
.tab-btn:hover { background: rgba(255, 255, 255, 0.04); }
.app-icon {
    display: grid; place-items: center;
    width: 46px; height: 46px; border-radius: 14px;
    color: var(--tint, var(--accent));
    background: var(--tint-bg, var(--accent-soft));
    border: 1px solid var(--tint-line, transparent);
    transition: transform 0.15s, background 0.15s, color 0.15s, box-shadow 0.15s;
}
.app-icon svg { width: 22px; height: 22px; }
.app-label { font-size: 11.5px; font-weight: 700; color: var(--muted); text-align: center; line-height: 1.2; }
.tab-btn:hover .app-icon { transform: translateY(-1px); }
.tab-btn.active .app-icon {
    color: #fff;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 60%), var(--tint, var(--accent));
    border-color: transparent;
    box-shadow: 0 8px 20px -8px var(--tint, var(--accent));
}
.tab-btn.active .app-label { color: var(--white); }

.ic-employees { --tint: rgb(139, 143, 248); --tint-bg: rgba(139, 143, 248, 0.13); --tint-line: rgba(139, 143, 248, 0.22); }
.ic-recruit   { --tint: rgb(45, 212, 191); --tint-bg: rgba(45, 212, 191, 0.13); --tint-line: rgba(45, 212, 191, 0.22); }
.ic-money     { --tint: rgb(74, 222, 128); --tint-bg: rgba(74, 222, 128, 0.13); --tint-line: rgba(74, 222, 128, 0.22); }
.ic-salary    { --tint: rgb(251, 191, 36); --tint-bg: rgba(251, 191, 36, 0.13); --tint-line: rgba(251, 191, 36, 0.22); }
.ic-inventory { --tint: rgb(96, 165, 250); --tint-bg: rgba(96, 165, 250, 0.13); --tint-line: rgba(96, 165, 250, 0.22); }
.ic-outfit    { --tint: rgb(244, 114, 182); --tint-bg: rgba(244, 114, 182, 0.13); --tint-line: rgba(244, 114, 182, 0.22); }
.ic-logs      { --tint: rgb(161, 166, 196); --tint-bg: rgba(161, 166, 196, 0.13); --tint-line: rgba(161, 166, 196, 0.22); }

.dock-close {
    margin-top: auto;
    width: 84px;
    display: flex; flex-direction: column; align-items: center; gap: 5px;
    padding: 8px 4px; border-radius: 16px;
    font-size: 11.5px; font-weight: 700; color: var(--muted);
}
.dock-close svg {
    width: 46px; height: 46px; padding: 12px; border-radius: 50%;
    background: var(--danger-soft); color: var(--danger);
    transition: background 0.15s;
}
.dock-close:hover svg { background: rgba(255, 107, 102, 0.26); }

/* ------------------------------------------------------------ app window */

.window {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column;
    border-radius: 22px;
    background: var(--window);
    border: 1px solid var(--line-soft);
    box-shadow: 0 20px 50px -25px rgba(0, 0, 0, 0.7);
    overflow: hidden;
}

.context-bar {
    flex: none;
    display: flex; align-items: center; gap: 12px;
    padding: 16px 22px;
    border-bottom: 1px solid var(--line-soft);
}
.context-avatar {
    width: 42px; height: 42px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--accent-soft); color: var(--accent);
}
.context-avatar svg { width: 22px; height: 22px; }
.context-job { font-size: 16px; font-weight: 800; color: var(--white); }
.context-name { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.context-title {
    margin-left: auto;
    font-size: 12px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
}
.context-page {
    min-width: 30px; height: 26px; padding: 0 9px; border-radius: 13px;
    display: grid; place-items: center;
    font: 600 12px var(--mono); color: var(--accent); background: var(--accent-soft);
}
.context-page:empty { display: none; }

.panel-body { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 22px 22px; }
.panel-body::-webkit-scrollbar { width: 6px; }
.panel-body::-webkit-scrollbar-thumb { background: #2a2d42; border-radius: 6px; }

.tab-content { display: none; animation: fade 0.2s ease-out; }
.tab-content.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.section-hint { font-size: 13px; color: var(--muted); line-height: 1.55; margin-bottom: 14px; max-width: 70ch; }
.section-title { font-size: 11.5px; font-weight: 800; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 12px; }
.empty-state {
    padding: 42px 0; text-align: center; font-size: 13.5px; color: var(--muted);
    border: 1px dashed var(--line); border-radius: 16px;
}

/* ------------------------------------------------------------ rows */

.rows-list { display: grid; gap: 8px; }
.row-card {
    display: flex; align-items: center; gap: 14px;
    padding: 12px 14px 12px 16px;
    border-radius: 14px;
    background: var(--row);
    border: 1px solid var(--line-soft);
    transition: border-color 0.15s;
}
.row-card:hover { border-color: var(--line); }
.row-main { flex: 1; min-width: 0; }
.row-grade { font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); margin-bottom: 2px; }
.row-title { font-size: 14.5px; font-weight: 700; color: var(--white); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { font: 500 11.5px var(--mono); color: var(--muted); }
.row-actions { display: flex; align-items: center; gap: 6px; flex: none; }

.icon-action {
    width: 34px; height: 34px; border-radius: 10px;
    display: grid; place-items: center;
    background: #1e2132; color: var(--text);
    transition: background 0.15s, color 0.15s;
}
.icon-action svg { width: 17px; height: 17px; }
.icon-action:hover:not(:disabled) { background: var(--accent-soft); color: var(--accent); }
.fire-btn:hover:not(:disabled) { background: var(--danger-soft); color: var(--danger); }
.icon-action:disabled { opacity: 0.3; cursor: default; }

.status-pill {
    display: inline-flex; align-items: center; gap: 6px;
    height: 26px; padding: 0 10px; margin-left: 4px; border-radius: 13px;
    font-size: 10.5px; font-weight: 800; letter-spacing: 0.06em;
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-pill.online { color: var(--success); background: var(--success-soft); }
.status-pill.offline { color: var(--muted); background: rgba(134, 138, 163, 0.12); }

/* ------------------------------------------------------------ buttons & inputs */

.btn-primary, .btn-secondary {
    height: 42px; padding: 0 20px; border-radius: 12px;
    font-size: 13.5px; font-weight: 700;
    transition: background 0.15s, transform 0.1s;
}
.btn-primary { color: #fff; background: linear-gradient(145deg, var(--accent), var(--accent-strong)); box-shadow: 0 8px 20px -10px rgba(109, 113, 240, 0.8); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-secondary { color: var(--white); background: #22253a; }
.btn-secondary:hover { background: #2b2f48; }
.btn-primary:active, .btn-secondary:active { transform: scale(0.98); }
.btn-block { width: 100%; }
.row-card .btn-secondary { height: 34px; padding: 0 14px; font-size: 12.5px; }

.cta-block {
    max-width: 440px; margin: 40px auto 0;
    display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px;
}
.cta-icon {
    width: 72px; height: 72px; border-radius: 22px; margin-bottom: 10px;
    display: grid; place-items: center;
    color: var(--tint, var(--accent)); background: var(--tint-bg, var(--accent-soft));
    border: 1px solid var(--tint-line, transparent);
}
.cta-icon svg { width: 34px; height: 34px; }
.cta-block .btn-primary { margin-top: 6px; }

/* ------------------------------------------------------------ money */

.money-layout { display: grid; grid-template-columns: minmax(300px, 380px) 1fr; gap: 18px; align-items: start; }
.money-left { display: grid; gap: 14px; }

.money-card {
    position: relative; overflow: hidden;
    padding: 20px 22px; border-radius: 20px;
    color: #fff;
    background:
        radial-gradient(260px 160px at 100% 0%, rgba(255, 255, 255, 0.18), transparent 70%),
        linear-gradient(140deg, #7b7ff6 0%, #5a5ee6 45%, #3a3db8 100%);
    box-shadow: 0 22px 40px -22px rgba(90, 94, 230, 0.9);
    aspect-ratio: 1.62;
    display: flex; flex-direction: column;
}
.money-card-top { display: flex; align-items: center; gap: 10px; }
.money-card-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(255, 255, 255, 0.18); }
.money-card-icon svg { width: 18px; height: 18px; }
.money-card-city { font-size: 10px; font-weight: 800; letter-spacing: 0.14em; opacity: 0.8; }
.money-card-job { font-size: 14px; font-weight: 800; }
.money-card-chip {
    margin-left: auto; width: 38px; height: 28px; border-radius: 6px;
    background: linear-gradient(135deg, #f6d27a, #c99a35);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
}
.money-card-number { margin-top: auto; font: 600 15px var(--mono); letter-spacing: 0.12em; opacity: 0.9; }
.money-card-amount-label { margin-top: 12px; font-size: 10px; font-weight: 800; letter-spacing: 0.14em; opacity: 0.75; }
.money-card-amount { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.15; }

.money-actions { display: grid; gap: 10px; }
.money-input, .salary-input {
    height: 44px; width: 100%; padding: 0 14px; border-radius: 12px;
    border: 1px solid var(--line); background: #0f1119; color: var(--white);
    font: 600 14px var(--mono); outline: none;
    transition: border-color 0.15s;
}
.money-input:focus, .salary-input:focus { border-color: var(--accent); }
.money-input::-webkit-inner-spin-button, .salary-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.money-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick-amounts { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.quick-btn {
    display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
    padding: 9px 12px; border-radius: 12px;
    background: var(--row); border: 1px solid var(--line-soft);
    font: 600 13px var(--mono); color: var(--white);
    transition: border-color 0.15s, background 0.15s;
}
.quick-btn:hover { border-color: var(--accent); background: var(--accent-soft); }
.quick-btn-label { font: 800 9.5px "Manrope", sans-serif; letter-spacing: 0.1em; color: var(--muted); }

.money-activities {
    padding: 16px 18px; border-radius: 18px;
    background: var(--row); border: 1px solid var(--line-soft);
    min-height: 100%;
}
.activities-list { display: grid; }
.activity-row {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 11px 0; border-bottom: 1px solid var(--line-soft);
}
.activity-row:last-child { border-bottom: 0; }
.activity-info { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.activity-label { font-size: 10.5px; font-weight: 800; letter-spacing: 0.1em; color: var(--muted); }
.activity-name { font-size: 13.5px; font-weight: 700; color: var(--white); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-amount { font: 600 14px var(--mono); flex: none; }
.activity-amount.positive { color: var(--success); }
.activity-amount.negative { color: var(--danger); }

/* ------------------------------------------------------------ salary */

.salary-funds {
    display: inline-flex; align-items: center; gap: 8px;
    margin-bottom: 14px; padding: 8px 14px; border-radius: 12px;
    background: var(--success-soft); color: var(--success);
    font-size: 13px; font-weight: 700;
}
.salary-funds span:last-child { font-family: var(--mono); }
.salary-actions { gap: 8px; }
.salary-currency { font: 600 13px var(--mono); color: var(--muted); }
.salary-input { width: 120px; height: 36px; }
.managed-badge { color: var(--warning); }

/* ------------------------------------------------------------ logs */

.logs-list { display: grid; gap: 6px; }
.log-row {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px; border-radius: 12px;
    background: var(--row); border: 1px solid var(--line-soft);
}
.log-action {
    flex: none; min-width: 104px; text-align: center;
    padding: 4px 8px; border-radius: 8px;
    font-size: 10px; font-weight: 800; letter-spacing: 0.08em;
    color: var(--accent); background: var(--accent-soft);
}
.log-action.log-hire { color: var(--success); background: var(--success-soft); }
.log-action.log-fire { color: var(--danger); background: var(--danger-soft); }
.log-action.log-promote { color: #60a5fa; background: rgba(96, 165, 250, 0.14); }
.log-action.log-demote { color: var(--warning); background: rgba(251, 191, 36, 0.13); }
.log-action.log-salary { color: #2dd4bf; background: rgba(45, 212, 191, 0.13); }
.log-text { font-size: 13px; color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ------------------------------------------------------------ home indicator & toast */

.home-indicator {
    position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%);
    width: 130px; height: 5px; border-radius: 3px;
    background: rgba(243, 244, 250, 0.35);
}

.toast {
    position: absolute; top: 46px; left: 50%; transform: translateX(-50%);
    max-width: 70%;
    padding: 11px 18px; border-radius: 14px;
    font-size: 13px; font-weight: 700; color: var(--white);
    background: rgb(28, 30, 46);
    border: 1px solid var(--line);
    box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.8);
    animation: toast-in 0.25s ease-out;
    z-index: 5;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -10px); } to { opacity: 1; transform: translate(-50%, 0); } }

@media (max-height: 640px) {
    .tablet { padding: 12px; border-radius: 34px; }
    .screen { border-radius: 24px; }
    .money-card { aspect-ratio: auto; min-height: 190px; }
}
@media (prefers-reduced-motion: reduce) {
    .tablet, .tab-content, .toast { animation: none; }
}

/* ------------------------------------------------------------ login */

.login {
    position: absolute; top: 34px; right: 0; bottom: 0; left: 0; z-index: 4;
    display: flex; align-items: center; justify-content: center;
    background:
        radial-gradient(600px 380px at 50% 20%, rgba(139, 143, 248, 0.22), transparent 70%),
        var(--screen);
    transition: opacity 0.35s ease, transform 0.35s ease;
}
.login.leaving { opacity: 0; transform: scale(1.04); pointer-events: none; }
.login-card {
    width: min(380px, 80%);
    display: flex; flex-direction: column; align-items: center;
    animation: fade 0.35s ease-out;
}
.login-logo {
    width: 74px; height: 74px; border-radius: 22px;
    display: grid; place-items: center;
    font-size: 19px; font-weight: 800; letter-spacing: 0.06em; color: #fff;
    background: linear-gradient(145deg, var(--accent), var(--accent-strong));
    box-shadow: 0 16px 34px -12px rgba(109, 113, 240, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.login-org { margin-top: 16px; font-size: 21px; font-weight: 800; color: var(--white); text-align: center; }
.login-sub { margin-top: 2px; margin-bottom: 26px; font-size: 13px; color: var(--muted); }

.login-field { width: 100%; margin-bottom: 14px; }
.login-field label { display: block; margin: 0 0 6px 2px; font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.login-input {
    height: 46px; padding: 0 14px; border-radius: 13px;
    display: flex; align-items: center; gap: 10px;
    background: #0f1119; border: 1px solid var(--line);
    color: var(--muted);
    transition: border-color 0.2s;
}
.login-input.typing { border-color: var(--accent); }
.login-input svg { width: 18px; height: 18px; flex: none; }
.login-typed { font-size: 14.5px; font-weight: 700; color: var(--white); white-space: nowrap; overflow: hidden; }
.login-dots { letter-spacing: 0.18em; font-size: 16px; }
.login-caret { width: 2px; height: 18px; margin-left: -8px; border-radius: 1px; background: var(--accent); opacity: 0; }
.login-input.typing .login-caret { opacity: 1; animation: blink 0.9s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.login-hint { margin: 6px 0 0 2px; font-size: 11.5px; color: var(--muted); }
.login-hint span:last-child { font-family: var(--mono); color: var(--text); }

.login-btn { width: 100%; height: 46px; margin-top: 8px; }
.login-btn:disabled { opacity: 0.45; cursor: default; filter: grayscale(0.4); box-shadow: none; }
.login-btn.ready { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse {
    0%, 100% { box-shadow: 0 8px 20px -10px rgba(109, 113, 240, 0.8); }
    50% { box-shadow: 0 0 0 5px rgba(139, 143, 248, 0.22), 0 8px 20px -10px rgba(109, 113, 240, 0.8); }
}
@media (prefers-reduced-motion: reduce) {
    .login-card, .login-btn.ready { animation: none; }
}

/* scrollbars: thin, rounded, no Windows arrows */
* { scrollbar-width: thin; scrollbar-color: #2e3248 transparent; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2e3248; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #4a4f70; }
::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
