* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    font-family: 'Segoe UI', sans-serif;
    background: #f4f7fb;
    color: #1f2937;
    display: flex;
    flex-direction: column;
}

a {
    text-decoration: none;
}

.main-content,
main {
    flex: 1;
}

.container {
    max-width: 1200px;
    margin-top: 30px;
}

/* AUTH */

.auth-page {
    min-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.auth-card {
    width: 420px;
    background: white;
    padding: 40px;
    border-radius: 24px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.25);
}

.auth-card h2 {
    margin: 0;
    color: #111827;
    font-size: 30px;
}

.auth-card p {
    color: #6b7280;
    margin-bottom: 25px;
}

.auth-card form {
    display: grid;
    gap: 15px;
}

.auth-card input {
    padding: 15px;
    border-radius: 14px;
    border: 1px solid #d1d5db;
    font-size: 15px;
}

.auth-card button {
    padding: 14px;
    border: none;
    border-radius: 14px;
    background: #4f46e5;
    color: white;
    font-weight: 700;
    cursor: pointer;
}

.auth-card a {
    display: block;
    margin-top: 20px;
    color: #4f46e5;
    font-weight: 600;
}

.error {
    background: #fee2e2;
    color: #991b1b;
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 15px;
}

/* DASHBOARD */

.dashboard-header {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    background: linear-gradient(135deg, #111827, #312e81);
    color: white;
    padding: 35px;
    border-radius: 28px;
    margin-bottom: 28px;
}

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

.dashboard-header p {
    color: #d1d5db;
    margin-bottom: 0;
}

.dashboard-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.main-btn,
.logout-btn {
    display: inline-block;
    padding: 13px 20px;
    border-radius: 14px;
    font-weight: 700;
    color: white;
}

.main-btn {
    background: #22c55e;
}

.main-btn.secondary {
    background: #0ea5e9;
}

.logout-btn {
    background: #ef4444;
}

/* STATS */

.stats-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
    gap: 20px !important;
    margin-bottom: 35px !important;
    align-items: stretch;
}

.stat-card {
    color: white;
    padding: 25px;
    border-radius: 24px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.12);
    min-height: 150px !important;
    height: auto !important;
}

.stat-card h2 {
    margin: 0;
    font-size: 40px;
}

.stat-card p {
    margin: 8px 0 0;
    font-weight: 600;
}

