@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;700&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
    --bg: #f3f6fb;
    --bg-soft: #e9eef6;
    --bg-accent: #edf4ff;
    --surface: rgba(255, 255, 255, 0.86);
    --surface-strong: #ffffff;
    --surface-soft: #f8fbff;
    --surface-muted: #f1f5f9;
    --line: #d8e0ea;
    --line-strong: #c5d0de;
    --text: #17253d;
    --text-strong: #0f172a;
    --muted: #62748c;
    --muted-strong: #45556d;
    --accent: #2563eb;
    --accent-strong: #1d4ed8;
    --accent-soft: #dbeafe;
    --accent-soft-strong: #bfdbfe;
    --success: #1f8f5f;
    --success-soft: #dcfce7;
    --warning: #b7791f;
    --warning-soft: #fef3c7;
    --danger: #c24141;
    --danger-soft: #fee2e2;
    --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.05);
    --shadow: 0 22px 60px rgba(15, 23, 42, 0.08);
    --radius-xl: 30px;
    --radius-lg: 24px;
    --radius-md: 18px;
    --radius-sm: 14px;
    --bs-primary: var(--accent);
    --bs-primary-rgb: 37, 99, 235;
    --bs-secondary-color: var(--text);
    --bs-secondary-bg: var(--surface-strong);
    --bs-border-color: var(--line);
    --bs-body-bg: var(--bg);
    --bs-body-color: var(--text);
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html {
    color-scheme: light;
}

body {
    margin: 0;
    min-height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    font-family: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.1), transparent 28%),
        radial-gradient(circle at 88% 14%, rgba(59, 130, 246, 0.08), transparent 24%),
        linear-gradient(180deg, #f7f9fc 0%, #edf2f8 100%);
    background-attachment: scroll;
}

body::before,
body::after {
    content: '';
    position: fixed;
    z-index: -2;
    border-radius: 50%;
    filter: blur(52px);
    opacity: 0.9;
    pointer-events: none;
}

body::before {
    top: -120px;
    left: -120px;
    width: 280px;
    height: 280px;
    background: rgba(37, 99, 235, 0.12);
}

body::after {
    right: -160px;
    bottom: -120px;
    width: 320px;
    height: 320px;
    background: rgba(14, 165, 233, 0.08);
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    border: 0;
}

.page-shell {
    position: relative;
    z-index: 1;
    flex: 1 0 auto;
    width: min(1650px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 40px;
}
.page-shell-admin{
    position: relative;
    z-index: 1;
    flex: 1 0 auto;
    width: min(1650px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 40px;
}
.glass-panel,
.panel {
    border-radius: var(--radius-xl);
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(216, 224, 234, 0.92);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.07);
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--accent-soft);
    border: 1px solid var(--accent-soft-strong);
    color: var(--accent-strong);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.headline {
    font-family: 'Space Grotesk', 'Segoe UI', sans-serif;
    font-weight: 700;
    letter-spacing: -0.04em;
    color: var(--text-strong);
}

.headline strong {
    color: var(--accent-strong);
    font-weight: 700;
}

.muted {
    color: var(--muted);
}

.grid-cards {
    display: grid;
    gap: 16px;
}

.metric-card {
    position: relative;
    overflow: hidden;
    padding: 20px 22px;
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 255, 0.96));
    border: 1px solid rgba(216, 224, 234, 0.96);
    box-shadow: var(--shadow-soft);
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--accent) 0%, #60a5fa 100%);
}

.metric-card span {
    display: block;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.metric-card strong {
    display: block;
    margin-top: 10px;
    color: var(--text-strong);
    font-size: clamp(1.6rem, 2vw, 2.2rem);
    font-family: 'Space Grotesk', 'Segoe UI', sans-serif;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 46px;
    padding: 0 18px;
    border-radius: 14px;
    cursor: pointer;
    transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
    font-weight: 700;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.58;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    color: #ffffff;
    background: linear-gradient(180deg, var(--accent) 0%, var(--accent-strong) 100%);
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.18);
}

.btn-secondary {
    color: var(--text);
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(216, 224, 234, 0.96);
    box-shadow: var(--shadow-soft);
}

.btn-danger {
    color: #ffffff;
    background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 14px 28px rgba(220, 38, 38, 0.16);
}

