:root {
    --primary-color: #3b82f6;
    /* Blue 500 */
    --primary-hover: #2563eb;
    /* Blue 600 */
    --secondary-color: #6b7280;
    /* Gray 500 */
    --success-color: #10b981;
    /* Emerald 500 */
    --danger-color: #ef4444;
    /* Red 500 */
    --warning-color: #f59e0b;
    /* Amber 500 */
    --bg-color: #f3f4f6;
    /* Gray 100 */
    --card-bg: #ffffff;
    --text-main: #1f2937;
    /* Gray 800 */
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    /* Gray 200 */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    margin: 0;
    padding-bottom: 50px;
    /* Space for footer */
    line-height: 1.5;
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.container-sm {
    max-width: 600px;
}

.container-md {
    max-width: 900px;
    margin: 0 auto;
    background: var(--card-bg);
    padding: 30px;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    margin-top: 0;
    color: #111827;
}

h1 {
    font-size: 1.875rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Navigation */
.navbar {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.navbar-brand {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav-links a {
    color: var(--text-main);
    font-weight: 500;
    font-size: 0.95rem;
}

.nav-links a:hover {
    color: var(--primary-color);
    text-decoration: none;
}

.nav-links .logout {
    color: var(--danger-color);
}

/* Dropdown */
/* Dropdown */
.dropdown {
    position: relative;
    display: inline-block;
    height: 100%;
}

/* Added height */
.dropdown>a {
    display: inline-block;
    height: 100%;
    display: flex;
    align-items: center;
}

/* Capture interactions */
.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    /* Anchor to bottom */
    background-color: var(--card-bg);
    min-width: 200px;
    /* SLightly wider */
    box-shadow: var(--shadow-md);
    z-index: 1000;
    /* Higher Z */
    border-radius: 6px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    margin-top: 0;
    /* Remove gap */
}

.dropdown-content a {
    color: var(--text-main);
    padding: 10px 16px;
    display: block;
    border-bottom: 1px solid var(--border-color);
    text-decoration: none;
}

.dropdown-content a:last-child {
    border-bottom: none;
}

.dropdown-content a:hover {
    background-color: #f9fafb;
    color: var(--primary-color);
}

.dropdown:hover .dropdown-content {
    display: block;
}

/* Cards & Sections */
.card {
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

/* Forms */
.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #374151;
    font-size: 0.9rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: border-color 0.15s;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.form-inline {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 16px;
    border-radius: 6px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background-color 0.15s;
    font-size: 0.95rem;
    text-decoration: none !important;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-secondary {
    background-color: white;
    border-color: #d1d5db;
    color: #374151;
}

.btn-secondary:hover {
    background-color: #f9fafb;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    background-color: #059669;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

th,
td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background-color: #f8fafc;
    font-weight: 600;
    color: #475569;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover {
    background-color: #f9fafb;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
}

.alert-success {
    background-color: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-error {
    background-color: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-info {
    background-color: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* Utilities */
.text-right {
    text-align: right;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-muted);
}

.mt-4 {
    margin-top: 1.5rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Display Only (Read-Only Fields) */
.display-field {
    background-color: #f3f4f6;
    padding: 10px;
    border-radius: 6px;
    font-weight: 500;
    color: #111827;
    border: 1px solid #e5e7eb;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 40px;
    border-top: 1px solid var(--border-color);
}