/* =========================================================
   POINTEUR HEURES — STYLE COMPLET
   ========================================================= */


/* =========================================================
   RESET
   ========================================================= */

* {
    box-sizing: border-box;
}

html {
    margin: 0;
    padding: 0;
}

body {
    margin: 0;
    padding: 0;

    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;

    background: #f4f7fb;
    color: #172033;

    -webkit-font-smoothing: antialiased;
}

button {
    font-family: inherit;
}


/* =========================================================
   APPLICATION
   ========================================================= */

.app {
    width: 100%;
    max-width: 520px;
    min-height: 100vh;

    margin: 0 auto;

    background: #f4f7fb;
}

.main-content {
    min-height: 100vh;

    padding: 24px 18px 105px;
}


/* =========================================================
   PAGES
   ========================================================= */

.page {
    display: none;
}

.page.active {
    display: block;
}


/* =========================================================
   HEADER
   ========================================================= */

.page-header {
    display: flex;

    justify-content: space-between;
    align-items: flex-start;

    margin-bottom: 24px;
}

.greeting {
    margin: 0 0 5px;

    color: #7c8799;

    font-size: 14px;
    line-height: 1.3;
}

.page-header h1 {
    margin: 0;

    color: #172033;

    font-size: 28px;
    line-height: 1.1;
    font-weight: 750;

    letter-spacing: -0.6px;
}

.header-date {
    max-width: 130px;

    margin-top: 4px;

    color: #7c8799;

    font-size: 12px;
    line-height: 1.4;

    text-align: right;
}


/* =========================================================
   HORLOGE
   ========================================================= */

.clock-card {
    padding: 28px 20px;

    margin-bottom: 18px;

    border-radius: 24px;

    background:
        linear-gradient(
            135deg,
            #172033 0%,
            #26344d 100%
        );

    color: white;

    text-align: center;

    box-shadow:
        0 12px 30px
        rgba(23, 32, 51, 0.18);
}

.clock-label {
    margin: 0 0 8px;

    color: #aeb9cb;

    font-size: 13px;
}

.current-time {
    color: white;

    font-size: 52px;
    line-height: 1;

    font-weight: 750;

    letter-spacing: -2px;
}

.clock-status {
    margin: 11px 0 0;

    color: #aeb9cb;

    font-size: 13px;
}


/* =========================================================
   BOUTONS DE POINTAGE
   ========================================================= */

.action-buttons {
    display: flex;

    flex-direction: column;

    gap: 12px;
}

.action-button {
    display: flex;

    align-items: center;

    width: 100%;

    padding: 16px;

    border: none;
    border-radius: 18px;

    color: white;

    text-align: left;

    cursor: pointer;

    transition:
        transform 0.15s ease,
        opacity 0.15s ease,
        box-shadow 0.15s ease;
}

.action-button:not(:disabled):active {
    transform: scale(0.985);
}

.action-button:not(:disabled):hover {
    box-shadow:
        0 7px 18px
        rgba(0, 0, 0, 0.12);
}

.action-button:disabled {
    opacity: 0.35;

    cursor: not-allowed;

    filter: grayscale(0.5);
}

.action-icon {
    display: flex;

    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    width: 44px;
    height: 44px;

    margin-right: 14px;

    border-radius: 13px;

    background:
        rgba(255, 255, 255, 0.18);

    font-size: 16px;
}

.action-button strong {
    display: block;

    margin-bottom: 3px;

    font-size: 16px;
    line-height: 1.2;
}

.action-button small {
    display: block;

    color: rgba(255, 255, 255, 0.72);

    font-size: 12px;
    line-height: 1.3;
}

.arrival {
    background:
        linear-gradient(
            135deg,
            #16a36a,
            #19b878
        );
}

.departure {
    background:
        linear-gradient(
            135deg,
            #df5353,
            #ec6565
        );
}


/* =========================================================
   TÉLÉTRAVAIL
   ========================================================= */

.remote-card {
    display: flex;

    justify-content: space-between;
    align-items: center;

    padding: 16px;

    margin-top: 16px;

    background: white;

    border: 1px solid #e8edf4;

    border-radius: 18px;

    box-shadow:
        0 2px 7px
        rgba(23, 32, 51, 0.025);
}

