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

:root {
    /* DARK MODE (Default) */
    --bg-color: #0b0f19;
    --panel-bg: rgba(22, 27, 34, 0.6);
    --panel-bg-solid: #161b22;
    --text-primary: #f8fafc;
    --text-secondary: #8b949e;
    --accent-color: #3b82f6;
    --accent-hover: #2563eb;
    --border-color: rgba(255, 255, 255, 0.1);
    --border-solid: #30363d;
    --input-bg: rgba(0, 0, 0, 0.2);
    --input-bg-solid: #0d1117;
    --input-border: rgba(255, 255, 255, 0.15);
    --input-focus: #3b82f6;
    --danger-color: #ef4444;
    --danger-hover: #dc2626;
    --success-color: #10b981;
    --glass-bg: rgba(11, 15, 25, 0.7);
    --glass-border: rgba(255, 255, 255, 0.08);
    --shadow-color: rgba(0, 0, 0, 0.5);
    --table-header-bg: rgba(255, 255, 255, 0.05);
    --table-row-hover: rgba(255, 255, 255, 0.03);
    --scrollbar-bg: #0b0f19;
    --scrollbar-thumb: #30363d;
    --switch-bg: #30363d;
    --switch-handle: #f8fafc;
    --bg-alpha-5: rgba(255, 255, 255, 0.05);
    --bg-alpha-8: rgba(255, 255, 255, 0.08);
    --bg-alpha-10: rgba(255, 255, 255, 0.1);
    --bg-alpha-20: rgba(255, 255, 255, 0.2);
    --text-alpha-40: rgba(255, 255, 255, 0.4);
    --text-alpha-50: rgba(255, 255, 255, 0.5);
    --text-alpha-70: rgba(255, 255, 255, 0.7);
    --border-alpha-10: rgba(255, 255, 255, 0.1);
    --border-alpha-20: rgba(255, 255, 255, 0.2);
    --border-alpha-30: rgba(255, 255, 255, 0.3);
}

html.light-mode {
    /* LIGHT MODE */
    --bg-color: #f0f2f5;
    --panel-bg: rgba(255, 255, 255, 0.8);
    --panel-bg-solid: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --accent-color: #2563eb;
    --accent-hover: #1d4ed8;
    --border-color: rgba(0, 0, 0, 0.1);
    --border-solid: #cbd5e1;
    --input-bg: rgba(255, 255, 255, 0.9);
    --input-bg-solid: #ffffff;
    --input-border: rgba(0, 0, 0, 0.2);
    --input-focus: #2563eb;
    --danger-color: #dc2626;
    --danger-hover: #b91c1c;
    --success-color: #059669;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(0, 0, 0, 0.05);
    --shadow-color: rgba(0, 0, 0, 0.05);
    --table-header-bg: rgba(0, 0, 0, 0.03);
    --table-row-hover: rgba(0, 0, 0, 0.02);
    --scrollbar-bg: #f0f2f5;
    --scrollbar-thumb: #cbd5e1;
    --switch-bg: #cbd5e1;
    --switch-handle: #ffffff;
    --bg-alpha-5: rgba(0, 0, 0, 0.03);
    --bg-alpha-8: rgba(0, 0, 0, 0.05);
    --bg-alpha-10: rgba(0, 0, 0, 0.06);
    --bg-alpha-20: rgba(0, 0, 0, 0.12);
    --text-alpha-40: rgba(0, 0, 0, 0.4);
    --text-alpha-50: rgba(0, 0, 0, 0.5);
    --text-alpha-70: rgba(0, 0, 0, 0.7);
    --border-alpha-10: rgba(0, 0, 0, 0.1);
    --border-alpha-20: rgba(0, 0, 0, 0.2);
    --border-alpha-30: rgba(0, 0, 0, 0.3);
}

html, body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    background: var(--bg-color);
    min-height: 100vh;
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
    background: var(--scrollbar-bg);
}
::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 4px;
}
::-webkit-scrollbar-corner {
    background: var(--scrollbar-bg);
}

#blazor-error-ui {
    background: var(--danger-color);
    color: white;
    bottom: 0;
    box-shadow: 0 -1px 4px var(--shadow-color);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
      max-width: none !important;
    z-index: 1000;
}
#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

h1:focus, h2:focus, h3:focus, h4:focus, h5:focus, h6:focus {
    outline: none !important;
}



/* Global Glass Input */
.glass-input {
    width: 100%;
      max-width: none !important;
    box-sizing: border-box;
    background: var(--bg-alpha-5);
    border: 1px solid var(--border-solid);
    padding: 0.5rem 1rem;
    min-height: 42px;
    border-radius: 12px;
    color: var(--text-primary);
    outline: none;
    transition: all 0.2s;
}
.glass-input:focus {
    border-color: #FF8C00 !important;
    background: var(--bg-alpha-10) !important;
    box-shadow: 0 0 0 3px rgba(255, 140, 0, 0.15) !important;
    outline: none !important;
}
.glass-input::placeholder {
    color: var(--text-secondary);
}

