:root {
    font-family: Inter, Arial, sans-serif;
    color: #172033;
    background: #f3f5f9;

    --tm-dark: #111827;
    --tm-dark-2: #1f2937;
    --tm-blue: #0b6e99;
    --tm-cyan: #7bdff2;
    --tm-border: #dde3ed;
    --tm-muted: #637083;
    --tm-bg: #f3f5f9;
    --tm-white: #ffffff;
}

* {
    box-sizing: border-box;
}

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

body {
    background: var(--tm-bg);
}


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

.tm-header {
    width: 100%;
    max-width: none;
    min-height: 82px;
    margin: 0;
    padding: 15px max(24px, calc((100vw - 1160px) / 2 + 24px));

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

    color: white;
    background: var(--tm-dark);

    border-bottom: 1px solid rgba(255,255,255,.08);
}

.tm-brand {
    display: flex;
    align-items: center;
    gap: 13px;
}

.tm-brand-icon {
    width: 48px;
    height: 48px;

    display: grid;
    place-items: center;

    flex: 0 0 auto;

    border-radius: 13px;

    background: white;
    color: var(--tm-dark);

    font-size: 15px;
    font-weight: 900;
    letter-spacing: -.04em;
}

.tm-header h1 {
    margin: 2px 0 0;
    font-size: 22px;
    line-height: 1.1;
}

.eyebrow {
    margin: 0;
    color: var(--tm-cyan);

    font-size: 11px;
    font-weight: 800;
    letter-spacing: .1em;
}

button {
    border: 0;
    border-radius: 8px;
    padding: 10px 16px;

    color: white;
    background: var(--tm-blue);

    cursor: pointer;
    font-weight: 700;
}

button.secondary {
    background: #374151;
}


/* =========================================================
   CONTEÚDO
   ========================================================= */

main {
    width: 100%;
    max-width: 1160px;
    margin: auto;
    padding: 28px 24px 50px;
}

h1,
h2,
p {
    margin-top: 0;
}

.dashboard-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    margin-bottom: 22px;
}

.dashboard-heading h2 {
    margin: 3px 0 5px;
    font-size: 28px;
}

.section-label {
    margin-bottom: 3px;

    color: var(--tm-blue);

    font-size: 11px;
    font-weight: 900;
    letter-spacing: .12em;
}

.muted {
    margin: 0;
    color: var(--tm-muted);
}

.primary-action {
    display: inline-flex;
    align-items: center;
    gap: 9px;

    padding: 12px 18px;

    border-radius: 10px;

    background: var(--tm-blue);
    color: white;

    text-decoration: none;
    font-weight: 800;
}

.primary-action-icon {
    font-size: 22px;
    line-height: 1;
}


/* =========================================================
   AÇÕES RÁPIDAS
   ========================================================= */

.quick-actions {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;

    margin-bottom: 22px;
}

.quick-action {
    min-width: 0;
    padding: 17px;

    display: flex;
    flex-direction: column;
    gap: 4px;

    background: white;
    border: 1px solid var(--tm-border);
    border-radius: 12px;

    color: var(--tm-dark);
    text-decoration: none;

    box-shadow: 0 3px 12px rgba(23,32,51,.05);

    transition:
        transform .15s ease,
        box-shadow .15s ease,
        border-color .15s ease;
}

.quick-action:hover {
    transform: translateY(-2px);
    border-color: #aeb9c8;
    box-shadow: 0 7px 20px rgba(23,32,51,.09);
}

.quick-icon {
    margin-bottom: 8px;
    font-size: 24px;
}

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

.quick-action small {
    overflow: hidden;

    color: var(--tm-muted);
    font-size: 12px;

    white-space: nowrap;
    text-overflow: ellipsis;
}


/* =========================================================
   INDICADORES
   ========================================================= */

.grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;

    margin-bottom: 22px;
}

