
* {
    box-sizing: border-box;
}

:root {
    color-scheme: light;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f4f7fb;
    color: #172033;
    transition: background .2s, color .2s;
}

a {
    color: inherit;
}

.navbar {
    min-height: 72px;
    padding: 14px 5%;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    box-shadow: 0 2px 12px rgba(15, 23, 42, .06);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #155bd5;
    font-size: 23px;
    font-weight: 800;
    text-decoration: none;
}

.logo-icon {
    display: grid;
    place-items: center;
    width: 35px;
    height: 35px;
    background: #155bd5;
    color: white;
    border-radius: 10px;
}

.nav-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.nav-links a {
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
}

.nav-links a:hover {
    color: #155bd5;
}

.nav-register,
.primary-button {
    background: #155bd5;
    color: white !important;
    padding: 11px 17px;
    border: 0;
    border-radius: 9px;
    text-decoration: none;
    font-weight: 700;
    cursor: pointer;
}

.theme-toggle {
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    padding: 10px 13px;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font-weight: 700;
}

.dashboard {
    width: 100%;
    max-width: 1200px;
    margin: auto;
    padding: 35px 20px 60px;
}

.dashboard-header,
.tasks-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 25px;
}

.dashboard-header h1 {
    font-size: 34px;
    margin: 5px 0;
}

.dashboard-header p,
.section-heading p {
    color: #64748b;
    margin-top: 8px;
}

.section-label {
    display: block;
    color: #155bd5;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.5px;
    margin-bottom: 7px;
}

.dashboard-date {
    background: white;
    padding: 13px 17px;
    border-radius: 10px;
    color: #475569;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 17px;
    margin-bottom: 25px;
}

.stat-card {
    display: flex;
    flex-direction: column;
    gap: 9px;
    padding: 22px;
    background: white;
    border-radius: 15px;
    border: 1px solid #e2e8f0;
    text-decoration: none;
}

.stat-card span {
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
}

.stat-card strong {
    font-size: 30px;
}

.stat-link:hover {
    border-color: #155bd5;
}

.create-card,
.filter-card,
.reminder-box,
.guest-notice {
    background: white;
    padding: 25px;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    margin-bottom: 25px;
}

.section-heading h2,
.tasks-heading h2 {
    margin: 0;
    font-size: 22px;
}

.task-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 17px;
    margin-top: 20px;
}

.form-group {
    min-width: 0;
}

.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    display: block;
    font-weight: 700;
    margin-bottom: 7px;
}

.form-group input,
.form-group textarea,
.form-group select,
.filter-form input,
.filter-form select {
    width: 100%;
    padding: 12px 13px;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    background: #f8fafc;
    color: #172033;
    font: inherit;
}

.primary-button {
    display: inline-block;
    text-align: center;
}

button.primary-button {
    font: inherit;
}

.filter-form {
    display: grid;
    grid-template-columns: minmax(200px, 1fr) 180px 110px;
    gap: 12px;
}

.completed-search {
    grid-template-columns: minmax(200px, 1fr) 110px;
}

.filter-button {
    background: #155bd5;
    color: white;
    border: 0;
    border-radius: 9px;
    padding: 12px;
    cursor: pointer;
}

.tasks-section {
    margin-top: 35px;
}

.task-count {
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
}

.task-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.task-card {
    padding: 21px;
    border-radius: 15px;
    transition: transform .2s;
}

.task-card:hover {
    transform: translateY(-3px);
}

.task-pending {
    background: #fff1f2;
    border: 1px solid #fecaca;
    border-left: 6px solid #dc2626;
}

.task-completed {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-left: 6px solid #16a34a;
}

.task-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 17px;
}

.status {
    font-size: 12px;
    font-weight: 800;
}

.pending-label {
    color: #b91c1c;
}

.completed-label {
    color: #15803d;
}

.priority-badge {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 800;
}

.priority-low {
    background: #e2e8f0;
    color: #475569;
}

.priority-medium {
    background: #dbeafe;
    color: #1d4ed8;
}

.priority-high {
    background: #fee2e2;
    color: #b91c1c;
}

.task-content h3 {
    margin: 0;
    font-size: 19px;
}

.task-pending .task-content h3 {
    color: #b91c1c;
}

.task-completed .task-content h3 {
    color: #15803d;
    text-decoration: line-through;
}

.task-content p {
    line-height: 1.6;
    font-size: 13px;
}

