* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}


:root {

    --background: #080b10;
    --panel: #10151d;
    --panel-light: #151c26;

    --border: #252d38;

    --text: #f2f4f7;
    --muted: #8993a1;

    --green: #35d07f;
    --blue: #4da3ff;
    --orange: #ffb454;
    --purple: #9b7cff;
    --red: #ff5c5c;

}


html {

    background: var(--background);

}


body {

    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Arial,
        sans-serif;

    background: var(--background);

    color: var(--text);

    min-height: 100vh;

    line-height: 1.4;

}


/* =========================================================
   APP
========================================================= */

.app {

    width: 100%;

    max-width: 900px;

    margin: 0 auto;

    padding:
        env(safe-area-inset-top)
        16px
        env(safe-area-inset-bottom)
        16px;

}


/* =========================================================
   CABECERA
========================================================= */

.topbar {

    display: flex;

    justify-content: space-between;

    align-items: center;

    padding: 20px 0 18px;

    border-bottom:
        1px solid var(--border);

}


.app-name {

    font-size: 13px;

    font-weight: 800;

    letter-spacing: 1.5px;

    color: var(--muted);

}


.current-date {

    margin-top: 4px;

    font-size: 15px;

    font-weight: 600;

}


.clock {

    font-size: 26px;

    font-weight: 800;

    letter-spacing: -1px;

}


/* =========================================================
   HOY
========================================================= */

.today-section {

    padding: 24px 0 18px;

}


.today-label {

    font-size: 11px;

    font-weight: 800;

    color: var(--green);

    letter-spacing: 1.5px;

    margin-bottom: 5px;

}


h1 {

    font-size: 30px;

    line-height: 1.1;

    margin-bottom: 18px;

    letter-spacing: -1px;

}


.now-card,
.next-card {

    border-radius: 16px;

    padding: 18px;

    margin-bottom: 10px;

    border:
        1px solid var(--border);

}


.now-card {

    background: var(--panel-light);

    border-left:
        5px solid var(--green);

}


.next-card {

    background: var(--panel);

    border-left:
        5px solid var(--blue);

}


.now-label,
.next-label {

    font-size: 10px;

    font-weight: 900;

    letter-spacing: 1.4px;

    margin-bottom: 7px;

    color: var(--muted);

}


#nowActivity,
#nextActivityName {

    font-size: 20px;

    font-weight: 800;

}


.activity-time {

    margin-top: 4px;

    font-size: 13px;

    color: var(--muted);

}


/* =========================================================
   SECCIONES
========================================================= */

section {

    margin-top: 18px;

}


.section-title {

    font-size: 11px;

    font-weight: 900;

    color: var(--muted);

    letter-spacing: 1.4px;

}


.selected-day {

    font-size: 18px;

    font-weight: 800;

    margin-top: 3px;

}


.section-header {

    display: flex;

    align-items: center;

    justify-content: space-between;

}


.day-mode {

    font-size: 9px;

    font-weight: 900;

    padding: 6px 8px;

    border-radius: 7px;

    color: var(--green);

    border:
        1px solid
        rgba(53, 208, 127, .3);

    background:
        rgba(53, 208, 127, .08);

}


.day-mode.read-only {

    color: var(--muted);

    border-color: var(--border);

    background: var(--panel);

}


/* =========================================================
   SEMANA
========================================================= */

.week-days {

    display: grid;

    grid-template-columns:
        repeat(7, 1fr);

    gap: 7px;

    margin-top: 10px;

}


.day-button {

    border:
        1px solid var(--border);

    background:
        var(--panel);

    color:
        var(--muted);

    border-radius: 12px;

    min-height: 52px;

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    cursor: pointer;

    transition:
        0.15s ease;

}


.day-button strong {

    font-size: 14px;

    color: var(--text);

}


.day-button small {

    margin-top: 2px;

    font-size: 9px;

}


.day-button.today {

    border-color:
        var(--green);

    background:
        rgba(53, 208, 127, 0.10);

}


.day-button.selected {

    background:
        var(--green);

    color:
        #06100b;

    border-color:
        var(--green);

}


.day-button.selected strong {

    color:
        #06100b;

}


/* =========================================================
   HORARIO
========================================================= */

.schedule {

    display: flex;

    flex-direction: column;

    gap: 9px;

    margin-top: 12px;

}


.schedule-row {

    display: grid;

    grid-template-columns:
        70px 1fr;

    gap: 9px;

    min-height: 90px;

}


.schedule-time {

    padding-top: 12px;

    color: var(--muted);

    font-size: 12px;

    font-weight: 700;

    text-align: right;

}


