:root {
    /* Brand Colors */
    --brand-primary: #4F46E5;
    /* Indigo 600 */
    --brand-primary-dark: #4338ca;
    --brand-secondary: #10B981;
    /* Emerald 500 */
    --brand-danger: #EF4444;
    --brand-dark: #111827;
    /* Gray 900 */

    /* UI semantics */
    --bg-body: #F3F4F6;
    /* Cool Gray 100 */
    --bg-card: #FFFFFF;
    --bg-header: #1F2937;
    /* Gray 800 - Dark Header for contrast */

    --text-primary: #111827;
    --text-secondary: #6B7280;
    --text-on-dark: #F9FAFB;

    --border-subtle: #E5E7EB;
    --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
}

/* Dark Mode Overrides */
body.dark-mode {
    --bg-body: #0F172A;
    /* Slate 900 */
    --bg-card: #1E293B;
    /* Slate 800 */
    --bg-header: #020617;
    /* Slate 950 */

    --text-primary: #F1F5F9;
    --text-secondary: #94A3B8;

    --border-subtle: #334155;
    --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
}

/* Reset & Base */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    background-color: var(--bg-body);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    font-size: 15px;
    line-height: 1.5;
}

/* Header & Nav */
.navbar {
    background-color: var(--bg-header);
    color: var(--text-on-dark);
    height: 64px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-content {
    width: 100%;
    max-width: 1400px;
    /* Wider container */
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.025em;
    color: white;
    margin-right: 32px;
}

.nav-links {
    display: flex;
    gap: 8px;
    flex: 1;
}

.nav-link {
    color: #D1D5DB;
    /* Gray 300 */
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-link.active {
    background-color: var(--brand-primary);
    color: white;
}

.theme-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 16px;
    transition: background 0.2s;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Main Layout */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px 24px;
}

h1,
h2,
h3 {
    margin-top: 0;
    color: var(--text-primary);
}

h1 {
    font-size: 1.875rem;
    margin-bottom: 24px;
    font-weight: 700;
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-subtle);
    padding: 24px;
    margin-bottom: 24px;
}

/* Forms - Big Modern Inputs */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
    align-items: end;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Action buttons container */
.form-actions {
    flex-direction: row;
    gap: 12px;
    flex-wrap: wrap;
    /* Allow wrapping on small screens */
    align-items: flex-end;
}

label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    color: var(--text-secondary);
}

input[type="text"],
input[type="date"],
input[type="number"],
select {
    height: 42px;
    padding: 0 12px;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    font-size: 0.95rem;
    background-color: var(--bg-card);
    color: var(--text-primary);
    width: 100%;
    transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Buttons */
.btn {
    height: 42px;
    padding: 0 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: transform 0.1s, opacity 0.2s;
    text-decoration: none;
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

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

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

/* Data Grid (Table) */
.table-responsive {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    background-color: var(--bg-card);
}

th {
    background-color: rgba(243, 244, 246, 0.5);
    /* Slight tint */
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 12px 16px;
    border-bottom: 2px solid var(--border-subtle);
    text-align: left;
    white-space: nowrap;
}

body.dark-mode th {
    background-color: rgba(30, 41, 59, 0.5);
}

td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-primary);
    vertical-align: middle;
}

tr:hover td {
    background-color: rgba(0, 0, 0, 0.02);
}

body.dark-mode tr:hover td {
    background-color: rgba(255, 255, 255, 0.02);
}

/* Images & Badges */
.img-thumb {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    object-fit: cover;
    background-color: var(--border-subtle);
}

.badge {
    padding: 4px 8px;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--brand-secondary);
}

.badge-warning {
    background-color: rgba(245, 158, 11, 0.1);
    color: #F59E0B;
}

/* Utilities */
.text-muted {
    color: var(--text-secondary);
}

.d-flex {
    display: flex;
}

.justify-between {
    justify-content: space-between;
}

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