:root {
    /* DARK THEME (Default) */
    --bg-main: #000000;
    --bg-card: #121212;
    --bg-item: #1c1c1e;
    --primary: #a9ff1c; /* Electric Lime */
    --primary-muted: rgba(169, 255, 28, 0.1);
    --text-main: #ffffff;
    --text-muted: #8e8e93;
    --border: rgba(255, 255, 255, 0.08);
    --radius-lg: 32px;
    --radius-md: 22px;
    --radius-sm: 14px;
    --header-height: 80px;
    --sidebar-width: 290px;
}

/* LIGHT THEME */
[data-theme="light"] {
    --bg-main: #f5f5f7;
    --bg-card: #ffffff;
    --bg-item: #fcfcfc;
    --primary: #a9ff1c; /* Keep neon green for signature */
    --primary-muted: rgba(169, 255, 28, 0.1);
    --text-main: #1c1c1e;
    --text-muted: #6e6e73;
    --border: rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color 0.3s, color 0.3s;
}

/* FORCE GREEN TEXT ON TITLES & LABELS (Signature Look) */
h1, .card-title, .sidebar-header span, .sidebar-section, label {
    color: var(--primary) !important;
}

/* CLEAN INPUTS (Remove Arrows/Spinners) - FORCED */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type=number] {
    -moz-appearance: textfield;
    appearance: none;
}

/* DATE PICKER STYLING */
input[type="date"] {
    position: relative;
    color-scheme: dark; /* White icon in dark mode */
}
[data-theme="light"] input[type="date"] {
    color-scheme: light; /* Black icon in light mode */
}

/* TOP NAV */
.top-nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--header-height);
    background-color: var(--bg-main);
    display: flex;
    align-items: center;
    justify-content: space-between; /* Space between hamburger and theme toggle */
    padding: 0 1.5rem;
    z-index: 1000;
    border-bottom: 2px solid var(--border);
}

.theme-toggle, .nav-toggle {
    width: 48px;
    height: 48px;
    border-radius: 18px;
    background: var(--bg-item);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.3rem;
    color: var(--primary); /* Button icons in green too */
}

/* TOGGLE SWITCH DESIGN */
.switch-container { display: flex; align-items: center; gap: 15px; cursor: pointer; }
.switch { position: relative; display: inline-block; width: 54px; height: 28px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--bg-item); transition: .4s; border-radius: 34px; border: 1px solid var(--border);
}
.slider:before {
    position: absolute; content: ""; height: 20px; width: 20px; left: 4px; bottom: 3px;
    background-color: var(--text-muted); transition: .4s; border-radius: 50%;
}
input:checked + .slider { background-color: var(--primary-muted); border-color: var(--primary); }
input:checked + .slider:before { transform: translateX(26px); background-color: var(--primary); }

/* SIDEBAR */
.sidebar {
    position: fixed; top: 0; left: 0; width: var(--sidebar-width); height: 100vh;
    background-color: var(--bg-main); z-index: 2000;
    transform: translateX(-100%); transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 1rem; border-right: 1px solid var(--border); overflow-y: auto;
}
.sidebar.show { transform: translateX(0); }

/* OVERLAY */
.sidebar-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
    z-index: 1500; display: none; transition: 0.3s;
}
.sidebar-overlay.show { display: block; }

.sidebar-header { display: flex; align-items: center; gap: 15px; padding: 1.5rem; margin-bottom: 1rem; }
.sidebar-header i { font-size: 1.5rem; color: var(--primary); }
.sidebar-nav ul, .sidebar-nav li { list-style: none !important; padding: 0; margin: 0; }
.sidebar-nav a {
    display: flex; align-items: center; gap: 16px; padding: 1rem 1.5rem;
    color: var(--text-muted); text-decoration: none; border-radius: var(--radius-md);
    margin-bottom: 4px; font-weight: 600;
}
.sidebar-nav a.active, .sidebar-nav a:hover { background-color: var(--bg-item); color: var(--primary); }

