:root {
    --ui-canvas: #f4f7fb;
    --ui-surface: #ffffff;
    --ui-surface-alt: #eef3f8;
    --ui-surface-dark: #172033;
    --ui-border: #dbe3ec;
    --ui-border-strong: #c7d2de;
    --ui-text: #172033;
    --ui-muted: #667085;
    --ui-primary: #2563eb;
    --ui-primary-soft: #dbeafe;
    --ui-success: #12b76a;
    --ui-success-soft: #dcfae6;
    --ui-warning: #f79009;
    --ui-warning-soft: #fef0c7;
    --ui-danger: #f04438;
    --ui-danger-soft: #fee4e2;
    --ui-radius-sm: 12px;
    --ui-radius-md: 18px;
    --ui-radius-lg: 24px;
    --ui-radius-xl: 32px;
    --ui-shadow-sm: 0 10px 30px rgba(15, 23, 42, 0.06);
    --ui-shadow-md: 0 18px 48px rgba(15, 23, 42, 0.08);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    min-height: 100%;
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.08), transparent 20%),
        radial-gradient(circle at top right, rgba(18, 183, 106, 0.05), transparent 18%),
        linear-gradient(180deg, #f8fafc 0%, var(--ui-canvas) 100%);
    background-color: var(--ui-canvas);
    overscroll-behavior-y: none;
}

html.theme-dark {
    --ui-canvas: #0b1220;
    --ui-surface: #101828;
    --ui-surface-alt: #172033;
    --ui-surface-dark: #08101f;
    --ui-border: #243041;
    --ui-border-strong: #344054;
    --ui-text: #e5edf8;
    --ui-muted: #98a2b3;
    --ui-primary-soft: rgba(37, 99, 235, 0.18);
    --ui-success-soft: rgba(18, 183, 106, 0.18);
    --ui-warning-soft: rgba(247, 144, 9, 0.18);
    --ui-danger-soft: rgba(240, 68, 56, 0.18);
    --ui-shadow-sm: 0 12px 34px rgba(2, 6, 23, 0.38);
    --ui-shadow-md: 0 20px 54px rgba(2, 6, 23, 0.42);
}

body {
    margin: 0;
    min-height: 100%;
    font-family: "Plus Jakarta Sans", sans-serif;
    color: var(--ui-text);
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.08), transparent 20%),
        radial-gradient(circle at top right, rgba(18, 183, 106, 0.05), transparent 18%),
        linear-gradient(180deg, #f8fafc 0%, var(--ui-canvas) 100%);
    background-color: var(--ui-canvas);
    overscroll-behavior-y: none;
    overflow-x: hidden;
}

::selection {
    background: rgba(37, 99, 235, 0.18);
}

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

.btn {
    border-radius: 14px;
    font-weight: 700;
    padding: 0.78rem 1rem;
    letter-spacing: -0.01em;
}

.btn-lg {
    padding: 0.92rem 1.25rem;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-color: transparent;
    box-shadow: 0 12px 20px rgba(37, 99, 235, 0.18);
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(135deg, #2f74ef 0%, #1d4fd8 100%);
}

.btn-light,
.btn-outline-secondary,
.btn-outline-light {
    border-color: var(--ui-border);
}

.form-label {
    margin-bottom: 8px;
    font-weight: 700;
    color: var(--ui-text);
}

.form-control,
.form-select,
.input-group-text {
    min-height: 52px;
    border-radius: 14px;
    border-color: var(--ui-border);
    box-shadow: none;
}

.form-control,
.form-select {
    padding: 0.85rem 1rem;
}

.input-group-text {
    padding: 0 1rem;
    color: var(--ui-muted);
    background: #f8fafc;
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    border-color: rgba(37, 99, 235, 0.45);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

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

.ui-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.08);
    color: var(--ui-primary);
    font-size: 0.82rem;
    font-weight: 700;
}

.ui-icon {
    width: 48px;
    height: 48px;
    display: inline-grid;
    place-items: center;
    border-radius: 16px;
    background: var(--ui-surface-alt);
    color: var(--ui-text);
    font-size: 1.1rem;
}

