/* =========================================================
   SISAT — ESTILO GENERAL DEL SISTEMA
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=Inter:wght@400;500;600;700&family=Sora:wght@500;600;700&display=swap');

/* ---------- Variables globales ---------- */

:root {
    --ink: #0B2B26;
    --paper: #F6F8F6;
    --white: #FFFFFF;

    --teal: #0F7A72;
    --deep-teal: #0B5B54;
    --lime: #8FC63E;

    --alert: #D65C42;
    --amber: #E0A526;

    --line: #DCE4E0;
    --muted: #5C736C;
    --muted-light: #84958F;

    --success-bg: #EEF7E7;
    --warning-bg: #FFF7DF;
    --danger-bg: #FCEDEA;
    --info-bg: #EAF5F3;

    --font-display: "Sora", sans-serif;
    --font-body: "Inter", sans-serif;
    --font-mono: "IBM Plex Mono", monospace;

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    --shadow-sm: 0 4px 16px rgba(11, 43, 38, 0.06);
    --shadow-md: 0 12px 34px rgba(11, 43, 38, 0.10);
}

/* ---------- Reset ---------- */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 13px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

a {
    color: inherit;
}

img,
svg {
    max-width: 100%;
}

/* ---------- Contenedor pagina ---------- */

.page-container {
    width: min(1440px, calc(100% - 64px));
    margin: 0 auto;
    padding: 30px 0 45px;
}

/* ---------- Tipografía general ---------- */

h1,
h2,
h3,
h4 {
    margin: 0;
    font-family: var(--font-display);
    color: var(--ink);
    line-height: 1.15;
}

p {
    margin: 0;
}

.eyebrow,
.section-number,
.mono {
    font-family: var(--font-mono);
}

.eyebrow {
    margin: 0 0 7px;
    color: var(--teal);
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: .08em;
}

.page-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 26px;
    line-height: 1.2;
    color: var(--ink);
}

.page-description {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 12px;
}
.section-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    padding: 5px 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--teal);
    background: var(--white);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .08em;
}

/* ---------- Controles generales ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition:
        transform .16s ease,
        box-shadow .16s ease,
        background-color .16s ease,
        border-color .16s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn:focus-visible,
.text-button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid rgba(143, 198, 62, .30);
    outline-offset: 2px;
}

.btn-primary {
    background: var(--teal);
    color: var(--white);
    box-shadow: 0 7px 18px rgba(15, 122, 114, .16);
}

.btn-primary:hover {
    background: var(--deep-teal);
}

/* ---------- Campos generales ---------- */

.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.field > label,
.field-label-row label {
    color: var(--ink);
    font-size: 13px;
    font-weight: 600;
}

.field-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

input,
select,
textarea {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--ink);
    padding: 0 13px;
    transition:
        border-color .16s ease,
        box-shadow .16s ease;
}

textarea {
    min-height: 110px;
    padding-top: 12px;
    padding-bottom: 12px;
    resize: vertical;
}

input::placeholder,
textarea::placeholder {
    color: var(--muted-light);
}

input:hover,
select:hover,
textarea:hover {
    border-color: #C7D5D0;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(15, 122, 114, .09);
    outline: none;
}

.search-select-input input:focus,
.search-select-input input:focus-visible {
    border-color: transparent;
    box-shadow: none;
    outline: none;
}

input:disabled,
select:disabled,
textarea:disabled {
    background: #F0F3F1;
    color: var(--muted);
    cursor: not-allowed;
}

/* ---------- Cards generales ---------- */

.card {
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--white);
    box-shadow: var(--shadow-sm);
}

.card-header {
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
}

.card-body {
    padding: 20px;
}

/* ---------- Badges / estados generales ---------- */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 26px;
    padding: 4px 9px;
    border-radius: 999px;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-normal {
    background: var(--success-bg);
    color: #4D7621;
}

.badge-alta {
    background: var(--warning-bg);
    color: #85620D;
}

.badge-urgente {
    background: var(--danger-bg);
    color: #A53E29;
}

.badge-pendiente {
    background: #EEF1F0;
    color: #52645F;
}

.badge-proceso {
    background: var(--info-bg);
    color: var(--deep-teal);
}

.badge-resuelto {
    background: var(--success-bg);
    color: #4D7621;
}

/* ---------- Utilidades ---------- */

.text-muted {
    color: var(--muted);
}

.text-center {
    text-align: center;
}

.hidden {
    display: none !important;
}


/* ================================
   TOPBAR
   ================================ */

.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    height: 72px;
    display: flex;
    align-items: center;
    padding: 0 32px;
    background: #ffffff;
    border-bottom: 1px solid var(--line);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    text-decoration: none;
    color: var(--ink);
}

