:root {
    --glass-bg: rgba(18, 22, 32, 0.72);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-highlight: rgba(99, 179, 237, 0.15);
    --accent: #63b3ed;
    --accent-glow: rgba(99, 179, 237, 0.35);
}

html, body {
    background: radial-gradient(ellipse at 20% 0%, #1a2744 0%, #0d1117 45%, #080b10 100%) fixed;
    min-height: 100vh;
    overflow-x: hidden;
}

.glass-panel {
    background: var(--glass-bg) !important;
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    border: 1px solid var(--glass-border) !important;
    border-radius: 16px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.kpi-card {
    height: 100%;
    min-height: 7.25rem;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kpi-card-value-row {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: auto;
}

.kpi-card-value {
    line-height: 1.1;
}

.kpi-card-subtitle {
    line-height: 1.2;
    white-space: nowrap;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45), 0 0 24px var(--accent-glow);
}

.kpi-card-link {
    display: block;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

.kpi-card-link .kpi-card {
    cursor: pointer;
}

.table-action-group {
    flex-wrap: nowrap;
}

.table-action-group .mud-button-root,
.table-action-group .mud-icon-button {
    min-width: 2rem;
}

.admin-drawer {
    background: rgba(12, 16, 24, 0.92) !important;
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border) !important;
}

.admin-appbar {
    background: rgba(12, 16, 24, 0.85) !important;
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border) !important;
    overflow: visible !important;
}

.admin-appbar .mud-toolbar {
    min-height: 56px;
    overflow: visible;
}

.admin-appbar .notification-menu-badge .mud-badge-wrapper {
    overflow: visible;
}

.admin-appbar .notification-menu-badge {
    margin-right: 0.25rem;
}

.admin-appbar .notification-menu-badge .mud-badge {
    min-width: 1.125rem;
    height: 1.125rem;
    padding: 0 0.3rem;
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 1.125rem;
    color: #fff !important;
    border: 2px solid #0c1018;
}

.admin-main {
    background: transparent !important;
    overflow-x: hidden;
    max-width: 100vw;
}

.admin-main .mud-main-content {
    padding-top: calc(56px + 1.5rem) !important;
    overflow-x: hidden;
    max-width: 100%;
}

.nav-link-active {
    background: var(--glass-highlight) !important;
    border-left: 3px solid var(--accent);
}

.login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.login-card {
    width: 100%;
    max-width: 420px;
}

.login-label {
    display: block;
    font-size: 0.75rem;
    color: #94a3b8;
    margin-bottom: 0.35rem;
}

.login-input {
    width: 100%;
    padding: 0.75rem 0.875rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: #e2e8f0;
    outline: none;
}

.login-input:focus {
    border-color: #63b3ed;
    box-shadow: 0 0 0 2px rgba(99, 179, 237, 0.25);
}

.login-submit {
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #805ad5, #63b3ed);
    color: white;
    font-weight: 600;
    cursor: pointer;
}

.login-submit:hover {
    opacity: 0.92;
}

.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }

.page-header {
    margin-bottom: 1.5rem;
}

.mud-table-root.glass-panel .mud-table-container {
    background: transparent;
}

.feed-item-unread {
    border-left: 3px solid var(--accent);
    background: rgba(99, 179, 237, 0.06);
}

.code-chip {
    font-family: ui-monospace, monospace;
    font-size: 0.75rem;
    padding: 0.15rem 0.45rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.code-chip-copy {
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.code-chip-copy:hover {
    background: rgba(99, 179, 237, 0.12);
    border-color: rgba(99, 179, 237, 0.45);
}

.count-chip-clickable {
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.count-chip-empty {
    min-width: 1.75rem;
    min-height: 1.5rem;
    background: transparent !important;
}

.count-chip-clickable:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 0 1px rgba(99, 179, 237, 0.35);
}

.ios-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 34px;
    height: 18px;
    cursor: pointer;
    vertical-align: middle;
}

.ios-toggle input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
}

.ios-toggle-slider {
    position: absolute;
    inset: 0;
    background: rgba(120, 120, 128, 0.32);
    border-radius: 999px;
    transition: background-color 0.2s ease;
}

.ios-toggle-slider::before {
    content: "";
    position: absolute;
    width: 14px;
    height: 14px;
    left: 2px;
    top: 2px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.28);
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.ios-toggle input:checked + .ios-toggle-slider {
    background: #3182ce;
}

.ios-toggle input:checked + .ios-toggle-slider::before {
    transform: translateX(16px);
    background: #63b3ed;
}

.ios-toggle input:focus-visible + .ios-toggle-slider {
    box-shadow: 0 0 0 2px rgba(99, 179, 237, 0.45);
}

