* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background: #0b1020;
    color: #ffffff;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
}

button,
input,
select,
textarea {
    font: inherit;
}

/* =========================
   TOPBAR
========================= */

.topbar {
    height: 72px;
    padding: 0 28px;

    display: flex;
    align-items: center;
    gap: 20px;

    border-bottom: 1px solid rgba(255,255,255,0.08);

    background: rgba(12, 18, 36, 0.95);

    position: sticky;
    top: 0;
    z-index: 100;
}

.back-btn {
    width: 38px;
    height: 38px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 12px;

    background: rgba(255,255,255,0.06);

    font-size: 22px;
}

.brand {
    font-weight: 800;
    font-size: 21px;
}

.header-title {
    margin-left: auto;

    color: #a8b2c7;

    font-size: 14px;
}

/* =========================
   PAGE
========================= */

.routine-page {
    width: min(1100px, 92%);
    margin: 0 auto;

    padding: 34px 0 70px;
}

.routine-header {
    margin-bottom: 24px;
}

.small-label,
.section-heading span,
.today-card span,
.progress-info span,
.modal-header span {
    color: #7f8ca6;
    font-size: 12px;
    letter-spacing: 1.4px;
}

.routine-header h1 {
    margin-top: 6px;

    font-size: 36px;
}

.routine-header p {
    margin-top: 8px;

    color: #9ba6ba;
}

/* =========================
   TABS
========================= */

.routine-tabs {
    display: flex;
    gap: 12px;

    margin-bottom: 24px;
}

.routine-tab {
    border: 1px solid rgba(255,255,255,0.08);

    background: #11182a;

    color: #cbd5e1;

    padding: 12px 18px;

    border-radius: 14px;

    cursor: pointer;

    display: inline-flex;
    align-items: center;
    gap: 8px;

    transition: 0.2s ease;
}

.routine-tab:hover {
    transform: translateY(-1px);

    border-color: rgba(255,255,255,0.18);
}

.routine-tab.active {
    background: #18223a;

    color: #ffffff;
}

.premium-tag {
    font-size: 12px;
}

/* =========================
   TODAY CARD
========================= */

.today-card,
.routine-progress-card,
.routine-section,
.week-card {
    background: #10172a;

    border: 1px solid rgba(255,255,255,0.07);

    border-radius: 20px;
}

.today-card {
    padding: 22px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 16px;

    margin-bottom: 18px;
}

.today-card h2 {
    margin-top: 6px;

    font-size: 22px;
}

.add-task-btn {
    border: none;

    padding: 12px 18px;

    border-radius: 13px;

    background: #ffffff;

    color: #0b1020;

    font-weight: 700;

    cursor: pointer;
}

/* =========================
   PROGRESS
========================= */

.routine-progress-card {
    padding: 22px;

    margin-bottom: 24px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;

    gap: 16px;
}

.progress-info h2 {
    margin-top: 6px;

    font-size: 20px;
}

.progress-info strong {
    font-size: 22px;
}

.progress-bar {
    height: 10px;

    margin-top: 18px;

    border-radius: 999px;

    background: rgba(255,255,255,0.07);

    overflow: hidden;
}

.progress-fill {
    width: 0%;
    height: 100%;

    background: linear-gradient(
        90deg,
        #7c3aed,
        #22d3ee
    );

    border-radius: inherit;

    transition: width 0.3s ease;
}

/* =========================
   ROUTINE LIST
========================= */

.routine-section {
    padding: 22px;

    margin-bottom: 24px;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;

    margin-bottom: 18px;
}

.section-heading h2 {
    margin-top: 4px;

    font-size: 22px;
}

.routine-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.empty-routine {
    padding: 44px 20px;

    text-align: center;

    border: 1px dashed rgba(255,255,255,0.12);

    border-radius: 16px;

    color: #9ba6ba;
}

.empty-icon {
    font-size: 34px;

    margin-bottom: 12px;
}

.empty-routine h3 {
    color: #ffffff;

    margin-bottom: 6px;
}

/* =========================
   TASK CARD
========================= */