.metric-card,
.panel,
.login-card {
    background: white;
    border: 1px solid var(--tm-border);
    border-radius: 12px;

    box-shadow: 0 3px 12px rgba(23,32,51,.05);
}

.metric-card {
    padding: 19px;
}

.metric-card span {
    display: block;
    margin-bottom: 9px;

    color: var(--tm-muted);
    font-size: 12px;
    font-weight: 700;
}

.metric-card strong {
    font-size: 22px;
    letter-spacing: -.03em;
}


/* =========================================================
   PAINÉIS / TABELAS
   ========================================================= */

.panel {
    padding: 22px;
}

.panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;

    margin-bottom: 14px;
}

.panel-heading h2 {
    margin: 2px 0 0;
    font-size: 20px;
}

.text-link {
    color: var(--tm-blue);
    text-decoration: none;
    font-size: 13px;
    font-weight: 800;
}

.table-scroll {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 12px 9px;

    border-bottom: 1px solid #e6eaf0;

    text-align: left;
}

th {
    color: var(--tm-muted);

    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .05em;
}

td {
    font-size: 14px;
}

.money {
    font-weight: 800;
    white-space: nowrap;
}

.movement-type {
    display: inline-block;

    padding: 5px 8px;

    border-radius: 999px;

    background: #eef2f7;

    font-size: 11px;
    font-weight: 800;
    text-transform: capitalize;
}

.empty-state {
    padding: 35px 10px;
    text-align: center;
    color: var(--tm-muted);
}


/* =========================================================
   LOGIN / FORMULÁRIOS
   ========================================================= */

.login-page {
    display: grid;
    min-height: 100vh;
    place-items: center;

    padding: 24px;
}

.login-card {
    width: min(100%, 400px);
    padding: 24px;
}

label {
    display: block;
    margin: 15px 0;

    font-weight: 700;
}

input {
    width: 100%;
    margin-top: 6px;
    padding: 11px;

    border: 1px solid #b9c4d2;
    border-radius: 8px;
}

.alert {
    padding: 12px;
    border-radius: 8px;
}

