/* QuarkGrid Admin — Minimal Dark Theme */
:root {
    --bg: #0d1117;
    --bg-card: #161b22;
    --bg-sidebar: #0d1117;
    --border: #30363d;
    --text: #c9d1d9;
    --text-dim: #8b949e;
    --accent: #58a6ff;
    --accent-hover: #79c0ff;
    --green: #3fb950;
    --red: #f85149;
    --yellow: #d29922;
    --radius: 6px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}
.login-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    width: 360px;
}
.login-header { text-align: center; margin-bottom: 1.5rem; }
.login-header h1 { color: var(--accent); font-size: 1.5rem; }
.login-header p { color: var(--text-dim); font-size: 0.875rem; }

.form-group { margin-bottom: 1rem; }
.form-group label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-dim);
    margin-bottom: 0.25rem;
}
.form-group input, .inline-form input, .inline-form select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.875rem;
}
.inline-form select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b949e' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    padding-right: 1.5rem;
    cursor: pointer;
}
.inline-form select:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-success { color: var(--green); border-color: var(--green); }
.btn-success:hover { background: var(--green); color: #fff; }
.form-group input:focus, .inline-form input:focus, .inline-form select:focus {
    outline: none;
    border-color: var(--accent);
}
.error-msg {
    color: var(--red);
    font-size: 0.8125rem;
    margin-bottom: 0.75rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    color: var(--text);
    cursor: pointer;
    font-size: 0.875rem;
    text-decoration: none;
}
.btn:hover { border-color: var(--text-dim); }
.btn-primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    width: 100%;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-danger { color: var(--red); border-color: var(--red); }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-small { padding: 0.25rem 0.75rem; font-size: 0.8125rem; }

/* Layout */
.sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: 220px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 1rem 0;
}
.sidebar-header { padding: 0 1rem 1rem; border-bottom: 1px solid var(--border); }
.sidebar-header h2 { font-size: 1.125rem; color: var(--accent); }
.badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    background: var(--border);
    border-radius: 12px;
    font-size: 0.6875rem;
    color: var(--text-dim);
}
.nav-links {
    list-style: none;
    flex: 1;
    padding: 0.5rem 0;
}
.nav-links li a {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.875rem;
    border-left: 3px solid transparent;
}
.nav-links li a:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.nav-links li a.active {
    color: var(--accent);
    border-left-color: var(--accent);
    background: rgba(88,166,255,0.08);
}
.sidebar-footer { padding: 0.75rem 1rem; border-top: 1px solid var(--border); }

.content {
    margin-left: 220px;
    padding: 2rem;
}
.content h1 { font-size: 1.5rem; margin-bottom: 1.5rem; }

/* Pages */
.page { display: none; }
.page.active { display: block; }

/* Cards */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
}
.card .label { font-size: 0.75rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em; }
.card .value { font-size: 1.5rem; font-weight: 600; margin-top: 0.25rem; }
.card .value.green { color: var(--green); }
.card .value.red { color: var(--red); }
.card .value.yellow { color: var(--yellow); }

/* Sections */
.section { margin-bottom: 2rem; }
.section h2 { font-size: 1.125rem; margin-bottom: 0.75rem; color: var(--text-dim); }

/* Code block */
.code-block {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
    font-size: 0.8125rem;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

/* Tables */
.table-container { overflow-x: auto; }
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}
th, td {
    text-align: left;
    padding: 0.625rem 0.75rem;
    border-bottom: 1px solid var(--border);
}
th {
    color: var(--text-dim);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
tr:hover { background: rgba(255,255,255,0.02); }

.hidden { display: none; }
.text-dim { color: var(--text-dim); }
.status-ok { color: var(--green); }
.status-error { color: var(--red); }
.status-pending { color: var(--yellow); }

/* Inline form */
.inline-form {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: flex-end;
    margin-bottom: 1rem;
}
.inline-form input { width: auto; flex: 1; min-width: 120px; }
.inline-form .btn-primary { width: auto; }

/* Responsive */
@media (max-width: 768px) {
    .sidebar { width: 60px; overflow: hidden; }
    .sidebar-header h2, .sidebar-footer { display: none; }
    .nav-links li a { padding: 0.75rem; text-align: center; font-size: 0; }
    .nav-links li a::first-letter { font-size: 0.875rem; }
    .content { margin-left: 60px; padding: 1rem; }
}
