:root {
    --ink: #14243a;
    --navy: #102b3e;
    --navy-2: #173e55;

    --green: #168263;
    --green-dark: #0f684f;
    --green-soft: #e9f6f1;

    --blue: #24588b;

    --bg: #f4f6f8;
    --surface: #ffffff;
    --surface-soft: #f8fafb;

    --muted: #718095;
    --line: #e1e7eb;

    --amber: #f2a900;
    --danger: #b33a3a;

    --shadow-xs: 0 2px 8px rgba(16, 43, 62, 0.04);
    --shadow-sm: 0 6px 20px rgba(16, 43, 62, 0.06);
    --shadow: 0 14px 40px rgba(16, 43, 62, 0.09);

    --radius: 18px;
    --radius-sm: 11px;
}

/* =========================================================
   BASE
   ========================================================= */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(
            circle at top right,
            rgba(22, 130, 99, 0.045),
            transparent 28rem
        ),
        var(--bg);

    color: var(--ink);

    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a,
button,
input,
select,
textarea {
    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        background-color 0.18s ease,
        color 0.18s ease,
        transform 0.18s ease,
        opacity 0.18s ease;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid rgba(36, 88, 139, 0.2);
    outline-offset: 2px;
}

/* =========================================================
   CABEÇALHO
   ========================================================= */

.top {
    position: sticky;
    top: 0;
    z-index: 30;

    height: 76px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 28px;

    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);

    border-bottom: 1px solid rgba(16, 43, 62, 0.07);

    box-shadow: 0 2px 15px rgba(16, 43, 62, 0.035);
}

.brand {
    display: flex;
    align-items: center;

    gap: 12px;

    min-width: 0;

    font-weight: 900;
    line-height: 1.15;
}

.logo {
    display: grid;
    place-items: center;

    width: 44px;
    height: 44px;

    flex-shrink: 0;

    border-radius: 13px;

    background:
        linear-gradient(
            135deg,
            var(--green),
            #20a47d
        );

    color: white;

    box-shadow:
        0 7px 18px rgba(22, 130, 99, 0.22);

    font-weight: 900;
}

