@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #0084ff;
    --primary-hover: #0062cc;
    --success-color: #16a34a;
    --success-hover: #15803d;
    --danger-color: #dc2626;
    --danger-hover: #b91c1c;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --bg-main: #f3f4f6;
    --bg-card: #ffffff;
    --border-color: #e5e7eb;
    --radius: 8px;
    --transition: all 0.3s ease;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-main);
    font-weight: 600;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: var(--transition);
}

a:hover {
    color: var(--primary-hover);
}

/* Layout */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

header.app-header {
    background-color: var(--primary-color);
    border-bottom: 1px solid var(--primary-hover);
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-sm);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 4rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
}

.brand i {
    font-size: 1.5rem;
}

.brand-logo {
    height: 32px;
    width: auto;
    object-fit: contain;
}

.brand-text {
    display: none;
}

@media (min-width: 640px) {
    .brand-text {
        display: inline;
    }
}

.shift-badge {
    background-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
}

main {
    padding: 2rem 0;
}

header.app-header .btn-outline {
    border-color: rgba(255, 255, 255, 0.4);
    color: #ffffff;
}

header.app-header .btn-outline:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: #ffffff;
}

/* Login Page Specifics */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.login-card {
    background-color: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
    padding: 2rem;
    text-align: center;
}

.login-card .brand {
    justify-content: center;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.login-card .brand-logo {
    height: 48px;
}

.login-subtitle {
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 0.875rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
    text-align: left;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: var(--transition);
    background-color: #f9fafb;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    font-size: 0.875rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    color: white;
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    background-color: var(--success-hover);
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: var(--danger-hover);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-outline:hover {
    background-color: var(--bg-main);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
}

.btn-icon {
    padding: 0.5rem;
    border-radius: var(--radius);
}

/* Action Bar */
.action-bar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
    background: var(--bg-card);
    padding: 1rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

@media (min-width: 768px) {
    .action-bar {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.action-bar-left,
.action-bar-right {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Cards & Tables */
.card {
    background-color: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: visible;
    margin-bottom: 1.5rem;
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

th,
td {
    padding: 1rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background-color: #f8fafc;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

tbody tr {
    transition: var(--transition);
}

tbody tr:hover {
    background-color: #f8fafc;
}

tbody tr:last-child td {
    border-bottom: none;
}

/* Form Grid */
.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1.5rem;
}

@media (min-width: 768px) {
    .form-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        align-items: end;
    }
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-success {
    background-color: #dcfce7;
    color: #166534;
}

.badge-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Preview Specifics */
.preview-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.stat-box {
    background: #f8fafc;
    padding: 0.75rem;
    border-radius: var(--radius);
    text-align: center;
    border: 1px solid var(--border-color);
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.summary-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    margin-top: 2rem;
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 1rem;
}

.summary-item {
    text-align: center;
}

.summary-item .stat-value {
    font-size: 2rem;
}

/* Utility */
.text-center {
    text-align: center;
}

.mt-1 {
    margin-top: 0.25rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-3 {
    margin-top: 0.75rem;
}

.mt-4 {
    margin-top: 1rem;
}

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

.gap-2 {
    gap: 0.5rem;
}

.flex {
    display: flex;
}

.justify-end {
    justify-content: flex-end;
}

.w-full {
    width: 100%;
}

/* Autocomplete (Phase 4A) */
.autocomplete-wrapper {
    position: relative;
    width: 100%;
}

.autocomplete-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: var(--shadow-md);
    max-height: 220px;
    overflow-y: auto;
}

.autocomplete-dropdown.active {
    display: block;
}

.autocomplete-item {
    padding: 0.6rem 1rem;
    cursor: pointer;
    font-size: 0.875rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.15s ease;
    border-bottom: 1px solid var(--border-color);
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.highlighted {
    background-color: #eef4ff;
}

.autocomplete-item .emp-name {
    font-weight: 500;
    color: var(--text-main);
}

.autocomplete-item .emp-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.autocomplete-no-results {
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    color: var(--danger-color);
    text-align: center;
}

/* ============================================================
   SIDEBAR LAYOUT SYSTEM (Phase 4C)
   ============================================================ */

:root {
    --sidebar-width: 260px;
    --sidebar-bg: #0f172a;
    --sidebar-text: #94a3b8;
    --sidebar-text-hover: #ffffff;
    --sidebar-active-bg: rgba(0, 132, 255, 0.15);
    --sidebar-active-accent: #0084ff;
    --sidebar-border: #1e293b;
    --topbar-height: 60px;
}

/* Full-page layout wrapper */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Overlay (mobile) */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

body.sidebar-open .sidebar-overlay {
    display: block;
    opacity: 1;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    z-index: 999;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    -webkit-overflow-scrolling: touch;
}

body.sidebar-open .sidebar {
    transform: translateX(0);
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-header {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    border-bottom: 1px solid var(--sidebar-border);
    flex-shrink: 0;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.sidebar-logo {
    height: 32px;
    width: 32px;
    max-width: 32px;
    object-fit: contain;
    flex-shrink: 0;
}

.sidebar-brand-text {
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.05em;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    padding: 0.75rem 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 1rem;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border-radius: 6px;
    margin: 0.25rem 1rem;
}

.sidebar-link:hover {
    color: var(--sidebar-text-hover);
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-link.active {
    color: var(--sidebar-text-hover);
    background: var(--sidebar-active-bg);
    font-weight: 600;
}

.sidebar-link i {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
    color: #64748b;
    transition: color 0.2s ease;
    flex-shrink: 0;
}

.sidebar-link:hover i {
    color: #94a3b8;
}

.sidebar-link.active i {
    color: var(--sidebar-active-accent);
}

/* Sidebar Footer */
.sidebar-footer {
    border-top: 1px solid var(--sidebar-border);
    padding: 0.75rem 0;
    flex-shrink: 0;
    margin-top: auto;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
}

.sidebar-user-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--sidebar-text);
    font-size: 0.875rem;
    flex-shrink: 0;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-role {
    font-size: 0.85rem;
    color: #cbd5e1;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.sidebar-logout {
    color: #f87171 !important;
}

.sidebar-logout:hover {
    background: rgba(248, 113, 113, 0.1) !important;
    color: #fca5a5 !important;
}

/* Main Content */
.main-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Topbar */
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    height: var(--topbar-height);
    background: var(--primary-color);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.topbar-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.topbar-badge {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    padding: 0.3rem 0.85rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

/* Hamburger Button */
.hamburger-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: #ffffff;
    font-size: 1.25rem;
    cursor: pointer;
    border-radius: var(--radius);
    transition: var(--transition);
    flex-shrink: 0;
}

.hamburger-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Mobile Header Logo */
.topbar-mobile-logo {
    display: none;
    height: 32px;
    width: auto;
    object-fit: contain;
}

@media (max-width: 1023px) {
    .topbar-badge {
        display: none !important;
    }
    .topbar-mobile-logo {
        display: block;
    }
}

/* Page Content */
.page-content {
    flex: 1;
    padding: 1.5rem 1.25rem;
    overflow-x: hidden;
}

/* Override container inside sidebar layout */
.page-content .container {
    max-width: 100%;
    padding: 0;
}

/* ---- Tablet Breakpoint (768px) ---- */
@media (min-width: 768px) {
    .page-content {
        padding: 1.75rem 1.5rem;
    }
}

/* ---- Desktop Breakpoint (1024px) ---- */
@media (min-width: 1024px) {
    .sidebar {
        transform: translateX(0);
        overflow-y: auto;
        overflow-x: hidden;
    }

    body.sidebar-open .sidebar-overlay {
        display: none;
    }

    .main-content {
        margin-left: var(--sidebar-width);
    }

    .hamburger-btn {
        display: none;
    }

    .page-content {
        padding: 2rem;
    }
}

/* ============================================================
   PHASE 6A — Toast Notifications
   ============================================================ */
.krystal-toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 10000;
    display: flex;
    flex-direction: column-reverse;
    gap: 0.5rem;
    pointer-events: none;
    max-width: 400px;
    width: calc(100% - 2rem);
}

.krystal-toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    font-size: 0.875rem;
    color: var(--text-main);
    pointer-events: auto;
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

.krystal-toast--visible {
    transform: translateX(0);
    opacity: 1;
}

.krystal-toast--exit {
    transform: translateX(120%);
    opacity: 0;
}

.krystal-toast__icon {
    font-size: 1.15rem;
    flex-shrink: 0;
}

.krystal-toast--success .krystal-toast__icon { color: var(--success-color); }
.krystal-toast--error .krystal-toast__icon { color: var(--danger-color); }
.krystal-toast--warning .krystal-toast__icon { color: #f59e0b; }
.krystal-toast--info .krystal-toast__icon { color: var(--primary-color); }

.krystal-toast--success { border-left: 3px solid var(--success-color); }
.krystal-toast--error { border-left: 3px solid var(--danger-color); }
.krystal-toast--warning { border-left: 3px solid #f59e0b; }
.krystal-toast--info { border-left: 3px solid var(--primary-color); }

.krystal-toast__msg {
    flex: 1;
    line-height: 1.4;
}

.krystal-toast__close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0 0.25rem;
    line-height: 1;
    flex-shrink: 0;
    transition: color 0.15s ease;
}

.krystal-toast__close:hover {
    color: var(--text-main);
}

/* ============================================================
   PHASE 6A — Confirmation Modal
   ============================================================ */
.krystal-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10001;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.krystal-modal-overlay--visible {
    opacity: 1;
}

.krystal-modal {
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
    padding: 2rem 1.5rem 1.5rem;
    text-align: center;
    transform: scale(0.95);
    transition: transform 0.2s ease;
}

.krystal-modal-overlay--visible .krystal-modal {
    transform: scale(1);
}

.krystal-modal__icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.25rem;
}

.krystal-modal__icon--danger {
    background: rgba(220, 38, 38, 0.1);
    color: var(--danger-color);
}

.krystal-modal__icon--info {
    background: rgba(0, 132, 255, 0.1);
    color: var(--primary-color);
}

.krystal-modal__title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.krystal-modal__message {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

.krystal-modal__actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.krystal-modal__actions .btn {
    min-width: 100px;
}

/* ============================================================
   PHASE 6A — Empty State
   ============================================================ */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.empty-state__icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    opacity: 0.4;
}

.empty-state__title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.25rem;
}

.empty-state__desc {
    font-size: 0.85rem;
}

/* Phase 6A responsive adjustments */
@media (max-width: 480px) {
    .krystal-toast-container {
        right: 0.75rem;
        bottom: 0.75rem;
        left: 0.75rem;
        width: auto;
        max-width: none;
    }

    .krystal-modal {
        padding: 1.5rem 1.25rem 1.25rem;
    }

    .krystal-modal__actions {
        flex-direction: column-reverse;
    }

    .krystal-modal__actions .btn {
        width: 100%;
    }
}

/* ============================================================
   Batch Capacity Bar
   ============================================================ */
.capacity-bar {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.capacity-bar__info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.capacity-bar__info i {
    margin-right: 0.35rem;
}

.capacity-bar__track {
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
}

.capacity-bar__fill {
    height: 100%;
    background: var(--success-color);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.capacity-bar__fill.capacity-warn {
    background: #f59e0b;
}

.capacity-bar__fill.capacity-full {
    background: var(--danger-color);
}

/* Print Styles */
@media print {
    body {
        background: white;
    }

    .app-header,
    .action-bar,
    .print-hide,
    .sidebar,
    .sidebar-overlay,
    .topbar {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
    }

    .page-content {
        padding: 0 !important;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* ============================================================
   ANALYTICS DASHBOARD SYSTEM (Phase 7A)
   ============================================================ */
.analytics-dashboard {
    margin-bottom: 2rem;
}

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
    .analytics-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }
}

.kpi-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.25rem 1rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    text-align: center;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.kpi-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.kpi-title {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.kpi-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
}

.kpi-value.text-primary { color: var(--primary-color); }
.kpi-value.text-success { color: var(--success-color); }
.kpi-value.text-warning { color: #f59e0b; }
.kpi-value.text-danger { color: var(--danger-color); }

.charts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 1024px) {
    .charts-grid {
        grid-template-columns: 2fr 1fr;
    }
}

.chart-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.chart-card h3 {
    margin-bottom: 1.25rem;
    font-size: 1.1rem;
    color: var(--text-main);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
}

.chart-container {
    position: relative;
    min-height: 250px;
    height: 100%;
    width: 100%;
    max-width: 100%;
    flex: 1;
}

.summary-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-label {
    font-weight: 500;
    color: var(--text-main);
}

.summary-data {
    font-weight: 600;
    color: var(--text-muted);
}

.summary-data span {
    color: var(--primary-color);
}

.insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.insight-card {
    background: #f8fafc;
    border-radius: var(--radius);
    padding: 1rem;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.insight-icon {
    font-size: 1.5rem;
    color: var(--primary-color);
    background: rgba(0, 132, 255, 0.1);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.insight-content h4 {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.insight-content p {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
}

.insight-alert {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-left: 4px solid #f59e0b;
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    display: none;
    align-items: center;
    gap: 1rem;
}

.insight-alert.active {
    display: flex;
}

.insight-alert i {
    color: #f59e0b;
    font-size: 1.5rem;
}

.insight-alert-text {
    font-weight: 500;
    color: #92400e;
    font-size: 0.95rem;
}