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

:root {
    /* Neo-SaaS Palette */
    --bg-dark: #0f172a;
    --bg-gradient: radial-gradient(at 0% 0%, hsla(253, 16%, 7%, 1) 0, transparent 50%), radial-gradient(at 50% 0%, hsla(225, 39%, 30%, 1) 0, transparent 50%), radial-gradient(at 100% 0%, hsla(339, 49%, 30%, 1) 0, transparent 50%);

    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.4);
    --secondary: #ec4899;

    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: 1px solid rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);

    --text-main: #f8fafc;
    --text-muted: #94a3b8;

    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    background-image: var(--bg-gradient);
    background-attachment: fixed;
    background-size: cover;
    color: var(--text-main);
    display: flex;
    height: 100vh;
    overflow: hidden;
    /* Fix scrollbars */
}

/* Fix Dropdown Options */
select option {
    background: #0f172a;
    color: white;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: var(--glass-border);
    flex-shrink: 0;
    padding: 24px;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    margin-bottom: 40px;
    padding-left: 10px;
}

.sidebar-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    letter-spacing: -0.025em;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius-sm);
    margin-bottom: 4px;
    transition: var(--transition);
    font-weight: 500;
    font-size: 0.95rem;
}

.sidebar a:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

.sidebar li.active a {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.2) 0%, transparent 100%);
    color: #818cf8;
    border-left: 3px solid #6366f1;
}

.sidebar i {
    width: 20px;
    text-align: center;
    font-size: 1.1em;
}

/* Main Content */
.main-content {
    flex-grow: 1;
    padding: 40px;
    overflow-y: auto;
    /* Reverted flex gap due to browser support issues */
}

.header-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 5px;
    background: linear-gradient(to right, #fff, #94a3b8);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    border: none;
}

/* The Bento Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 60px;
    /* Explicit spacing */
}

/* Neo-SaaS Cards */
.stat-card,
.glass-card,
.login-card,
.content-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--glass-shadow);
    padding: 24px;
    display: flex;
    flex-direction: column;
    color: var(--text-main);
    transition: var(--transition);
}

.content-panel {
    margin-top: 60px;
    /* Explicit spacing */
    margin-bottom: 40px;
}

/* Specific layout for dashboard stat cards */
.dashboard-grid .stat-card {
    height: 100%;
    /* Only stretch in the grid */
    justify-content: space-between;
}

.stat-card:hover,
.content-panel:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.45);
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    margin: 4px 0 12px 0;
    letter-spacing: -0.02em;
    line-height: 1;
}

/* Typography Overrides for Dark Mode */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: white;
    margin-top: 0;
}

p {
    color: var(--text-muted);
    line-height: 1.6;
}

/* Buttons with Glow */
.btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5);
    filter: brightness(1.1);
}

/* Date Filter - Glass Style */
.date-filter {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: var(--glass-border);
    border-radius: var(--radius-md);
    padding: 4px;
    overflow: hidden;
}

.date-filter:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.date-filter input,
.date-filter select {
    background: transparent !important;
    border: none !important;
    color: white !important;
    font-weight: 500;
    font-size: 0.9rem;
}

.date-filter input {
    border-right: 1px solid rgba(255, 255, 255, 0.1) !important;
    text-align: center;
    width: 80px;
}

/* Tables - Dark Mode */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: transparent;
}

th {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    font-weight: 600;
    text-align: left;
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

td {
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    vertical-align: middle;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
    border: 1px solid transparent;
}

.alert.success {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.alert.error {
    background: rgba(244, 63, 94, 0.1);
    border-color: rgba(244, 63, 94, 0.2);
    color: #fb7185;
}

/* Utilities */
.wrapper {
    display: flex;
    width: 100%;
}

/* Input Reset */
input,
select,
textarea {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: var(--radius-sm);
    padding: 10px;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

/* Number Spinner Hide */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
}
/* Sidebar - Remove List Dots */
#sidebar ul.components {
    padding: 20px 0;
    list-style: none !important;
    margin: 0;
    padding-left: 0;
}

#sidebar ul li {
    list-style: none !important;
}

#sidebar ul li a {
    padding: 10px;
    font-size: 1.1em;
    display: block;
    color: var(--text-muted);
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 12px;
}

#sidebar ul li.active > a,
#sidebar ul li a:hover {
    color: var(--primary);
    background: rgba(41, 121, 255, 0.05);
    border-left-color: var(--primary);
}

#sidebar ul li a i {
    width: 25px;
    text-align: center;
}
