:root {
    --bg: #ffffff;
    --surface: #f9fafb;
    --surface-2: #e5e7eb;
    --text: #050505;
    --muted: #6b7280;
    --primary: #D46A33;
    --primary-2: #b85524;
    --success: #15803d;
    --danger: #b91c1c;
    --warning: #b45309;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.05);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
}

/* Hide scrollbars everywhere */
::-webkit-scrollbar { display: none; }
html { scrollbar-width: none; }

.mono { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace; }
.copper-text { color: var(--primary); }

/* N2 Logo */
.n2-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
}
.n2-logo svg {
    height: 32px;
    width: auto;
    display: block;
}
.n2-logo .n2-wordmark {
    font-weight: 900;
    letter-spacing: 0.05em;
    font-size: 1.1rem;
}

.app {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--bg);
    border-right: 1px solid var(--surface-2);
    display: flex;
    flex-direction: column;
    padding: 24px 0;
    position: fixed;
    height: 100vh;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 24px 24px;
    border-bottom: 1px solid var(--surface-2);
    margin-bottom: 16px;
}

.brand-mark {
    width: 36px;
    height: 36px;
    background: var(--text);
    color: var(--bg);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.85rem;
}

.brand-name {
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: -0.01em;
}

.nav {
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1;
}

.nav a {
    display: block;
    padding: 12px 24px;
    color: var(--muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all .15s;
    border-right: 3px solid transparent;
}

.nav a:hover, .nav a.active {
    color: var(--text);
    background: rgba(212,106,51,.08);
    border-right-color: var(--primary);
}

.nav-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--surface-2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--muted);
    font-size: .875rem;
}

.nav-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.main {
    flex: 1;
    margin-left: 260px;
    padding: 32px;
    max-width: calc(100% - 260px);
    min-height: 100vh;
    max-height: 100vh;
    background: var(--bg);
    overflow-y: auto;
}

.main-full {
    margin-left: 0;
    max-width: 100%;
    padding: 0;
}

.topbar {
    margin-bottom: 24px;
}

.topbar h1 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.content { display: flex; flex-direction: column; gap: 24px; }

.card {
    background: var(--surface);
    border: 1px solid var(--surface-2);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

.card h2, .card h3 {
    margin-top: 0;
    font-weight: 700;
}

.grid {
    display: grid;
    gap: 24px;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1100px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 800px) {
    .sidebar { width: 100%; position: relative; height: auto; }
    .main { margin-left: 0; max-width: 100%; }
    .grid-2, .grid-4 { grid-template-columns: 1fr; }
}

.stat { text-align: center; }
.stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
}
.stat-label { color: var(--muted); font-size: .875rem; font-weight: 500; }

.toolbar { display: flex; justify-content: flex-end; }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 6px;
    border: 1px solid transparent;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    font-size: .875rem;
    transition: all .15s;
}

.btn:hover { opacity: .9; transform: translateY(-1px); }
.btn-primary {
    background: var(--text);
    color: var(--bg);
    border-color: var(--text);
}
.btn-primary:hover { background: var(--primary); border-color: var(--primary); color: var(--bg); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--surface-2); }
.btn-secondary:hover { border-color: var(--text); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: .75rem; }
.btn-block { width: 100%; justify-content: center; }

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
}

.table th {
    text-align: left;
    padding: 12px;
    border-bottom: 1px solid var(--surface-2);
    color: var(--muted);
    font-weight: 600;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.table td {
    padding: 12px;
    border-bottom: 1px solid var(--surface-2);
    vertical-align: middle;
}

.table tr:last-child td { border-bottom: none; }

.table a { color: var(--primary); text-decoration: none; }
.table a:hover { text-decoration: underline; }

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 600;
}

.badge-success { background: rgba(21,128,61,.1); color: var(--success); }
.badge-danger { background: rgba(185,28,28,.1); color: var(--danger); }
.badge-warning { background: rgba(180,83,9,.1); color: var(--warning); }

.form-group { margin-bottom: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group label {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: .8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg);
    border: 1px solid var(--surface-2);
    border-radius: 6px;
    color: var(--text);
    font-family: inherit;
    font-size: .95rem;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(212,106,51,.15);
}

.form-check { display: flex; align-items: center; gap: 8px; }
.form-check input { width: auto; }

.inline-form { display: inline-block; margin: 0; }

.alert {
    padding: 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: .9rem;
}
.alert-danger { background: rgba(185,28,28,.08); color: var(--danger); border: 1px solid rgba(185,28,28,.15); }
.alert-success { background: rgba(21,128,61,.08); color: var(--success); border: 1px solid rgba(21,128,61,.15); }

.muted { color: var(--muted); }

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.detail-list {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 8px 24px;
    margin: 0;
}

.detail-list dt { color: var(--muted); font-weight: 500; }
.detail-list dd { margin: 0; }

.code-block {
    margin-top: 12px;
    padding: 12px;
    background: #050505;
    color: #f9fafb;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.code-block code {
    flex: 1;
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    word-break: break-all;
    font-size: .85rem;
}

/* Login */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--surface);
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg);
    border: 1px solid var(--surface-2);
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: var(--shadow);
}

.login-card .brand {
    padding: 0;
    border-bottom: none;
    margin-bottom: 32px;
    justify-content: center;
}

.login-card h2 {
    margin: 0 0 24px;
    text-align: center;
    font-weight: 700;
    font-size: 1.4rem;
}

.narrow { max-width: 560px; }

/* Public landing */
.landing {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 48px;
}
.landing h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin: 32px 0 12px;
    letter-spacing: -0.03em;
}
.landing p {
    color: var(--muted);
    max-width: 520px;
    margin: 0 auto 32px;
    font-size: 1.1rem;
}
.landing-actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
}