.btn-warm {
    color: #7a4a11;
    background: #fff3dc;
    border: 1px solid #f8d7a0;
    box-shadow: var(--shadow-soft);
}

.field,
.select-field {
    width: 100%;
    min-height: 50px;
    padding: 0 16px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.96);
    color: var(--text);
    outline: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.textarea-field {
    min-height: 120px;
    padding: 14px 16px;
    resize: vertical;
}

.field:focus,
.select-field:focus {
    border-color: var(--accent);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.field::placeholder,
.textarea-field::placeholder {
    color: #90a0b6;
}

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

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

.tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: 999px;
    background: var(--surface-muted);
    border: 1px solid #dbe3ed;
    color: var(--muted-strong);
    font-size: 0.84rem;
    font-weight: 700;
}

.tag.is-success {
    color: #166534;
    border-color: #bbf7d0;
    background: var(--success-soft);
}

.tag.is-warning {
    color: #92400e;
    border-color: #fde68a;
    background: var(--warning-soft);
}

.tag.is-danger {
    color: #991b1b;
    border-color: #fecaca;
    background: var(--danger-soft);
}

.toast-stack {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    min-width: 280px;
    max-width: min(420px, calc(100vw - 36px));
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(216, 224, 234, 0.96);
    box-shadow: var(--shadow);
    transform: translateY(12px);
    opacity: 0;
    animation: toast-in 0.24s ease forwards;
}

.toast[data-type='success'] {
    border-color: #bbf7d0;
}

.toast[data-type='error'] {
    border-color: #fecaca;
}

.toast[data-type='warning'] {
    border-color: #fde68a;
}

.toast-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-strong);
}

.toast-copy {
    margin-top: 6px;
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.5;
}

.empty-state {
    padding: 44px 20px;
    text-align: center;
    color: var(--muted);
    border-radius: var(--radius-lg);
    border: 1px dashed var(--line-strong);
    background: rgba(255, 255, 255, 0.7);
}

.modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.34);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    z-index: 1500;
    overflow-y: auto;
}

.modal.is-open {
    display: flex;
}

/* Support Bootstrap modal structure inside custom modal */
.modal .modal-dialog {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: min(720px, 100vw - 40px);
    margin: auto;
}

.modal .modal-content {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-height: calc(100vh - 40px);
    border-radius: 28px;
    background: #ffffff;
    border: 1px solid rgba(216, 224, 234, 0.96);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.modal .modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 28px;
    border-bottom: 1px solid rgba(216, 224, 234, 0.5);
    flex-shrink: 0;
}

.modal .modal-header h3 {
    margin: 0;
    font-size: 1.4rem;
}

.modal .modal-body {
    display: grid;
    gap: 14px;
    padding: 28px;
    overflow-y: auto;
    overscroll-behavior: contain;
    flex: 1;
}

.modal .modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 28px;
    border-top: 1px solid rgba(216, 224, 234, 0.5);
    flex-shrink: 0;
    flex-wrap: wrap;
}

.modal-card {
    width: min(720px, 100%);
    max-height: calc(100vh - 40px);
    padding: 28px;
    border-radius: 28px;
    background: #ffffff;
    border: 1px solid rgba(216, 224, 234, 0.96);
    box-shadow: var(--shadow);
    overflow: auto;
    overscroll-behavior: contain;
}

.modal-dialog {
    position: relative;
    width: 100%;
    margin: auto;
    pointer-events: none;
}

.modal-dialog-centered {
    display: flex;
    align-items: center;
    min-height: calc(100% - 40px);
}

.modal-xl {
    max-width: 1140px;
}

.modal-content {
    pointer-events: auto;
}

.modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.modal-head h3 {
    margin: 0;
    font-size: 1.4rem;
}

.modal-grid {
    display: grid;
    gap: 14px;
}

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

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@keyframes toast-in {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .page-shell {
        width: min(100%, calc(100% - 24px));
        padding-top: 18px;
    }
.page-shell-admin {
        width: min(100%, calc(100% - 24px));
        padding-top: 18px;
    }
    .form-row {
        grid-template-columns: 1fr;
    }

    .modal-card {
        max-height: calc(100vh - 24px);
        padding: 20px;
        border-radius: 24px;
    }
}
