:root {
    --brand-primary: #0B6F84;
    --brand-primary-dark: #07586A;
    --brand-accent: #F5B400;
    --bg-page: #F4F6F8;
    --bg-card: #FFFFFF;
    --text-main: #14252E;
    --text-muted: #5F6B76;
    --border-soft: #D7DEE3;
    --danger: #DC2626;
    --success: #166534;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg-page);
    color: var(--text-main);
    font-size: 16px;
}

/* =========================
   LOGIN
========================= */

.login-body {
    min-height: 100vh;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    width: 100%;
    max-width: 430px;
    background: var(--bg-card);
    padding: 34px;
    border-radius: 18px;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.08);
    border-top: 6px solid var(--brand-primary);
}

.login-header {
    text-align: center;
    margin-bottom: 28px;
}

.login-logo {
    display: block;
    width: auto;
    max-width: 180px;
    max-height: 110px;
    object-fit: contain;
    margin: 0 auto 16px;
}

.login-header h1 {
    margin: 0 0 8px;
    font-size: 28px;
    color: var(--brand-primary);
}

.login-header p {
    margin: 0;
    color: var(--text-muted);
    font-size: 15px;
}

/* =========================
   TOPBAR
========================= */

.topbar {
    background: var(--brand-primary);
    color: #ffffff;
    min-height: 78px;
    padding: 14px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-logo {
    display: block;
    width: auto !important;
    height: auto !important;
    max-height: 54px !important;
    max-width: 170px !important;
    object-fit: contain !important;
}

.brand strong {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
}

.topbar nav {
    display: flex;
    align-items: center;
    gap: 18px;
}

.topbar a {
    color: #ffffff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}

.topbar a:hover {
    color: var(--brand-accent);
}

/* =========================
   LAYOUT
========================= */

.container {
    width: min(1100px, calc(100% - 32px));
    margin: 32px auto;
}

.card {
    background: var(--bg-card);
    padding: 28px;
    border-radius: 16px;
    margin-bottom: 24px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    border-top: 5px solid var(--brand-primary);
}

.card h1 {
    margin-top: 0;
    margin-bottom: 16px;
    color: var(--brand-primary);
}

/* =========================
   DASHBOARD MODULES
========================= */

.grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

.module-card {
    background: var(--bg-card);
    padding: 22px;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    border-top: 4px solid var(--brand-accent);
}

.module-card h2 {
    margin: 0 0 14px;
    font-size: 20px;
    color: var(--brand-primary);
}

.module-card p {
    margin: 0;
    color: var(--text-muted);
    min-height: 48px;
}

.module-card span {
    display: inline-block;
    margin-top: 18px;
    color: var(--brand-accent);
    font-size: 14px;
    font-weight: 700;
}

.module-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.module-link:hover {
    text-decoration: none;
    transform: translateY(-2px);
    transition: 0.15s ease;
}

/* =========================
   FORMULARIOS
========================= */

.form-group {
    margin-bottom: 18px;
}

label {
    display: block;
    margin-bottom: 7px;
    font-weight: 700;
    font-size: 14px;
    color: var(--text-main);
}

input,
select,
textarea {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    font-size: 15px;
    background: #ffffff;
    color: var(--text-main);
    font-family: Arial, Helvetica, sans-serif;
}

textarea {
    min-height: 110px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(11, 111, 132, 0.12);
}

.btn-primary,
.btn-action,
.btn-secondary {
    display: inline-block;
    padding: 12px 16px;
    border: 0;
    border-radius: 10px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    font-family: Arial, Helvetica, sans-serif;
}

.btn-primary,
.btn-action {
    background: var(--brand-primary);
    color: #ffffff;
}

.btn-primary:hover,
.btn-action:hover {
    background: var(--brand-primary-dark);
    color: #ffffff;
}

.btn-secondary {
    background: #E5E7EB;
    color: var(--text-main);
}

.btn-secondary:hover {
    background: #D1D5DB;
}

.login-card .btn-primary {
    width: 100%;
}

/* =========================
   ALERTAS
========================= */

.alert-error {
    background: #FEF2F2;
    color: #991B1B;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 18px;
    font-size: 14px;
    border-left: 4px solid var(--danger);
}

.alert-success {
    background: #DCFCE7;
    color: var(--success);
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 18px;
    font-size: 14px;
    border-left: 4px solid var(--success);
}

/* =========================
   PÁGINAS INTERNAS
========================= */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.page-header h1 {
    margin: 0 0 6px;
    color: var(--brand-primary);
}

.page-header p {
    margin: 0;
    color: var(--text-muted);
}

.table-wrapper {
    width: 100%;
    overflow-x: auto;
    margin-top: 16px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    overflow: hidden;
}

.data-table th,
.data-table td {
    padding: 14px 14px;
    border-bottom: 1px solid var(--border-soft);
    text-align: left;
    font-size: 14px;
    vertical-align: middle;
}

.data-table th {
    background: #F8FAFC;
    color: var(--text-main);
    font-weight: 700;
}

.data-table tbody tr:hover td {
    background: #F9FBFC;
}

.badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.badge-ok {
    background: #DCFCE7;
    color: #166534;
}

.badge-off {
    background: #FEE2E2;
    color: #991B1B;
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 900px) {
    .grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 700px) {
    .page-header {
        display: block;
    }

    .btn-action {
        margin-top: 14px;
    }
}

@media (max-width: 560px) {
    .grid {
        grid-template-columns: 1fr;
    }

    .topbar {
        display: block;
        padding: 16px;
    }

    .brand {
        margin-bottom: 12px;
    }

    .topbar nav {
        gap: 14px;
        flex-wrap: wrap;
    }

    .container {
        width: calc(100% - 24px);
        margin: 24px auto;
    }
}


.checkbox-row label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
}

.checkbox-row input[type="checkbox"] {
    width: auto;
}