.brand small {
    display: block;

    margin-top: 3px;

    color: var(--muted);

    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.company-logo {
    display: block;

    width: auto;
    height: 44px;

    max-width: 160px;
    max-height: 44px;

    object-fit: contain;
    object-position: left center;

    flex-shrink: 0;
}

.user-head {
    display: flex;
    align-items: center;

    gap: 9px;

    color: var(--muted);

    font-size: 14px;
}

.user-head strong {
    color: var(--ink);
}

.user-head a {
    color: var(--green-dark);

    font-weight: 750;

    text-decoration: none;
}

.user-head a:hover {
    text-decoration: underline;
}

/* =========================================================
   AVATAR
   ========================================================= */

.avatar {
    width: 38px;
    height: 38px;

    border-radius: 50%;

    object-fit: cover;

    border: 2px solid #fff;

    box-shadow:
        0 0 0 1px var(--line),
        0 3px 10px rgba(16, 43, 62, 0.1);

    flex-shrink: 0;
}

.avatar-empty {
    display: inline-grid;
    place-items: center;

    background: var(--green-soft);

    color: var(--green-dark);

    font-weight: 900;
}

.profile-photo {
    width: 68px;
    height: 68px;

    border-radius: 20px;

    object-fit: cover;

    border: 3px solid #fff;

    box-shadow:
        0 0 0 1px var(--line),
        0 8px 24px rgba(16, 43, 62, 0.12);
}

/* =========================================================
   ESTRUTURA
   ========================================================= */

.shell {
    display: grid;

    grid-template-columns:
        245px
        minmax(0, 1fr);

    min-height:
        calc(100vh - 76px);
}

/* =========================================================
   MENU LATERAL
   ========================================================= */

.side {
    position: sticky;
    top: 76px;

    height:
        calc(100vh - 76px);

    overflow-y: auto;

    padding: 23px 16px;

    background:
        linear-gradient(
            180deg,
            var(--navy) 0%,
            #0b2231 100%
        );

    color: #fff;

    scrollbar-width: thin;
}

.side a {
    position: relative;

    display: flex;
    align-items: center;

    min-height: 44px;

    padding: 11px 14px;

    margin: 4px 0;

    border-radius: 10px;

    color: #cbd6dd;

    text-decoration: none;

    font-size: 14px;
    font-weight: 700;
}

.side a:hover {
    background: rgba(255, 255, 255, 0.075);

    color: #fff;
}

.side a.active {
    background: rgba(255, 255, 255, 0.1);

    color: #fff;

    box-shadow:
        inset 3px 0 0 var(--green);
}

.side a.active::after {
    content: "";

    position: absolute;

    right: 12px;

    width: 6px;
    height: 6px;

    border-radius: 50%;

    background: #55d8aa;
}

/* =========================================================
   CONTEÚDO
   ========================================================= */

.content {
    width: 100%;
    max-width: 1440px;

    margin: 0 auto;

    padding: 30px;
}

.content > h1 {
    margin-top: 0;
    margin-bottom: 6px;

    font-size:
        clamp(
            25px,
            3vw,
            34px
        );

    line-height: 1.15;

    letter-spacing: -0.035em;
}

.grid {
    display: grid;

    gap: 18px;
}

/* =========================================================
   CARDS
   ========================================================= */

.card {
    background: var(--surface);

    border:
        1px solid
        rgba(16, 43, 62, 0.065);

    border-radius: var(--radius);

    padding: 23px;

    box-shadow: var(--shadow-xs);
}

.card:hover {
    box-shadow: var(--shadow-sm);
}

.card h2,
.card h3 {
    margin-top: 0;

    letter-spacing: -0.02em;
}

.card h2 {
    font-size: 20px;
}

.muted {
    color: var(--muted);
}

/* =========================================================
   DASHBOARD
   ========================================================= */

.welcome {
    display: flex;
    align-items: center;

    gap: 16px;

    margin-bottom: 24px;
}

.welcome h1 {
    margin: 0;

    font-size:
        clamp(
            25px,
            3vw,
            34px
        );

    letter-spacing: -0.035em;
}

.welcome p {
    margin: 3px 0 0;
}

.stats {
    grid-template-columns:
        repeat(
            4,
            minmax(0, 1fr)
        );
}

.stat {
    position: relative;

    overflow: hidden;

    min-height: 110px;
}

.stat::before {
    content: "";

    position: absolute;

    left: 0;
    top: 20px;
    bottom: 20px;

    width: 3px;

    border-radius: 10px;

    background: var(--green);
}

.stat strong {
    display: inline-block;

    margin-top: 5px;

    font-size: 30px;

    letter-spacing: -0.04em;
}

/* =========================================================
   FORMULÁRIOS
   ========================================================= */

.form-grid {
    grid-template-columns:
        repeat(
            2,
            minmax(0, 1fr)
        );
}

label {
    display: block;

    margin: 15px 0 7px;

    font-size: 13px;
    font-weight: 750;

    color: #354457;
}

input,
select,
textarea {
    width: 100%;

    min-height: 47px;

    padding: 11px 13px;

    border:
        1px solid
        #d6dde3;

    border-radius:
        var(--radius-sm);

    background: #fff;

    color: var(--ink);

    font: inherit;

    font-size: 15px;
}

textarea {
    min-height: 110px;

    resize: vertical;
}

input:hover,
select:hover,
textarea:hover {
    border-color: #b7c4ce;
}

input:focus,
select:focus,
textarea:focus {
    outline: 0;

    border-color:
        var(--green);

    box-shadow:
        0 0 0 4px
        rgba(22, 130, 99, 0.1);
}

input::placeholder,
textarea::placeholder {
    color: #9aa6b4;
}

input:disabled,
select:disabled,
textarea:disabled {
    background: #f2f4f5;

    color: #8a96a3;

    cursor: not-allowed;
}

/* =========================================================
   BOTÕES
   ========================================================= */

button,
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 8px;

    min-height: 43px;

    padding: 10px 17px;

    border: 0;

    border-radius:
        var(--radius-sm);

    background:
        linear-gradient(
            135deg,
            var(--green),
            var(--green-dark)
        );

    color: #fff;

    font: inherit;
    font-size: 14px;
    font-weight: 800;

    text-decoration: none;

    cursor: pointer;

    box-shadow:
        0 4px 12px
        rgba(22, 130, 99, 0.17);
}

button:hover,
.btn:hover {
    transform: translateY(-1px);

    box-shadow:
        0 7px 18px
        rgba(22, 130, 99, 0.21);
}

button:active,
.btn:active {
    transform: translateY(0);
}