.routine-task {
    padding: 16px;

    border-radius: 16px;

    background: #151e34;

    border: 1px solid rgba(255,255,255,0.06);

    display: grid;
    grid-template-columns: 110px 1fr auto;
    align-items: center;

    gap: 16px;
}

.task-time {
    color: #8bdcff;

    font-weight: 700;
}

.task-info h3 {
    font-size: 17px;
}

.task-info p {
    margin-top: 4px;

    color: #8d99af;

    font-size: 13px;
}

.task-actions {
    display: flex;
    gap: 8px;
}

.task-actions button {
    width: 36px;
    height: 36px;

    border-radius: 10px;

    border: 1px solid rgba(255,255,255,0.08);

    background: rgba(255,255,255,0.05);

    color: white;

    cursor: pointer;
}

.routine-task.completed {
    opacity: 0.55;
}

.routine-task.completed h3 {
    text-decoration: line-through;
}

/* =========================
   WEEK DAYS
========================= */

.week-card {
    padding: 22px;
}

.week-days {
    display: grid;

    grid-template-columns:
        repeat(7, 1fr);

    gap: 10px;
}

.day-btn {
    border: 1px solid rgba(255,255,255,0.08);

    background: #151e34;

    color: #b8c2d6;

    padding: 12px 6px;

    border-radius: 12px;

    cursor: pointer;
}

.day-btn.active {
    background: #ffffff;

    color: #0b1020;

    font-weight: 700;
}

/* =========================
   MODAL
========================= */

.modal-overlay {
    position: fixed;
    inset: 0;

    background: rgba(0,0,0,0.65);

    display: none;
    align-items: center;
    justify-content: center;

    padding: 20px;

    z-index: 1000;
}

.modal-overlay.active {
    display: flex;
}

.task-modal {
    width: min(520px, 100%);

    max-height: 90vh;
    overflow-y: auto;

    background: #11182a;

    border: 1px solid rgba(255,255,255,0.1);

    border-radius: 22px;

    padding: 24px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;

    margin-bottom: 22px;
}

.modal-header h2 {
    margin-top: 5px;
}

.close-modal {
    border: none;

    width: 36px;
    height: 36px;

    border-radius: 10px;

    background: rgba(255,255,255,0.06);

    color: white;

    cursor: pointer;
}

.form-group {
    display: flex;
    flex-direction: column;

    gap: 8px;

    margin-bottom: 16px;
}

.form-group label {
    color: #c7d0e2;

    font-size: 14px;
}

.form-group label span {
    color: #718096;

    font-size: 12px;
}

input,
select,
textarea {
    width: 100%;

    border: 1px solid rgba(255,255,255,0.08);

    background: #0b1120;

    color: #ffffff;

    padding: 13px 14px;

    border-radius: 12px;

    outline: none;
}

textarea {
    min-height: 100px;

    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(34,211,238,0.55);
}

.time-row {
    display: grid;
    grid-template-columns: 1fr 1fr;

    gap: 12px;
}

.save-task-btn {
    width: 100%;

    border: none;

    padding: 14px;

    border-radius: 13px;

    background: #ffffff;

    color: #0b1020;

    font-weight: 800;

    cursor: pointer;
}

/* =========================
   MOBILE
========================= */

@media (max-width: 700px) {

    .topbar {
        padding: 0 16px;
    }

    .routine-page {
        width: 94%;

        padding-top: 22px;
    }

    .routine-header h1 {
        font-size: 29px;
    }

    .routine-tabs {
        display: grid;

        grid-template-columns: 1fr 1fr;
    }

    .routine-tab {
        justify-content: center;
    }

    .today-card {
        align-items: flex-start;
        flex-direction: column;
    }

    .add-task-btn {
        width: 100%;
    }

    .week-days {
        grid-template-columns:
            repeat(4, 1fr);
    }

    .routine-task {
        grid-template-columns: 1fr;

        gap: 8px;
    }

    .task-actions {
        justify-content: flex-end;
    }

    .time-row {
        grid-template-columns: 1fr;
    }

}