.ui-icon.primary {
    background: var(--ui-primary-soft);
    color: var(--ui-primary);
}

.ui-icon.success {
    background: var(--ui-success-soft);
    color: #067647;
}

.ui-icon.warning {
    background: var(--ui-warning-soft);
    color: #b54708;
}

.brand-mark {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    color: #fff;
    background: linear-gradient(135deg, #60a5fa 0%, #2563eb 100%);
    box-shadow: 0 14px 24px rgba(37, 99, 235, 0.28);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.8rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
}

.status-primary {
    background: var(--ui-primary-soft);
    color: var(--ui-primary);
}

.status-success {
    background: var(--ui-success-soft);
    color: #067647;
}

.status-warning {
    background: var(--ui-warning-soft);
    color: #b54708;
}

.status-danger {
    background: var(--ui-danger-soft);
    color: #b42318;
}

.alert-danger-soft {
    border: 1px solid #fecdca;
    background: #fef3f2;
    color: #b42318;
    border-radius: 18px;
    padding: 14px 16px;
}

.auth-body {
    min-height: 100vh;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    padding: 28px;
    gap: 24px;
}

.auth-panel {
    border-radius: var(--ui-radius-xl);
    overflow: hidden;
}

.auth-panel-brand {
    padding: 42px;
    color: #fff;
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.14), transparent 25%),
        linear-gradient(135deg, #172033 0%, #1e293b 46%, #2563eb 100%);
    box-shadow: var(--ui-shadow-md);
}

.auth-panel-brand h1 {
    margin: 18px 0 14px;
    font-size: clamp(2.3rem, 4vw, 4rem);
    line-height: 1.02;
    letter-spacing: -0.05em;
}

.auth-panel-brand p {
    max-width: 620px;
    color: rgba(255, 255, 255, 0.74);
    line-height: 1.8;
}

.auth-feature-list {
    display: grid;
    gap: 16px;
    margin-top: 40px;
}

.auth-feature-item {
    display: flex;
    gap: 14px;
    align-items: start;
    padding: 16px 18px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
}

.auth-feature-item strong {
    display: block;
    margin-bottom: 4px;
}

.auth-panel-form {
    display: grid;
    place-items: center;
    padding: 24px;
}

.auth-card {
    width: 100%;
    max-width: 520px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(219, 227, 236, 0.85);
    border-radius: 28px;
    box-shadow: var(--ui-shadow-md);
    padding: 30px;
}

.auth-card-head {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.auth-card-head h2 {
    margin: 0 0 6px;
    font-size: 1.65rem;
    letter-spacing: -0.03em;
}

.auth-card-head p {
    margin: 0;
    color: var(--ui-muted);
}

.demo-credentials {
    margin-top: 22px;
    padding: 16px;
    border-radius: 18px;
    background: #f8fafc;
    border: 1px solid var(--ui-border);
    color: var(--ui-muted);
}

.demo-credentials-label {
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ui-text);
    margin-bottom: 8px;
}

.panel-body {
    min-height: 100vh;
}

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

html.sidebar-compact-init .app-layout {
    grid-template-columns: 94px minmax(0, 1fr);
}

.app-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 24px;
    display: flex;
    flex-direction: column;
    background: rgba(23, 32, 51, 0.98);
    color: #fff;
    box-shadow: var(--ui-shadow-md);
    z-index: 20;
    overflow: hidden;
}

.app-sidebar::before {
    content: "";
    position: absolute;
    inset: -10% auto auto -20%;
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, rgba(96, 165, 250, 0.22) 0%, transparent 72%);
    pointer-events: none;
}

.app-sidebar::after {
    content: "";
    position: absolute;
    inset: auto -70px 80px auto;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 72%);
    pointer-events: none;
}

.sidebar-brand {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
}

.sidebar-brand-copy {
    min-width: 0;
}

.sidebar-brand h1 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
}

