:root {
  --navy: #063f60;
  --navy-dark: #052f49;
  --blue: #08779d;
  --sky: #deeff2;
  --cream: #f4f5f3;
  --white: #fff;
  --ink: #263845;
  --muted: #74828a;
  --line: #dfe4e4;
  --orange: #f28a0b;
  --orange-dark: #d86f00;
  --green: #2d8a72;
  --yellow: #e4a231;
  --red: #ca5a53;
  --shadow: 0 14px 40px rgba(25, 60, 74, .1);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--cream); }
body { margin: 0; color: var(--ink); font-family: "DM Sans", Arial, sans-serif; font-size: 15px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

h1, h2, h3, h4, p { margin-top: 0; }
h1, h2, h3 { font-family: "Manrope", Arial, sans-serif; letter-spacing: -.04em; }
.eyebrow { margin-bottom: 6px; color: var(--blue); font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }

.login-screen { display: grid; min-height: 100vh; grid-template-columns: minmax(380px, 43%) 1fr; background: var(--white); }
.login-card { align-self: center; justify-self: center; width: min(385px, calc(100% - 48px)); }
.login-card h1 { margin: 18px 0 10px; color: var(--navy-dark); font-size: 40px; line-height: 1.04; }
.login-card h1 span { display: block; color: var(--blue); }
.login-copy { margin: 0 0 30px; color: var(--muted); line-height: 1.6; }
.login-art { position: relative; display: grid; min-height: 100vh; overflow: hidden; background: linear-gradient(145deg, #052f49, #08779d); color: #fff; place-items: end start; }
.login-art::before, .login-art::after { position: absolute; border: 1px solid rgba(255, 255, 255, .15); border-radius: 50%; content: ""; }
.login-art::before { top: -170px; right: -130px; width: 580px; height: 580px; }
.login-art::after { right: 10%; bottom: -300px; width: 610px; height: 610px; }
.login-art-inner { position: relative; z-index: 1; max-width: 520px; padding: 70px; }
.login-art .eyebrow { color: #ffd298; }
.login-art h2 { margin: 0; font-size: clamp(38px, 5vw, 68px); line-height: 1.06; }
.login-art p:last-child { max-width: 400px; color: #d8e9f5; font-size: 17px; line-height: 1.6; }
.art-line { width: 72px; height: 3px; margin: 30px 0; background: var(--orange); }
.brand-logo { display: block; width: 56px; height: 56px; border-radius: 15px; background: #fff; object-fit: contain; padding: 3px; box-shadow: 0 6px 14px rgba(5, 47, 73, .12); }
.brand-logo-small { width: 39px; height: 39px; border-radius: 11px; padding: 2px; }

.stack-form { display: grid; gap: 16px; }
label { display: grid; gap: 7px; }
label > span, legend { color: #526278; font-size: 12px; font-weight: 700; letter-spacing: .03em; }
input, select, textarea { min-width: 0; border: 1px solid #dbe2e8; border-radius: 10px; outline: none; background: #fff; color: var(--ink); padding: 11px 12px; transition: border .2s, box-shadow .2s; }
input:focus, select:focus, textarea:focus { border-color: #73add5; box-shadow: 0 0 0 3px rgba(77, 149, 198, .16); }
textarea { resize: vertical; }
.form-error { min-height: 18px; margin: -4px 0; color: var(--red); font-size: 13px; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 0; border-radius: 10px; padding: 11px 15px; text-decoration: none; font-size: 13px; font-weight: 700; transition: transform .15s, background .15s, box-shadow .15s; }
.button:hover { transform: translateY(-1px); }
.button svg { width: 17px; height: 17px; fill: currentColor; }
.button-primary { background: var(--navy); color: #fff; box-shadow: 0 7px 16px rgba(6, 63, 96, .18); }
.button-primary:hover { background: #075477; }
.button-save { background: var(--orange); color: #fff; box-shadow: 0 7px 16px rgba(242, 138, 11, .24); }
.button-save:hover { background: var(--orange-dark); }
.button-light { background: #edf3f7; color: var(--navy); }
.button-light:hover { background: #e1ebf1; }
.button-danger { background: #fbe8e6; color: #a83f39; }
.button-wide { width: 100%; padding-block: 13px; }

.app-shell { display: grid; min-height: 100vh; grid-template-columns: 240px 1fr; background: var(--cream); }
.sidebar { display: flex; flex-direction: column; min-height: 100vh; padding: 22px 14px 14px; background: var(--navy-dark); color: #fff; }
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 22px; }
.sidebar-brand strong { display: block; font-family: "Manrope", Arial, sans-serif; letter-spacing: .09em; }
.sidebar-brand span { display: block; color: #9ab2cf; font-size: 11px; }
.sidebar-nav { display: grid; gap: 5px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.11); }
.nav-item { display: flex; align-items: center; gap: 10px; border: 0; border-radius: 9px; background: transparent; color: #b6c7dc; padding: 11px 10px; text-align: left; font-size: 13px; font-weight: 600; }
.nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-item.active { background: rgba(242, 138, 11, .18); color: #fff; box-shadow: inset 3px 0 0 var(--orange); }
.nav-item svg { width: 18px; height: 18px; fill: currentColor; }
.sidebar-bottom { display: flex; gap: 4px; align-items: center; margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.11); }
.profile-button { display: flex; flex: 1; align-items: center; gap: 9px; min-width: 0; border: 0; border-radius: 9px; background: transparent; color: #fff; padding: 6px; text-align: left; }
.profile-button:hover, .logout-button:hover { background: rgba(255,255,255,.08); }
.profile-button span:last-child { min-width: 0; }
.profile-button strong, .profile-button small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-button strong { font-size: 12px; }
.profile-button small { margin-top: 2px; color: #9ab2cf; font-size: 10px; }
.avatar { display: grid; width: 32px; height: 32px; flex: 0 0 auto; border-radius: 50%; background: var(--orange); color: #fff; font-size: 11px; font-weight: 700; place-items: center; }
.logout-button { display: grid; width: 35px; height: 35px; border: 0; border-radius: 9px; background: transparent; color: #b6c7dc; place-items: center; }
.logout-button svg { width: 17px; height: 17px; fill: currentColor; }

.main-content { min-width: 0; padding: 28px clamp(20px, 4vw, 54px) 46px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 25px; }
.topbar h2 { margin: 0; color: var(--navy-dark); font-size: 27px; }
.topbar h2.company-title { max-width: 520px; font-size: 20px; letter-spacing: -.025em; }
.hero { display: flex; align-items: center; justify-content: space-between; gap: 30px; overflow: hidden; margin-bottom: 20px; border-radius: var(--radius); background: linear-gradient(120deg, #063f60, #08779d); color: #fff; padding: 26px 30px; box-shadow: var(--shadow); }
.hero h3 { margin-bottom: 8px; font-size: 26px; }
.hero p:last-child { max-width: 600px; margin-bottom: 0; color: #dbeef9; }
.hero .eyebrow { color: #9ed5f2; }
.hero-date { min-width: 96px; border-left: 1px solid rgba(255,255,255,.25); padding-left: 26px; text-align: center; }
.hero-date strong, .hero-date span { display: block; }
.hero-date strong { font: 800 45px/1 "Manrope", Arial, sans-serif; }
.hero-date span { margin-top: 4px; color: #b9e3f6; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }

.summary-grid { display: grid; gap: 14px; margin-bottom: 20px; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.summary-card { border: 1px solid #edf0f0; border-radius: 15px; background: #fff; padding: 17px; box-shadow: 0 7px 20px rgba(31, 59, 87, .05); }
.summary-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.summary-card span { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.summary-card strong { display: block; margin-top: 12px; color: var(--navy-dark); font: 800 30px/1 "Manrope", Arial, sans-serif; }
.summary-icon { display: grid; width: 31px; height: 31px; border-radius: 10px; place-items: center; }
.summary-icon svg { width: 16px; height: 16px; fill: currentColor; }
.summary-icon.blue { background: #e6f1fa; color: #3477b7; }
.summary-icon.yellow { background: #fff0dc; color: var(--orange-dark); }
.summary-icon.green { background: #dff4ed; color: #2d8a72; }
.summary-icon.red { background: #fae5e2; color: #bd5048; }
.summary-icon.navy { background: #e6ebf0; color: #234b77; }

.panel { border: 1px solid #e9edef; border-radius: var(--radius); background: #fff; box-shadow: 0 8px 24px rgba(28, 50, 71, .05); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 22px 12px; }
.panel-heading h3 { margin: 0; color: var(--navy-dark); font-size: 19px; }
.panel-description { margin: -4px 22px 16px; color: var(--muted); font-size: 13px; }
.text-button { border: 0; background: transparent; color: var(--blue); font-size: 13px; font-weight: 700; }
.text-button:hover { color: var(--navy); }

.aviso-row { display: grid; align-items: center; gap: 12px; border-top: 1px solid #edf0f2; padding: 14px 22px; grid-template-columns: 64px minmax(180px, 2fr) minmax(120px, .85fr) 82px minmax(110px, .8fr) 92px 28px; transition: background .15s; }
.aviso-row:hover { background: #f8fbfc; }
.part-meta { display: grid; gap: 3px; min-width: 0; }
.part-number { color: var(--navy); font-size: 11px; font-weight: 700; white-space: nowrap; }
.part-date { color: var(--muted); font-size: 10px; font-weight: 700; white-space: nowrap; }
.client-cell strong, .client-cell span, .muted-cell strong, .muted-cell span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.client-cell strong { color: #526278; font-size: 14px; font-weight: 500; }
.client-cell span, .muted-cell span { margin-top: 3px; color: var(--muted); font-size: 12px; }
.client-cell span { color: var(--navy-dark); font-weight: 700; }
.notice-type-list { display: block; margin-top: 5px; color: var(--blue); font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.notice-description-list { display: block; margin-top: 4px; overflow: hidden; color: var(--blue); font-size: 11px; font-weight: 400; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.row-controls { display: contents; }
.muted-cell strong { color: #526278; font-size: 12px; }
.review-info { display: block; margin-top: 5px; color: #a55b08; font-size: 10px; font-weight: 800; }
.review-info.reviewed { color: var(--green); }
.review-info-mobile { display: none; }
.status-label { display: inline-flex; align-items: center; gap: 5px; color: #526278; font-size: 11px; font-weight: 800; white-space: nowrap; }
.status-label::before { width: 9px; height: 9px; border-radius: 2px; background: currentColor; content: ""; }
.status-label small { color: #84909e; font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.status-pendiente { color: #286d9e; }
.status-volver { color: #bd5048; }
.status-finalizado { color: #27755f; }
.urgency { display: inline-flex; align-items: center; width: fit-content; gap: 6px; border-radius: 999px; padding: 5px 8px; font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.urgency::before { width: 7px; height: 7px; border-radius: 50%; content: ""; }
.urgency-leve { background: #dcf3e9; color: #27755f; }
.urgency-leve::before { background: var(--green); }
.urgency-media, .urgency-medio { background: #fff0d5; color: #9a6514; }
.urgency-media::before, .urgency-medio::before { background: var(--yellow); }
.urgency-urgente { background: #fae5e2; color: #ae4842; }
.urgency-urgente::before { background: var(--red); }
.appointment { max-width: 190px; overflow: hidden; color: #bc413a; font-size: 12px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.appointment:empty { visibility: hidden; }
.row-action { display: grid; width: 28px; height: 28px; border: 0; border-radius: 8px; background: #eff4f7; color: #5a7087; font-size: 18px; place-items: center; }
.row-action:hover { background: #dceaf1; color: var(--navy); }
.empty-state { padding: 44px 22px; color: var(--muted); text-align: center; }
.empty-state strong { display: block; margin-bottom: 6px; color: var(--navy); font: 700 16px "Manrope", Arial, sans-serif; }

.filter-bar { display: flex; gap: 11px; align-items: center; margin-bottom: 16px; padding: 14px; }
.toolbar-spacer { flex: 1; }
.filter-bar .button.active { background: var(--navy); color: #fff; box-shadow: 0 7px 16px rgba(23, 52, 95, .16); }
.criteria-panel { margin: -4px 0 16px; padding: 18px 20px; }
.criteria-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 7px; }
.criteria-heading h3 { margin: 0; color: var(--navy-dark); font-size: 18px; }
.criteria-panel > p { margin: 0 0 15px; color: var(--muted); font-size: 12px; }
.criteria-grid { display: grid; gap: 12px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.criteria-grid-short { grid-template-columns: repeat(3, minmax(0, 220px)); }
.criteria-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 16px; }
.table-heading { padding-bottom: 16px; }
.result-count { color: var(--muted); font-size: 12px; font-weight: 700; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 12px; border-top: 1px solid #edf0f2; padding: 14px; color: var(--muted); font-size: 12px; font-weight: 700; }
.pagination:empty { display: none; }
.page-button { border: 1px solid #d9e3e9; border-radius: 8px; background: #f0f5f8; color: var(--navy); padding: 7px 11px; font-size: 12px; font-weight: 700; }
.page-button:hover:not(:disabled) { background: #e1ebf1; }
.page-button:disabled { cursor: default; opacity: .4; }
.workload-panel { margin-bottom: 20px; }
.workload-panel .panel-heading { padding-bottom: 8px; }
#technician-workload { display: flex; gap: 7px; flex-wrap: wrap; padding: 0 14px 13px; }
.workload-row { display: grid; gap: 3px 8px; border: 1px solid #e5eaee; border-radius: 9px; background: #fbfcfc; padding: 7px 9px; grid-template-columns: auto auto; }
.workload-row strong { grid-column: 1 / -1; color: var(--navy-dark); font-size: 11px; }
.workload-row span { color: var(--muted); font-size: 10px; }
.workload-row b { color: var(--navy); }
.workload-row em { grid-column: 1 / -1; color: var(--blue); font-size: 10px; font-style: normal; font-weight: 700; }
.workload-row span:nth-of-type(3) { grid-column: 1 / -1; color: #a55b08; }

.tecnico-row { display: grid; align-items: center; gap: 14px; border-top: 1px solid #edf0f2; padding: 14px 22px; grid-template-columns: 42px 1fr 1fr 180px 95px 30px; }
.tecnico-row .avatar { width: 38px; height: 38px; background: #dcecf5; color: var(--navy); }
.tecnico-name strong, .tecnico-name span { display: block; }
.tecnico-name span, .tecnico-user { margin-top: 2px; color: var(--muted); font-size: 12px; }
.status-dot { display: inline-flex; align-items: center; gap: 6px; color: var(--green); font-size: 12px; font-weight: 700; }
.status-dot::before { width: 7px; height: 7px; border-radius: 50%; background: currentColor; content: ""; }
.status-dot.inactive { color: #9ba5b0; }

.dialog { width: min(530px, calc(100vw - 24px)); max-height: calc(100vh - 32px); overflow: hidden; border: 0; border-radius: 18px; padding: 0; box-shadow: 0 22px 70px rgba(20, 41, 68, .24); }
.dialog-large { width: min(820px, calc(100vw - 24px)); }
.dialog::backdrop { background: rgba(13, 31, 53, .53); backdrop-filter: blur(3px); }
.dialog form { display: flex; max-height: calc(100vh - 32px); flex-direction: column; }
.dialog-header, .dialog-footer { display: flex; align-items: center; gap: 16px; padding: 19px 22px; }
.dialog-header { flex: 0 0 auto; justify-content: space-between; border-bottom: 1px solid var(--line); }
.dialog-header h3 { margin: 0; color: var(--navy-dark); font-size: 21px; }
.dialog-header p:last-child:not(.eyebrow) { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.dialog-body { min-height: 0; flex: 1 1 auto; overflow-y: auto; padding: 14px 22px; }
.dialog-footer { position: relative; z-index: 2; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; border-top: 1px solid #d5dfe6; background: #fff; box-shadow: 0 -8px 20px rgba(24, 52, 78, .1); }
.dialog-footer .button { min-height: 42px; padding-inline: 18px; }
.dialog-footer .button-primary { background: #173f70; box-shadow: 0 7px 16px rgba(23, 52, 95, .24); }
.dialog-footer .button-light { border: 1px solid #d9e3e9; background: #f0f5f8; }
.button-pdf { border: 1px solid #f2d6b7; background: #fff0dc; color: #b85f00; }
.button-pdf:hover { background: #ffe4c0; }
.footer-spacer { flex: 1; }
.icon-button { display: grid; width: 34px; height: 34px; flex: 0 0 auto; border: 0; border-radius: 50%; background: #eff3f5; color: #617186; font-size: 23px; line-height: 1; place-items: center; }
.icon-button:hover { background: #e4ecf0; color: var(--navy); }
.form-section + .form-section { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 13px; }
.form-section h4 { margin-bottom: 9px; color: var(--navy-dark); font: 800 14px "Manrope", Arial, sans-serif; }
.form-section > p { margin: -4px 0 9px; color: var(--muted); font-size: 12px; }
.form-grid { display: grid; gap: 9px 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.breakdown-description { min-height: 132px; }
.address-field { min-height: 62px; }
.appointment-field input { color: #bc413a; font-weight: 700; }
.notice-type-field select { font-weight: 800; }
.span-2 { grid-column: span 2; }
fieldset { min-width: 0; margin: 0; border: 0; padding: 0; }
.checkbox-grid { display: flex; gap: 7px; flex-wrap: wrap; padding-top: 2px; }
.check-pill { display: flex; align-items: center; gap: 6px; border: 1px solid #e0e6ea; border-radius: 999px; color: #5c6d80; padding: 7px 9px; font-size: 12px; font-weight: 600; }
.check-pill:has(input:checked) { border-color: #93bedb; background: #edf7fb; color: var(--navy); }
.check-pill input { width: 14px; height: 14px; margin: 0; accent-color: var(--blue); }
.switch-label { display: flex; align-items: center; align-self: end; gap: 8px; min-height: 40px; }
.switch-label input { width: 17px; height: 17px; accent-color: var(--blue); }
.readonly-switch { opacity: .72; cursor: not-allowed; }
.readonly-switch input { cursor: not-allowed; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 20; max-width: min(390px, calc(100vw - 40px)); border-radius: 10px; background: var(--navy-dark); color: #fff; padding: 13px 16px; font-size: 13px; font-weight: 600; opacity: 0; pointer-events: none; transform: translateY(10px); transition: opacity .2s, transform .2s; }
.toast.visible { opacity: 1; transform: translateY(0); }
.toast.error { background: #9e423d; }

@media (max-width: 1100px) {
  .summary-grid { grid-template-columns: repeat(3, 1fr); }
  .aviso-row { grid-template-columns: 58px minmax(150px, 1.7fr) minmax(95px, .75fr) 74px minmax(95px, .7fr) 82px 28px; }
}

@media (max-width: 820px) {
  .login-screen { display: block; padding-top: 64px; }
  .login-art { display: none; }
  .app-shell { display: block; }
  .sidebar { min-height: auto; padding: 10px 14px; }
  .sidebar-brand { display: none; }
  .sidebar-nav { display: flex; justify-content: center; padding-top: 0; border-top: 0; }
  .nav-item { justify-content: center; padding: 10px 12px; }
  .sidebar-bottom { position: absolute; top: 10px; right: 12px; padding-top: 0; border-top: 0; }
  .profile-button { display: none; }
  .main-content { padding: 22px 16px 36px; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .filter-bar { align-items: stretch; flex-wrap: wrap; }
  .toolbar-spacer { display: none; }
  .filter-bar .button { flex: 1; }
  .criteria-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .aviso-row { grid-template-columns: minmax(42px, max-content) minmax(160px, 1fr) minmax(145px, max-content); padding-inline: 15px; }
  .aviso-row .muted-cell { display: none; }
  .review-info-mobile { display: block; }
  .row-controls { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
  .row-controls .appointment:empty { display: none; }
  .row-controls .status-label { display: none; }
  .tecnico-row { grid-template-columns: 38px 1fr 30px; padding-inline: 16px; }
  .tecnico-user, .tecnico-permission, .status-dot { display: none; }
}

@media (max-width: 560px) {
  .topbar h2 { font-size: 23px; }
  .topbar .button { padding-inline: 11px; }
  .hero { padding: 20px; }
  .hero-date { display: none; }
  .summary-grid { gap: 9px; }
  .summary-card { padding: 14px; }
  .summary-card strong { font-size: 27px; }
  .filter-bar .button { flex: 1; }
  .criteria-grid, .criteria-grid-short { grid-template-columns: 1fr; }
  .criteria-actions .button { flex: 1; padding-inline: 9px; }
  .aviso-row { align-items: start; gap: 7px 10px; grid-template-columns: minmax(38px, max-content) minmax(0, 1fr); padding: 13px 12px; }
  .client-cell strong, .client-cell span { overflow: visible; text-overflow: clip; white-space: normal; }
  .client-cell strong { color: #526278; font-size: 13px; font-weight: 500; line-height: 1.25; }
  .client-cell span { color: var(--navy-dark); font-size: 13px; font-weight: 700; line-height: 1.3; }
  .row-controls { display: flex; grid-column: 1 / -1; flex-wrap: wrap; gap: 8px; justify-content: space-between; padding-top: 3px; }
  .row-controls .urgency { justify-self: start; }
  .row-controls .appointment { flex: 1 1 150px; }
  .row-controls .row-action { margin-left: auto; }
  .workload-row { gap: 3px 8px; padding: 7px 9px; grid-template-columns: auto auto; }
  .workload-row em { grid-column: 1 / -1; grid-row: auto; }
  .form-grid { display: grid; grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .dialog-header, .dialog-footer, .dialog-body { padding-inline: 16px; }
  .dialog-footer { gap: 9px; }
  .dialog-footer .button { min-height: 40px; padding-inline: 13px; }
  .dialog-footer .button-danger { margin-right: auto; }
}