.blue {
    background: linear-gradient(135deg, #2563eb, #60a5fa);
}

.purple {
    background: linear-gradient(135deg, #7c3aed, #a78bfa);
}

.orange {
    background: linear-gradient(135deg, #f97316, #fb923c);
}

.green {
    background: linear-gradient(135deg, #16a34a, #4ade80);
}

.red {
    background: linear-gradient(135deg, #dc2626, #f87171);
}

.pink {
    background: linear-gradient(135deg, #db2777, #f472b6);
}

/* DASHBOARD WIDGETS */

.dashboard-widgets {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    gap: 24px !important;
    margin: 35px 0 !important;
    width: 100%;
    clear: both;
}

.chart-card,
.alert-card {
    width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    background: white;
    padding: 28px;
    border-radius: 26px;
    box-shadow: 0 18px 45px rgba(0,0,0,0.08);
    overflow: hidden;
}

.chart-card h2,
.alert-card h2 {
    margin-top: 0;
    color: #111827;
}

.chart-wrapper {
    height: 300px;
    width: 100%;
}

.chart-wrapper canvas {
    width: 100% !important;
    height: 100% !important;
}

.deadline-alert {
    padding: 16px;
    border-radius: 18px;
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.deadline-alert strong {
    font-size: 17px;
}

.deadline-alert span,
.deadline-alert p {
    margin: 0;
    color: #4b5563;
}

.overdue-alert {
    background: #fee2e2;
    border-left: 6px solid #dc2626;
}

.danger-alert {
    background: #fff7ed;
    border-left: 6px solid #f97316;
}

.normal-alert {
    background: #eef2ff;
    border-left: 6px solid #6366f1;
}

.empty-alert {
    padding: 18px;
    background: #f3f4f6;
    border-radius: 16px;
    color: #6b7280;
}

/* TASKS */

.section-title {
    margin: 35px 0 20px;
}

.task-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 22px;
}

.task-card {
    background: white;
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.08);
    border: 1px solid #e5e7eb;
}

.task-top {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.task-top h3 {
    margin: 0;
    font-size: 22px;
}

.priority {
    background: #eef2ff;
    color: #4338ca;
    padding: 7px 12px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 13px;
}

.task-card p {
    color: #6b7280;
}

.task-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.task-meta span {
    background: #f3f4f6;
    padding: 8px 12px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 13px;
}

.deadline {
    font-weight: 700;
    color: #374151 !important;
}

.task-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.task-actions a {
    background: #4f46e5;
    color: white;
    padding: 9px 14px;
    border-radius: 12px;
    font-weight: 600;
}

.task-actions .delete {
    background: #ef4444;
}

/* FORM */

.form-card {
    max-width: 720px;
    margin: 40px auto;
    background: white;
    padding: 35px;
    border-radius: 26px;
    box-shadow: 0 20px 45px rgba(0,0,0,0.1);
}

.form-card h2 {
    margin-top: 0;
    font-size: 30px;
}

.form-card form {
    display: grid;
    gap: 14px;
}

.form-card label {
    font-weight: 700;
}

.form-card input,
.form-card textarea,
.form-card select {
    width: 100%;
    padding: 14px;
    border: 1px solid #d1d5db;
    border-radius: 14px;
    font-size: 15px;
}

.form-card textarea {
    height: 110px;
}

.form-card button {
    margin-top: 10px;
    padding: 15px;
    border: none;
    border-radius: 14px;
    background: #4f46e5;
    color: white;
    font-weight: 800;
    cursor: pointer;
}

/* FILTER */

.filter-box {
    background: white;
    padding: 22px;
    border-radius: 22px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.08);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 25px;
}

.filter-box input,
.filter-box select {
    padding: 13px;
    border-radius: 14px;
    border: 1px solid #d1d5db;
}

.filter-box button {
    border: none;
    border-radius: 14px;
    background: #4f46e5;
    color: white;
    font-weight: 700;
    cursor: pointer;
}

/* TOAST */

.toast-box {
    position: fixed;
    top: 90px;
    right: 25px;
    z-index: 9999;
    display: grid;
    gap: 12px;
}

.toast-alert {
    min-width: 280px;
    padding: 15px 18px;
    border-radius: 16px;
    color: white;
    font-weight: 700;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
}

.toast-alert.overdue {
    background: #dc2626;
}

.toast-alert.danger {
    background: #f97316;
}

.toast-alert.normal {
    background: #4f46e5;
}

/* FOOTER */

.footer-clean {
    margin-top: 60px;
    padding: 25px 0;
    text-align: center;
    color: #6b7280;
    border-top: 1px solid #e5e7eb;
}

/* RESPONSIVE */

@media (max-width: 900px) {
    .dashboard-widgets {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .dashboard-actions {
        width: 100%;
    }

    .main-btn,
    .logout-btn {
        margin: 0;
    }
}
.stats-row {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)) !important;
    gap: 20px;
    margin: 30px 0;
}

.status-box {
    min-height: 150px;
    border-radius: 28px;
    padding: 28px;
    color: white;
    box-shadow: 0 18px 40px rgba(0,0,0,0.12);
}

.status-box h2 {
    font-size: 42px;
    margin: 0;
    font-weight: 800;
}

.status-box p {
    margin-top: 10px;
    font-size: 17px;
    font-weight: 700;
}

.dashboard-panel-grid {
    display: grid !important;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 24px;
    margin: 35px 0;
    align-items: stretch;
}

.panel-card {
    background: white;
    border-radius: 28px;
    padding: 28px;
    box-shadow: 0 18px 45px rgba(0,0,0,0.08);
    min-width: 0;
}

.panel-card h2 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 26px;
    color: #111827;
}

.chart-box {
    width: 100%;
    height: 280px;
}

.chart-box canvas {
    width: 100% !important;
    height: 100% !important;
}

.deadline-alert {
    padding: 16px;
    border-radius: 18px;
    margin-bottom: 14px;
    border-left: 6px solid #6366f1;
}

.deadline-alert strong {
    display: block;
    font-size: 17px;
}

.deadline-alert span,
.deadline-alert p {
    margin: 4px 0 0;
    color: #4b5563;
}

.overdue-alert {
    background: #fee2e2;
    border-left-color: #dc2626;
}

.danger-alert {
    background: #fff7ed;
    border-left-color: #f97316;
}

.normal-alert {
    background: #eef2ff;
    border-left-color: #6366f1;
}

.calendar-list {
    display: grid;
    gap: 14px;
}

.calendar-item {
    display: flex;
    gap: 14px;
    align-items: center;
    background: #f8fafc;
    padding: 14px;
    border-radius: 18px;
    border: 1px solid #e5e7eb;
}

.calendar-date {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    background: #4f46e5;
    color: white;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.calendar-date strong {
    font-size: 22px;
    line-height: 18px;
}

.calendar-date span {
    font-size: 12px;
    margin-top: -8px;
}

.calendar-item h4 {
    margin: 0;
    font-size: 16px;
}

.calendar-item p {
    margin: 4px 0 0;
    color: #6b7280;
}

.toast-box {
    position: fixed;
    top: 90px;
    right: 25px;
    z-index: 9999;
    display: grid;
    gap: 12px;
}

.toast-alert {
    min-width: 280px;
    padding: 15px 18px;
    border-radius: 16px;
    color: white;
    font-weight: 700;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
}

.toast-alert.overdue {
    background: #dc2626;
}

.toast-alert.danger {
    background: #f97316;
}

.toast-alert.normal {
    background: #4f46e5;
}

@media (max-width: 1100px) {
    .dashboard-panel-grid {
        grid-template-columns: 1fr;
    }
}