.remote-info {
    display: flex;

    align-items: center;
}

.remote-icon {
    display: flex;

    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    width: 42px;
    height: 42px;

    margin-right: 12px;

    border-radius: 13px;

    background: #eef8f3;

    font-size: 20px;
}

.remote-info strong {
    display: block;

    margin-bottom: 3px;

    color: #172033;

    font-size: 14px;
}

.remote-info small {
    display: block;

    color: #8993a3;

    font-size: 11px;
}


/* =========================================================
   SWITCH
   ========================================================= */

.switch {
    position: relative;

    display: block;

    width: 48px;
    height: 27px;

    flex-shrink: 0;
}

.switch input {
    position: absolute;

    width: 0;
    height: 0;

    opacity: 0;
}

.slider {
    position: absolute;

    inset: 0;

    background: #dce2ea;

    border-radius: 20px;

    cursor: pointer;

    transition:
        background 0.2s ease;
}

.slider::before {
    content: "";

    position: absolute;

    left: 3px;
    top: 3px;

    width: 21px;
    height: 21px;

    border-radius: 50%;

    background: white;

    box-shadow:
        0 2px 5px
        rgba(0, 0, 0, 0.18);

    transition:
        transform 0.2s ease;
}

.switch input:checked + .slider {
    background: #16a36a;
}

.switch input:checked + .slider::before {
    transform: translateX(21px);
}


/* =========================================================
   TITRES DE SECTION
   ========================================================= */

.section-title {
    margin: 27px 0 12px;
}

.section-title h2 {
    margin: 0;

    color: #172033;

    font-size: 18px;
    line-height: 1.2;
}


/* =========================================================
   CARTE AUJOURD'HUI
   ========================================================= */

.today-card {
    padding: 5px 17px;

    background: white;

    border: 1px solid #e8edf4;

    border-radius: 18px;

    box-shadow:
        0 2px 7px
        rgba(23, 32, 51, 0.025);
}

.time-row,
.total-row {
    display: flex;

    justify-content: space-between;
    align-items: center;

    min-height: 51px;

    padding: 12px 0;
}

.time-row {
    border-bottom: 1px solid #edf0f4;
}

.row-label {
    color: #737e90;

    font-size: 14px;
}

.time-row strong {
    color: #172033;

    font-size: 15px;
}

.total-row strong {
    color: #16a36a;

    font-size: 18px;
}


/* =========================================================
   FILTRES
   ========================================================= */

.filter-container,
.stats-period {
    display: flex;

    gap: 8px;

    margin-bottom: 18px;

    overflow-x: auto;

    scrollbar-width: none;
}

.filter-container::-webkit-scrollbar,
.stats-period::-webkit-scrollbar {
    display: none;
}

.filter {
    flex-shrink: 0;

    padding: 9px 14px;

    border: 1px solid #e1e6ee;
    border-radius: 20px;

    background: white;

    color: #6f7989;

    font-size: 12px;

    cursor: pointer;

    transition:
        background 0.15s ease,
        color 0.15s ease;
}

.filter.active {
    border-color: #172033;

    background: #172033;

    color: white;
}


/* =========================================================
   HISTORIQUE
   ========================================================= */

.history-list {
    display: flex;

    flex-direction: column;

    gap: 13px;
}

.empty-history {
    display: flex;

    flex-direction: column;

    align-items: center;
    justify-content: center;

    min-height: 220px;

    padding: 30px 20px;

    background: white;

    border: 1px solid #e8edf4;

    border-radius: 18px;

    text-align: center;
}

.empty-history div {
    margin-bottom: 12px;

    font-size: 35px;
}

.empty-history strong {
    color: #172033;

    font-size: 16px;
}

.empty-history span {
    margin-top: 5px;

    color: #8993a3;

    font-size: 12px;
}


/* =========================================================
   CARTE D'UNE JOURNÉE
   ========================================================= */

.history-day {
    padding: 17px;

    background: white;

    border: 1px solid #e8edf4;

    border-radius: 18px;

    box-shadow:
        0 2px 7px
        rgba(23, 32, 51, 0.025);
}

