/* Abbot Server Panel — Stylesheet */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg:          #0f1117;
    --surface:     #1a1d27;
    --surface2:    #222536;
    --border:      #2e3248;
    --accent:      #6c8ebf;
    --accent-dim:  #3b5178;
    --text:        #d4d8e8;
    --text-muted:  #7a8099;
    --green:       #4caf82;
    --red:         #cf6679;
    --yellow:      #c9a227;
    --sidebar-w:   220px;
    --radius:      6px;
    --font:        'Segoe UI', system-ui, sans-serif;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
}

/* ── Layout ── */
.abbot-body {
    display: flex;
    min-height: 100vh;
}

.abbot-sidebar {
    width: var(--sidebar-w);
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    overflow-y: auto;
}

.abbot-main {
    margin-left: var(--sidebar-w);
    flex: 1;
    padding: 24px 32px;
    max-width: 1200px;
}

/* ── Sidebar ── */
.sidebar-brand {
    padding: 20px 16px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--border);
    font-size: 16px;
    font-weight: 600;
    letter-spacing: .02em;
}
.brand-icon { font-size: 20px; }

.sidebar-nav {
    list-style: none;
    padding: 12px 0;
    flex: 1;
}
.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    color: var(--text-muted);
    text-decoration: none;
    transition: background .12s, color .12s;
    border-radius: 0;
}
.sidebar-nav li a:hover,
.sidebar-nav li.active a {
    background: var(--surface2);
    color: var(--text);
}
.sidebar-nav li.active a { color: var(--accent); }
.nav-icon { width: 20px; text-align: center; }

.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logout-link { color: var(--red); text-decoration: none; }
.logout-link:hover { text-decoration: underline; }

/* ── Page header ── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
}
.page-header h1 { font-size: 20px; font-weight: 600; }

/* ── Cards ── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 20px;
}
.card-title {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
    margin-bottom: 14px;
}

/* ── Stat tiles (dashboard) ── */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-tile {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
}
.stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.stat-value { font-size: 26px; font-weight: 700; margin: 4px 0; }
.stat-sub   { font-size: 12px; color: var(--text-muted); }

/* ── Progress bar ── */
.progress-bar {
    height: 6px;
    background: var(--surface2);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 8px;
}
.progress-fill { height: 100%; background: var(--accent); border-radius: 3px; transition: width .3s; }
.progress-fill.warn  { background: var(--yellow); }
.progress-fill.danger { background: var(--red); }

/* ── Tables ── */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.data-table th { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--surface2); }

/* ── Badges ── */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.badge-green  { background: rgba(76,175,130,.18); color: var(--green); }
.badge-red    { background: rgba(207,102,121,.18); color: var(--red); }
.badge-yellow { background: rgba(201,162,39,.18);  color: var(--yellow); }
.badge-gray   { background: var(--surface2); color: var(--text-muted); }

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: opacity .12s;
}
.btn:hover { opacity: .85; }
.btn-primary  { background: var(--accent); color: #fff; }
.btn-danger   { background: var(--red); color: #fff; }
.btn-outline  { background: transparent; border-color: var(--border); color: var(--text); }
.btn-sm       { padding: 4px 10px; font-size: 12px; }

/* ── Forms ── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 500; color: var(--text-muted); margin-bottom: 6px; }
.form-control {
    width: 100%;
    padding: 8px 12px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 14px;
}
.form-control:focus { outline: none; border-color: var(--accent); }
select.form-control { appearance: none; }

/* ── Flashes ── */
.flash {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 13px;
}
.flash-error   { background: rgba(207,102,121,.15); border: 1px solid var(--red);    color: var(--red); }
.flash-success { background: rgba(76,175,130,.15);  border: 1px solid var(--green);  color: var(--green); }

/* ── Log output ── */
.log-output {
    background: #0a0c12;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 12px;
    line-height: 1.6;
    color: #c8d0e8;
    overflow-x: auto;
    white-space: pre;
    max-height: 600px;
    overflow-y: auto;
}

/* ── Login page ── */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
}
.login-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px;
    width: 360px;
}
.login-title {
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
}
.login-sub {
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 28px;
}

/* ── Responsive ── */
@media (max-width: 700px) {
    .abbot-sidebar { width: 56px; }
    .brand-name, .sidebar-nav li a span:not(.nav-icon), .sidebar-footer .sidebar-user { display: none; }
    .abbot-main { margin-left: 56px; padding: 16px; }
    .stat-grid { grid-template-columns: 1fr 1fr; }
}
