/* Badge para Pdte. Reserva */
.status-badge.status-reserva {
    background: #6e66db;
    color: #fff;
    border-radius: 20px;
    padding: 4px 16px;
    font-weight: bold;
    display: inline-block;
}

html, body {
    height: 100%;
}
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
footer {
    margin-top: auto;
}
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
}
.header {
    background-color: #2c3e50;
    color: white;
    padding: 15px 0; 
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}
header img {
    max-width: 150px;
    height: auto;
}
.header div {
    flex-shrink: 0;
}
.header h1, .header p {
    margin: 0;
}
.logo-placeholder {
    width: 120px;
    height: 60px;
    border: 1px dashed #ccc;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #666;
    background-color: #f9f9f9;
}
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}
.login-container {
    max-width: 400px;
    margin: 50px auto;
    background-color: white;
    padding: 30px;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.dashboard-container {
    display: none;
    margin-top: 20px;
}
.form-group {
    margin-bottom: 20px;
}
label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}
input, select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 16px;
}
button {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    width: 100%;
}
button:hover {
    background-color: #2980b9;
}
.error-message {
    color: #e74c3c;
    margin-top: 15px;
    display: none;
    padding: 10px;
    background-color: #fce5e5;
    border-radius: 4px;
}
.card {
    background-color: white;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    padding: 20px;
    margin-bottom: 20px;
}
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.user-info {
    font-size: 16px;
}
.nav-tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
    margin-bottom: 20px;
}
.nav-tab {
    padding: 10px 20px;
    cursor: pointer;
    border: 1px solid transparent;
    border-bottom: none;
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
    margin-right: 5px;
    background-color: #f5f5f5;
}
.nav-tab.active {
    background-color: white;
    border-color: #ddd;
    border-bottom-color: white;
    margin-bottom: -1px;
}
.tab-content {
    display: none;
    padding: 20px;
    border: 1px solid #ddd;
    border-top: none;
    background-color: white;
}
.tab-content.active {
    display: block;
}
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}
th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}
th {
    background-color: #f8f9fa;
    font-weight: bold;
}
.status-badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    color: white;
    font-weight: bold;
}
.status-open {
    background-color: #61cfeb;
}
.status-pending {
    background-color: #0d5f96;
}
.status-closed {
    background-color: #03b612;
}
.status-rejected {
    background-color: #e74c3c;
}
.status-pending-sign {
    background-color: #f39c12;
}   
.status-signed {
    background-color: #1a550e;
}

/* Icono para indicar que hay una reclamación/motivo guardado (preventa) */
.reclamacion-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    border-radius: 50%;
    background: #e74c3c; /* mismo rojo que .status-rejected */
    color: #ffffff; /* texto blanco dentro del círculo */
    border: none;
    font-weight: bold;
    margin-left: 6px;
    cursor: pointer;
    font-size: 12px;
    vertical-align: middle;
    box-shadow: 0 1px 0 rgba(0,0,0,0.08);
}

.reclamacion-icon:hover {
    filter: brightness(0.95);
}
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    overflow: auto;
}
.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    width: 80%;
    max-width: 800px;
    position: relative;
}
.close-modal {
    position: absolute;
    right: 20px;
    top: 10px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #666;
}
.close-modal:hover {
    color: #000;
}
.tab-container {
    margin-top: 20px;
}
.detail-tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
    margin-bottom: 20px;
}
.detail-tab {
    padding: 10px 20px;
    cursor: pointer;
    border: 1px solid transparent;
    border-bottom: none;
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
    margin-right: 5px;
    background-color: #f5f5f5;
}
.detail-tab.active {
    background-color: white;
    border-color: #ddd;
    border-bottom-color: white;
    margin-bottom: -1px;
}
.detail-tab-content {
    display: none;
    padding: 20px;
    border: 1px solid #ddd;
    border-top: none;
    background-color: white;
}
.detail-tab-content.active {
    display: block;
}
.form-row {
    display: flex;
    margin-bottom: 15px;
}
.form-group-detail {
    flex: 1;
    padding: 0 10px;
}
.form-group-detail label {
    font-weight: bold;
    margin-bottom: 5px;
    display: block;
}
.info-value {
    padding: 8px 12px;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
}
div[style*="text-align: right;"] {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 15px;
}

.hoja-actions {
    justify-content: center !important;
    gap: 10px;
    flex-wrap: wrap;
}