.contract-no-btn {
    min-width: auto;
    padding: 0 0.35rem;
    font-size: 0.7rem;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

/* Dashboard */
.dashboard-hero {
    position: relative;
    overflow: hidden;
    padding: 1.5rem 1.75rem;
    margin-bottom: 1.75rem;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(99, 179, 237, 0.18) 0%, rgba(128, 90, 213, 0.22) 45%, rgba(15, 23, 42, 0.85) 100%);
    border: 1px solid rgba(99, 179, 237, 0.25);
    box-shadow: 0 0 40px rgba(99, 179, 237, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.dashboard-hero::before {
    content: "";
    position: absolute;
    top: -40%;
    right: -10%;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(104, 211, 145, 0.25) 0%, transparent 70%);
    pointer-events: none;
}

.dashboard-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.dashboard-section-title::before {
    content: "";
    width: 4px;
    height: 1.25rem;
    border-radius: 4px;
    background: linear-gradient(180deg, #63b3ed, #805ad5);
    box-shadow: 0 0 12px rgba(99, 179, 237, 0.6);
}

.kpi-accent-blue { border-color: rgba(99, 179, 237, 0.35) !important; box-shadow: 0 4px 24px rgba(99, 179, 237, 0.12), inset 0 1px 0 rgba(255,255,255,0.06); }
.kpi-accent-cyan { border-color: rgba(79, 209, 197, 0.35) !important; box-shadow: 0 4px 24px rgba(79, 209, 197, 0.12), inset 0 1px 0 rgba(255,255,255,0.06); }
.kpi-accent-green { border-color: rgba(104, 211, 145, 0.35) !important; box-shadow: 0 4px 24px rgba(104, 211, 145, 0.12), inset 0 1px 0 rgba(255,255,255,0.06); }
.kpi-accent-amber { border-color: rgba(246, 173, 85, 0.35) !important; box-shadow: 0 4px 24px rgba(246, 173, 85, 0.12), inset 0 1px 0 rgba(255,255,255,0.06); }
.kpi-accent-rose { border-color: rgba(252, 129, 129, 0.35) !important; box-shadow: 0 4px 24px rgba(252, 129, 129, 0.12), inset 0 1px 0 rgba(255,255,255,0.06); }
.kpi-accent-violet { border-color: rgba(183, 148, 244, 0.35) !important; box-shadow: 0 4px 24px rgba(183, 148, 244, 0.12), inset 0 1px 0 rgba(255,255,255,0.06); }

.kpi-icon-blue { color: #63b3ed !important; filter: drop-shadow(0 0 8px rgba(99, 179, 237, 0.6)); }
.kpi-icon-cyan { color: #4fd1c5 !important; filter: drop-shadow(0 0 8px rgba(79, 209, 197, 0.6)); }
.kpi-icon-green { color: #68d391 !important; filter: drop-shadow(0 0 8px rgba(104, 211, 145, 0.6)); }
.kpi-icon-amber { color: #f6ad55 !important; filter: drop-shadow(0 0 8px rgba(246, 173, 85, 0.6)); }
.kpi-icon-rose { color: #fc8181 !important; filter: drop-shadow(0 0 8px rgba(252, 129, 129, 0.6)); }
.kpi-icon-violet { color: #b794f4 !important; filter: drop-shadow(0 0 8px rgba(183, 148, 244, 0.6)); }

.kpi-accent-blue:hover { box-shadow: 0 8px 32px rgba(99, 179, 237, 0.28), 0 0 24px rgba(99, 179, 237, 0.2) !important; }
.kpi-accent-cyan:hover { box-shadow: 0 8px 32px rgba(79, 209, 197, 0.28), 0 0 24px rgba(79, 209, 197, 0.2) !important; }
.kpi-accent-green:hover { box-shadow: 0 8px 32px rgba(104, 211, 145, 0.28), 0 0 24px rgba(104, 211, 145, 0.2) !important; }
.kpi-accent-amber:hover { box-shadow: 0 8px 32px rgba(246, 173, 85, 0.28), 0 0 24px rgba(246, 173, 85, 0.2) !important; }
.kpi-accent-rose:hover { box-shadow: 0 8px 32px rgba(252, 129, 129, 0.28), 0 0 24px rgba(252, 129, 129, 0.2) !important; }
.kpi-accent-violet:hover { box-shadow: 0 8px 32px rgba(183, 148, 244, 0.28), 0 0 24px rgba(183, 148, 244, 0.2) !important; }

.dashboard-chart-panel {
    background: rgba(18, 22, 32, 0.78) !important;
    border-radius: 18px !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.dashboard-chart-panel:hover {
    transform: translateY(-2px);
}

.dashboard-chart-panel.glow-blue { box-shadow: 0 0 32px rgba(99, 179, 237, 0.18); border-color: rgba(99, 179, 237, 0.22) !important; }
.dashboard-chart-panel.glow-green { box-shadow: 0 0 32px rgba(104, 211, 145, 0.18); border-color: rgba(104, 211, 145, 0.22) !important; }
.dashboard-chart-panel.glow-amber { box-shadow: 0 0 32px rgba(246, 173, 85, 0.18); border-color: rgba(246, 173, 85, 0.22) !important; }
.dashboard-chart-panel.glow-rose { box-shadow: 0 0 32px rgba(252, 129, 129, 0.18); border-color: rgba(252, 129, 129, 0.22) !important; }
.dashboard-chart-panel.glow-violet { box-shadow: 0 0 32px rgba(183, 148, 244, 0.18); border-color: rgba(183, 148, 244, 0.22) !important; }
.dashboard-chart-panel.glow-cyan { box-shadow: 0 0 32px rgba(79, 209, 197, 0.18); border-color: rgba(79, 209, 197, 0.22) !important; }

.chart-panel-icon { opacity: 0.85; }
.chart-panel-icon.icon-blue { color: #63b3ed; filter: drop-shadow(0 0 10px rgba(99, 179, 237, 0.5)); }
.chart-panel-icon.icon-green { color: #68d391; filter: drop-shadow(0 0 10px rgba(104, 211, 145, 0.5)); }
.chart-panel-icon.icon-amber { color: #f6ad55; filter: drop-shadow(0 0 10px rgba(246, 173, 85, 0.5)); }
.chart-panel-icon.icon-rose { color: #fc8181; filter: drop-shadow(0 0 10px rgba(252, 129, 129, 0.5)); }
.chart-panel-icon.icon-violet { color: #b794f4; filter: drop-shadow(0 0 10px rgba(183, 148, 244, 0.5)); }
.chart-panel-icon.icon-cyan { color: #4fd1c5; filter: drop-shadow(0 0 10px rgba(79, 209, 197, 0.5)); }

.dashboard-chart-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 220px;
}

.dashboard-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    color: #94a3b8;
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    box-shadow: 0 0 8px currentColor;
}

.dashboard-table-panel {
    border-radius: 18px !important;
    box-shadow: 0 0 24px rgba(99, 179, 237, 0.08);
}

.mb-6 { margin-bottom: 1.5rem; }
.mt-2 { margin-top: 0.5rem; }

.dashboard-tabs {
    margin-top: 0.5rem;
}

.dashboard-tabs.mud-tabs-rounded {
    overflow: hidden;
}

.dashboard-tabs .mud-tabs-tabbar {
    background: rgba(18, 22, 32, 0.6) !important;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px 14px 0 0;
    padding: 0.5rem 0.75rem 0;
    position: relative;
    z-index: 2;
    overflow: hidden;
}

.dashboard-tabs .mud-tabs-tabbar-content {
    overflow: hidden;
}

.dashboard-tabs .mud-tabs-panels {
    position: relative;
    z-index: 1;
}

.dashboard-tabs .mud-tab {
    overflow: hidden;
}

.dashboard-tabs .mud-tab-badge.mud-badge-root {
    position: static;
    flex-shrink: 0;
}

.dashboard-tabs .mud-tab-badge .mud-badge-wrapper {
    position: static;
    width: auto;
    height: auto;
    pointer-events: auto;
}

.dashboard-tabs .mud-tab-badge .mud-badge {
    position: static;
    display: inline-flex;
}

.dashboard-tab-panel {
    background: rgba(18, 22, 32, 0.55) !important;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-top: none;
    border-radius: 0 0 16px 16px;
    padding: 1.25rem !important;
    min-height: 320px;
}

.dashboard-overview-grid {
    margin-bottom: 1.25rem;
}

.dashboard-split-panel {
    overflow: hidden;
}

.dashboard-split-row {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
}

.dashboard-split-col {
    min-width: 0;
}

.dashboard-split-col--chart {
    flex: 0 0 38%;
    max-width: 38%;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.dashboard-split-col--list {
    flex: 1;
}

.dashboard-chart-panel-embedded {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

.dashboard-chart-panel-embedded:hover {
    transform: none;
}

.dashboard-mosaic-panel {
    overflow: hidden;
    border-radius: 18px !important;
}

.dashboard-mosaic-row {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.dashboard-mosaic-row:last-child {
    border-bottom: none;
}

.dashboard-mosaic-col {
    flex: 1 1 33.333%;
    min-width: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.dashboard-mosaic-col:last-child {
    border-right: none;
}

.dashboard-mosaic-col--narrow {
    flex: 0 0 33.333%;
    max-width: 33.333%;
}

.dashboard-mosaic-col--wide {
    flex: 1;
}

@media (max-width: 960px) {
    .dashboard-mosaic-col,
    .dashboard-mosaic-col--narrow,
    .dashboard-mosaic-col--wide {
        flex: 0 0 100%;
        max-width: 100%;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .dashboard-mosaic-col:last-child,
    .dashboard-mosaic-col--wide:last-child {
        border-bottom: none;
    }

    .dashboard-mosaic-row:last-child .dashboard-mosaic-col:last-child {
        border-bottom: none;
    }
}

@media (max-width: 960px) {
    .dashboard-split-col--chart,
    .dashboard-split-col--list {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .dashboard-split-col--chart {
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }
}