/* Global Form Select */
select.glass-input {
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="%238b949e" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>');
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 40px;
}

/* Global Glass Table Styles */
.table-container { background: var(--panel-bg); border: 1px solid var(--border-solid); border-radius: 12px; overflow: visible; margin-top: 15px; }
.glass-table th:first-child { border-top-left-radius: 11px; }
.glass-table th:last-child { border-top-right-radius: 11px; }
.glass-table { width: 100%;
      max-width: none !important; border-collapse: collapse; }
.glass-table th { background: var(--bg-alpha-5); padding: 15px; text-align: left; font-weight: 600; color: var(--text-secondary); border-bottom: 1px solid var(--border-solid); font-size: 13px; text-transform: uppercase; letter-spacing: 0.5px; }
.glass-table td { padding: 15px; border-bottom: 1px solid var(--border-solid); vertical-align: middle; color: var(--text-primary); }
.glass-table tr:hover td { background: var(--bg-alpha-5); }
.glass-table tr:last-child td { border-bottom: none; }

/* Global Action Buttons */
.action-btn { background: var(--bg-alpha-5); border: 1px solid var(--border-solid); color: var(--text-secondary); width: 34px; height: 34px; border-radius: 8px; display: inline-flex; justify-content: center; align-items: center; cursor: pointer; transition: all 0.2s; }
.action-btn:hover { background: var(--bg-alpha-10); color: var(--text-primary); transform: translateY(-2px); }
.action-btn.delete:hover { background: rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.2); color: #ef4444; }