.activity {

    border:
        1px solid var(--border);

    background:
        var(--panel);

    border-radius: 13px;

    padding: 12px 14px;

    position: relative;

    overflow: hidden;

}


.activity::before {

    content: "";

    position: absolute;

    left: 0;

    top: 0;

    bottom: 0;

    width: 4px;

    background: var(--blue);

}


.activity.trading::before {

    background: var(--green);

}


.activity.optional::before {

    background: var(--orange);

}


.activity.gym::before {

    background: var(--purple);

}


.activity.meal::before {

    background: var(--orange);

}


.activity.sleep::before {

    background: var(--blue);

}


.activity.personal::before {

    background: var(--blue);

}


.activity.current {

    border-color:
        var(--green);

    box-shadow:
        0 0 0 1px
        rgba(53, 208, 127, 0.25);

}


.activity.status-running {

    border-color:
        var(--green);

}


.activity.status-finished {

    opacity: .65;

}


/* =========================================================
   TIEMPO LIBRE
========================================================= */

.activity.free-time {

    border-style:
        dashed;

    border-color:
        rgba(77, 163, 255, .35);

    background:
        rgba(77, 163, 255, .04);

}


.activity.free-time::before {

    background:
        var(--blue);

}


.activity-name {

    font-size: 14px;

    font-weight: 800;

    padding-right: 5px;

}


.activity-time-small {

    font-size: 11px;

    color:
        var(--muted);

    margin-top: 2px;

}


.optional-label {

    display: inline-block;

    margin-left: 6px;

    font-size: 9px;

    font-weight: 800;

    color:
        var(--orange);

    border:
        1px solid
        rgba(255,180,84,.35);

    padding: 2px 5px;

    border-radius: 5px;

}


/* =========================================================
   REGISTRO REAL
========================================================= */

.real-time {

    margin-top: 7px;

    font-size: 11px;

    color:
        var(--green);

    font-weight: 700;

}


.delay-time {

    font-size: 10px;

    color:
        var(--orange);

    margin-top: 2px;

}


.activity-actions {

    display: flex;

    align-items: center;

    gap: 6px;

    margin-top: 10px;

    flex-wrap: wrap;

}


.action-button {

    border:
        1px solid var(--border);

    background:
        #0c1117;

    color:
        var(--text);

    border-radius: 8px;

    padding:
        7px 10px;

    font-size: 10px;

    font-weight: 800;

    cursor: pointer;

}


.action-button.start {

    border-color:
        var(--green);

    color:
        var(--green);

}


.action-button.finish {

    background:
        var(--green);

    color:
        #06100b;

    border-color:
        var(--green);

}


.action-button.undo {

    width: 34px;

    height: 34px;

    padding: 0;

    border-color:
        rgba(255,180,84,.4);

    color:
        var(--orange);

    font-size: 16px;

}


.action-button:hover {

    filter:
        brightness(1.15);

}


.activity-status {

    font-size: 10px;

    color:
        var(--green);

    font-weight: 800;

}


.readonly-label {

    margin-top: 10px;

    font-size: 10px;

    color:
        var(--muted);

    font-weight: 700;

}


/* =========================================================
   RESUMEN
========================================================= */

.summary-grid {

    display: grid;

    grid-template-columns:
        repeat(2, 1fr);

    gap: 9px;

    margin-top: 10px;

}


.summary-item {

    display: flex;

    align-items: center;

    gap: 10px;

    background:
        var(--panel);

    border:
        1px solid var(--border);

    border-radius: 13px;

    padding: 12px;

}


.summary-item > span {

    font-size: 20px;

}


.summary-item small {

    display: block;

    font-size: 9px;

    font-weight: 800;

    color:
        var(--muted);

    letter-spacing: .8px;

}


.summary-item strong {

    display: block;

    margin-top: 2px;

    font-size: 13px;

}


/* =========================================================
   COPIAS DE SEGURIDAD
========================================================= */

.backup-section {

    margin-top: 22px;

}


.backup-status {

    margin-top: 10px;

    padding: 13px;

    background:
        rgba(53,208,127,.05);

    border:
        1px solid
        rgba(53,208,127,.2);

    border-radius: 12px;

}


.backup-status-title {

    font-size: 12px;

    font-weight: 900;

}


.backup-status-text {

    margin-top: 4px;

    font-size: 10px;

    color:
        var(--muted);

}


.backup-buttons {

    display: grid;

    grid-template-columns:
        1fr 1fr;

    gap: 8px;

    margin-top: 9px;

}


.backup-button {

    min-height: 48px;

    padding: 10px;

    border:
        1px solid var(--border);

    background:
        var(--panel);

    color:
        var(--text);

    border-radius: 11px;

    font-size: 10px;

    font-weight: 900;

    cursor: pointer;

}