.error {
    color: #8d1f1f;
    background: #ffe5e5;
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 900px) {

    .quick-actions {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}


/* =========================================================
   MOBILE — ASPETO DE APP
   ========================================================= */

@media (max-width: 600px) {

    .tm-header {
        min-height: 68px;
        padding: 10px 14px;
    }

    .tm-brand {
        gap: 10px;
    }

    .tm-brand-icon {
        width: 40px;
        height: 40px;
        border-radius: 10px;
        font-size: 13px;
    }

    .tm-header h1 {
        font-size: 17px;
    }

    .eyebrow {
        font-size: 9px;
    }

    .tm-header button {
        padding: 8px 11px;
        font-size: 12px;
    }

    main {
        padding: 18px 12px 35px;
    }

    .dashboard-heading {
        align-items: flex-start;
        margin-bottom: 18px;
    }

    .dashboard-heading h2 {
        font-size: 23px;
    }

    .dashboard-heading .muted {
        font-size: 13px;
    }

    .primary-action {
        padding: 10px 12px;
        font-size: 13px;
        white-space: nowrap;
    }

    .primary-action-icon {
        font-size: 18px;
    }

    .quick-actions {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }

    .quick-action {
        min-height: 100px;
        padding: 12px 9px;

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

        text-align: center;
    }

    .quick-icon {
        margin-bottom: 3px;
        font-size: 22px;
    }

    .quick-action strong {
        font-size: 12px;
    }

    .quick-action small {
        width: 100%;
        font-size: 10px;
    }

    .grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .metric-card {
        padding: 14px;
    }

    .metric-card span {
        font-size: 11px;
    }

    .metric-card strong {
        font-size: 18px;
    }

    .panel {
        padding: 15px 12px;
    }

    .panel-heading h2 {
        font-size: 18px;
    }

    th,
    td {
        padding: 10px 7px;
        font-size: 12px;
    }
}


/* =========================================================
   TM01 · CAIXA REGISTADORA · MENU GLOBAL
   ========================================================= */

.tm-topbar {
    position: sticky;
    top: 0;
    z-index: 1000;

    display: flex;
    align-items: center;
    gap: 28px;

    min-height: 74px;
    padding: 0 28px;

    background:
        linear-gradient(
            135deg,
            #07182d 0%,
            #0b2747 55%,
            #10375e 100%
        );

    border-bottom: 1px solid rgba(255,255,255,.12);

    box-shadow:
        0 8px 25px rgba(0,0,0,.18);
}


/* MARCA */

.tm-topbar-brand {
    flex: 0 0 auto;
}

.tm-topbar-logo {
    display: flex;
    align-items: center;
    gap: 12px;

    color: white;
    text-decoration: none;
}

.tm-topbar-logo:hover {
    text-decoration: none;
}

.tm-topbar-logo-mark {
    display: grid;
    place-items: center;

    width: 42px;
    height: 42px;

    border-radius: 12px;

    background: rgba(255,255,255,.10);
    border: 1px solid rgba(255,255,255,.18);

    font-size: 14px;
    font-weight: 800;
    letter-spacing: .08em;
}

.tm-topbar-title {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.tm-topbar-title small {
    margin-bottom: 4px;

    color: rgba(255,255,255,.62);

    font-size: 10px;
    font-weight: 700;
    letter-spacing: .13em;
}

.tm-topbar-title strong {
    color: white;
    font-size: 15px;
    font-weight: 700;
}


/* NAVEGAÇÃO */

.tm-main-nav {
    display: flex;
    align-items: stretch;
    align-self: stretch;
    gap: 3px;

    flex: 1;
}

.tm-main-nav a {
    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;

    padding: 0 13px;

    color: rgba(255,255,255,.72);
    text-decoration: none;

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

    transition:
        background .18s ease,
        color .18s ease;
}

.tm-main-nav a:hover {
    color: white;
    background: rgba(255,255,255,.07);
    text-decoration: none;
}

.tm-main-nav a.active {
    color: white;
    background: rgba(255,255,255,.09);
}

.tm-main-nav a.active::after {
    content: "";

    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 0;

    height: 3px;

    border-radius: 3px 3px 0 0;

    background: #e9438c;
}


/* UTILIZADOR / LOGOUT */

.tm-topbar-user {
    display: flex;
    align-items: center;
    gap: 12px;

    flex: 0 0 auto;
}

.tm-user-name {
    color: rgba(255,255,255,.65);
    font-size: 12px;
}

.tm-logout-form {
    margin: 0;
}

.tm-logout-button {
    width: auto;
    margin: 0;

    padding: 9px 15px;

    border: 1px solid rgba(255,255,255,.18);
    border-radius: 9px;

    background: rgba(255,255,255,.07);

    color: white;

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

    cursor: pointer;
}

.tm-logout-button:hover {
    background: rgba(255,255,255,.14);
}


/* RESPONSIVO */

@media (max-width: 1050px) {

    .tm-topbar {
        gap: 15px;
        padding: 0 15px;
    }

    .tm-topbar-title {
        display: none;
    }

    .tm-main-nav a {
        padding: 0 9px;
        font-size: 12px;
    }

    .tm-user-name {
        display: none;
    }
}


@media (max-width: 760px) {

    .tm-topbar {
        position: relative;

        flex-wrap: wrap;
        padding: 10px 12px 0;
    }

    .tm-topbar-brand {
        flex: 1;
    }

    .tm-topbar-title {
        display: flex;
    }

    .tm-main-nav {
        order: 3;

        width: 100%;
        flex: 0 0 100%;

        overflow-x: auto;
        scrollbar-width: thin;
    }

    .tm-main-nav a {
        flex: 0 0 auto;
        min-height: 48px;
        padding: 0 13px;

        white-space: nowrap;
    }

}
