:root {
    --bg-soft: #f5f5f3;
    --bg-paper: #ffffff;
    --ink: #121212;
    --ink-muted: #626262;
    --brand: #ff6a00;
    --brand-dark: #d75a02;
    --accent: #ff6a00;
    --line: #e7e7e2;
    --card-shadow: 0 12px 28px rgba(18, 18, 18, 0.08);
    --nav-bg: rgba(255, 255, 255, 0.82);
    --focus-ring: rgba(255, 106, 0, 0.2);
}

html[data-theme="dark"] {
    --bg-soft: #101010;
    --bg-paper: #171717;
    --ink: #ffffff;
    --ink-muted: #bbbbbb;
    --brand: #ff6a00;
    --brand-dark: #ff812f;
    --accent: #ff6a00;
    --line: #2b2b2b;
    --card-shadow: 0 14px 32px rgba(0, 0, 0, 0.35);
    --nav-bg: rgba(16, 16, 16, 0.78);
    --focus-ring: rgba(255, 106, 0, 0.28);
}

html, body {
    min-height: 100%;
}

body {
    font-family: "Space Grotesk", "Segoe UI", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at 10% -20%, rgba(255, 106, 0, 0.09) 0%, transparent 42%),
        radial-gradient(circle at 95% 15%, rgba(255, 255, 255, 0.4) 0%, transparent 45%),
        linear-gradient(160deg, var(--bg-soft), var(--bg-soft));
}

html[data-theme="dark"] body {
    background:
        radial-gradient(circle at 10% -20%, rgba(255, 106, 0, 0.18) 0%, transparent 42%),
        radial-gradient(circle at 95% 15%, rgba(255, 255, 255, 0.03) 0%, transparent 45%),
        linear-gradient(160deg, #101010, #101010);
}

.page-shell {
    min-height: 100vh;
}

.fade-in {
    animation: fadeIn 380ms ease-out both;
}

.stagger-1 {
    animation-delay: 40ms;
}

.stagger-2 {
    animation-delay: 90ms;
}

.stagger-3 {
    animation-delay: 140ms;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.app-navbar {
    backdrop-filter: blur(8px);
    background: var(--nav-bg);
    border-bottom: 1px solid var(--line);
}

.navbar-brand {
    letter-spacing: 0.02em;
}

.brand-logo {
    height: 42px;
    width: auto;
    display: block;
}

.brand-logo-dark {
    display: none;
}

html[data-theme="dark"] .brand-logo-light {
    display: none;
}

html[data-theme="dark"] .brand-logo-dark {
    display: block;
}

.brand-dot {
    width: 10px;
    height: 10px;
    background: var(--accent);
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
}

.nav-link {
    color: var(--ink-muted);
    font-weight: 600;
}

.nav-link:hover {
    color: var(--brand);
}

.theme-toggle {
    border: 1px solid var(--line);
    background: transparent;
    color: var(--ink);
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    font-weight: 600;
}

.theme-toggle:hover {
    border-color: var(--brand);
    color: var(--brand);
}

.page-title {
    font-size: clamp(1.5rem, 2.2vw, 2rem);
    font-weight: 700;
    margin-bottom: 1rem;
}

.surface-card {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--bg-paper);
    box-shadow: var(--card-shadow);
}

.metric-card {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: linear-gradient(180deg, var(--bg-paper) 0%, rgba(255, 106, 0, 0.03) 100%);
    padding: 1.1rem;
    box-shadow: var(--card-shadow);
    transition: transform 200ms ease, box-shadow 200ms ease;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.12);
}

.metric-label {
    color: var(--ink-muted);
    font-size: 0.86rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.3rem;
}

.metric-value {
    font-weight: 700;
    font-size: 2rem;
    margin: 0;
}

.table-modern {
    margin: 0;
}

.table-modern thead th {
    border-bottom: 1px solid var(--line);
    color: var(--ink-muted);
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-weight: 700;
}

.table-modern tbody td {
    border-color: var(--line);
    vertical-align: middle;
}

.action-stack {
    display: inline-flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    justify-content: end;
}

.row-actions-toggle {
    min-width: 2rem;
    letter-spacing: 0.05em;
    font-weight: 700;
    padding-left: 0.45rem;
    padding-right: 0.45rem;
}

.row-actions-menu {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--bg-paper);
    box-shadow: var(--card-shadow);
}

.row-actions-menu .dropdown-item {
    color: var(--ink);
    font-weight: 500;
}

.row-actions-menu .dropdown-item:hover {
    background: rgba(255, 106, 0, 0.08);
}

.btn-brand {
    background: var(--brand);
    border: 1px solid var(--brand);
    color: #ffffff;
    font-weight: 600;
}

.btn-brand:hover {
    background: var(--brand-dark);
    border-color: var(--brand-dark);
    color: #fff;
}

.form-label {
    font-weight: 600;
    color: var(--ink);
}

.form-control,
.form-select {
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--bg-paper);
    color: var(--ink);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 0.2rem var(--focus-ring);
}

.panel-check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
    padding: 10px;
    border: 1px dashed var(--line);
    border-radius: 12px;
    background: var(--bg-paper);
}

.panel-check-grid .form-check {
    margin: 0;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    padding: 1.2rem 0.4rem;
    color: var(--ink-muted);
}

.empty-state svg {
    width: 30px;
    height: 30px;
    opacity: 0.7;
    color: var(--brand);
}

.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--ink);
}

.text-muted,
.text-secondary {
    color: var(--ink-muted) !important;
}

@media (max-width: 768px) {
    .surface-card {
        border-radius: 14px;
    }

    .metric-value {
        font-size: 1.55rem;
    }
}
