/* ==========================================================
   Portal2026 – modern portal styling
   ========================================================== */

:root {
    color-scheme: light dark;
    --bg: #dbf4ff;
    --bg-gradient: linear-gradient(180deg, #e0f0f2 0%, #dee8eb 100%);
    --text-on-bg: #4a4663;
    --surface: #ffffff;
    --surface-alt: #faf9fd;
    --border: #e3ebf0;
    --text: #25223a;
    --text-muted: #737f8c;
    --accent: #4f99d1;
    --accent-strong: #2f73b3;
    --accent-soft: #ebf9fc;
    --on-accent: #ffffff;
    --focus: rgba(79, 146, 209, 0.28);
    --shadow-sm: 0 1px 2px rgba(37, 34, 58, .05), 0 1px 3px rgba(37, 34, 58, .04);
    --shadow-md: 0 6px 20px rgba(37, 34, 58, .08);
    --radius-lg: 16px;
    --radius-pill: 999px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #16141f;
        --bg-gradient: none;
        --text-on-bg: #9b97b2;
        --surface: #1f1c2c;
        --surface-alt: #252236;
        --border: #332f47;
        --text: #ecebf5;
        --text-muted: #9b97b2;
        --accent: #86ebf2;
        --accent-strong: #a8efff;
        --accent-soft: #2c2745;
        --on-accent: #16141f;
        --focus: rgba(134, 235, 242, 0.35);
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
        --shadow-md: 0 6px 20px rgba(0, 0, 0, .35);
    }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    background-color: var(--bg);
    background-image: var(--bg-gradient);
    background-repeat: no-repeat;
    background-attachment: fixed;
    color: var(--text);
    font-family: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ---------- Layout ---------- */

.page {
    max-width: 2560px;
    margin: 0 auto;
    padding: 40px 40px 64px;
}

.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px 24px;
    margin-bottom: 36px;
}

.page-title {
    margin: 0;
    padding: 0;
    font-size: 30px;
    font-weight: 600;
    letter-spacing: -.02em;
    text-transform: none;
    color: var(--text);
}

.page-subtitle {
    margin: 4px 0 0;
    color: var(--text-on-bg);
}

.status {
    padding: 8px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    color: var(--text-muted);
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    box-shadow: var(--shadow-sm);
}

.section { margin-top: 44px; }

.section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 16px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--text-on-bg);
}

.section-title::after {
    content: "";
    flex: 1;
    height: 1px;
    background: currentColor;
    opacity: .25;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
    gap: 20px;
    align-items: start;
}

/* ---------- Cards ---------- */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 14px 14px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow .2s ease;
}

.card:hover { box-shadow: var(--shadow-md); }

.card h3 {
    margin: 0 0 8px;
    padding: 0 8px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--accent);
}

.card h3:not(:first-child) {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.empty {
    padding: 4px 8px 6px;
    color: var(--text-muted);
    font-size: 13px;
    font-style: italic;
}

/* ---------- Links ---------- */

p { margin: 0; }

a:any-link {
    position: relative;
    display: block;
    padding: 7px 28px 7px 8px;
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
    overflow-wrap: anywhere;
    transition: background .15s ease, color .15s ease;
}

a:any-link::after {
    content: "\2197" / "";
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--accent);
    opacity: 0;
    transition: opacity .15s ease;
}

a:any-link:hover,
a:any-link:focus-visible {
    background: var(--accent-soft);
    color: var(--accent-strong);
}

a:any-link:hover::after,
a:any-link:focus-visible::after { opacity: 1; }

a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

/* ---------- Quick search panel ---------- */

.quick {
    background: linear-gradient(135deg, var(--surface) 0%, var(--surface-alt) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.quick-bottom { margin-top: 44px; }

.quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: 20px 24px;
}

.field-label {
    display: block;
    margin: 0 0 6px 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.field-group {
    display: flex;
    align-items: stretch;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 4px;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.field-group:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--focus);
}

.field-group input[type="text"] {
    flex: 1;
    min-width: 0;
    padding: 8px 14px;
    border: 0;
    background: transparent;
    color: var(--text);
    font: inherit;
    outline: none;
}

.field-group input::placeholder { color: var(--text-muted); opacity: .8; }

.field-group button {
    flex: none;
    padding: 8px 20px;
    border: 0;
    border-radius: var(--radius-pill);
    background: var(--accent);
    color: var(--on-accent);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: background .15s ease, transform .1s ease, box-shadow .15s ease;
}

.field-group button:hover { background: var(--accent-strong); box-shadow: 0 4px 12px var(--focus); }
.field-group button:active { transform: scale(.97); }
.field-group button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Responsive ---------- */

@media (max-width: 640px) {
    .page { padding: 24px 16px 48px; }
    .page-title { font-size: 24px; }
    .quick { padding: 16px; }
    .grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}