button:disabled,
.btn.disabled {
    opacity: 0.55;

    cursor: not-allowed;

    transform: none;

    box-shadow: none;
}

.btn.alt {
    background:
        linear-gradient(
            135deg,
            var(--navy),
            var(--navy-2)
        );
}

.btn.light {
    background: #eef4f9;

    color: var(--blue);

    box-shadow: none;
}

.btn.light:hover {
    background: #e1ebf4;

    box-shadow: none;
}

.btn.danger {
    background: #fff0f0;

    color: var(--danger);

    box-shadow: none;
}

.btn.danger:hover {
    background: #ffe2e2;

    box-shadow: none;
}

.actions {
    display: flex;

    gap: 8px;

    flex-wrap: wrap;

    margin-top: 16px;
}

/* =========================================================
   TABELAS
   ========================================================= */

.table-wrap {
    overflow: auto;

    border: 1px solid var(--line);

    border-radius: 13px;

    background: #fff;
}

table {
    width: 100%;

    min-width: 720px;

    border-collapse: collapse;

    background: #fff;
}

th,
td {
    padding: 13px 14px;

    text-align: left;

    border-bottom:
        1px solid #edf0f2;

    font-size: 14px;
}

th {
    position: sticky;

    top: 0;

    z-index: 2;

    background: #f8fafb;

    color: var(--muted);

    font-size: 11px;

    letter-spacing: 0.045em;

    text-transform: uppercase;
}

tbody tr:hover {
    background: #f8fbfa;
}

tbody tr:last-child td {
    border-bottom: 0;
}

/* =========================================================
   PESSOAS
   ========================================================= */

.person-cell {
    display: flex;
    align-items: center;

    gap: 10px;

    font-weight: 700;
}

.photo-form {
    display: flex;
    align-items: center;

    gap: 8px;
}

/* =========================================================
   BADGES
   ========================================================= */

.badge {
    display: inline-flex;
    align-items: center;

    min-height: 27px;

    padding: 5px 10px;

    border-radius: 999px;

    background: var(--green-soft);

    color: #12664d;

    font-size: 11px;
    font-weight: 800;
}

.badge.warn {
    background: #fff3d8;

    color: #8c5b00;
}

/* =========================================================
   MENSAGENS
   ========================================================= */

.flash {
    margin-bottom: 18px;

    padding: 13px 15px;

    border:
        1px solid
        #cce9de;

    border-left:
        4px solid
        var(--green);

    border-radius: 10px;

    background: #eef8f4;

    color: #12664d;

    font-size: 14px;
    font-weight: 700;
}

.flash.error {
    border-color: #f1caca;

    border-left-color:
        var(--danger);

    background: #fff2f2;

    color: #a33;
}

/* =========================================================
   LOGIN
   ========================================================= */

.login {
    position: relative;

    isolation: isolate;

    min-height: 100vh;

    display: grid;

    place-items: center;

    padding: 24px;

    background:
        radial-gradient(
            circle at 20% 10%,
            rgba(22, 130, 99, 0.28),
            transparent 32rem
        ),
        radial-gradient(
            circle at 90% 90%,
            rgba(36, 88, 139, 0.2),
            transparent 30rem
        ),
        linear-gradient(
            135deg,
            var(--navy),
            #071c29
        );
}

.login::before {
    content: "";

    position: absolute;

    inset: 0;

    z-index: -1;

    opacity: 0.55;

    background-image:
        linear-gradient(
            rgba(255, 255, 255, 0.025) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(255, 255, 255, 0.025) 1px,
            transparent 1px
        );

    background-size:
        30px 30px;
}

.login .card {
    width:
        min(
            430px,
            100%
        );

    padding: 34px;

    border:
        1px solid
        rgba(255, 255, 255, 0.08);

    box-shadow:
        0 28px 80px
        rgba(0, 0, 0, 0.3);
}

.login .brand {
    margin-bottom: 28px;
}

.login h1 {
    margin-bottom: 5px;

    font-size: 29px;

    letter-spacing: -0.035em;
}

.login .company-logo {
    width: auto;

    max-width: 145px;

    height: 48px;
    max-height: 48px;

    object-fit: contain;
    object-position: left center;

    flex-shrink: 0;
}

.login-system-name small {
    margin-top: 0;

    font-size: 13px;
}

/* =========================================================
   CAMPO DE SENHA
   ========================================================= */