.sidebar-brand p {
    margin: 4px 0 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.86rem;
}

.sidebar-nav {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 8px;
}

.sidebar-link {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    color: rgba(255, 255, 255, 0.78);
    transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.sidebar-link-icon {
    width: 20px;
    min-width: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-link i {
    text-align: center;
    font-size: 1rem;
}

.sidebar-link-label {
    flex: 1 1 auto;
    min-width: 0;
}

.sidebar-link-meta {
    flex: 0 0 auto;
    padding: 0.28rem 0.45rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.sidebar-link:hover,
.sidebar-link.is-active {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(2px);
}

.sidebar-link.is-active::before {
    content: "";
    position: absolute;
    left: -8px;
    top: 10px;
    bottom: 10px;
    width: 3px;
    border-radius: 999px;
    background: linear-gradient(180deg, #93c5fd 0%, #2563eb 100%);
    box-shadow: 0 0 16px rgba(96, 165, 250, 0.45);
}

.sidebar-footer {
    margin-top: auto;
    position: relative;
    z-index: 1;
}

.sidebar-compact-toggle {
    margin-left: auto;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    transition: 0.2s ease;
}

.sidebar-compact-toggle:hover {
    background: rgba(255, 255, 255, 0.14);
}

.sidebar-close-toggle {
    margin-left: auto;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.sidebar-logout-btn {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
}

.sidebar-insight {
    position: relative;
    z-index: 1;
    margin-top: 20px;
    padding: 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-insight-kicker {
    display: inline-flex;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.66);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.sidebar-insight strong {
    display: block;
    margin-bottom: 6px;
}

.sidebar-insight p {
    margin: 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.88rem;
    line-height: 1.65;
}

.app-layout.is-sidebar-compact {
    grid-template-columns: 94px minmax(0, 1fr);
}

.app-layout.is-sidebar-compact .app-sidebar {
    padding: 20px 14px;
}

.app-layout.is-sidebar-compact .sidebar-brand {
    justify-content: center;
    margin-bottom: 22px;
}

.app-layout.is-sidebar-compact .sidebar-brand-copy,
.app-layout.is-sidebar-compact .sidebar-link-label,
.app-layout.is-sidebar-compact .sidebar-link-meta,
.app-layout.is-sidebar-compact .sidebar-insight {
    display: none;
}

.app-layout.is-sidebar-compact .sidebar-compact-toggle {
    margin-left: 0;
}

.app-layout.is-sidebar-compact .sidebar-nav {
    justify-items: center;
}

.app-layout.is-sidebar-compact .sidebar-link {
    width: 56px;
    height: 56px;
    justify-content: center;
    padding: 0;
}

.app-layout.is-sidebar-compact .sidebar-footer {
    display: flex;
    justify-content: center;
}

.app-layout.is-sidebar-compact .sidebar-logout-btn {
    width: 56px !important;
    height: 56px;
    padding: 0;
}

.app-layout.is-sidebar-compact .sidebar-logout-btn .sidebar-link-label {
    display: none;
}

.app-layout.is-sidebar-compact .sidebar-compact-toggle i {
    transform: rotate(180deg);
}

.app-main {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    padding: 24px;
}

.app-sidebar-overlay {
    display: none;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    padding: 18px 22px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(219, 227, 236, 0.85);
    border-radius: 24px;
    box-shadow: var(--ui-shadow-sm);
    width: 100%;
    max-width: 100%;
    backdrop-filter: blur(16px);
}

.topbar-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.topbar-status-dot {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.3rem 0.6rem;
    border-radius: 999px;
    background: rgba(18, 183, 106, 0.1);
    color: #067647;
    font-size: 0.74rem;
    font-weight: 700;
}

.topbar-status-dot::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #12b76a;
    box-shadow: 0 0 0 6px rgba(18, 183, 106, 0.14);
}

.topbar-tools {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-tool {
    width: 46px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--ui-border);
    border-radius: 14px;
    background: #fff;
    color: var(--ui-text);
    transition: 0.2s ease;
}

.topbar-tool:hover {
    background: #f8fafc;
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}

.topbar-search {
    align-items: center;
    gap: 12px;
    min-width: 280px;
    padding: 0 16px;
    background: #f8fafc;
    border: 1px solid var(--ui-border);
    border-radius: 14px;
}

.topbar-search input {
    width: 100%;
    border: 0;
    background: transparent;
    min-height: 48px;
    outline: none;
    color: var(--ui-text);
}

.topbar-main,
.topbar-actions {
    min-width: 0;
    max-width: 100%;
}

.topbar-search input::placeholder {
    color: var(--ui-muted);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border: 1px solid var(--ui-border);
    background: #fff;
    border-radius: 16px;
    transition: 0.2s ease;
}

.user-menu:hover {
    background: #f8fafc;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.user-avatar {
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(135deg, #bfdbfe 0%, #dbeafe 100%);
    color: var(--ui-primary);
    font-size: 0.9rem;
    font-weight: 800;
}

.user-avatar.small {
    width: 38px;
    height: 38px;
    font-size: 0.82rem;
}

.user-menu small {
    display: block;
    color: var(--ui-muted);
}

.content-area {
    display: grid;
    gap: 24px;
    min-width: 0;
    width: 100%;
    max-width: 100%;
}

.hero-card,
.panel-card,
.components-shell,
.component-block {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(219, 227, 236, 0.85);
    border-radius: 28px;
    box-shadow: var(--ui-shadow-sm);
}

html.theme-dark body {
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.14), transparent 20%),
        radial-gradient(circle at top right, rgba(18, 183, 106, 0.08), transparent 18%),
        linear-gradient(180deg, #08101f 0%, var(--ui-canvas) 100%);
}

html.theme-dark {
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.14), transparent 20%),
        radial-gradient(circle at top right, rgba(18, 183, 106, 0.08), transparent 18%),
        linear-gradient(180deg, #08101f 0%, var(--ui-canvas) 100%);
    background-color: var(--ui-canvas);
}

html.theme-dark .btn-light,
html.theme-dark .btn-outline-secondary,
html.theme-dark .btn-outline-light,
html.theme-dark .topbar-tool,
html.theme-dark .user-menu,
html.theme-dark .topbar-search,
html.theme-dark .form-control,
html.theme-dark .form-select,
html.theme-dark .input-group-text,
html.theme-dark .quick-action,
html.theme-dark .showcase-card,
html.theme-dark .table-responsive,
html.theme-dark .table thead th,
html.theme-dark .table tbody td,
html.theme-dark .demo-credentials {
    background-color: #101828;
    color: var(--ui-text);
    border-color: var(--ui-border);
}

html.theme-dark .topbar,
html.theme-dark .hero-card,
html.theme-dark .panel-card,
html.theme-dark .components-shell,
html.theme-dark .component-block,
html.theme-dark .auth-card {
    background: rgba(16, 24, 40, 0.92);
    border-color: rgba(36, 48, 65, 0.9);
}

html.theme-dark .table thead th {
    background: #172033;
    color: #c8d3e0;
}

html.theme-dark .table tbody td,
html.theme-dark .table tbody tr,
html.theme-dark .panel-table {
    border-color: #243041;
}

html.theme-dark .topbar-tool:hover,
html.theme-dark .btn-light:hover,
html.theme-dark .btn-outline-secondary:hover {
    background: #172033;
}

html.theme-dark .topbar-search input,
html.theme-dark .form-control,
html.theme-dark .form-select {
    color: var(--ui-text);
}

html.theme-dark .dropdown-menu {
    background: #101828;
    border-color: var(--ui-border);
}

html.theme-dark .dropdown-item {
    color: var(--ui-text);
}

html.theme-dark .dropdown-item:hover {
    background: #172033;
}

html.theme-dark .sidebar-link-meta,
html.theme-dark .hero-metric {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(36, 48, 65, 0.9);
    color: #c8d3e0;
}

html.theme-dark .topbar-status-dot {
    background: rgba(18, 183, 106, 0.14);
    color: #6ce9ad;
}

html.theme-dark .table tbody tr:hover {
    background: rgba(37, 99, 235, 0.08);
}

html.theme-dark .ui-helper,
html.theme-dark .user-menu small,
html.theme-dark .table-user small,
html.theme-dark .section-head p,
html.theme-dark .hero-card p,
html.theme-dark .demo-credentials {
    color: var(--ui-muted);
}

html.theme-dark .user-avatar {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.22) 0%, rgba(37, 99, 235, 0.26) 100%);
    color: #bfdbfe;
}

.hero-card {
    position: relative;
    overflow: hidden;
    padding: 30px;
    min-width: 0;
    width: 100%;
    max-width: 100%;
}

.hero-card::before {
    content: "";
    position: absolute;
    inset: -20% -10% auto auto;
    width: 340px;
    height: 340px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.12) 0%, transparent 68%);
    pointer-events: none;
}