.brand-mark {
    width: 11px;
    height: 32px;
    border-radius: 4px;
    background: var(--lime);
}

.brand-text {
    display: flex;
    flex-direction: column;
    font-family: "Sora", sans-serif;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.1;
}

.brand-text small {
    margin-top: 4px;
    color: var(--muted);
    font-family: "Inter", sans-serif;
    font-size: 9px;
    font-weight: 500;
    letter-spacing: .02em;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    margin-right: 28px;
}

.main-nav a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 13px;
    border-radius: 7px;
    color: var(--muted);
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    transition: .2s ease;
}

.main-nav a span {
    font-family: "IBM Plex Mono", monospace;
    font-size: 9px;
    opacity: .65;
}

.main-nav a:hover {
    color: var(--teal);
    background: #f1f5f3;
}

.main-nav a.active {
    color: var(--deep-teal);
    background: #e9f2ef;
}

.topbar-user {
    position: relative;
}

.user-menu {
    position: relative;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 5px 8px 5px 5px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    cursor: pointer;
    text-align: left;
}

.user-chip:hover,
.user-chip.open {
    background: #f5f7f6;
    border-color: var(--line);
}

.user-avatar {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--deep-teal);
    color: #ffffff;
    font-family: "Sora", sans-serif;
    font-size: 13px;
    font-weight: 700;
}

.user-avatar.large {
    width: 42px;
    height: 42px;
    font-size: 15px;
}

.user-data {
    display: flex;
    flex-direction: column;
    min-width: 100px;
}

.user-data strong {
    color: var(--ink);
    font-size: 11px;
    font-weight: 700;
}

.user-data small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 9px;
}

.user-chevron {
    margin-left: 3px;
    color: var(--muted);
    font-size: 16px;
    transition: transform .2s ease;
}

.user-chip.open .user-chevron {
    transform: rotate(180deg);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 9px);
    right: 0;
    width: 235px;
    padding: 10px;
    display: none;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 12px 35px rgba(11, 43, 38, .12);
}

.user-dropdown.show {
    display: block;
}

.dropdown-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px;
}

.dropdown-profile > div {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.dropdown-profile strong {
    color: var(--ink);
    font-size: 11px;
}

.dropdown-profile small {
    margin-top: 3px;
    overflow: hidden;
    color: var(--muted);
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropdown-divider {
    height: 1px;
    margin: 7px 0;
    background: var(--line);
}

.dropdown-logout {
    width: 100%;
    padding: 9px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--alert);
    cursor: pointer;
    font-size: 10px;
    font-weight: 600;
    text-align: left;
}

.dropdown-logout:hover {
    background: #fff4f1;
}

/* ================================
   FOOTER
   ================================ */

.menu-footer {
    padding: 18px 30px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-family: "IBM Plex Mono", monospace;
    font-size: 8px;
    text-align: center;
}

/* ================================
   RESPONSIVE — ELEMENTOS GENERALES
   ================================ */

@media (max-width: 1150px) {
    .topbar {
        padding: 0 20px;
    }

    .brand {
        min-width: auto;
    }

    .brand-text small {
        display: none;
    }

    .main-nav {
        margin-right: 10px;
    }

    .main-nav a {
        padding: 9px 8px;
    }

    .main-nav a span {
        display: none;
    }
}

@media (max-width: 850px) {
    .topbar {
        height: auto;
        min-height: 68px;
        flex-wrap: wrap;
        gap: 10px;
        padding: 12px 18px;
    }

    .main-nav {
        order: 3;
        width: 100%;
        margin: 0;
        overflow-x: auto;
    }

    .main-nav a {
        flex-shrink: 0;
    }
}

@media (max-width: 600px) {
    .user-data {
        display: none;
    }

    .brand-text {
        font-size: 16px;
    }
}

/* ================================
   ESTADOS / BADGES
   ================================ */

.status-badge,
.priority-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 7px;
    border-radius: 5px;
    font-size: 8px;
    font-weight: 600;
    white-space: nowrap;
}

.status-pendiente {
    background: #fff6df;
    color: #9a7010;
}

.status-proceso {
    background: #e7f3f1;
    color: var(--deep-teal);
}

.status-resuelto {
    background: #eaf4e2;
    color: #4f7927;
}

.priority-normal {
    background: #eef2f0;
    color: var(--muted);
}

.priority-alta {
    background: #fff5dc;
    color: #967016;
}

.priority-urgente {
    background: #fff0ec;
    color: var(--alert);
}

/* ---------- Responsive — contenedor global ---------- */

@media (max-width: 1100px) {
    .page-container {
        width: calc(100% - 40px);
    }
}

@media (max-width: 600px) {
    .page-container {
        width: calc(100% - 24px);
        padding-top: 20px;
        padding-bottom: 30px;
    }
}