.password-field {
    position: relative;
}

.password-field input {
    padding-right: 88px;
}

.password-toggle {
    position: absolute;

    top: 50%;
    right: 7px;

    min-height: 34px;

    padding: 5px 9px;

    transform:
        translateY(-50%);

    border-radius: 8px;

    background: transparent;

    color:
        var(--green-dark);

    box-shadow: none;

    font-size: 12px;
}

.password-toggle:hover {
    transform:
        translateY(-50%);

    background: var(--green-soft);

    box-shadow: none;
}

.login-button {
    width: 100%;

    min-height: 50px;

    margin-top: 20px;
}

/* =========================================================
   PONTO
   ========================================================= */

.clock {
    padding: 12px 0;

    text-align: center;

    font-variant-numeric: tabular-nums;

    font-size:
        clamp(
            40px,
            6vw,
            56px
        );

    line-height: 1;

    font-weight: 900;

    letter-spacing: -0.055em;

    color: var(--navy);
}

.punch-btn {
    width: 100%;

    min-height: 66px;

    margin-top: 8px;

    background:
        linear-gradient(
            135deg,
            #f4b20b,
            #ffc733
        );

    color: #352a00;

    font-size: 17px;

    box-shadow:
        0 8px 21px
        rgba(242, 169, 0, 0.22);
}

.punch-btn:hover {
    box-shadow:
        0 11px 26px
        rgba(242, 169, 0, 0.29);
}

.mini-punches {
    display: flex;

    gap: 8px;

    flex-wrap: wrap;

    margin-top: 16px;
}

.mini-punches span {
    padding: 7px 10px;

    border-radius: 8px;

    background: #f4f7f8;

    color: var(--muted);

    font-size: 12px;
}

.mini-punches strong {
    color: var(--ink);
}

/* =========================================================
   DOCUMENTOS
   ========================================================= */

.doc {
    display: flex;

    justify-content: space-between;
    align-items: center;

    gap: 15px;

    padding: 14px 0;

    border-bottom:
        1px solid #edf0f2;
}

.doc:last-child {
    border-bottom: 0;
}

/* =========================================================
   MENU MOBILE
   ========================================================= */

.mobile-nav {
    display: none;
}

/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 1050px) {

    .shell {
        grid-template-columns:
            210px
            minmax(0, 1fr);
    }

    .content {
        padding: 25px;
    }

    .stats {
        grid-template-columns:
            repeat(
                2,
                1fr
            );
    }
}

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 800px) {

    body {
        background: #f4f6f8;
    }

    .top {
        height: 64px;

        padding:
            0 14px;
    }

    .top .company-logo {
        height: 34px;

        max-width: 105px;
    }

    .top .brand {
        gap: 8px;
    }

    .top .brand > span:not(.logo) {
        font-size: 13px;
    }

    .top .brand small {
        font-size: 10px;
    }

    .user-head {
        gap: 7px;

        font-size: 12px;
    }

    .user-head .avatar {
        width: 34px;
        height: 34px;
    }

    .shell {
        display: block;

        min-height:
            calc(100vh - 64px);
    }

    .side {
        display: none;
    }

    .content {
        padding:
            18px 13px
            calc(
                96px +
                env(
                    safe-area-inset-bottom
                )
            );
    }

    .content > h1 {
        font-size: 26px;
    }

    .grid {
        gap: 13px;
    }

    .dashboard-main {
        grid-template-columns: 1fr !important;
    }

    .stats {
        grid-template-columns:
            repeat(
                2,
                minmax(0, 1fr)
            );

        gap: 10px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .card {
        padding: 18px;

        border-radius: 14px;

        box-shadow:
            0 2px 8px
            rgba(16, 43, 62, 0.045);
    }

    .card:hover {
        box-shadow:
            0 2px 8px
            rgba(16, 43, 62, 0.045);
    }

    .welcome {
        gap: 12px;

        margin-bottom: 18px;
    }

    .welcome h1 {
        font-size: 24px;
    }

    .profile-photo {
        width: 54px;
        height: 54px;

        border-radius: 16px;
    }

    .stat {
        min-height: 95px;

        padding: 16px;
    }

    .stat::before {
        top: 16px;
        bottom: 16px;
    }

    .stat strong {
        font-size: 26px;
    }

    .clock {
        font-size: 44px;

        padding: 8px 0 14px;
    }

    .punch-btn {
        min-height: 58px;

        font-size: 16px;
    }

    .doc {
        display: block;
    }

    .doc .actions {
        margin-top: 10px;
    }

    .table-wrap {
        border-left: 0;
        border-right: 0;

        border-radius: 0;

        margin-left: -18px;
        margin-right: -18px;
    }

    .login {
        padding: 18px;
    }

    .login .card {
        padding: 26px;

        border-radius: 18px;
    }

    /* ===============================
       MENU INFERIOR MOBILE
       =============================== */

    .mobile-nav {
        position: fixed;

        z-index: 100;

        left: 10px;
        right: 10px;

        bottom:
            calc(
                10px +
                env(
                    safe-area-inset-bottom
                )
            );

        display: flex;

        align-items: center;

        gap: 3px;

        overflow-x: auto;

        padding: 6px;

        border:
            1px solid
            rgba(16, 43, 62, 0.08);

        border-radius: 17px;

        background:
            rgba(
                255,
                255,
                255,
                0.96
            );

        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);

        box-shadow:
            0 10px 32px
            rgba(16, 43, 62, 0.16);

        scrollbar-width: none;
    }

    .mobile-nav::-webkit-scrollbar {
        display: none;
    }

    .mobile-nav a {
        position: relative;

        flex:
            1 0 86px;

        min-height: 48px;

        display: flex;

        align-items: center;
        justify-content: center;

        padding:
            7px 8px;

        border-radius: 12px;

        color:
            #7a8795;

        text-align: center;

        text-decoration: none;

        font-size: 10px;

        font-weight: 750;

        line-height: 1.2;
    }

    .mobile-nav a:hover {
        background: #f4f7f8;

        color: var(--ink);
    }

    .mobile-nav a.active {
        background:
            var(--green-soft);

        color:
            var(--green-dark);
    }

    .mobile-nav a.active::before {
        content: "";

        position: absolute;

        top: 4px;

        width: 18px;
        height: 3px;

        border-radius: 10px;

        background:
            var(--green);
    }
}

