:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    --secondary: #64748b;
    --secondary-hover: #475569;
    --success: #16a34a;
    --success-light: #f0fdf4;
    --warning: #d97706;
    --warning-light: #fffbeb;
    --danger: #dc2626;
    --danger-light: #fef2f2;
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --border-focus: #93c5fd;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.07);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.08);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header & Navbar */
header.navbar {
    background: #0f172a;
    color: #ffffff;
    padding: 0.85rem 2rem;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    text-decoration: none;
    letter-spacing: -0.025em;
}

.brand-badge {
    background: #3b82f6;
    color: white;
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    font-weight: 800;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
}

.nav-links a {
    color: #cbd5e1;
    text-decoration: none;
    padding: 0.5rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.925rem;
    font-weight: 500;
    transition: all 0.15s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

/* Main Container */
main.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    flex: 1;
    width: 100%;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-title h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.02em;
}

.page-title p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 0.25rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem 1.15rem;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s ease-in-out;
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.825rem;
}

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

.btn-secondary {
    background-color: #ffffff;
    color: var(--secondary);
    border-color: var(--border);
}
.btn-secondary:hover {
    background-color: #f1f5f9;
    color: var(--text-main);
}

.btn-success {
    background-color: var(--success);
    color: #ffffff;
}
.btn-success:hover {
    background-color: #15803d;
}

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

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.925rem;
}

.alert-success {
    background-color: var(--success-light);
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.alert-danger {
    background-color: var(--danger-light);
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.alert-warning {
    background-color: var(--warning-light);
    color: #b45309;
    border: 1px solid #fde68a;
}

/* Cards & Grid */
.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-cols-4 {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.grid-cols-2 {
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
}

.card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    overflow: hidden;
}

.card-stat {
    display: flex;
    flex-direction: column;
    position: relative;
}

.card-stat .stat-title {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.card-stat .stat-value {
    font-size: 2.25rem;
    font-weight: 700;
    color: #0f172a;
    margin-top: 0.5rem;
}

.card-stat.due-stat {
    border-left: 4px solid var(--danger);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.75rem;
}

.card-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #0f172a;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    text-align: left;
}

th {
    background-color: #f8fafc;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 0.85rem 1rem;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

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

tbody tr:hover {
    background-color: #f1f5f9;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    letter-spacing: 0.025em;
}

.badge-success {
    background-color: var(--success-light);
    color: #15803d;
}

.badge-warning {
    background-color: var(--warning-light);
    color: #b45309;
}

.badge-danger {
    background-color: var(--danger-light);
    color: #b91c1c;
}

.badge-neutral {
    background-color: #f1f5f9;
    color: #475569;
}

.badge-primary {
    background-color: var(--primary-light);
    color: var(--primary);
}

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

label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: #334155;
}

input[type="text"],
input[type="datetime-local"],
select,
textarea {
    width: 100%;
    padding: 0.65rem 0.9rem;
    font-size: 0.925rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background-color: #ffffff;
    color: var(--text-main);
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input[type="text"]:focus,
input[type="datetime-local"]:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
}

/* Progress bar */
.progress-container {
    width: 100%;
    background-color: #e2e8f0;
    border-radius: 9999px;
    height: 10px;
    overflow: hidden;
    margin: 0.75rem 0;
}

.progress-bar {
    height: 100%;
    background-color: var(--primary);
    border-radius: 9999px;
    transition: width 0.3s ease;
}

.progress-bar.complete {
    background-color: var(--success);
}

/* Checklist items interactive list */
.checklist-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
    background-color: #ffffff;
    transition: background-color 0.15s ease;
}

.checklist-item.checked {
    background-color: #f0fdf4;
    border-color: #bbf7d0;
}

.checklist-item-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.checklist-item-index {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: #f1f5f9;
    font-weight: 700;
    font-size: 0.85rem;
    color: #475569;
}

.checklist-item.checked .checklist-item-index {
    background: #22c55e;
    color: #ffffff;
}

.checklist-item-text {
    font-size: 0.95rem;
    font-weight: 500;
}

.checklist-item-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}

.tab {
    padding: 0.5rem 1rem;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
}

.tab:hover {
    color: var(--text-main);
    background-color: #f1f5f9;
}

.tab.active {
    color: var(--primary);
    background-color: var(--primary-light);
}

/* Footer */
footer {
    background: #ffffff;
    border-top: 1px solid var(--border);
    padding: 1.5rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: auto;
}



/* Mobile Responsiveness */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .nav-links {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .entry-row {
        flex-wrap: wrap;
    }
    
    .entry-row > input {
        width: 100%;
        flex: 1 1 100% !important;
    }
    
    .entry-row > button {
        width: 100%;
        flex: 1 1 100% !important;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
}