.backup-button.primary {

    border-color:
        var(--green);

    color:
        var(--green);

}


.backup-button:hover {

    border-color:
        var(--green);

}


.backup-info {

    margin-top: 9px;

    padding: 12px;

    border-radius: 10px;

    background:
        var(--panel);

    border:
        1px solid var(--border);

    color:
        var(--muted);

    font-size: 10px;

    line-height: 1.55;

}


/* =========================================================
   CONFIGURACIÓN
========================================================= */

.settings-button {

    width: 100%;

    padding: 14px;

    border:
        1px solid var(--border);

    background:
        var(--panel);

    color:
        var(--text);

    border-radius: 13px;

    font-size: 12px;

    font-weight: 800;

    cursor: pointer;

}


.settings-button:hover {

    border-color:
        var(--green);

}


.settings-panel {

    margin-top: 9px;

    padding: 16px;

    background:
        var(--panel);

    border:
        1px solid var(--border);

    border-radius: 13px;

}


.hidden {

    display: none !important;

}


.setting-label {

    display: flex;

    flex-direction: column;

    gap: 6px;

    margin-top: 15px;

    font-size: 10px;

    font-weight: 800;

    color:
        var(--muted);

    letter-spacing: .8px;

}


.setting-select {

    width: 100%;

    padding: 11px;

    background:
        #0b1016;

    color:
        var(--text);

    border:
        1px solid var(--border);

    border-radius: 8px;

}


.timezone-info {

    margin-top: 8px;

    padding: 10px;

    border-radius: 8px;

    background:
        rgba(77,163,255,.06);

    border:
        1px solid
        rgba(77,163,255,.18);

    color:
        var(--blue);

    font-size: 11px;

    font-weight: 700;

}


.setting-check {

    display: flex;

    align-items: center;

    gap: 8px;

    margin-top: 15px;

    font-size: 12px;

    font-weight: 700;

}


.setting-check input {

    width: 18px;

    height: 18px;

}


.settings-note {

    margin-top: 15px;

    font-size: 10px;

    line-height: 1.5;

    color:
        var(--muted);

}


/* =========================================================
   MODAL DE CONFIRMACIÓN
========================================================= */

.modal {

    position: fixed;

    inset: 0;

    z-index: 9999;

    display: flex;

    align-items: center;

    justify-content: center;

    padding: 20px;

    background:
        rgba(0,0,0,.72);

    backdrop-filter:
        blur(5px);

}


.modal-box {

    width: 100%;

    max-width: 390px;

    padding: 22px;

    background:
        #111720;

    border:
        1px solid var(--border);

    border-radius: 18px;

    box-shadow:
        0 20px 60px
        rgba(0,0,0,.5);

}


.modal-icon {

    font-size: 30px;

    text-align: center;

    margin-bottom: 8px;

}


.modal-title {

    text-align: center;

    font-size: 18px;

    font-weight: 900;

}


.modal-message {

    margin-top: 10px;

    text-align: center;

    color:
        var(--muted);

    font-size: 12px;

    line-height: 1.5;

}


.modal-actions {

    display: grid;

    grid-template-columns:
        1fr 1fr;

    gap: 8px;

    margin-top: 20px;

}


.modal-button {

    padding: 12px;

    border-radius: 10px;

    font-size: 10px;

    font-weight: 900;

    cursor: pointer;

}


.modal-button.cancel {

    background:
        var(--panel);

    color:
        var(--text);

    border:
        1px solid var(--border);

}


.modal-button.danger {

    background:
        var(--red);

    color:
        white;

    border:
        1px solid var(--red);

}


/* =========================================================
   PIE
========================================================= */

footer {

    text-align: center;

    color:
        var(--muted);

    font-size: 10px;

    padding: 30px 0 20px;

}


/* =========================================================
   MÓVIL
========================================================= */

@media (max-width: 600px) {

    .app {

        padding-left: 12px;

        padding-right: 12px;

    }


    .clock {

        font-size: 22px;

    }


    h1 {

        font-size: 27px;

    }


    .week-days {

        gap: 4px;

    }


    .day-button {

        min-height: 48px;

        border-radius: 10px;

    }


    .day-button strong {

        font-size: 13px;

    }


    .schedule-row {

        grid-template-columns:
            53px 1fr;

        gap: 7px;

    }


    .schedule-time {

        font-size: 11px;

    }


    .activity {

        padding: 11px 12px;

    }


    .activity-name {

        font-size: 13px;

    }


    .summary-grid {

        grid-template-columns:
            1fr 1fr;

    }


    .backup-buttons {

        grid-template-columns:
            1fr;

    }


    .modal-box {

        padding: 18px;

    }

}