:root {
    --bg: #0b1220;
    --panel: #121a2b;
    --panel-soft: #18243a;
    --line: #25324c;
    --text: #edf2ff;
    --muted: #9fb0d1;
    --primary: #2f6fed;
    --primary-strong: #1d56c9;
    --success: #18a957;
    --danger: #cb3d54;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font-family: Arial, Helvetica, sans-serif; background: var(--bg); color: var(--text); }
a { text-decoration: none; color: inherit; }
button, input { font: inherit; }

.shell { min-height: 100vh; display: grid; grid-template-columns: 270px 1fr; }
.sidebar { background: linear-gradient(180deg, #0f1727 0%, #0d1422 100%); border-right: 1px solid var(--line); padding: 24px 18px; }
.brand-block { padding: 10px 12px 24px 12px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.brand-title { font-size: 26px; font-weight: 700; letter-spacing: .5px; }
.brand-subtitle { color: var(--muted); margin-top: 6px; }
.nav-menu { display: flex; flex-direction: column; gap: 8px; }
.nav-link { padding: 12px 14px; border-radius: 14px; color: #d6e0f7; transition: .2s ease; }
.nav-link:hover, .nav-link.active { background: #1b2943; color: white; }
.content-area { display: flex; flex-direction: column; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 20px 26px; border-bottom: 1px solid var(--line); background: rgba(10,15,25,.65); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 10; }
.page-kicker, .header-kicker { color: #74a3ff; text-transform: uppercase; letter-spacing: 1px; font-size: 12px; font-weight: 700; }
.page-title { font-size: 24px; font-weight: 700; margin-top: 4px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.page-body { padding: 26px; }
.page-header-card, .table-card, .loading-card { background: var(--panel); border: 1px solid var(--line); border-radius: 24px; padding: 22px; box-shadow: 0 12px 32px rgba(0,0,0,.22); }
.page-header-split { display: flex; justify-content: space-between; gap: 16px; align-items: end; }
.page-header-card h1 { margin: 8px 0 10px 0; font-size: 30px; }
.page-header-card p { margin: 0; color: var(--muted); }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 18px; }
.stat-card { background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.stat-card span { color: var(--muted); }
.stat-card strong { font-size: 34px; }
.search-box { display: flex; gap: 10px; min-width: 360px; }
.search-box input, .login-form input { width: 100%; background: #0d1627; color: white; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.btn { border: 0; border-radius: 14px; padding: 12px 18px; cursor: pointer; transition: .2s ease; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-strong); }
.btn-outline { background: transparent; color: white; border: 1px solid var(--line); }
.btn-outline:hover { background: #1b2943; }
.btn-block { width: 100%; }
.table-card { margin-top: 18px; overflow: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 14px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.data-table th { color: var(--muted); font-weight: 700; font-size: 13px; text-transform: uppercase; }
.muted { color: var(--muted); font-size: 13px; margin-top: 4px; }
.status-badge { display: inline-flex; padding: 7px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.status-active { background: rgba(24,169,87,.16); color: #7fe3a8; }
.status-inactive { background: rgba(203,61,84,.16); color: #ff9aab; }
.empty-state { text-align: center; color: var(--muted); padding: 26px !important; }
.user-chip { background: #1b2943; border: 1px solid var(--line); padding: 10px 14px; border-radius: 999px; }
.login-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: radial-gradient(circle at top, #19315f 0%, #0b1220 50%); }
.login-card { width: 100%; max-width: 440px; background: rgba(18,26,43,.96); border: 1px solid var(--line); border-radius: 28px; padding: 30px; box-shadow: 0 18px 50px rgba(0,0,0,.32); }
.login-brand { font-size: 28px; font-weight: 700; margin-bottom: 10px; }
.login-card h1 { margin: 0 0 10px 0; }
.login-text, .login-footer { color: var(--muted); }
.login-form { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.login-form label { display: flex; flex-direction: column; gap: 8px; }
.alert-error { background: rgba(203,61,84,.14); color: #ff9aab; border: 1px solid rgba(203,61,84,.25); padding: 12px 14px; border-radius: 14px; margin-top: 16px; }

.machines-page { display: flex; flex-direction: column; gap: 18px; }
.machines-spacing { margin-top: 18px; }
.machines-main-text { font-weight: 700; color: var(--text); }
.danger-outline { border-color: rgba(203,61,84,.45); color: #ffb3bf; }
.danger-outline:hover { background: rgba(203,61,84,.12); border-color: rgba(203,61,84,.65); }
.data-table tbody tr:hover { background: rgba(255,255,255,.02); }
.data-table td .btn { min-width: 132px; }

@media (max-width: 980px) {
    .shell { grid-template-columns: 1fr; }
    .sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
    .page-header-split { flex-direction: column; align-items: stretch; }
    .search-box { min-width: 100%; }
}
