:root {
    --navy: #10243b;
    --navy-light: #193650;
    --gold: #d4aa55;
    --background: #f3f5f8;
    --white: #ffffff;
    --text: #253448;
    --muted: #748094;
    --border: #e4e9ef;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    color: var(--text);
    background: var(--background);
}

.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 242px;
    flex-shrink: 0;
    background: var(--navy);
    color: var(--white);
    display: flex;
    flex-direction: column;
}

.brand {
    padding: 27px 23px;
    border-bottom: 1px solid rgba(255,255,255,.1);
}

.brand-name {
    color: var(--gold);
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 3px;
}

.brand-subtitle {
    font-size: 11px;
    letter-spacing: 5px;
    margin-top: 4px;
}

.sidebar-nav {
    padding: 18px 12px;
    flex: 1;
}

.nav-section {
    margin: 24px 12px 10px;
    color: #8e9fb1;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.3px;
}

.nav-link {
    display: block;
    padding: 12px 14px;
    margin-bottom: 4px;
    color: #dce5ef;
    text-decoration: none;
    border-radius: 6px;
    font-size: 13px;
}

.nav-link:hover {
    background: var(--navy-light);
}

.nav-link.active {
    background: var(--navy-light);
    color: var(--gold);
    border-left: 3px solid var(--gold);
}

.nav-disabled {
    opacity: .55;
    cursor: default;
}

.sidebar-footer {
    padding: 18px;
    font-size: 11px;
    text-align: center;
    color: #a9b8c8;
    border-top: 1px solid rgba(255,255,255,.1);
}

.main-area {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.topbar {
    height: 65px;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
}

.topbar-title {
    font-size: 16px;
    font-weight: 600;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 18px;
    font-size: 13px;
}

.logout-btn {
    border: 1px solid var(--border);
    background: white;
    border-radius: 5px;
    padding: 8px 14px;
    cursor: pointer;
}

.logout-btn:hover {
    background: #f0f2f5;
}

.content {
    flex: 1;
    padding: 26px 30px;
}

.page-title {
    font-size: 23px;
    margin: 0 0 6px;
    color: var(--navy);
}

.page-subtitle {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 24px;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.metric-card {
    background: var(--white);
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 9px;
    border-top: 3px solid var(--gold);
}

.metric-label {
    color: var(--muted);
    font-size: 12px;
}

.metric-value {
    margin-top: 12px;
    font-size: 30px;
    font-weight: 700;
    color: var(--navy);
}

.footer {
    padding: 14px 30px;
    font-size: 11px;
    color: var(--muted);
    border-top: 1px solid var(--border);
}

@media (max-width: 1000px) {
    .metrics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 650px) {
    .app-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }

    .sidebar-nav {
        padding: 8px 12px;
    }

    .content {
        padding: 18px;
    }

    .topbar {
        padding: 0 16px;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
    }
}

/* Dashboard compacto */

.metric-card {
    padding: 15px 18px;
    min-height: 96px;
}

.metric-value {
    margin-top: 8px;
    font-size: 27px;
}

.page-subtitle {
    margin-bottom: 18px;
}

.dashboard-columns {
    display: grid;
    grid-template-columns: 0.85fr 1.15fr;
    gap: 18px;
    margin-top: 20px;
    align-items: start;
}

.dashboard-panel {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 20px;
    min-width: 0;
}

.dashboard-panel h2 {
    font-size: 15px;
    color: var(--navy);
    margin: 0 0 18px;
}

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

.status-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: #f5f7fa;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px;
    font-size: 12px;
}

.status-item strong {
    font-size: 20px;
    color: var(--navy);
}

.status-warning {
    grid-column: 1 / -1;
    background: #fff9ec;
    border-color: #f1dfb7;
}

.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.data-table th {
    text-align: left;
    background: #f5f7fa;
    color: var(--muted);
    font-weight: 600;
    padding: 11px;
    white-space: nowrap;
}

