/* Omer Mobile Shop Manager - Clean White Sidebar SaaS Design System */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500;600&display=swap');

:root {
    /* Color System - Stripe/Linear Inspired Off-White & Crisp Clean Surfaces */
    --bg-page: #f8f9fa;
    --bg-sidebar: #ffffff;
    --bg-surface: #ffffff;
    --bg-surface-hover: #fafafa;
    --bg-input: #ffffff;

    --border-subtle: #e4e4e7;
    --border-focus: #18181c;
    --border-hover: #d4d4d8;

    --text-primary: #09090b;
    --text-secondary: #52525b;
    --text-muted: #71717a;
    --text-inverse: #ffffff;

    --btn-primary-bg: #09090b;
    --btn-primary-text: #ffffff;
    --btn-primary-hover: #27272a;

    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;

    --shadow-subtle: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-card: 0 2px 4px rgba(0, 0, 0, 0.02), 0 8px 16px rgba(0, 0, 0, 0.03);
    --shadow-popover: 0 10px 30px rgba(0, 0, 0, 0.12);

    --transition-fast: 150ms cubic-bezier(0.16, 1, 0.3, 1);
    --transition-smooth: 250ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reset & Base Styling */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
    font-family: var(--font-sans);
    background-color: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.01em;
    overflow-x: hidden;
}

#app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
}

/* Auth View Card */
.auth-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100vw;
    min-height: 100vh;
    background: radial-gradient(circle at 50% 20%, #ffffff 0%, #f4f4f5 70%);
    padding: 20px 16px;
}

.auth-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 36px 28px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-card);
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
}

.brand-icon {
    width: 40px;
    height: 40px;
    background: #09090b;
    color: #ffffff;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 18px;
    flex-shrink: 0;
}

.brand-text h1 {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    line-height: 1.2;
}

.brand-text p {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Clean White Mobile Topbar */
.mobile-topbar {
    display: none;
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    color: #09090b;
    padding: 12px 16px;
    z-index: 99;
    border-bottom: 1px solid var(--border-subtle);
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.mobile-topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-icon-toggle {
    background: #f4f4f5;
    border: 1px solid var(--border-subtle);
    color: #09090b;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
}

.btn-icon-toggle:hover {
    background: #e4e4e7;
}

.mobile-topbar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mobile-topbar-brand .brand-icon {
    width: 30px;
    height: 30px;
    font-size: 15px;
    background: #09090b;
    color: #ffffff;
}

.mobile-topbar-brand h1 {
    font-size: 15px;
    font-weight: 700;
    color: #09090b;
}

/* Sidebar Drawer - Clean White Theme */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(9, 9, 11, 0.4);
    backdrop-filter: blur(4px);
    z-index: 998;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-smooth);
}

.sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.sidebar {
    width: 250px;
    background: #ffffff;
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 999;
    transition: transform var(--transition-smooth);
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.03);
}

.sidebar-header {
    padding: 20px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--border-subtle);
}

.btn-sidebar-close {
    display: none;
    background: #f4f4f5;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: #09090b;
    font-size: 16px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    align-items: center;
    justify-content: center;
}

.sidebar-nav {
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
    overflow-y: auto;
}

.nav-group-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: #a1a1aa;
    padding: 14px 12px 6px 12px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    color: #52525b;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.nav-link:hover {
    color: #09090b;
    background: #f4f4f5;
}

/* Active State: Soft light-dark / neutral gray background with bold text & left accent bar */
.nav-link.active {
    color: #09090b;
    background: #f4f4f5;
    font-weight: 700;
    box-shadow: inset 3px 0 0 #09090b;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #f4f4f5;
    color: #09090b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    border: 1px solid var(--border-subtle);
}

.user-info h4 {
    font-size: 13px;
    font-weight: 600;
    color: #09090b;
}

.user-info p {
    font-size: 11px;
    color: #71717a;
    text-transform: capitalize;
}

/* Main Content Area */
.main-wrapper {
    flex: 1;
    margin-left: 250px;
    padding: 32px 40px 60px 40px;
    max-width: 100%;
    width: calc(100% - 250px);
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.page-title h2 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

.page-title p {
    font-size: 14px;
    color: var(--text-secondary);
}

.header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Operational KPI Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.kpi-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    box-shadow: var(--shadow-subtle);
    transition: border-color var(--transition-fast);
}

.kpi-card:hover {
    border-color: var(--border-hover);
}

.kpi-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.kpi-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.kpi-icon {
    font-size: 16px;
    opacity: 0.8;
}

.kpi-value {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-bottom: 4px;
    font-variant-numeric: tabular-nums;
}

.kpi-sub {
    font-size: 12px;
    color: var(--text-muted);
}

