:root {
    --bg: #f4f1ed;
    --panel: #ffffff;
    --text: #1f2a32;
    --muted: #6c7a86;
    --primary: #1a5a6b;
    --secondary: #dfe7ea;
    --accent: #b67b2c;
    --danger: #b93b3b;
    --border: #e1e6ea;
    --shadow: 0 12px 28px rgba(16, 24, 32, 0.08);
    --font: 'Georgia', 'Times New Roman', serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font);
    color: var(--text);
    background: linear-gradient(135deg, #f7f1e7 0%, #edf3f5 100%);
}

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

.sidebar {
    width: 260px;
    background: #14252c;
    color: #eef4f6;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.brand {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sidebar nav a {
    color: #eef4f6;
    text-decoration: none;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(255,255,255,0.05);
}

.sidebar nav a:hover {
    background: rgba(255,255,255,0.12);
}

.main {
    flex: 1;
    padding: 32px 40px;
}

.page-header h1 {
    margin: 0 0 20px 0;
    font-size: 30px;
}

.content {
    background: var(--panel);
    padding: 24px;
    border-radius: 14px;
    box-shadow: var(--shadow);
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
}

.card-title {
    color: var(--muted);
    font-size: 14px;
}

.card-value {
    font-size: 28px;
    font-weight: 700;
}

.panel {
    background: #f7f4f0;
    padding: 18px;
    border-radius: 10px;
    border: 1px solid var(--border);
    margin-bottom: 16px;
}

.form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.form.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 14px;
}

input, textarea, select {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
}

.form-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 12px;
    align-items: center;
}

.btn-primary, .btn-secondary, .btn-link {
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-secondary {
    background: var(--secondary);
    color: var(--text);
}

.btn-link {
    background: transparent;
    color: #eef4f6;
    padding: 0;
}

.alert.error {
    background: #fbeaea;
    border: 1px solid #f1b2b2;
    color: var(--danger);
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 12px;
}

.field-error {
    color: var(--danger);
    font-size: 12px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.table th, .table td {
    padding: 10px 8px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.two-col {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.code-block {
    background: #111a1f;
    color: #e9f2f4;
    padding: 16px;
    border-radius: 10px;
    overflow-x: auto;
    font-size: 13px;
}

.muted {
    color: var(--muted);
    font-size: 12px;
}

.status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    background: #eee;
}

.status-draft { background: #f2e7d5; }
.status-submitted { background: #d9e7f2; }
.status-queued_for_build { background: #e7e0f2; }
.status-building { background: #f2e0d6; }
.status-ready_for_internal_test { background: #f2f0d6; }
.status-ready_for_comtech_test { background: #d6f2ef; }
.status-comtech_approved { background: #cdecd9; }
.status-paused { background: #f2e3d6; }
.status-internal_approved { background: #d7f2e1; }
.status-failed { background: #f2d7d7; }
.status-offline { background: #f2d7d7; }
.status-stale { background: #f2e3d6; }
.status-healthy { background: #d7f2e1; }
.status-live { background: #d7f2e1; }

.inline-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.logout-form {
    margin-top: auto;
}

.auth-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.auth-card {
    width: 360px;
    background: var(--panel);
    padding: 28px;
    border-radius: 16px;
    box-shadow: var(--shadow);
}

@media (max-width: 900px) {
    .app-shell { flex-direction: column; }
    .sidebar { width: 100%; flex-direction: row; flex-wrap: wrap; }
    .main { padding: 24px; }
}