.hero-card::after {
    content: "";
    position: absolute;
    inset: auto auto -120px -120px;
    width: 260px;
    height: 260px;
    background: radial-gradient(circle, rgba(18, 183, 106, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
    gap: 24px;
    margin-top: 18px;
    min-width: 0;
    width: 100%;
}

.hero-card h2 {
    margin: 0 0 12px;
    font-size: clamp(2rem, 3vw, 3rem);
    line-height: 1.04;
    letter-spacing: -0.04em;
}

.hero-card p {
    color: var(--ui-muted);
    line-height: 1.8;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 22px;
}

.hero-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.hero-metric {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0.65rem 0.85rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(219, 227, 236, 0.85);
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--ui-muted);
}

.hero-metric strong {
    color: var(--ui-text);
}

.hero-mini-card {
    padding: 22px;
    border-radius: 24px;
    background: linear-gradient(135deg, #172033 0%, #243247 100%);
    color: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.hero-mini-card strong {
    display: block;
    font-size: 1.6rem;
    letter-spacing: -0.03em;
}

.hero-mini-card .ui-helper {
    color: rgba(255, 255, 255, 0.72);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    min-width: 0;
    width: 100%;
}

.panel-card {
    position: relative;
    padding: 22px;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.panel-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
    border-color: rgba(191, 213, 255, 0.9);
}

.card-accent-line {
    position: absolute;
    top: 0;
    left: 22px;
    right: 22px;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(147, 197, 253, 0.18) 0%, rgba(37, 99, 235, 0.95) 48%, rgba(147, 197, 253, 0.18) 100%);
}

.stat-card strong {
    display: block;
    margin-top: 8px;
    font-size: 2rem;
    letter-spacing: -0.04em;
}

.stat-card p {
    margin: 8px 0 0;
    color: var(--ui-muted);
}

.stat-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
    gap: 18px;
    min-width: 0;
    width: 100%;
}

.content-side {
    display: grid;
    gap: 18px;
    min-width: 0;
}

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

.section-head h3 {
    margin: 0;
    font-size: 1.2rem;
    letter-spacing: -0.03em;
}

.section-head p {
    margin: 6px 0 0;
    color: var(--ui-muted);
}

.panel-table {
    border: 1px solid var(--ui-border);
    border-radius: 20px;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
}

.table-responsive {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
}

.table thead th {
    background: #f8fafc;
    color: var(--ui-muted);
    border-bottom-color: var(--ui-border);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 1rem 1.1rem;
}

.table tbody td {
    padding: 1rem 1.1rem;
    border-bottom-color: #edf2f7;
}

.table tbody tr {
    transition: background 0.2s ease;
}

.table tbody tr:hover {
    background: rgba(37, 99, 235, 0.03);
}

.table-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.table-user small {
    display: block;
    color: var(--ui-muted);
}

.quick-actions {
    display: grid;
    gap: 12px;
    min-width: 0;
}

.quick-action {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border-radius: 18px;
    border: 1px solid var(--ui-border);
    background: #fff;
    transition: 0.2s ease;
}

.quick-action:hover {
    transform: translateY(-1px);
    box-shadow: var(--ui-shadow-sm);
    border-color: rgba(191, 213, 255, 0.95);
}

.quick-action strong {
    display: block;
    margin-bottom: 3px;
}

.quick-action small {
    color: var(--ui-muted);
}

.starter-notes {
    margin: 0;
    padding-left: 18px;
    color: var(--ui-muted);
    display: grid;
    gap: 10px;
}

.components-page {
    padding: 24px;
}

.components-layout {
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
    gap: 24px;
}

.components-sidebar {
    position: sticky;
    top: 24px;
    align-self: start;
    padding: 22px;
    background: rgba(23, 32, 51, 0.98);
    border-radius: 28px;
    color: #fff;
    box-shadow: var(--ui-shadow-md);
}

.components-sidebar h2 {
    margin: 18px 0 6px;
    font-size: 1rem;
}

.components-sidebar p {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.88rem;
}

.component-nav {
    display: grid;
    gap: 8px;
    margin-top: 18px;
}

.component-link {
    padding: 11px 13px;
    border-radius: 14px;
    color: rgba(255, 255, 255, 0.76);
}

.component-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.components-shell {
    padding: 28px;
}

.components-hero {
    padding: 30px;
    border-radius: 30px;
    border: 1px solid rgba(219, 227, 236, 0.8);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.96) 0%, rgba(241, 245, 249, 0.96) 100%);
    margin-bottom: 24px;
}