/* CONTENT CONTAINER */
.app-container { padding-top: var(--header-height); min-height: 100vh; }
.view-container { padding: 1.5rem; max-width: 1400px; margin: 0 auto; }

/* CARDS */
.card {
    background-color: var(--bg-card); border-radius: var(--radius-lg);
    padding: 2.5rem; margin-bottom: 2rem; border: 1px solid var(--border);
}
.card-title {
    font-size: 1.4rem; font-weight: 700; margin-bottom: 2rem;
    display: flex; justify-content: space-between; align-items: center;
}

/* STATS GRID */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 2rem; }
.stat-card {
    background-color: var(--bg-card); padding: 2.5rem 1.5rem; border-radius: var(--radius-lg);
    text-align: center; border: 1px solid var(--border);
}
.stat-icon {
    width: 65px; height: 65px; margin: 0 auto 15px; background-color: var(--bg-item);
    color: var(--primary); border-radius: 20px; display: flex; align-items: center; justify-content: center; font-size: 1.6rem;
}
.stat-data .value { font-size: 2rem; font-weight: 800; color: var(--text-main); }

/* TABLES */
.table-responsive { margin: 1rem -2.5rem -2.5rem -2.5rem !important; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; table-layout: auto; }
th {
    text-align: left; padding: 1.5rem 2.5rem; color: var(--text-muted);
    border-bottom: 1px solid var(--border); font-size: 0.85rem; font-weight: 800; text-transform: uppercase;
}
td { padding: 1.5rem 2.5rem; border-bottom: 1px solid var(--border); color: var(--text-main); font-weight: 500; }
tr:last-child td { border-bottom: none; }

/* BADGES */
.badge { padding: 6px 12px; border-radius: 20px; font-size: 0.75rem; font-weight: 800; text-transform: uppercase; }

/* FORMS */
.form-group { margin-bottom: 1.5rem; }
label { display: block; margin-bottom: 1rem; font-weight: 800; font-size: 0.95rem; text-transform: uppercase; letter-spacing: 1px; }
textarea.form-control { padding: 1.5rem; min-height: 120px; line-height: 1.8; }
.form-control {
    width: 100%; min-height: 64px; background-color: var(--bg-item);
    border: 1px solid var(--border); border-radius: var(--radius-md);
    color: var(--text-main); padding: 0 1.5rem; font-size: 1.1rem; transition: 0.3s;
}
.form-control:focus { border-color: var(--primary); outline: none; background-color: var(--bg-card); box-shadow: 0 0 0 4px var(--primary-muted); }

/* BUTTONS */
.btn {
    min-height: 64px; border-radius: 32px; padding: 0 2.5rem; font-weight: 800;
    display: inline-flex; align-items: center; justify-content: center; gap: 12px;
    cursor: pointer; border: none; transition: 0.25s; text-decoration: none; font-size: 1rem;
}
.btn-primary { background-color: var(--primary); color: #000; }
.btn-outline { background-color: var(--bg-item); color: var(--text-main); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { min-height: 48px; padding: 0 1.2rem; font-size: 0.8rem; border-radius: 24px; }

/* RESPONSIVE */
@media (min-width: 1400px) {
    .sidebar { transform: translateX(0); }
    .nav-toggle { display: none; }
    .app-container { padding-left: var(--sidebar-width); }
    .top-nav { left: var(--sidebar-width); justify-content: flex-end; }
}

@media (max-width: 767px) {
    .view-container { padding: 1rem; }
    .card { padding: 1.5rem; }
    .table-responsive { margin: 0 -1.5rem -1.5rem -1.5rem !important; }
    tr { display: block; border-bottom: 1px solid var(--border); padding: 1.5rem; }
    td { display: flex; justify-content: space-between; border-bottom: none; padding: 0.6rem 0; width: 100% !important; }
    td::before { content: attr(data-label); font-weight: 700; color: var(--primary); margin-right: 15px; }
}