/* Split Layouts for Dashboard Panels */
.dashboard-split-layout {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
}

/* Sales Performance Bar Chart Styling */
.chart-box {
    min-height: 220px;
    display: flex;
    align-items: flex-end;
    padding: 20px 10px 10px 10px;
}

.bar-chart-wrapper {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    width: 100%;
    height: 180px;
    gap: 12px;
}

.bar-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    position: relative;
}

.bar-fill-container {
    flex: 1;
    width: 100%;
    max-width: 32px;
    background: #f4f4f5;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: flex-end;
    overflow: hidden;
}

.bar-fill {
    width: 100%;
    background: #09090b;
    border-radius: var(--radius-sm);
    transition: height 400ms cubic-bezier(0.16, 1, 0.3, 1);
}

.bar-column:hover .bar-fill {
    background: #27272a;
}

.bar-label {
    margin-top: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.bar-tooltip {
    position: absolute;
    top: -28px;
    background: #09090b;
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity var(--transition-fast);
    pointer-events: none;
}

.bar-column:hover .bar-tooltip {
    opacity: 1;
}

/* Inventory Health List */
.health-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.health-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: var(--bg-page);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}

.health-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.dot-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.dot-green {
    background: #16a34a;
}

.dot-amber {
    background: #d97706;
}

.dot-blue {
    background: #2563eb;
}

.dot-gray {
    background: #71717a;
}

.health-val {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Quick Actions Bar */
.quick-actions-bar {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-subtle);
    flex-wrap: wrap;
}

.quick-actions-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

.quick-actions-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Segmented Control Toggles */
.segmented-control {
    display: inline-flex;
    background: #f4f4f5;
    padding: 3px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.btn-segmented {
    background: transparent;
    border: none;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-segmented.active {
    background: #ffffff;
    color: var(--text-primary);
    box-shadow: var(--shadow-subtle);
}

/* Hero Dark Stat Block (Finance Page) */
.metric-card-hero {
    background: #09090b;
    border: 1px solid #18181c;
    border-radius: var(--radius-xl);
    padding: 28px 24px;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.hero-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: #ffffff;
}

.live-pulse {
    width: 7px;
    height: 7px;
    background: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 8px #22c55e;
}

.hero-tag {
    font-size: 12px;
    color: #a1a1aa;
}

.hero-body {
    margin-bottom: 12px;
}

.hero-value {
    font-size: 34px;
    font-weight: 800;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
    color: #ffffff;
    line-height: 1.1;
    margin-bottom: 6px;
}

.hero-sub {
    font-size: 13px;
    color: #a1a1aa;
}

/* Cards & Surface Layouts */
.card-panel {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-subtle);
}

.card-header-clean {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-subtle);
    flex-wrap: wrap;
    gap: 12px;
}

.card-header-clean h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.card-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.metric-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    box-shadow: var(--shadow-subtle);
}

.metric-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.metric-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.metric-value {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
}

.metric-footer {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    margin-top: 4px;
}

/* Premium Table System */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    width: 100%;
    background: var(--bg-surface);
}

.data-table {
    width: 100%;
    min-width: 640px;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
}

.data-table th {
    background: #f8f9fa;
    padding: 12px 16px;
    font-weight: 600;
    font-size: 12px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-subtle);
    white-space: nowrap;
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.table-row-hover:hover td {
    background: var(--bg-surface-hover);
}

/* Filter Toolbar */
.filter-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

/* Profit Calculator Banner */
.profit-calculator-banner {
    background: #09090b;
    border-radius: var(--radius-xl);
    padding: 20px 24px;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}

.profit-calculator-title {
    font-size: 14px;
    font-weight: 700;
}

.profit-calculator-subtitle {
    font-size: 12px;
    color: #a1a1aa;
}

.profit-calculator-amount {
    font-size: 26px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: #22c55e;
}

/* Skeleton Loading Shimmer State */
.skeleton-row td {
    padding: 16px;
}

