* { box-sizing: border-box; }
:root {
    --bg: #111;
    --surface: #1a1a1a;
    --surface-2: #202020;
    --border: #2f2f2f;
    --text: #f2f2f2;
    --muted: #a4a4a4;
    --success-bg: #15351f;
    --success-border: #2d6d41;
    --error-bg: #3a1616;
    --error-border: #7c2d2d;
}
body { margin: 0; font-family: Arial, sans-serif; background: var(--bg); color: var(--text); }
.container { width: min(100% - 2rem, 1080px); margin: 0 auto; }
.site-header { background: #171717; border-bottom: 1px solid var(--border); padding: 1rem 0 1.15rem; margin-bottom: 2rem; position: sticky; top: 0; z-index: 20; }
.header-shell { display: grid; gap: 0.8rem; }
.header-top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.brand a { color: #fff; text-decoration: none; font-size: 1.15rem; font-weight: 700; }
.lang-switch { display: flex; gap: 0.5rem; align-items: center; }
.lang-pill { display: inline-flex; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem; border-radius: 999px; background: var(--surface-2); border: 1px solid #3a3a3a; text-decoration: none; font-size: 1.05rem; color: #fff; }
.lang-pill:visited, .lang-pill:hover, .lang-pill:active { color: #fff; }
.lang-pill.is-active { outline: 2px solid #fff; outline-offset: 1px; }
.top-nav { display: flex; gap: 0.65rem; flex-wrap: wrap; }
.top-nav a { color: #fff; text-decoration: none; background: var(--surface-2); border: 1px solid #343434; padding: 0.55rem 0.8rem; border-radius: 999px; }
.hero, .card, .form-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 1.25rem; }
.card, .form-card { margin-bottom: 1rem; }
form { display: grid; gap: 1rem; }
.inline-form { display: inline-block; margin: 0; }
label { display: grid; gap: 0.4rem; }
input, select, textarea, button { padding: 0.8rem 0.9rem; border-radius: 10px; border: 1px solid #3a3a3a; font: inherit; }
input, select, textarea { background: #0f0f0f; color: #fff; }
textarea { resize: vertical; min-height: 120px; }
button, .button-link { display: inline-block; background: #fff; color: #111; cursor: pointer; font-weight: 700; text-decoration: none; padding: 0.85rem 1rem; border-radius: 10px; border: none; }
.button-small { padding: 0.55rem 0.8rem; font-size: 0.92rem; }
button:disabled { opacity: 0.45; cursor: not-allowed; }
.button-secondary { background: transparent; color: #fff; border: 1px solid #555; }
.alert { padding: 1rem; border-radius: 12px; margin-bottom: 1rem; }
.alert-success { background: var(--success-bg); border: 1px solid var(--success-border); }
.alert-error { background: var(--error-bg); border: 1px solid var(--error-border); }
.stats-grid { display: grid; gap: 1rem; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 1rem; }
.stats-grid-admin { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.stat-card { text-align: center; }
.stat-number { font-size: 2rem; font-weight: 700; margin-bottom: 0.35rem; color: var(--text); }
.stat-label, .muted { color: var(--muted); }
.stat-link-card { display: block; text-decoration: none; color: inherit; transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease; }
.stat-link-card:visited, .stat-link-card:hover, .stat-link-card:active { color: inherit; text-decoration: none; }
.stat-link-card:hover { transform: translateY(-2px); border-color: #555; background: #202020; }
.status-badge { display: inline-flex; padding: 0.35rem 0.65rem; border-radius: 999px; font-size: 0.85rem; border: 1px solid #444; background: #222; }
.status-open { border-color: #666; }
.status-submitted { border-color: #a67c00; background: #2a2410; }
.status-approved { border-color: #2d6d41; background: #15351f; }
.status-failed, .status-cancelled, .status-expired { border-color: #7c2d2d; background: #3a1616; }
.status-claimed { border-color: #a67c00; background: #2a2410; }
.status-fulfilled { border-color: #2d6d41; background: #15351f; }
.action-row { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.9rem 0.7rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.filters-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1rem; align-items: end; }
.filters-row-user { grid-template-columns: 1fr auto; }
.filters-actions { display: flex; align-items: end; }
.segment-switch { display: inline-flex; gap: 0.5rem; flex-wrap: wrap; }
.segment-pill { display: inline-flex; padding: 0.6rem 0.9rem; border-radius: 999px; background: var(--surface-2); border: 1px solid #3a3a3a; color: #fff; text-decoration: none; }
.segment-pill.is-active { background: #fff; color: #111; }
.details-row td { background: #171717; }
.details-panel { padding: 0.25rem 0; }
.compact-table td, .compact-table th { white-space: nowrap; }
.compact-table .details-row td { white-space: normal; }
.simple-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.75rem; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.section-head h2 { margin: 0; }
.inline-link { color: #fff; text-decoration: none; border-bottom: 1px solid #666; }
.history-link { display: block; color: inherit; text-decoration: none; padding: 0.1rem 0; }
.history-link:visited, .history-link:hover, .history-link:active { color: inherit; text-decoration: none; }

@media (max-width: 980px) {
    .stats-grid-admin { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .filters-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .filters-row-user { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
    .stats-grid, .filters-row { grid-template-columns: 1fr; }
    .top-nav { gap: 0.55rem; }
    .top-nav a { padding: 0.5rem 0.7rem; }
    .section-head { align-items: flex-start; flex-direction: column; }
}