.history-date {
    display: flex;

    justify-content: space-between;
    align-items: flex-start;

    margin-bottom: 17px;
}

.history-date strong {
    display: block;

    color: #172033;

    font-size: 15px;
}

.history-date > div > span {
    display: block;

    margin-top: 4px;

    color: #8993a3;

    font-size: 12px;
}

.office-badge,
.remote-badge {
    display: inline-flex;

    align-items: center;

    padding: 6px 9px;

    border-radius: 10px;

    font-size: 10px;
    font-weight: 600;

    white-space: nowrap;
}

.office-badge {
    background: #eef3f9;

    color: #617086;
}

.remote-badge {
    background: #eef8f3;

    color: #16865a;
}

.history-hours {
    display: grid;

    grid-template-columns: 1fr 1fr 1fr;

    gap: 8px;

    padding-bottom: 15px;

    border-bottom: 1px solid #edf0f4;
}

.history-hours span {
    display: block;

    margin-bottom: 5px;

    color: #8993a3;

    font-size: 10px;
}

.history-hours strong {
    color: #172033;

    font-size: 14px;
}

.history-total strong {
    color: #16a36a;
}

.history-actions {
    display: flex;

    justify-content: flex-end;

    gap: 7px;

    padding-top: 12px;
}

.history-actions button {
    padding: 7px 9px;

    border: none;
    border-radius: 9px;

    background: #f4f6f9;

    color: #566174;

    font-size: 10px;

    cursor: pointer;
}

.history-actions button:hover {
    background: #e9edf3;
}

.history-actions .delete {
    color: #d94b4b;
}


/* =========================================================
   STATISTIQUES
   ========================================================= */

.stats-main-card {
    padding: 24px;

    margin-bottom: 14px;

    border-radius: 20px;

    background:
        linear-gradient(
            135deg,
            #172033,
            #26344d
        );

    color: white;

    box-shadow:
        0 10px 25px
        rgba(23, 32, 51, 0.15);
}

.stats-main-card span {
    display: block;

    color: #aeb9cb;

    font-size: 13px;
}

.stats-main-card strong {
    display: block;

    margin: 6px 0;

    color: white;

    font-size: 36px;
    line-height: 1.1;

    letter-spacing: -1px;
}

.stats-main-card small {
    display: block;

    color: #aeb9cb;

    font-size: 12px;
}

.stats-grid {
    display: grid;

    grid-template-columns:
        1fr 1fr;

    gap: 12px;

    margin-bottom: 14px;
}

.stat-card {
    min-height: 125px;

    padding: 17px;

    background: white;

    border: 1px solid #e8edf4;

    border-radius: 18px;

    box-shadow:
        0 2px 7px
        rgba(23, 32, 51, 0.025);
}

.stat-card span {
    display: block;

    color: #697589;

    font-size: 12px;
}

.stat-card strong {
    display: block;

    margin: 9px 0 3px;

    color: #172033;

    font-size: 22px;
    line-height: 1.1;
}

.stat-card small {
    display: block;

    color: #9aa3b1;

    font-size: 11px;
}


/* =========================================================
   GRAPHIQUE
   ========================================================= */

.chart-card {
    padding: 18px;

    background: white;

    border: 1px solid #e8edf4;

    border-radius: 18px;

    box-shadow:
        0 2px 7px
        rgba(23, 32, 51, 0.025);
}

.chart-header h2 {
    margin: 0;

    color: #172033;

    font-size: 17px;
}

.chart-header span {
    display: block;

    margin-top: 3px;

    color: #8993a3;

    font-size: 12px;
}

.chart {
    display: flex;

    align-items: flex-end;
    justify-content: space-around;

    gap: 8px;

    height: 220px;

    padding:
        20px 3px
        10px;

    margin-top: 20px;

    border-bottom: 1px solid #e8edf4;
}

.chart-empty {
    display: flex;

    align-items: center;
    justify-content: center;

    width: 100%;
    height: 100%;

    color: #a0a8b5;

    font-size: 13px;
}

.chart-bar-container {
    display: flex;

    flex: 1;

    flex-direction: column;

    align-items: center;
    justify-content: flex-end;

    height: 100%;

    min-width: 0;
}