.skeleton-pill {
    background: linear-gradient(90deg, #f4f4f5 0%, #e4e4e7 50%, #f4f4f5 100%);
    background-size: 400px 100%;
    animation: shimmer 1.5s infinite ease-in-out;
    border-radius: 4px;
}

@keyframes shimmer {
    0% {
        background-position: -200px 0;
    }

    100% {
        background-position: 200px 0;
    }
}

/* Designed Empty State */
.empty-state-cell {
    padding: 48px 24px !important;
    text-align: center;
}

.empty-state-wrapper {
    max-width: 360px;
    margin: 0 auto;
}

.empty-state-icon {
    font-size: 32px;
    margin-bottom: 12px;
    opacity: 0.8;
}

.empty-state-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.empty-state-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-primary {
    background: #09090b;
    color: #ffffff;
}

.badge-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.badge-danger {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.badge-neutral {
    background: #f4f4f5;
    border: 1px solid #e4e4e7;
    color: #52525b;
}

/* Form Styling */
.form-card {
    max-width: 100%;
    width: 100%;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 28px 24px;
    box-shadow: var(--shadow-card);
    position: relative;
}

/* Searchable IMEI Select Dropdown */
.search-dropdown-wrapper {
    position: relative;
}

.search-dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 30px -4px rgba(0, 0, 0, 0.12);
    max-height: 240px;
    overflow-y: auto;
    z-index: 100;
}

.search-dropdown-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f4f4f5;
    transition: background 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.search-dropdown-item:hover,
.search-dropdown-item.active {
    background: #f4f4f5;
}

.selected-phone-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-lg);
    padding: 14px 18px;
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.form-group {
    margin-bottom: 18px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-control,
select,
textarea {
    width: 100%;
    padding: 11px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 14px;
    transition: border-color var(--transition-fast);
}

.form-control:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(9, 9, 11, 0.05);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-fast);
    min-height: 42px;
}

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

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

.btn-secondary {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
}

.btn-secondary:hover {
    border-color: var(--border-hover);
    background: #f4f4f5;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    min-height: 34px;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 13px;
    margin-bottom: 16px;
}

.alert-error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #991b1b;
}

#global-error-fallback {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99999;
    max-width: 90%;
    width: 480px;
    box-shadow: var(--shadow-popover);
}

.hidden {
    display: none !important;
}

.text-right {
    text-align: right;
}

.text-mono {
    font-family: var(--font-mono);
}

/* Responsive Breakpoints & Mobile Sidebar Drawer */
#layout-app {
    display: flex;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

@media (max-width: 1024px) {
    .mobile-topbar {
        display: flex;
    }

    .sidebar-overlay {
        display: block;
    }

    .sidebar {
        position: fixed !important;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px !important;
        max-width: 80vw !important;
        transform: translateX(-100%) !important;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
        z-index: 9999;
    }

    .sidebar.mobile-active {
        transform: translateX(0) !important;
    }

    .btn-sidebar-close {
        display: flex !important;
    }

    .main-wrapper {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        flex: 1 1 100% !important;
        padding: 20px 16px 40px 16px;
    }

    .dashboard-split-layout {
        flex-direction: column;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .header-actions {
        width: 100%;
    }

    .header-actions .btn {
        flex: 1;
    }
}

/* Modals */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(9, 9, 11, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 16px;
}

.modal-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 24px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-subtle);
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.btn-icon {
    background: transparent;
    border: none;
    font-size: 18px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
}

.btn-icon:hover {
    background: #f4f4f5;
    color: var(--text-primary);
}

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

/* Toast Notification System */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: calc(100vw - 40px);
    width: 360px;
    pointer-events: none;
}

.toast {
    background: #09090b;
    color: #ffffff;
    padding: 12px 18px;
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
    pointer-events: auto;
    animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.toast-success {
    border-left: 4px solid #22c55e;
}

.toast-error {
    border-left: 4px solid #ef4444;
}

.toast-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}

.toast-error .toast-icon {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.toast-message {
    flex: 1;
    line-height: 1.4;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.toast.toast-fade-out {
    animation: toastFadeOut 0.3s forwards;
}

@keyframes toastFadeOut {
    to {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }
}

/* Data Table Pagination Toolbar */
.pagination-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-top: none;
    border-bottom-left-radius: var(--radius-xl);
    border-bottom-right-radius: var(--radius-xl);
    flex-wrap: wrap;
    gap: 12px;
}

.pagination-info {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.pagination-wrapper {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.pagination-size-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.pagination-size-selector select {
    padding: 4px 8px;
    font-size: 12px;
    width: auto;
    background: #ffffff;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pagination-btn {
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid var(--border-subtle);
    background: #ffffff;
    color: var(--text-primary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    min-height: 32px;
}

.pagination-btn:hover:not(:disabled) {
    background: #f4f4f5;
    border-color: var(--border-hover);
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-btn.active {
    background: #09090b;
    color: #ffffff;
    border-color: #09090b;
}

.pagination-page-number {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Clickable Interactive KPI Card */
.kpi-card-clickable {
    cursor: pointer;
    transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.kpi-card-clickable:hover {
    transform: translateY(-2px);
    border-color: #09090b;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.kpi-card-clickable.active-kpi {
    border-color: #09090b;
    background: #fdfdfd;
    box-shadow: inset 0 -3px 0 #09090b;
}