/* css/style.css */
:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #475569;
    --success-color: #10b981;
    --success-hover: #059669;
    --danger-color: #ef4444;
    --danger-hover: #dc2626;
    --warning-color: #f59e0b;
    --background: #f8fafc;
    --surface: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --radius: 8px;
    --shadow: 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);
}

[data-theme="dark"] {
    --primary-color: #3b82f6;
    --primary-hover: #60a5fa;
    --secondary-color: #94a3b8;
    --success-color: #10b981;
    --success-hover: #059669;
    --danger-color: #ef4444;
    --danger-hover: #dc2626;
    --warning-color: #fbbf24;
    --background: #0f172a;
    --surface: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: #334155;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.6), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
}


* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--background);
    color: var(--text-main);
    line-height: 1.5;
    padding-bottom: 2rem;
}

/* Header & Navigation */
header {
    background-color: var(--surface);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--secondary-color);
    font-weight: 500;
    transition: color 0.2s ease;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
}

.nav-links a:hover, .nav-links a.active {
    color: var(--primary-color);
    background-color: var(--border);
}

/* Dropdown Menu */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: var(--surface);
    min-width: 220px;
    box-shadow: var(--shadow-hover);
    border-radius: var(--radius);
    z-index: 1000;
    top: 100%;
    left: 0;
    border: 1px solid var(--border);
}

.dropdown.open .dropdown-content {
    display: block;
}

.dropdown-content a {
    color: var(--text-main);
    padding: 0.75rem 1rem;
    text-decoration: none;
    display: block;
    border-radius: 0;
}

.dropdown-content a:first-child {
    border-top-left-radius: var(--radius);
    border-top-right-radius: var(--radius);
}

.dropdown-content a:last-child {
    border-bottom-left-radius: var(--radius);
    border-bottom-right-radius: var(--radius);
}

.dropdown-content a:hover {
    background-color: var(--border);
    color: var(--primary-hover);
}

/* Removed duplicate hover rule */

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Container & Layout */
.container {
    max-width: 1280px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

.card {
    background-color: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow-hover);
}

/* Typography */
h1, h2, h3, h4 {
    color: var(--text-main);
    margin-bottom: 1rem;
    font-weight: 600;
}

p {
    margin-bottom: 1rem;
}

.text-muted {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    text-decoration: none;
    gap: 0.5rem;
}

.btn:active {
    transform: scale(0.98);
}

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

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

.btn-secondary {
    background-color: var(--surface);
    color: var(--text-main);
    border: 1px solid var(--border);
}

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

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

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

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

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

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--secondary-color);
    font-size: 0.875rem;
}

.form-control {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    color: var(--text-main);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}
.form-row > * {
    flex: 1;
    min-width: 200px;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius);
    box-shadow: 0 0 0 1px var(--border);
}

table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--surface);
    text-align: left;
}

th, td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

th {
    background-color: var(--surface);
    font-weight: 600;
    color: var(--secondary-color);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: sticky;
    top: 0;
}

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

tr:hover td {
    background-color: var(--background);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    background-color: var(--border);
    color: var(--text-main);
}

.badge-success {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge-primary {
    background-color: #dbeafe;
    color: #1e40af;
}

/* Utilities */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.justify-between { justify-content: space-between; }
.items-center { align-items: center; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.hidden { display: none !important; }

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    border: 1px solid transparent;
}
.alert-success {
    background-color: #d1fae5;
    border-color: #a7f3d0;
    color: #065f46;
}
.alert-error {
    background-color: #fee2e2;
    border-color: #fecaca;
    color: #991b1b;
}

/* Dashboard Grid */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* Mobile responsive menu */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block !important;
    }
    .nav-links {
        display: none;
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--surface);
        box-shadow: var(--shadow);
        padding: 1rem;
        z-index: 1000;
        border-top: 1px solid var(--border);
    }
    .nav-links.active {
        display: flex;
    }
    .user-menu {
        display: none;
    }
    .user-menu.active {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        padding: 1rem;
        background: var(--background);
        width: 100%;
        box-sizing: border-box;
    }
    .dropdown {
        width: 100%;
    }
    .dropdown > a {
        display: block;
    }
    .dropdown-content {
        position: static;
        box-shadow: none;
        border: none;
        padding-left: 0;
        display: none;
    }
    .dropdown.open .dropdown-content {
        display: block;
    }
}

/* Print Styles */
@media print {
    header, .btn, .no-print {
        display: none !important;
    }
    body {
        background-color: white;
        padding: 0;
    }
    .container {
        max-width: 100%;
        margin: 0;
        padding: 0;
    }
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