.btn { padding: 12px 25px; border-radius: 12px; font-weight: 600; border: none; cursor: pointer; transition: all 0.2s; }
.btn-primary { background: linear-gradient(135deg, #FF8C00, #F27405); color: white; box-shadow: 0 4px 15px rgba(255,140,0,0.3); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(255,140,0,0.4); }

/* Global Pagination */
.pagination { display: flex; justify-content: center; align-items: center; gap: 15px; margin-top: 25px; }
.page-btn { background: var(--bg-alpha-5); border: 1px solid var(--border-solid); color: var(--text-primary); padding: 8px 15px; border-radius: 8px; cursor: pointer; transition: all 0.2s; font-weight: 500; }
.page-btn:hover:not(:disabled) { background: var(--bg-alpha-10); }
.page-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.page-info { color: var(--text-secondary); font-size: 14px; }
.page-info span { font-weight: 600; color: var(--text-primary); }

/* Global Badges */
.normal-badge { background: var(--bg-alpha-10); color: var(--text-secondary); border: 1px solid var(--border-solid); padding: 4px 10px; border-radius: 6px; font-size: 12px; font-weight: 500; }

/* Global Toggle Switch */
.toggle-label { display: flex; align-items: center; gap: 15px; cursor: pointer; }
.toggle-text { display: flex; flex-direction: column; }
.toggle-text strong { color: var(--text-primary); font-size: 14px; margin-bottom: 2px; font-weight: 600; }
.toggle-text p { color: var(--text-secondary); font-size: 12px; margin: 0; }
.toggle-switch { position: relative; width: 44px; height: 24px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: var(--border-solid); transition: .4s; border-radius: 24px; }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
input:checked + .slider { background-color: #FF8C00; }
input:focus + .slider { box-shadow: 0 0 1px #FF8C00; }
input:checked + .slider:before { transform: translateX(20px); }


/* Modern Glass Tabs - No Frame */
.glass-tabs {
    display: inline-flex;
    gap: 8px;
}
.glass-tab {
    padding: 10px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    gap: 8px;
}
.glass-tab:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}
.glass-tab.active {
    background: #FF8C00;
    color: white;
    box-shadow: 0 4px 12px rgba(255, 140, 0, 0.3);
}
.glass-tab.active-green {
    background: #4CAF50;
    color: white;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

/* Glass Input Search Box Tweaks */
.search-box-wrapper {
    position: relative;
    width: 350px;
    display: flex;
    align-items: center;
}
.search-box-wrapper svg.search-icon {
    position: absolute;
    left: 15px;
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
    pointer-events: none;
}
.search-box-wrapper .glass-input {
    width: 100%;
      max-width: none !important;
    padding-left: 45px;
    padding-right: 90px;
    height: 46px;
    border-radius: 14px;
    border: 1px solid var(--border-solid);
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: all 0.3s ease;
}
.search-box-wrapper .glass-input:focus {
    box-shadow: 0 0 0 3px rgba(255, 140, 0, 0.15);
    border-color: #FF8C00;
    background: var(--bg-primary);
}
.search-box-wrapper .search-btn {
    position: absolute;
    right: 6px;
    height: 34px;
    background: #FF8C00;
    color: white;
    border: none;
    border-radius: 10px;
    padding: 0 16px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s ease;
}
.search-box-wrapper .search-btn:hover {
    background: #e67e00;
    transform: translateY(-1px);
}

/* Global Card Override for Dark Mode Compatibility */
.card {
    background: var(--panel-bg) !important;
    border: 1px solid var(--border-solid) !important;
    border-radius: 12px !important;
    padding: 24px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05) !important;
    color: var(--text-primary) !important;
}

/* Dashboard Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}

.metric-card {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    align-items: flex-start;
    gap: 20px;
    box-shadow: 0 4px 20px var(--shadow-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.metric-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px var(--shadow-color);
}

.metric-icon {
    font-size: 32px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.metric-data {
    flex: 1;
}

.metric-data h3 {
    margin: 0 0 8px 0;
    font-size: 15px;
    color: var(--text-secondary);
    font-weight: 500;
}

.metric-data h2 {
    margin: 0 0 12px 0;
    font-size: 28px;
    color: var(--text-primary);
    font-weight: 700;
}

.trend {
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 6px;
}

.trend.up {
    color: #10B981;
    background: rgba(16, 185, 129, 0.1);
}

.trend.down {
    color: #EF4444;
    background: rgba(239, 68, 68, 0.1);
}

.trend.neutral {
    color: #6B7280;
    background: rgba(107, 114, 128, 0.1);
}

.gradient-1 {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05) 0%, rgba(37, 99, 235, 0.15) 100%);
    border-color: rgba(37, 99, 235, 0.2);
}

.gradient-2 {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, rgba(16, 185, 129, 0.15) 100%);
    border-color: rgba(16, 185, 129, 0.2);
}

.gradient-3 {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.05) 0%, rgba(245, 158, 11, 0.15) 100%);
    border-color: rgba(245, 158, 11, 0.2);
}

/* Dashboard Specific Layout */
.content-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 30px;
}

@media (max-width: 1024px) {
    .content-row {
        grid-template-columns: 1fr;
    }
}

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

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

.btn-text {
    background: none;
    border: none;
    color: var(--accent-color);
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
}

.btn-text:hover {
    text-decoration: underline;
}

.sleek-table {
    width: 100%;
      max-width: none !important;
    border-collapse: collapse;
}

.sleek-table th, .sleek-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.sleek-table th {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(0,0,0,0.02);
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.badge-outline {
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.amount {
    font-weight: 600;
}

.alert-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.alert-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    border-radius: 12px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
}

.alert-item.warning {
    border-left: 4px solid #F59E0B;
}

.alert-item.info {
    border-left: 4px solid #3B82F6;
}

.alert-icon {
    font-size: 20px;
}

.alert-text h4 {
    margin: 0 0 4px 0;
    font-size: 14px;
    color: var(--text-primary);
}

.alert-text p {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
}
/* Date Picker Styling */
input[type="date"].glass-input {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 15px;
    position: relative;
    font-family: inherit;
}
input[type="date"].glass-input::-webkit-calendar-picker-indicator {
    background: transparent;
    bottom: 0;
    color: transparent;
    cursor: pointer;
    height: auto;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    width: auto;
}
input[type="date"].glass-input::after {
    content: '';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="%23FF8C00" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line></svg>');
    background-repeat: no-repeat;
    background-size: contain;
    pointer-events: none;
}




/* Modern Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    margin-right: 10px;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--bg-alpha-10);
    border: 1px solid var(--border-solid);
    transition: .3s;
    border-radius: 24px;
}
.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background-color: var(--text-secondary);
    transition: .3s;
    border-radius: 50%;
}
input:checked + .toggle-slider {
    background-color: #FF8C00;
    border-color: #FF8C00;
}
input:checked + .toggle-slider:before {
    transform: translateX(20px);
    background-color: white;
}



/* Global Spinner */
.spinner {
    display: inline-block;
    border: 3px solid var(--border-solid);
    border-top: 3px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Elegant Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeInModal 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.glass-modal {
    background: var(--panel-bg);
    border: 1px solid var(--border-solid);
    padding: 30px;
    border-radius: 20px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    animation: slideUpModal 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-body {
    margin-bottom: 20px;
}

.modal-actions {
    margin-top: 25px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid var(--border-solid);
    padding-top: 20px;
}

@keyframes fadeInModal {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUpModal {
    from { 
        opacity: 0; 
        transform: translateY(30px) scale(0.95); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
}

/* Global Spinner Styles */
.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--bg-alpha-10, rgba(0,0,0,0.1));
    border-top-color: var(--accent-color, #10b981);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