.chart-bar-value {
    margin-bottom: 5px;

    color: #697589;

    font-size: 8px;

    white-space: nowrap;
}

.chart-bar {
    width: 28px;
    max-width: 100%;

    min-height: 8px;

    border-radius:
        7px 7px 3px 3px;

    background:
        linear-gradient(
            to top,
            #16a36a,
            #35c889
        );

    transition:
        height 0.3s ease;
}

.chart-bar-container > span {
    margin-top: 7px;

    color: #8993a3;

    font-size: 10px;
}


/* =========================================================
   PARAMÈTRES
   ========================================================= */

.settings-section {
    margin-bottom: 26px;
}

.settings-section h2 {
    margin: 0 0 10px 4px;

    color: #737e90;

    font-size: 12px;
    font-weight: 650;

    text-transform: uppercase;

    letter-spacing: 0.3px;
}

.setting-card {
    display: flex;

    justify-content: space-between;
    align-items: center;

    padding: 17px;

    margin-bottom: 8px;

    background: white;

    border: 1px solid #e8edf4;

    border-radius: 15px;
}

.setting-card strong {
    display: block;

    color: #172033;

    font-size: 14px;
}

.setting-card small {
    display: block;

    max-width: 210px;

    margin-top: 4px;

    color: #8993a3;

    font-size: 11px;
}

.setting-card > span {
    flex-shrink: 0;

    color: #172033;

    font-size: 14px;
    font-weight: 650;
}

.setting-button {
    padding: 17px;

    margin-bottom: 8px;

    background: white;

    border: 1px solid #e8edf4;

    border-radius: 15px;

    color: #172033;

    font-size: 14px;

    cursor: pointer;
}

.setting-button:hover {
    background: #f9fafc;
}

.app-version {
    margin-top: 40px;

    color: #a1a9b6;

    font-size: 11px;

    line-height: 1.6;

    text-align: center;
}


/* =========================================================
   NAVIGATION BASSE
   ========================================================= */

.bottom-nav {
    position: fixed;

    left: 50%;
    bottom: 0;

    z-index: 100;

    display: flex;

    width: 100%;
    max-width: 520px;

    padding:
        8px 12px
        calc(8px + env(safe-area-inset-bottom));

    transform: translateX(-50%);

    background:
        rgba(255, 255, 255, 0.96);

    border-top: 1px solid #e6eaf0;

    box-shadow:
        0 -5px 20px
        rgba(0, 0, 0, 0.05);

    backdrop-filter: blur(10px);
}

.nav-button {
    display: flex;

    flex: 1;

    flex-direction: column;

    align-items: center;

    gap: 3px;

    padding: 7px 3px;

    border: none;

    background: transparent;

    color: #9aa3b1;

    cursor: pointer;

    transition:
        color 0.15s ease;
}

.nav-button span {
    font-size: 20px;

    line-height: 20px;
}

.nav-button small {
    font-size: 10px;
}

.nav-button.active {
    color: #16a36a;
}


/* =========================================================
   RESPONSIVE — PETITS TÉLÉPHONES
   ========================================================= */

@media (max-width: 380px) {

    .main-content {
        padding-left: 14px;
        padding-right: 14px;
    }

    .page-header h1 {
        font-size: 25px;
    }

    .current-time {
        font-size: 45px;
    }

    .action-button {
        padding: 14px;
    }

    .action-icon {
        width: 40px;
        height: 40px;

        margin-right: 11px;
    }

    .action-button strong {
        font-size: 15px;
    }

    .history-hours strong {
        font-size: 13px;
    }

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

    .chart-bar {
        width: 22px;
    }
}


/* =========================================================
   RESPONSIVE — ÉCRANS PLUS LARGES
   ========================================================= */

@media (min-width: 700px) {

    body {
        padding: 30px 0;
    }

    .app {
        min-height: calc(100vh - 60px);

        border-radius: 25px;

        overflow: hidden;

        box-shadow:
            0 15px 50px
            rgba(23, 32, 51, 0.10);
    }

    .bottom-nav {
        bottom: 30px;

        border-radius:
            0 0 25px 25px;
    }
}