/* StageWrks Global Theme */

:root {
    --bg: #f4f6f8;
    --bg-soft: #eef1f5;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --surface-3: #eef2f7;
    --text: #111827;
    --muted: #667085;
    --muted-2: #8a94a6;
    --line: #d8dee8;
    --line-soft: #e8edf3;
    --accent: #ff6b35;
    --accent-2: #f59e0b;
    --accent-soft: rgba(255,107,53,.12);
    --success: #1D212B;
    --danger: #ef4444;
    --blue: #ff6b35;
    --shadow: 0 18px 40px rgba(16,24,40,.08);
    --radius: 16px;
    --radius-sm: 11px;
}

html[data-theme="dark"] {
    --bg: #0f1115;
    --bg-soft: #11141a;
    --surface: #171a21;
    --surface-2: #1d212b;
    --surface-3: #222734;
    --text: #f3f4f6;
    --muted: #9ca3af;
    --muted-2: #6b7280;
    --line: #2a3040;
    --line-soft: #202633;
    --accent: #ff6b35;
    --accent-2: #f59e0b;
    --accent-soft: rgba(255,107,53,.14);
    --success: #1D212B;
    --danger: #ef4444;
    --blue: #ff6b35;
    --shadow: 0 22px 50px rgba(0,0,0,.28);
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    min-height: 100%;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at 80% 0%, rgba(255,107,53,.11), transparent 32rem),
        linear-gradient(180deg, var(--bg), var(--bg-soft));
    color: var(--text);
}

a {
    color: inherit;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 18px 14px;
    background: color-mix(in srgb, var(--surface) 82%, var(--bg));
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.brand-block {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    padding: 12px 8px 18px;
    border-bottom: 1px solid var(--line);
}

.brand-logo {
    width: 62px;
    height: 62px;
    object-fit: contain;
    border-radius: 16px;
    filter: drop-shadow(0 0 18px rgba(255,107,53,.18));
}

.brand-text {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.brand-text strong {
    font-size: 18px;
    line-height: 1;
    letter-spacing: -.03em;
}

.brand-text span {
    font-size: 12px;
    color: var(--muted);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-nav {
    display: grid;
    gap: 4px;
    overflow-y: auto;
    padding-right: 2px;
}

.nav-details {
    border-radius: 12px;
}

.nav-summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 11px 10px;
    color: var(--text);
    font-weight: 850;
    border-radius: 12px;
}

.nav-summary::-webkit-details-marker {
    display: none;
}

.nav-summary:hover,
.nav-details[open] > .nav-summary {
    background: color-mix(in srgb, var(--surface-2) 76%, transparent);
}

.nav-details[open] .nav-caret {
    transform: rotate(90deg);
}

.nav-caret {
    color: var(--muted);
    transition: transform .16s ease;
}

.nav-submenu {
    display: grid;
    gap: 4px;
    padding: 2px 0 8px 14px;
    border-left: 1px solid var(--line);
    margin-left: 14px;
}

.sidebar-link {
    display: block;
    text-decoration: none;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--muted);
    font-weight: 750;
    font-size: 14px;
}

.sidebar-link:hover {
    color: var(--text);
    background: color-mix(in srgb, var(--surface-2) 82%, transparent);
}

.sidebar-link.active {
    color: var(--text);
    background: var(--accent-soft);
    box-shadow: inset 3px 0 0 var(--accent);
}

.sidebar-footer {
    margin-top: auto;
    border-top: 1px solid var(--line);
    padding-top: 12px;
    display: grid;
    gap: 8px;
}

.theme-toggle,
.user-summary {
    width: 100%;
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--text);
    border-radius: 10px;
    padding: 10px 12px;
    font-weight: 850;
    text-align: left;
    cursor: pointer;
}

.user-summary {
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-summary::-webkit-details-marker {
    display: none;
}

.user-menu {
    margin-top: 6px;
}

.page-main {
    min-width: 0;
    padding: 24px;
}

.card,
.page-hero,
.module,
.panel {
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.card {
    padding: 22px;
    margin-bottom: 18px;
}

.page-hero {
    padding: 26px;
    margin-bottom: 18px;
}

.page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
}

h1, h2, h3 {
    margin-top: 0;
    letter-spacing: -.035em;
}

h1 {
    font-size: clamp(30px, 3vw, 44px);
    margin-bottom: 10px;
}

h2 {
    font-size: 24px;
}

h3 {
    font-size: 20px;
}

p {
    color: var(--muted);
    line-height: 1.55;
}

.section-kicker {
    display: inline-block;
    color: var(--accent);
    font-size: 12px;
    font-weight: 950;
    letter-spacing: .14em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

button,
.btn,
input[type="submit"] {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 10px 15px;
    border-radius: 11px;
    border: 1px solid transparent;
    background: var(--accent);
    color: white;
    font-weight: 900;
    text-decoration: none;
    cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}

button:hover,
.btn:hover,
input[type="submit"]:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 22px rgba(255,107,53,.22);
}

.btn.dark,
button.dark,
.btn.secondary {
    background: var(--surface-2);
    border-color: var(--line);
    color: var(--text);
}

.btn.green,
button.green {
    background: var(--success);
}

.btn.red,
button.red {
    background: var(--danger);
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

label {
    display: block;
    color: var(--text);
    font-weight: 850;
    margin: 12px 0 7px;
}

input,
select,
textarea {
    width: 100%;
    min-height: 42px;
    border-radius: 11px;
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--text);
    padding: 10px 12px;
    outline: none;
    font: inherit;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255,107,53,.15);
}

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

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--surface);
}

th,
td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--line-soft);
    vertical-align: top;
}

th {
    background: color-mix(in srgb, var(--surface-3) 80%, var(--bg));
    color: var(--muted);
    font-size: 12px;
    font-weight: 950;
    letter-spacing: .08em;
    text-transform: uppercase;
}

tr:last-child td {
    border-bottom: 0;
}

tr:hover td {
    background: color-mix(in srgb, var(--surface-2) 54%, transparent);
}

.pill,
.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 6px 10px;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 900;
    font-size: 12px;
}

.notice,
.success {
    border: 1px solid color-mix(in srgb, var(--success) 40%, var(--line));
    background: color-mix(in srgb, var(--success) 12%, var(--surface));
    color: var(--text);
    border-radius: 13px;
    padding: 14px 16px;
    margin-bottom: 16px;
}

.error {
    border: 1px solid color-mix(in srgb, var(--danger) 45%, var(--line));
    background: color-mix(in srgb, var(--danger) 12%, var(--surface));
    color: var(--text);
    border-radius: 13px;
    padding: 14px 16px;
    margin-bottom: 16px;
}

.home-stats,
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.home-stat-card,
.stat-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 16px;
    box-shadow: var(--shadow);
}

.home-stat-number,
.stat-number {
    color: var(--accent);
    font-size: 34px;
    line-height: 1;
    font-weight: 950;
    letter-spacing: -.05em;
}

.home-stat-label,
.stat-label {
    margin-top: 10px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.empty-copy {
    color: var(--muted);
    padding: 18px;
    text-align: center;
}

@media (max-width: 900px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: relative;
        height: auto;
    }

    .page-main {
        padding: 16px;
    }

    .page-head {
        display: grid;
    }
}