.data-table td {
    padding: 11px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.data-table tbody tr:hover {
    background: #fafbfc;
}

.empty-state {
    text-align: center;
    color: var(--muted);
    padding: 24px !important;
}

@media (max-width: 1100px) {
    .dashboard-columns {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 650px) {
    .status-grid {
        grid-template-columns: 1fr;
    }

    .status-warning {
        grid-column: auto;
    }
}
/* Autenticação GLEICOS Gestão */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #10243b, #193650);
}

.login-container {
    width: 100%;
    max-width: 410px;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .25);
}

.login-brand {
    padding: 30px;
    text-align: center;
    background: #10243b;
    color: #ffffff;
}

.login-brand h1 {
    margin: 0;
    font-size: 30px;
    letter-spacing: 5px;
    color: #d4aa55;
}

.login-brand span {
    display: block;
    margin-top: 7px;
    font-size: 12px;
    letter-spacing: 6px;
}

.login-content {
    padding: 30px;
}

.login-content h2 {
    margin: 0 0 8px;
    color: #10243b;
    font-size: 21px;
}

.login-content p {
    color: #748094;
    font-size: 13px;
    margin-bottom: 25px;
}

.login-content label {
    display: block;
    margin-bottom: 7px;
    font-size: 12px;
    font-weight: 600;
}

.login-content input[type="text"],
.login-content input[type="password"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #dce3eb;
    border-radius: 6px;
    margin-bottom: 18px;
    font-size: 14px;
}

.login-content input:focus {
    outline: none;
    border-color: #d4aa55;
    box-shadow: 0 0 0 3px rgba(212, 170, 85, .15);
}

.login-button {
    width: 100%;
    border: none;
    padding: 13px;
    background: #d4aa55;
    color: #10243b;
    font-size: 14px;
    font-weight: 700;
    border-radius: 6px;
    cursor: pointer;
}

.login-button:hover {
    background: #c69a43;
}

.login-error {
    padding: 12px;
    background: #fff0f0;
    border: 1px solid #efc5c5;
    color: #a52a2a;
    border-radius: 6px;
    margin-bottom: 18px;
    font-size: 12px;
}

.login-footer {
    padding: 16px;
    text-align: center;
    color: #748094;
    font-size: 11px;
    border-top: 1px solid #e4e9ef;
}
/* Módulo de Clientes */

.page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.search-form {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.search-form input {
    flex: 1;
    min-width: 220px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font: inherit;
    font-size: 13px;
}

.action-button {
    background: var(--navy);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 11px 18px;
    cursor: pointer;
}

.clear-button {
    color: var(--muted);
    text-decoration: none;
    font-size: 13px;
}

.table-secondary {
    color: var(--muted);
    font-size: 11px;
    margin-top: 4px;
}

.status-badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.status-active {
    background: #e7f5ed;
    color: #247448;
}

.status-inactive {
    background: #fce9e9;
    color: #a83c3c;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 20px;
    font-size: 12px;
}

.pagination a {
    color: var(--navy);
    text-decoration: none;
    font-weight: 600;
}

/* Formulários GLEICOS Gestão */

.form-panel {
    max-width: 950px;
}

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

.form-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
}

.field-wide {
    grid-column: 1 / -1;
}

.form-field label {
    font-size: 12px;
    font-weight: 600;
}

.form-field input,
.form-field select {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font: inherit;
    font-size: 13px;
    background: white;
}

.form-field input:focus,
.form-field select:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212,170,85,.12);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 26px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.button-link {
    display: inline-block;
    text-decoration: none;
    font-size: 13px;
}

.cancel-button {
    padding: 11px 18px;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    text-decoration: none;
    font-size: 13px;
}

.table-action {
    color: var(--navy);
    font-weight: 600;
    text-decoration: none;
}

.field-error,
.form-errors {
    color: #b42318;
    font-size: 12px;
}

@media (max-width: 650px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .field-wide {
        grid-column: auto;
    }

    .page-heading {
        align-items: flex-start;
        gap: 12px;
        flex-wrap: wrap;
    }
}

.button-link,
.button-link:visited,
.button-link:hover {
    text-decoration: none;
    color: #ffffff;
}

.button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
}