/* =========================================================
   CELULARES PEQUENOS
   ========================================================= */

@media (max-width: 480px) {

    .top {
        padding:
            0 11px;
    }

    .top .brand small {
        display: none;
    }

    .top .brand > span:not(.logo) {
        display: none;
    }

    .top .company-logo {
        max-width: 112px;

        height: 36px;
    }

    .user-head strong {
        display: none;
    }

    .user-head {
        gap: 6px;
    }

    .content {
        padding-left: 10px;
        padding-right: 10px;
    }

    .card {
        padding: 16px;
    }

    .welcome {
        padding: 0 3px;
    }

    .welcome h1 {
        font-size: 22px;
    }

    .stats {
        grid-template-columns:
            1fr 1fr;
    }

    .stat {
        min-height: 88px;
    }

    .stat strong {
        font-size: 24px;
    }

    .stat .muted {
        font-size: 12px;
    }

    .clock {
        font-size: 42px;
    }

    .actions > * {
        flex:
            1 1 auto;
    }

    .login {
        place-items: center;

        padding: 14px;
    }

    .login .card {
        width: 100%;

        padding:
            25px 21px;

        border-radius: 17px;
    }

    .login .brand {
        margin-bottom: 24px;
    }

    .login .company-logo {
        max-width: 120px;

        height: 43px;
        max-height: 43px;
    }

    .login h1 {
        font-size: 27px;
    }

    .mobile-nav {
        left: 7px;
        right: 7px;
        bottom:
            calc(
                7px +
                env(
                    safe-area-inset-bottom
                )
            );
    }

    .mobile-nav a {
        flex:
            0 0 80px;

        min-height: 46px;

        font-size: 9.5px;
    }

    input,
    select,
    textarea {
        font-size: 16px;
    }
}

/* =========================================================
   TELAS MUITO PEQUENAS
   ========================================================= */

@media (max-width: 360px) {

    .content {
        padding-left: 8px;
        padding-right: 8px;
    }

    .stats {
        grid-template-columns: 1fr;
    }

    .card {
        padding: 15px;
    }

    .clock {
        font-size: 38px;
    }

    .mobile-nav a {
        flex:
            0 0 76px;
    }
}

/* =========================================================
   ACESSIBILIDADE
   ========================================================= */

@media (
    prefers-reduced-motion:
    reduce
) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;

        transition: none !important;

        animation: none !important;
    }
}