.hoja-actions button {
    min-width: 135px;
    padding: 8px 12px !important;
    font-size: 14px;
}

.presupuesto-box {
    background: #f8fbfa;
    border: 1px solid #d9e5e2;
    border-radius: 10px;
    padding: 14px;
}

.presupuesto-help {
    margin-top: 0;
    color: #46615c;
}

.presupuesto-upload-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.presupuesto-dropzone {
    position: relative;
    flex: 1;
    min-width: 240px;
    min-height: 132px;
    border: 2px dashed #c8d7d3;
    border-radius: 14px;
    background: linear-gradient(180deg, #fdfefe 0%, #f4f8f7 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 16px 14px;
    text-align: center;
    cursor: pointer;
    transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.presupuesto-dropzone:hover,
.presupuesto-dropzone:focus {
    border-color: #7eb7ac;
    background: linear-gradient(180deg, #ffffff 0%, #eef7f4 100%);
    box-shadow: 0 10px 28px rgba(28, 104, 93, 0.08);
    outline: none;
}

.presupuesto-dropzone.dragover {
    border-color: #13887f;
    background: linear-gradient(180deg, #f2fffb 0%, #e6f7f3 100%);
    box-shadow: 0 14px 32px rgba(19, 136, 127, 0.14);
    transform: translateY(-1px);
}

.presupuesto-file-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    color: transparent;
    background: transparent;
    border: 0;
    cursor: pointer;
}

.presupuesto-file-input::file-selector-button {
    display: none;
}

.presupuesto-file-input::-ms-browse {
    display: none;
}

.presupuesto-dropzone-icon {
    width: 42px;
    height: 42px;
    color: #a8b8b3;
}

.presupuesto-cloud-icon {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.presupuesto-dropzone-text {
    font-size: 18px;
    font-weight: 400;
    color: #7a8791;
    letter-spacing: 0.01em;
    max-width: 340px;
    line-height: 1.3;
}

.presupuesto-dropzone-subtext {
    color: #70807b;
    font-size: 12px;
}

.presupuesto-archivo-seleccionado {
    margin-top: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #edf5f3;
    color: #315952;
    font-size: 12px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.presupuesto-feedback {
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 14px;
}

.presupuesto-feedback.success {
    background: #eaf7ef;
    border: 1px solid #b9dfc6;
    color: #25613a;
}

.presupuesto-feedback.error {
    background: #fff2f1;
    border: 1px solid #efc2be;
    color: #8f3027;
}

.presupuesto-list-wrap h4 {
    margin-bottom: 10px;
}

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

.presupuesto-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid #dbe6e3;
    border-radius: 8px;
    background: #fff;
}

.presupuesto-item a {
    color: #17695f;
    text-decoration: none;
    font-weight: 600;
}

.presupuesto-item span {
    color: #667874;
    font-size: 13px;
}
@media print {
    #hoja-incidencia {
        width: 100%;
        margin: 0 auto;
        font-size: 12px;
        line-height: 1.5;
    }
}

/* Cookie overlay styles: bloquea toda la web hasta que el usuario acepte */
.cookie-overlay {
    position: fixed;
    inset: 0; /* top:0; right:0; bottom:0; left:0 */
    background: rgba(0,0,0,0.6);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cookie-box {
    background: #fff;
    padding: 24px;
    max-width: 520px;
    width: calc(100% - 40px);
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.35);
    text-align: center;
}
.cookie-box h2 {
    margin-top: 0;
}
.cookie-actions {
    margin-top: 18px;
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.guide-mascot-launcher {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 10020;
    width: 64px;
    height: 64px;
    min-width: 64px;
    min-height: 64px;
    max-width: 64px;
    max-height: 64px;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    border: 0;
    background: linear-gradient(145deg, #1d6f74 0%, #2ea2a7 100%);
    box-shadow: 0 16px 34px rgba(21, 94, 97, 0.28);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    overflow: hidden;
}

.guide-mascot-launcher:hover {
    background: linear-gradient(145deg, #195f63 0%, #279095 100%);
}

.guide-mascot-launcher.hidden,
.guide-mascot.hidden {
    display: none !important;
}

.guide-mascot-launcher span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;
    border-radius: 50%;
    line-height: 1;
}

.guide-mascot {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 10021;
    width: min(360px, calc(100vw - 24px));
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

.guide-mascot-character {
    width: 118px;
    flex: 0 0 118px;
    animation: guideMascotFloat 2.6s ease-in-out infinite;
}

.guide-mascot-body {
    position: relative;
    width: 118px;
    height: 170px;
}

.guide-mascot-roof {
    position: absolute;
    top: 10px;
    left: 13px;
    width: 92px;
    height: 92px;
    background: #10161a;
    clip-path: polygon(50% 0%, 100% 48%, 92% 56%, 50% 15%, 8% 56%, 0% 48%);
}

.guide-mascot-shell {
    position: absolute;
    top: 34px;
    left: 20px;
    width: 78px;
    height: 100px;
    border-radius: 16px 16px 18px 18px;
    background: linear-gradient(180deg, #ffffff 0%, #edf2f4 100%);
    border: 3px solid #1a1f23;
    box-shadow: inset 0 -8px 0 rgba(39, 52, 58, 0.08);
}

.guide-mascot-face {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    height: 24px;
}

.guide-mascot-eye {
    position: absolute;
    top: 2px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #12181c;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.18);
}

.guide-mascot-eye.left { left: 14px; }
.guide-mascot-eye.right { right: 14px; }

.guide-mascot-eye::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #ffffff;
}

.guide-mascot-smile {
    position: absolute;
    left: 24px;
    top: 14px;
    width: 14px;
    height: 7px;
    border-bottom: 3px solid #12181c;
    border-radius: 0 0 14px 14px;
}

.guide-mascot-screen {
    position: absolute;
    left: 12px;
    top: 34px;
    width: 48px;
    height: 50px;
    border-radius: 8px;
    background: linear-gradient(180deg, #dbe6ea 0%, #fefefe 100%);
    border: 4px solid #162126;
    box-shadow: 0 0 18px rgba(43, 95, 110, 0.22);
    display: flex;
    align-items: center;
    justify-content: center;
}

.guide-mascot-screen span {
    font-size: 22px;
    font-weight: 800;
    color: #2b3f46;
    letter-spacing: -0.04em;
}

.guide-mascot-arm {
    position: absolute;
    top: 84px;
    width: 6px;
    height: 34px;
    border-radius: 999px;
    background: #808f97;
    transform-origin: top center;
}

.guide-mascot-arm.left {
    left: 8px;
    transform: rotate(28deg);
}

.guide-mascot-arm.right {
    right: 8px;
    transform: rotate(-22deg);
}

.guide-mascot-tool {
    position: absolute;
    border: 2px solid #162126;
    background: #eef3f5;
}

.guide-mascot-tool.left {
    top: 106px;
    left: -2px;
    width: 16px;
    height: 28px;
    border-radius: 6px;
    transform: rotate(-14deg);
}

.guide-mascot-tool.left::before {
    content: '';
    position: absolute;
    top: -16px;
    left: 4px;
    width: 6px;
    height: 18px;
    border-radius: 999px;
    background: #eef3f5;
    border: 2px solid #162126;
    border-bottom: 0;
}

.guide-mascot-tool.left::after {
    content: '';
    position: absolute;
    top: -22px;
    left: 2px;
    width: 10px;
    height: 10px;
    border: 2px solid #162126;
    border-radius: 2px 6px 2px 2px;
    transform: rotate(45deg);
    background: #eef3f5;
}

.guide-mascot-tool.right {
    top: 102px;
    right: -2px;
    width: 24px;
    height: 30px;
    border-radius: 4px;
    transform: rotate(14deg);
}

.guide-mascot-tool.right::before,
.guide-mascot-tool.right::after {
    content: '';
    position: absolute;
    background: #2b7f89;
    border-radius: 999px;
}

.guide-mascot-tool.right::before {
    left: 7px;
    top: 11px;
    width: 10px;
    height: 2px;
    box-shadow: 0 -5px 0 #2b7f89, 0 5px 0 #2b7f89;
}

.guide-mascot-tool.right::after {
    right: 4px;
    top: 6px;
    width: 4px;
    height: 18px;
    opacity: 0.55;
}

.guide-mascot-leg {
    position: absolute;
    bottom: 18px;
    width: 10px;
    height: 28px;
    border-radius: 4px;
    background: linear-gradient(180deg, #f1f4f5 0%, #d4dbe0 100%);
    border: 2px solid #687b84;
}

.guide-mascot-leg.left { left: 36px; }
.guide-mascot-leg.right { right: 36px; }

.guide-mascot-wheel {
    position: absolute;
    bottom: 6px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 35%, #ffffff 0 18%, #6c7d85 19% 42%, #13191d 43% 100%);
}

.guide-mascot-wheel.left { left: 24px; }
.guide-mascot-wheel.right { right: 24px; }

.guide-mascot-bubble {
    position: relative;
    flex: 1;
    background: linear-gradient(180deg, #fffdf8 0%, #fff7ea 100%);
    border: 1px solid #ecd4a8;
    border-radius: 18px;
    box-shadow: 0 18px 40px rgba(115, 93, 42, 0.16);
    padding: 16px 16px 14px;
}

.guide-mascot-bubble::before {
    content: '';
    position: absolute;
    left: -10px;
    bottom: 22px;
    width: 18px;
    height: 18px;
    background: #fff9ef;
    border-left: 1px solid #ecd4a8;
    border-bottom: 1px solid #ecd4a8;
    transform: rotate(45deg);
}

.guide-mascot-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.guide-mascot-name {
    font-size: 15px;
    font-weight: 700;
    color: #21444a;
}

.guide-mascot-step {
    font-size: 12px;
    color: #846c3e;
}

.guide-mascot-close {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    border: 1px solid #ead19f;
    background: #fff7e6;
    color: #6b5a34;
    padding: 0;
}

.guide-mascot-title {
    margin: 0 0 6px;
    color: #5e4d2d;
    font-size: 18px;
}

.guide-mascot-text {
    margin: 0;
    color: #55482d;
    line-height: 1.45;
    font-size: 14px;
}

.guide-mascot-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
}

.guide-mascot-actions button {
    width: auto;
    min-width: 0;
    padding: 9px 12px;
    font-size: 14px;
}

.guide-mascot-secondary {
    background: #fff;
    color: #21444a;
    border: 1px solid #cfdedc;
}

.guide-mascot-secondary:hover {
    background: #f4fbfb;
}

.guide-mascot-target {
    position: relative;
    z-index: 3;
    box-shadow: 0 0 0 4px rgba(46, 162, 167, 0.18), 0 0 0 1px rgba(29, 111, 116, 0.42);
    border-radius: 10px;
    transition: box-shadow 180ms ease;
}

@keyframes guideMascotFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

@media (max-width: 720px) {
    .guide-mascot {
        left: 12px;
        right: 12px;
        bottom: 12px;
        width: auto;
        gap: 8px;
    }

    .guide-mascot-character {
        width: 96px;
        flex-basis: 96px;
    }

    .guide-mascot-body {
        transform: scale(0.82);
        transform-origin: bottom left;
    }

    .guide-mascot-bubble {
        padding: 14px;
    }

    .guide-mascot-actions {
        flex-wrap: wrap;
    }
}
.cookie-btn {
    background: #34af2f;
    color: rgb(255, 255, 255);
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}
.cookie-btn:hover { opacity: 0.95; }
.cookie-link {
    color: #035711;
    text-decoration: underline;
}

.cookie-reject-btn {
    background: #e25f5f;
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}
.cookie-reject-btn:hover { background: #cc0000; }

@media(min-width:600px) {
    .cookie-actions { flex-direction: row; }
    .cookie-actions > div { width: auto; }
    .cookie-actions .cookie-link { margin-right: 12px; align-self: center; }
}

/* Evitar scroll mientras el overlay esté activo */
.no-scroll {
    overflow: hidden !important;
    height: 100% !important;
}

/* =========================
   REDISENO VISUAL GLOBAL
   ========================= */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
    --bg-main: #f2f5f3;
    --bg-card: #ffffff;
    --bg-soft: #eef4f1;
    --text-main: #18312b;
    --text-soft: #4f6a63;
    --line: #d6e4de;
    --brand: #0f766e;
    --brand-strong: #0b5b55;
    --accent: #eb5e55;
    --accent-soft: #ffe1df;
    --ok: #1f9d55;
    --warn: #d5891f;
    --danger: #d34646;
    --shadow-soft: 0 10px 30px rgba(15, 42, 33, 0.08);
    --shadow-md: 0 18px 45px rgba(12, 38, 32, 0.14);
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 22px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', 'Segoe UI', Tahoma, sans-serif;
    background:
        radial-gradient(circle at 8% 8%, rgba(15, 118, 110, 0.18), transparent 34%),
        radial-gradient(circle at 95% 5%, rgba(235, 94, 85, 0.12), transparent 30%),
        linear-gradient(180deg, #f7faf8 0%, var(--bg-main) 100%);
    color: var(--text-main);
}

h1, h2, h3, h4, h5, .nav-tab, .detail-tab {
    font-family: 'Space Grotesk', 'Segoe UI', Tahoma, sans-serif;
    letter-spacing: 0.01em;
}

.header {
    position: sticky;
    top: 0;
    z-index: 900;
    border-bottom: 1px solid rgba(255, 255, 255, 0.25);
    background: linear-gradient(120deg, #0d4b46 0%, #0f766e 54%, #16938a 100%);
    box-shadow: 0 8px 26px rgba(15, 55, 50, 0.24);
    backdrop-filter: blur(6px);
}

.header h1 {
    font-size: clamp(1.15rem, 2.1vw, 1.8rem);
    font-weight: 800;
}

.header p {
    opacity: 0.92;
    font-weight: 500;
}

.container {
    max-width: 1200px;
    padding: 24px 18px 32px;
}

.login-container,
.card,
.tab-content,
.modal-content {
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
}

.login-container {
    max-width: 460px;
    padding: 30px 26px;
    background: linear-gradient(180deg, #ffffff 0%, #f9fcfb 100%);
}

.dashboard-header {
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #ffffff 0%, #f3f9f6 100%);
    box-shadow: var(--shadow-soft);
}

.user-info {
    color: var(--text-soft);
    font-weight: 500;
}

a {
    color: var(--brand-strong);
    text-decoration-color: rgba(11, 91, 85, 0.35);
    text-underline-offset: 2px;
}

a:hover {
    color: var(--accent);
}

label {
    color: #26463f;
    font-size: 0.95rem;
    margin-bottom: 7px;
}

input,
select,
textarea {
    border: 1px solid #c8d8d2;
    border-radius: 12px;
    background: #fcfefd;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #28a39a;
    box-shadow: 0 0 0 3px rgba(40, 163, 154, 0.18);
    transform: translateY(-1px);
}

button,
.cookie-btn,
.cookie-reject-btn {
    width: auto;
    min-width: 170px;
    border-radius: 999px;
    border: none;
    font-family: 'Space Grotesk', 'Segoe UI', Tahoma, sans-serif;
    font-weight: 700;
    letter-spacing: 0.01em;
    padding: 11px 18px;
    background: linear-gradient(130deg, var(--brand) 0%, #18a195 100%);
    color: #fff;
    box-shadow: 0 10px 22px rgba(15, 118, 110, 0.28);
    transition: transform 140ms ease, box-shadow 140ms ease, filter 140ms ease;
}

form button,
#login-form button,
#first-password-form button,
#incident-form button {
    width: 100%;
}

button:hover,
.cookie-btn:hover,
.cookie-reject-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(15, 118, 110, 0.32);
    filter: saturate(1.04);
}

.cookie-reject-btn {
    background: linear-gradient(130deg, #d44848 0%, #f17062 100%);
    box-shadow: 0 10px 24px rgba(211, 70, 70, 0.25);
}

.nav-tabs,
.detail-tabs {
    border-bottom: 0;
    gap: 8px;
    flex-wrap: wrap;
}

.nav-tab,
.detail-tab {
    border: 1px solid #cfe0d9;
    border-radius: 999px;
    background: #f4f9f7;
    color: #2b4e46;
    font-weight: 600;
    transition: all 150ms ease;
}

.nav-tab:hover,
.detail-tab:hover {
    background: #edf7f4;
    border-color: #b7d4ca;
}

.nav-tab.active,
.detail-tab.active {
    background: linear-gradient(120deg, #0f766e 0%, #159d90 100%);
    color: #fff;
    border-color: #0f766e;
    box-shadow: 0 8px 18px rgba(15, 118, 110, 0.22);
}

.tab-content,
.detail-tab-content,
.card {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
}

table {
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
}

th {
    background: linear-gradient(180deg, #e9f4ef 0%, #e2f0ea 100%);
    color: #294a42;
    font-size: 0.88rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

tbody tr {
    transition: background-color 140ms ease;
}

tbody tr:nth-child(odd) {
    background: #fcfefd;
}

tbody tr:hover {
    background: #edf7f3;
}

.status-badge {
    border-radius: 999px;
    padding: 5px 12px;
    font-size: 11px;
    letter-spacing: 0.02em;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24);
}

.status-open { background-color: #31a7cc; }
.status-pending { background-color: #158a87; }
.status-closed { background-color: var(--ok); }
.status-rejected { background-color: var(--danger); }
.status-pending-sign { background-color: var(--warn); }
.status-signed { background-color: #1a7f43; }
.status-badge.status-reserva { background: #0b7068; }

.info-value {
    border-radius: 12px;
    border: 1px solid #dbe8e3;
    background: linear-gradient(180deg, #fcfefd 0%, #f3f8f6 100%);
    color: #2e524a;
}

.modal {
    background-color: rgba(13, 35, 31, 0.5);
    backdrop-filter: blur(2px);
}

.modal-content {
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, #ffffff 0%, #f8fcfa 100%);
    border: 1px solid #c9ddd5;
    box-shadow: var(--shadow-md);
}

.close-modal {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: #f1f7f4;
    color: #36544c;
    border: 1px solid #d1e2dc;
}

.close-modal:hover {
    background: #e5f0ec;
    color: #102822;
}

.cookie-overlay {
    backdrop-filter: blur(3px);
    background: rgba(11, 28, 24, 0.62);
}

.cookie-box {
    border: 1px solid #cbddd6;
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, #ffffff 0%, #f6fbf9 100%);
}

.cookie-link {
    color: #0b5b55;
    font-weight: 600;
}

.error-message {
    border: 1px solid #f0b7b3;
    background-color: #fff0ef;
    color: #a63939;
    border-radius: 12px;
}

#progress-container > div:first-child {
    border: 1px solid #cce1d9;
    background: #edf6f2 !important;
}

@keyframes revealUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card,
.tab-content,
.detail-tab-content,
.modal-content,
.login-container {
    animation: revealUp 280ms ease-out;
}

@media (max-width: 900px) {
    .container {
        padding: 14px 12px 24px;
    }

    .header {
        padding: 12px;
    }

    .dashboard-header {
        display: block;
    }

    .form-row {
        flex-direction: column;
        gap: 10px;
    }

    .form-group-detail {
        padding: 0;
    }

    .modal-content {
        width: 94%;
        margin: 8% auto;
        padding: 16px;
    }

    button,
    .cookie-btn,
    .cookie-reject-btn {
        width: 100%;
        min-width: 0;
    }
}

/* Ajuste de encaje para modales principales de incidencias */
#modal-detalles,
#modal-detalles-preventa {
    overflow-y: auto;
    padding: 14px;
}

#modal-detalles .modal-content,
#modal-detalles-preventa .modal-content {
    width: min(980px, 92vw);
    max-width: 980px;
    max-height: calc(100vh - 28px);
    margin: 10px auto;
    padding: 18px;
    overflow: hidden;
}

#modal-detalles #modal-title,
#modal-detalles-preventa #modal-title {
    margin-right: 48px;
}

#modal-detalles .tab-container,
#modal-detalles-preventa .tab-container {
    min-height: 0;
}

#modal-detalles .detail-tabs,
#modal-detalles-preventa .detail-tabs {
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    scrollbar-width: thin;
    padding-bottom: 6px;
}

#modal-detalles .detail-tab,
#modal-detalles-preventa .detail-tab {
    flex: 0 0 auto;
}

#modal-detalles .detail-tab-content,
#modal-detalles-preventa .detail-tab-content {
    max-height: calc(100vh - 250px);
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 6px;
}

@media (max-width: 900px) {
    #modal-detalles,
    #modal-detalles-preventa {
        padding: 6px;
    }

    #modal-detalles .modal-content,
    #modal-detalles-preventa .modal-content {
        width: 100%;
        max-height: calc(100vh - 12px);
        margin: 6px auto;
        padding: 12px;
    }

    #modal-detalles .detail-tab-content,
    #modal-detalles-preventa .detail-tab-content {
        max-height: calc(100vh - 220px);
    }
}

/* Calendario industrial: mantenerlo centrado dentro del modal */
#industrial-calendario-wrap {
    max-width: 980px;
    margin: 14px auto 0 !important;
}

#industrial-calendario-grid {
    width: 100%;
    margin: 0 auto;
}

#industrial-calendario-grid > * {
    min-width: 0;
}

#industrial-calendario-grid button {
    width: 100% !important;
    min-width: 0 !important;
    padding: 8px 10px !important;
    margin: 0 !important;
    border-radius: 8px;
}