.components-hero h1 {
    margin: 16px 0 12px;
    font-size: clamp(2rem, 4vw, 3.2rem);
    line-height: 1.02;
    letter-spacing: -0.05em;
}

.components-hero p {
    max-width: 760px;
    color: var(--ui-muted);
    line-height: 1.8;
}

.component-block {
    padding: 24px;
    margin-bottom: 20px;
}

.component-head {
    margin-bottom: 18px;
}

.component-head h3 {
    margin: 0;
    font-size: 1.25rem;
    letter-spacing: -0.03em;
}

.component-head p {
    margin: 8px 0 0;
    color: var(--ui-muted);
}

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

.component-grid.cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.component-grid.cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.component-grid.cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.showcase-card {
    height: 100%;
    padding: 20px;
    border-radius: 22px;
    border: 1px solid var(--ui-border);
    background: linear-gradient(180deg, #ffffff 0%, #f9fbfd 100%);
}

.color-swatch {
    height: 86px;
    border-radius: 18px;
    margin-bottom: 14px;
}

.badge-soft {
    display: inline-flex;
    align-items: center;
    padding: 0.56rem 0.8rem;
    border-radius: 999px;
    font-weight: 700;
}

.badge-soft.primary {
    background: var(--ui-primary-soft);
    color: var(--ui-primary);
}

.badge-soft.success {
    background: var(--ui-success-soft);
    color: #067647;
}

.badge-soft.warning {
    background: var(--ui-warning-soft);
    color: #b54708;
}

.badge-soft.danger {
    background: var(--ui-danger-soft);
    color: #b42318;
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px;
    border-radius: 20px;
    border: 1px solid var(--ui-border);
    background: #f8fafc;
}

.filter-chip {
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid var(--ui-border);
    background: #fff;
    color: var(--ui-muted);
    font-weight: 600;
}

.filter-chip.active {
    background: var(--ui-primary-soft);
    color: var(--ui-primary);
    border-color: #bfd5ff;
}

.empty-state {
    padding: 34px 22px;
    text-align: center;
    border: 1px dashed var(--ui-border-strong);
    border-radius: 22px;
    background: linear-gradient(180deg, #ffffff 0%, #f9fbfd 100%);
}

.upload-box {
    position: relative;
    padding: 24px;
    text-align: center;
    border: 1px dashed var(--ui-border-strong);
    border-radius: 22px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.upload-box input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.mini-list {
    display: grid;
    gap: 12px;
}

.mini-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px;
    border-radius: 18px;
    border: 1px solid var(--ui-border);
    background: #fff;
}

@media (max-width: 1199.98px) {
    .auth-shell,
    .app-layout,
    .components-layout,
    .hero-grid,
    .content-grid {
        grid-template-columns: 1fr;
    }

    .app-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
        width: 100vw;
        max-width: 100vw;
        transition: transform 0.25s ease;
        z-index: 40;
        overflow-y: auto;
        padding: 24px 20px 20px;
        border-radius: 0;
    }

    .app-sidebar.is-open {
        transform: translateX(0);
    }

    .app-sidebar-overlay {
        position: fixed;
        inset: 0;
        display: block;
        background: rgba(8, 16, 31, 0.44);
        backdrop-filter: blur(2px);
        opacity: 0;
        visibility: hidden;
        transition: 0.22s ease;
        z-index: 30;
    }

    .app-sidebar-overlay.is-visible {
        opacity: 1;
        visibility: visible;
    }

    body.sidebar-mobile-open {
        overflow: hidden;
    }

    .app-main {
        padding-top: 18px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .app-layout.is-sidebar-compact {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767.98px) {
    .auth-shell,
    .components-page {
        padding: 16px;
    }

    .app-main {
        padding: 0 0 20px;
    }

    .auth-panel-brand,
    .auth-card,
    .hero-card,
    .panel-card,
    .components-shell,
    .component-block,
    .components-sidebar {
        padding: 20px;
        border-radius: 24px;
    }

    .stats-grid,
    .component-grid.cols-2,
    .component-grid.cols-3,
    .component-grid.cols-4 {
        grid-template-columns: 1fr;
    }

    .topbar {
        margin: 0 0 16px;
        padding: 16px;
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
        width: 100%;
        border-radius: 0;
        border-left: 0;
        border-right: 0;
        border-top: 0;
    }

    .topbar-main,
    .topbar-actions {
        width: 100%;
        justify-content: space-between;
    }

    .topbar-main {
        align-items: center !important;
    }

    .topbar-main > div:first-child {
        min-width: 0;
        flex: 1 1 auto;
    }

    .topbar-actions {
        gap: 12px;
        flex-wrap: nowrap;
        align-items: center !important;
        justify-content: flex-end;
    }

    .topbar-tools {
        margin-left: 0;
        flex: 0 0 auto;
        gap: 8px;
    }

    .user-menu {
        width: auto;
        min-width: 0;
        max-width: calc(100vw - 120px);
        justify-content: space-between;
        padding: 6px 10px;
        gap: 10px;
    }

    .topbar-actions .dropdown {
        width: auto;
        min-width: 0;
        flex: 1 1 auto;
        display: flex;
        justify-content: flex-end;
    }

    .user-menu .text-start {
        min-width: 0;
        flex: 1 1 auto;
    }

    .user-menu .text-start strong,
    .user-menu .text-start small {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .user-menu .text-start small {
        display: none;
    }

    .user-menu .text-start strong {
        max-width: 112px;
    }

    .topbar-tool-fullscreen {
        display: none !important;
    }

    .content-area {
        padding: 0 16px;
        overflow-x: hidden;
    }

    .app-sidebar {
        padding: 18px 16px 16px;
    }

    .sidebar-close-toggle {
        flex: 0 0 auto;
    }

    .sidebar-brand {
        margin-bottom: 22px;
    }

    .sidebar-link {
        justify-content: space-between;
    }

    .sidebar-link-label {
        flex: 1 1 auto;
        text-align: left;
    }

    .sidebar-link-icon {
        order: 2;
    }

    .sidebar-link-meta {
        display: none;
    }

    .sidebar-logout-btn {
        width: 100% !important;
        justify-content: space-between;
    }

    .sidebar-logout-btn .sidebar-link-icon {
        order: 2;
    }

    .hero-actions {
        flex-direction: column;
    }

    .hero-metrics {
        gap: 8px;
    }
}