.task-details {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
    font-size: 12px;
}

.task-details span {
    background: rgba(255,255,255,.75);
    padding: 9px;
    border-radius: 8px;
}

.task-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    border-top: 1px solid rgba(100,116,139,.2);
    margin-top: 18px;
    padding-top: 15px;
}

.action-button {
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.complete-button {
    background: #dcfce7;
    color: #166534;
}

.edit-button {
    background: #dbeafe;
    color: #1d4ed8;
}

.delete-button {
    background: #fee2e2;
    color: #b91c1c;
}

.secondary-button {
    display: inline-block;
    padding: 11px 15px;
    background: #e2e8f0;
    color: #334155;
    border-radius: 9px;
    text-decoration: none;
    font-weight: 700;
}

.empty-state {
    text-align: center;
    background: white;
    padding: 55px 20px;
    border-radius: 15px;
    border: 1px solid #e2e8f0;
}

.empty-icon {
    font-size: 35px;
    color: #16a34a;
}

.empty-state p {
    color: #64748b;
}

.reminder-box {
    border-left: 5px solid #f59e0b;
}

.reminder-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 15px;
}

.reminder-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 14px;
    border-radius: 9px;
    background: #fff7ed;
}

.guest-notice {
    text-align: center;
}

.guest-notice p {
    color: #64748b;
}

.flash-container {
    max-width: 1200px;
    margin: 18px auto 0;
    padding: 0 20px;
}

.flash-message {
    padding: 13px 16px;
    border-radius: 9px;
    margin-bottom: 10px;
}

.flash-message.success {
    background: #dcfce7;
    color: #166534;
}

.flash-message.error {
    background: #fee2e2;
    color: #991b1b;
}

.footer {
    text-align: center;
    padding: 25px;
    color: #64748b;
    font-size: 13px;
}

/* DARK MODE */

html[data-theme="dark"] {
    color-scheme: dark;
}

html[data-theme="dark"] body {
    background: #0f172a;
    color: #e2e8f0;
}

html[data-theme="dark"] .navbar,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .create-card,
html[data-theme="dark"] .filter-card,
html[data-theme="dark"] .empty-state,
html[data-theme="dark"] .guest-notice,
html[data-theme="dark"] .dashboard-date {
    background: #1e293b;
    color: #e2e8f0;
    border-color: #334155;
}

html[data-theme="dark"] .task-pending {
    background: #3b1d28;
    border-color: #7f1d1d;
}

html[data-theme="dark"] .task-completed {
    background: #153526;
    border-color: #166534;
}

html[data-theme="dark"] .task-pending .task-content h3,
html[data-theme="dark"] .task-pending .task-content p,
html[data-theme="dark"] .pending-label {
    color: #fca5a5;
}

html[data-theme="dark"] .task-completed .task-content h3,
html[data-theme="dark"] .task-completed .task-content p,
html[data-theme="dark"] .completed-label {
    color: #86efac;
}

html[data-theme="dark"] .dashboard-header p,
html[data-theme="dark"] .section-heading p,
html[data-theme="dark"] .stat-card span,
html[data-theme="dark"] .empty-state p {
    color: #94a3b8;
}

html[data-theme="dark"] .form-group input,
html[data-theme="dark"] .form-group textarea,
html[data-theme="dark"] .form-group select,
html[data-theme="dark"] .filter-form input,
html[data-theme="dark"] .filter-form select {
    background: #0f172a;
    color: #e2e8f0;
    border-color: #475569;
}

html[data-theme="dark"] .task-details span,
html[data-theme="dark"] .reminder-item {
    background: #273449;
    color: #e2e8f0;
}

html[data-theme="dark"] .theme-toggle {
    border-color: #475569;
    color: #e2e8f0;
}

html[data-theme="dark"] .secondary-button {
    background: #334155;
    color: #e2e8f0;
}

html[data-theme="dark"] .reminder-box {
    background: #1e293b;
    border-color: #b45309;
}

@media (max-width: 850px) {
    .task-grid,
    .stats-grid,
    .reminder-grid {
        grid-template-columns: 1fr;
    }

    .filter-form {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .navbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .nav-links {
        gap: 12px;
    }

    .dashboard {
        padding: 22px 14px 40px;
    }

    .dashboard-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .task-form {
        grid-template-columns: 1fr;
    }

    .full-width {
        grid-column: auto;
    }

    .reminder-item {
        flex-direction: column;
    }
}
