:root {
  color-scheme: light;
  --sidebar: linear-gradient(145deg, #e5d4f1 0%, #d7c1e8 55%, #e6d2ed 100%);
  --sidebar-text: #42506a;
  --sidebar-muted: #8d87a0;
  --sidebar-active: #f0eafa;
  --canvas: #faf9fc;
  --paper: #ffffff;
  --ink: #302b3e;
  --muted: #777188;
  --line: #e9e4f0;
  --violet: #522a8b;
  --violet-dark: #42216f;
  --violet-pale: #f1ebf9;
  --coral: #c56d91;
  --danger: #a63e36;
  font-family: "IBM Plex Sans", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--canvas); color: var(--ink); font-size: 15px; }
button, input, select { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 4; display: flex; width: 268px; flex-direction: column; padding: 28px 16px 18px; border-right: 1px solid #d5c0e5; background: var(--sidebar); color: var(--sidebar-text); }
.brand { display: inline-flex; align-items: center; gap: 10px; width: fit-content; margin: 0 0 52px 7px; color: var(--sidebar-text); text-decoration: none; }
.brand-mark { display: block; width: 48px; height: 48px; flex: 0 0 auto; }
.brand-lockup { display: grid; gap: 1px; }
.brand-name { color: #241d31; font-size: 25px; font-weight: 600; line-height: 1.1; }
.brand-name span { color: #9b70bd; }
.brand-tagline { color: #62586f; font-size: 12px; font-weight: 450; }
.workspace-label, .eyebrow, .login-kicker { color: var(--sidebar-muted); font-size: 12px; font-weight: 600; letter-spacing: 0; }
.workspace-label { padding: 0 12px; margin-bottom: 12px; }
.primary-nav { display: grid; gap: 7px; }
.nav-link { position: relative; display: flex; min-height: 50px; align-items: center; gap: 13px; padding: 0 12px; border: 1px solid #eee8f5; border-radius: 5px; background: #fff; color: var(--sidebar-text); font-size: 15px; font-weight: 500; text-decoration: none; transition: background .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease; }
.nav-link:hover { border-color: #d7c6e8; background: #f8f4fc; }
.nav-link.is-active { border-color: #522a8b; background: #522a8b; color: #fff; box-shadow: 0 2px 7px rgb(82 42 139 / 20%); }
.nav-link.is-active::before { position: absolute; inset: 10px auto 10px 0; width: 2px; border-radius: 2px; background: #9b70bd; content: ""; }
.nav-link svg, .icon-button svg, .button svg, .search-box svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.65; }
.nav-link svg { width: 21px; height: 21px; color: #9290a3; }
.nav-link.is-active svg { color: #fff; }
.nav-count { display: grid; min-width: 22px; height: 22px; margin-left: auto; place-items: center; border: 1px solid #eee7f5; border-radius: 11px; background: #faf7fd; color: #8c789f; font-size: 12px; font-weight: 550; }
.nav-link.is-active .nav-count { border-color: rgb(255 255 255 / 35%); background: rgb(255 255 255 / 16%); color: #fff; }
.sidebar-bottom { margin-top: auto; }
.profile-row { display: flex; min-height: 58px; align-items: center; gap: 10px; padding: 11px 8px 0; border-top: 1px solid #d5c0e5; }
.avatar { display: grid; width: 36px; height: 36px; flex: 0 0 auto; place-items: center; border: 1px solid #e4d8ef; border-radius: 50%; background: #f1eafa; color: #68488d; font-size: 12px; font-weight: 600; }
.profile-copy { display: grid; min-width: 0; gap: 2px; }
.profile-copy strong { overflow: hidden; color: #3d354b; font-size: 14px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.profile-copy small { color: #827a90; font-size: 12px; }
.icon-button { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border: 0; border-radius: 5px; background: transparent; color: currentColor; }
.logout-button { margin-left: auto; color: #858094; }
.icon-button:hover { background: #f2ecf8; color: var(--violet); }
.logout-button:hover { background: #f2ecf8; color: #604184; }

.main-content { min-height: 100vh; margin-left: 268px; }
.topbar { display: flex; height: 64px; align-items: center; justify-content: space-between; padding: 0 42px; border-bottom: 1px solid #e6e1ee; background: rgb(255 255 255 / 82%); }
.breadcrumbs { display: flex; align-items: center; gap: 10px; color: #736d85; font-size: 14px; }
.breadcrumbs strong { color: #4a4459; font-weight: 500; }
.breadcrumb-slash { color: #cbc5d6; }
.topbar-right { display: flex; align-items: center; gap: 9px; color: #6c6680; font-size: 13px; }
.topbar-dot { width: 3px; height: 3px; border-radius: 50%; background: #9d97ad; }
.today-label { color: #625b73; }
.page-content { width: min(1240px, 100%); margin: 0 auto; padding: 48px 42px 60px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; animation: enter .35s ease both; }
.page-heading .eyebrow { margin: 0 0 8px; color: var(--violet); }
.page-heading h1 { margin: 0; color: #342d42; font-size: 34px; font-weight: 550; line-height: 1.12; }
.heading-period { color: var(--coral); }
.page-description { margin: 10px 0 0; color: #6c6680; font-size: 15px; }
.button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; gap: 9px; padding: 0 18px; border: 1px solid transparent; border-radius: 4px; font-size: 14px; font-weight: 550; transition: background .16s ease, border-color .16s ease, transform .16s ease; }
.button:active { transform: translateY(1px); }
.button-primary { background: var(--violet); color: #fff; box-shadow: 0 2px 4px rgb(94 62 136 / 15%); }
.button-primary:hover { background: var(--violet-dark); }
.button-primary svg { width: 16px; height: 16px; }
.client-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 32px 0 18px; animation: enter .42s .04s ease both; }
.search-box { display: flex; width: min(460px, 100%); height: 46px; align-items: center; gap: 10px; padding: 0 11px; border: 1px solid #e6e1ee; border-radius: 4px; background: #fff; color: #6c6680; transition: border-color .15s, box-shadow .15s; }
.search-box:focus-within { border-color: #bca5d5; box-shadow: 0 0 0 3px rgb(118 81 165 / 9%); }
.search-box svg { width: 17px; height: 17px; flex: 0 0 auto; }
.search-box input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 14px; }
.search-box input::placeholder { color: #9d97ad; }
.search-box kbd { display: grid; width: 22px; height: 24px; flex: 0 0 auto; place-items: center; border: 1px solid #e6e1ee; border-radius: 3px; color: #9d97ad; font-family: inherit; font-size: 13px; }
.results-label { color: #736d85; font-size: 13px; white-space: nowrap; }
.client-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.client-card { position: relative; display: flex; min-height: 224px; flex-direction: column; overflow: hidden; padding: 22px 22px 18px; border: 1px solid #e9e4ef; border-radius: 5px; background: var(--paper); box-shadow: 0 2px 5px rgb(59 40 77 / 3%); animation: enter .36s ease both; transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.client-card:hover { transform: translateY(-2px); border-color: #d8cbe5; box-shadow: 0 8px 18px rgb(59 40 77 / 7%); }
.card-top { display: flex; min-height: 32px; align-items: flex-start; justify-content: space-between; gap: 12px; }
.client-monogram { display: grid; width: 40px; height: 40px; flex: 0 0 auto; place-items: center; border-radius: 5px; background: var(--violet-pale); color: #68488d; font-size: 13px; font-weight: 600; }
.client-card:nth-child(4n + 2) .client-monogram { background: #f8ece5; color: #a76347; }
.client-card:nth-child(4n + 3) .client-monogram { background: #e9f0e9; color: #57825e; }
.client-card:nth-child(4n + 4) .client-monogram { background: #edf0f7; color: #596c99; }
.type-badge { max-width: 60%; overflow: hidden; padding: 5px 8px; border-radius: 3px; background: #f3f0f7; color: #625b73; font-size: 12px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.client-name { margin: 16px 0 0; overflow-wrap: anywhere; color: #2d2740; font-size: 17px; font-weight: 550; line-height: 1.3; }
.client-location { display: flex; min-height: 27px; align-items: center; gap: 6px; margin-top: 5px; color: #736d85; font-size: 13px; }
.client-location svg { width: 15px; height: 15px; flex: 0 0 auto; fill: none; stroke: #736d85; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.6; }
.card-divider { height: 1px; margin: auto 0 13px; background: #ece8f2; }
.card-stats { display: flex; align-items: center; gap: 26px; }
.condition-badge { padding: 3px 10px; border-radius: 999px; background: #f1edf6; color: #5b5470; font-size: 12px; font-weight: 550; line-height: 1.4; }
.card-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.record-actions { display: flex; align-items: center; gap: 3px; margin: -5px -7px -5px 0; }
.record-actions .icon-button { width: 34px; height: 34px; color: #766789; }
.record-actions .icon-button svg { width: 18px; height: 18px; }
.record-actions .task-action { display: inline-flex; width: auto; gap: 4px; padding: 0 8px; }
.task-count { font-size: 13px; font-weight: 550; }
.record-actions .task-action:hover { background: var(--violet-pale); color: var(--violet); }
.record-actions .delete-action:hover { background: #fff0ef; color: #a63e36; }
.stat { display: flex; align-items: baseline; gap: 6px; }
.stat-value { color: #2d2740; font-size: 17px; font-weight: 550; }
.stat-label { color: #736d85; font-size: 12px; }
.loading-state, .empty-state { display: flex; min-height: 190px; grid-column: 1 / -1; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: #6c6680; font-size: 14px; }
.loader { width: 21px; height: 21px; border: 2px solid #e5dced; border-top-color: var(--violet); border-radius: 50%; animation: spin .75s linear infinite; }
.empty-state h2 { margin: 4px 0 0; color: #2d2740; font-size: 18px; font-weight: 550; }
.empty-state p { margin: 0; color: #736d85; }
.empty-icon { display: grid; width: 45px; height: 45px; place-items: center; border: 1px solid #e3d8ed; border-radius: 50%; color: var(--violet); font-size: 20px; }
.notice { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; border-radius: 4px; font-size: 14px; }
.notice-error { margin: 0 0 16px; border: 1px solid #f0d7d2; background: #fff8f6; color: var(--danger); }
.text-button { padding: 3px 0; border: 0; background: none; color: var(--violet); font-size: 14px; font-weight: 550; }
.text-button:hover { text-decoration: underline; }
.placeholder-view { padding: 76px 24px; text-align: center; animation: enter .3s ease both; }
.placeholder-mark { display: grid; width: 44px; height: 44px; margin: 0 auto 18px; place-items: center; border: 1px solid #d8c9e7; border-radius: 50%; color: var(--violet); font-size: 22px; font-weight: 300; }
.placeholder-view .eyebrow { margin: 0 0 9px; color: var(--violet); }
.placeholder-view h2 { margin: 0; color: #2d2740; font-size: 21px; font-weight: 550; }
.placeholder-view > p:last-child { margin: 8px 0 0; color: #6c6680; font-size: 14px; }

.client-dialog { width: min(520px, calc(100vw - 28px)); max-width: none; max-height: min(92vh, 700px); padding: 0; overflow: auto; border: 1px solid #e6e1ee; border-radius: 7px; background: #fff; color: var(--ink); box-shadow: 0 24px 80px rgb(28 18 44 / 25%); }
.client-dialog::backdrop { background: rgb(28 18 44 / 47%); backdrop-filter: blur(2px); }
.dialog-form { padding: 26px 28px 24px; }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.dialog-heading .eyebrow { margin: 0 0 7px; color: var(--violet); }
.dialog-heading h2 { margin: 0; color: #2d2740; font-size: 23px; font-weight: 550; }
.dialog-close { margin: -5px -7px 0 0; color: #6c6680; }
.dialog-description { margin: 11px 0 22px; color: #6c6680; font-size: 14px; line-height: 1.5; }
.dialog-form label { display: block; margin: 15px 0 6px; color: #4a4459; font-size: 13px; font-weight: 550; }
.dialog-form label > span:first-child:not(.optional-label) { color: var(--violet); }
.dialog-form input, .dialog-form select, .dialog-form textarea { display: block; width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid #e6e1ee; border-radius: 4px; outline: 0; background: #fff; color: #2d2740; font-size: 14px; }
.dialog-form textarea { min-height: 92px; padding: 10px 11px; resize: vertical; }
.dialog-form input:focus, .dialog-form select:focus { border-color: #bca5d5; box-shadow: 0 0 0 3px rgb(118 81 165 / 9%); }
.dialog-form input::placeholder { color: #9d97ad; }
.optional-label { float: right; color: #9d97ad; font-size: 11px; font-weight: 500; }
.form-error { margin: 12px 0 0; color: var(--danger); font-size: 13px; line-height: 1.45; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 24px; padding-top: 17px; border-top: 1px solid #ece8f2; }
.button-quiet { border-color: #e6e1ee; background: #fff; color: #4a4459; }
.button-quiet:hover { background: #f7f5fa; }
.button:disabled { cursor: wait; opacity: .65; }
.task-dialog { width: min(600px, calc(100vw - 28px)); }
.task-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.task-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 12px 12px 14px; border: 1px solid #e6e1ee; border-radius: 5px; background: #fff; }
.task-item.is-editing { border-color: #bca5d5; background: var(--violet-pale); }
.task-copy { display: grid; flex: 1; min-width: 0; gap: 6px; }
.task-copy p { margin: 0; overflow-wrap: anywhere; color: var(--ink); font-size: 15px; line-height: 1.4; white-space: pre-line; }
.task-period-badge { width: fit-content; padding: 3px 8px; border-radius: 3px; background: #f3f0f7; color: #625b73; font-size: 12px; font-weight: 500; }
.task-period-badge.is-recurring { background: var(--violet-pale); color: var(--violet); }
.task-item .record-actions { margin: -4px -6px -4px 0; }
.task-empty { padding: 22px 12px; border: 1px dashed #e6e1ee; border-radius: 5px; color: #736d85; font-size: 14px; text-align: center; }
.task-form { margin-top: 22px; padding-top: 4px; border-top: 1px solid #ece8f2; }
.task-form h3 { margin: 16px 0 0; color: #2d2740; font-size: 16px; font-weight: 550; }
.task-form label { display: block; margin: 14px 0 6px; color: #4a4459; font-size: 13px; font-weight: 550; }
.task-form label > span { color: var(--violet); }
.task-form textarea, .task-form select, .task-form input { display: block; width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid #e6e1ee; border-radius: 4px; outline: 0; background: #fff; color: #2d2740; font: inherit; font-size: 14px; }
.task-form textarea { min-height: 70px; padding: 10px 12px; resize: vertical; }
.task-form textarea:focus, .task-form select:focus, .task-form input:focus { border-color: #bca5d5; box-shadow: 0 0 0 3px rgb(118 81 165 / 9%); }
.task-period { display: flex; gap: 8px; }
.task-period select:first-child { flex: 1.2; }
.task-period input { flex: 0 0 90px; }
.task-period select:last-child { flex: 1; }
.dashboard { animation: enter .35s ease both; }
.dashboard-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 32px 0 24px; }
.dashboard-tile { padding: 18px 20px; border: 1px solid #e9e4ef; border-left: 4px solid #d8cbe5; border-radius: 5px; background: var(--paper); box-shadow: 0 2px 5px rgb(59 40 77 / 3%); }
.dashboard-tile strong { display: block; color: #2d2740; font-size: 34px; font-weight: 550; line-height: 1.1; }
.dashboard-tile span { color: #6c6680; font-size: 14px; }
.dashboard-tile.is-alert { border-left-color: var(--danger); }
.dashboard-tile.is-alert strong { color: var(--danger); }
.dashboard-tile.is-warning { border-left-color: var(--coral); }
.dashboard-tile.is-muted { border-left-color: #cbc5d6; }
.dashboard-toolbar { margin: 0 0 18px; }
.dashboard-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.dashboard-panel { padding: 20px 22px; border: 1px solid #e9e4ef; border-radius: 5px; background: var(--paper); }
.dashboard-panel h2 { margin: 0 0 14px; color: #2d2740; font-size: 18px; font-weight: 550; }
.dashboard-group { margin: 18px 0 8px; color: #736d85; font-size: 12px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; list-style: none; }
.dashboard-group:first-child { margin-top: 0; }
.dashboard-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.dashboard-item { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 14px 14px 14px 16px; border: 1px solid #ece8f2; border-left: 3px solid #cbc5d6; border-radius: 4px; }
.dashboard-item.is-alert { border-left-color: var(--danger); background: #fffafa; }
.dashboard-item.is-warning { border-left-color: var(--coral); }
.dashboard-item-copy { display: grid; min-width: 0; gap: 4px; }
.dashboard-item-copy strong { overflow-wrap: anywhere; color: #2d2740; font-size: 15px; font-weight: 550; line-height: 1.35; }
.dashboard-item-copy span { color: #6c6680; font-size: 13px; }
.dashboard-when { font-weight: 550; }
.dashboard-item.is-alert .dashboard-when { color: var(--danger); }
.dashboard-item .button { flex: 0 0 auto; min-height: 36px; padding: 0 12px; font-size: 13px; }
.dashboard-empty { padding: 18px 12px; border: 1px dashed #e6e1ee; border-radius: 4px; color: #736d85; font-size: 14px; text-align: center; }
.dashboard-tile.is-rojo { border-left-color: #d33c35; }
.dashboard-tile.is-rojo strong { color: #b8322c; }
.dashboard-tile.is-amarillo { border-left-color: #e6b422; }
.dashboard-tile.is-verde { border-left-color: #3fa45b; }
.task-item.is-preventive { border-color: #cfe0d1; background: #f7fbf7; }
.task-state-badge.is-overdue { background: #fff0ef; color: var(--danger); font-weight: 550; }
.task-register { flex: 0 0 auto; min-height: 34px; padding: 0 12px; font-size: 13px; }
.detail-list li.is-preventive { border-color: #cfe0d1; background: #f7fbf7; }
.history-list li { gap: 4px !important; }
.history-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; }
.history-date { color: #2d2740; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.history-notes { color: #4a4459 !important; font-size: 14px !important; white-space: pre-line; }
.history-meta { color: #9d97ad !important; font-size: 12px !important; }
.task-hint { margin: 10px 0 0; padding: 10px 12px; border-radius: 4px; background: #e9f0e9; color: #3c6b45; font-size: 13px; line-height: 1.4; }
.dashboard-replaces { color: #625b73; font-size: 13px; }
.dashboard-buttons { display: flex; flex: 0 0 auto; flex-direction: column; gap: 6px; }
.dialog-form textarea { padding: 10px 12px; }
@media (max-width: 760px) { .dashboard-buttons { flex-direction: row; flex-wrap: wrap; } }
.preventive-dialog { width: min(440px, calc(100vw - 28px)); }
.dashboard-more { margin-top: 12px; }
.dashboard-more summary { width: fit-content; padding: 6px 0; color: var(--violet); font-size: 14px; font-weight: 550; cursor: pointer; list-style-position: inside; }
.dashboard-more .dashboard-list { margin-top: 8px; }
.dashboard-item.is-vencido { border-left-color: #d33c35; background: #fffafa; }
.dashboard-item.is-vencido .dashboard-when { color: var(--danger); }
.dashboard-item.is-proximo { border-left-color: #e6b422; }
.table-wrap { grid-column: 1 / -1; overflow-x: auto; border: 1px solid #e6e1ee; border-radius: 5px; background: var(--paper); box-shadow: 0 2px 5px rgb(59 40 77 / 3%); animation: enter .36s ease both; }
.data-table { width: 100%; min-width: 760px; border-collapse: collapse; font-size: 15px; }
.data-table th { padding: 13px 16px; border-bottom: 1px solid #e0dae9; background: #f3f0f7; color: #2d2740; font-size: 13px; font-weight: 600; text-align: left; white-space: nowrap; }
.data-table td { padding: 12px 16px; border-bottom: 1px solid #ece8f2; color: #2d2740; vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover td { background: #faf8fc; }
.data-table td strong { display: block; font-weight: 550; }
.data-table .table-sub { display: block; margin-top: 2px; color: #736d85; font-size: 13px; }
.data-table .is-number { font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-table .is-actions { width: 1%; padding: 6px 10px; text-align: right; }
.data-table tr.is-inactive td { color: #9d97ad; }
.data-table tr.is-inactive td strong { color: #736d85; }
.table-empty { color: #b6b0c3; }
.access-state { display: inline-flex; align-items: center; gap: 6px; color: #736d85; font-size: 13px; white-space: nowrap; }
.access-state::before { width: 7px; height: 7px; border-radius: 50%; background: #cbc5d6; content: ""; }
.access-state.is-on { color: #3c6b45; }
.access-state.is-on::before { background: #3fa45b; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.user-badge { padding: 5px 8px; border-radius: 3px; font-size: 12px; font-weight: 550; }
.user-badge.is-admin { background: var(--violet-pale); color: var(--violet); }
.user-badge.is-tecnico { background: #edf0f7; color: #596c99; }
.client-card.is-inactive { opacity: .62; }
.priority-badge { display: inline-flex; align-items: center; gap: 6px; width: fit-content; padding: 3px 8px; border-radius: 3px; font-size: 12px; font-weight: 550; }
.priority-badge::before { width: 8px; height: 8px; border-radius: 50%; content: ""; }
.priority-badge.is-alta { background: #fff0ef; color: #b8322c; }
.priority-badge.is-alta::before { background: #d33c35; }
.priority-badge.is-media { background: #fdf6e0; color: #8a6a0c; }
.priority-badge.is-media::before { background: #e6b422; }
.priority-badge.is-baja { background: #e9f0e9; color: #3c6b45; }
.priority-badge.is-baja::before { background: #3fa45b; }
.dashboard-item.is-alta { border-left-color: #d33c35; background: #fffafa; }
.dashboard-item.is-media { border-left-color: #e6b422; }
.dashboard-item.is-baja { border-left-color: #3fa45b; }
.dashboard-item.is-alta .dashboard-when { color: var(--danger); }
.dashboard-raise { color: #8a6a0c; font-size: 13px; }
.task-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.task-type-badge { width: fit-content; padding: 3px 8px; border-radius: 3px; font-size: 12px; font-weight: 550; }
.task-type-badge.is-correctivo { background: #fff0ef; color: var(--danger); }
.task-type-badge.is-preventivo { background: #e9f0e9; color: #47704e; }
.task-state-badge { width: fit-content; padding: 3px 8px; border-radius: 3px; background: #f7f5fa; color: #6c6680; font-size: 12px; }
@media (max-width: 1180px) {
  .dashboard-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-columns { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .dashboard-tiles { gap: 10px; margin-top: 24px; }
  .dashboard-tile { padding: 14px; }
  .dashboard-tile strong { font-size: 28px; }
  .dashboard-panel { padding: 16px; }
  .dashboard-item { flex-direction: column; }
}
.client-card.is-clickable { cursor: pointer; }
.client-card.is-clickable:focus-visible { outline: 2px solid #bca5d5; outline-offset: 2px; }
.detail-dialog { width: min(620px, calc(100vw - 28px)); }
/* En las fichas, los botones quedan fijos abajo aunque se baje en la ventana */
.detail-dialog .dialog-actions { position: sticky; bottom: 0; z-index: 2; margin: 24px -28px -24px; padding: 14px 28px 18px; border-top: 1px solid #ece8f2; background: #fff; box-shadow: 0 -6px 14px rgb(59 40 77 / 6%); }
@media (max-width: 760px) {
  .detail-dialog .dialog-actions { margin: 20px -18px -18px; padding: 12px 18px 14px; }
}
.detail-data { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; margin: 22px 0 0; }
.detail-data div { min-width: 0; }
.detail-data dt { margin-bottom: 4px; color: #736d85; font-size: 12px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; }
.detail-data dd { margin: 0; overflow-wrap: anywhere; color: #2d2740; font-size: 15px; }
.detail-data dd.is-empty { color: #9d97ad; }
.detail-data a { color: var(--violet); text-decoration: none; }
.detail-data a:hover { text-decoration: underline; }
.detail-data .is-wide { grid-column: 1 / -1; }
.detail-section { margin-top: 26px; }
.detail-section h3 { margin: 0 0 10px; color: #2d2740; font-size: 16px; font-weight: 550; }
.detail-section.is-first { margin-top: 22px; }
.detail-section .detail-data { margin-top: 0; padding: 14px 16px; border: 1px solid #ece8f2; border-radius: 4px; }
.detail-section h3 span { color: #736d85; font-weight: 450; }
.detail-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.detail-list li { display: grid; gap: 2px; padding: 11px 14px; border: 1px solid #ece8f2; border-radius: 4px; }
.detail-list strong { color: #2d2740; font-size: 14px; font-weight: 550; }
.detail-list span { color: #6c6680; font-size: 13px; }
.detail-list .task-badges { margin-top: 4px; }
.detail-list .detail-empty { border-style: dashed; color: #736d85; font-size: 14px; }
@media (max-width: 760px) { .detail-data { grid-template-columns: 1fr; } }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 10; max-width: min(400px, calc(100vw - 32px)); padding: 12px 16px; transform: translateY(12px); border: 1px solid #cce4dd; border-radius: 4px; background: #f2fbf7; color: #316f5a; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.is-visible { transform: translateY(0); opacity: 1; }

.login-screen { min-height: 100vh; background: #fff; }
.login-aside { position: fixed; inset: 0 auto 0 0; display: flex; width: 48%; flex-direction: column; justify-content: space-between; padding: 34px clamp(35px, 6vw, 92px) 28px; overflow: hidden; background: linear-gradient(145deg, #e5d4f1 0%, #d7c1e8 55%, #e6d2ed 100%); color: #443756; }
.login-aside::after { position: absolute; right: -130px; bottom: -180px; width: 500px; height: 500px; border: 1px solid rgb(104 66 145 / 24%); border-radius: 50%; box-shadow: 0 0 0 46px rgb(104 66 145 / 6%), 0 0 0 95px rgb(104 66 145 / 5%), 0 0 0 145px rgb(104 66 145 / 3%); content: ""; }
.brand-login { position: relative; z-index: 1; margin: 0; }
.brand-login .brand-mark { width: 58px; height: 58px; }
.brand-login .brand-name { font-size: 29px; }
.brand-login .brand-tagline { color: #5b5068; font-size: 14px; }
.login-message { position: relative; z-index: 1; max-width: 480px; margin: auto 0; padding: 45px 0 70px; animation: enter .5s ease both; }
.login-message .eyebrow { color: #8060a2; }
.login-message h1 { margin: 15px 0 16px; color: #352b43; font-size: clamp(31px, 4vw, 49px); font-weight: 500; line-height: 1.13; }
.login-message h1 em { color: #805da5; font-style: normal; }
.login-message > p:last-child { color: #71677c; font-size: 15px; }
.login-edition { position: relative; z-index: 1; color: #827990; font-size: 12px; font-weight: 500; }
.login-edition span { padding: 0 5px; color: #c56d91; }
.login-content { display: grid; min-height: 100vh; margin-left: 48%; padding: 36px; place-items: center; }
.login-form { width: min(360px, 100%); animation: enter .45s .08s ease both; }
.login-kicker { display: block; margin-bottom: 7px; color: var(--violet); font-size: 14px; }
.login-form h2 { margin: 13px 0 4px; color: #2d2740; font-size: 28px; font-weight: 550; }
.login-form > p:not(.form-error) { margin: 0 0 30px; color: #736d85; font-size: 15px; }
.login-form label { display: block; margin: 16px 0 7px; color: #4a4459; font-size: 13px; font-weight: 550; }
.login-form input { width: 100%; height: 46px; padding: 0 12px; border: 1px solid #e6e1ee; border-radius: 4px; outline: 0; background: #fff; color: #2d2740; }
.login-form input:focus { border-color: #bca5d5; box-shadow: 0 0 0 3px rgb(118 81 165 / 9%); }
.login-submit { width: 100%; justify-content: space-between; margin-top: 20px; padding-inline: 14px; }
.login-submit span:last-child { font-size: 17px; font-weight: 400; }
.login-security { display: block; margin-top: 22px; color: #9d97ad; font-size: 12px; text-align: center; }

/* Menú lateral oscuro: versión por defecto. data-menu="claro" vuelve al lila. */
:root:not([data-menu="claro"]) .sidebar { border-right: 0; background: linear-gradient(170deg, #3f2069 0%, #2e1650 100%); color: #efe8f8; }
:root:not([data-menu="claro"]) .sidebar .brand-name { color: #fff; }
:root:not([data-menu="claro"]) .sidebar .brand-name span { color: #e3a3c4; }
:root:not([data-menu="claro"]) .sidebar .brand-tagline { color: rgb(255 255 255 / 66%); }
:root:not([data-menu="claro"]) .workspace-label { color: rgb(255 255 255 / 55%); }
:root:not([data-menu="claro"]) .nav-link { border-color: transparent; background: transparent; color: rgb(255 255 255 / 84%); }
:root:not([data-menu="claro"]) .nav-link svg { color: rgb(255 255 255 / 62%); }
:root:not([data-menu="claro"]) .nav-link:hover { border-color: transparent; background: rgb(255 255 255 / 9%); color: #fff; }
:root:not([data-menu="claro"]) .nav-link.is-active { border-color: #fff; background: #fff; color: var(--violet); box-shadow: 0 4px 14px rgb(10 0 25 / 28%); }
:root:not([data-menu="claro"]) .nav-link.is-active svg { color: var(--violet); }
:root:not([data-menu="claro"]) .nav-link.is-active::before { background: var(--coral); }
:root:not([data-menu="claro"]) .nav-count { border-color: transparent; background: rgb(255 255 255 / 13%); color: rgb(255 255 255 / 86%); }
:root:not([data-menu="claro"]) .nav-link.is-active .nav-count { border-color: transparent; background: var(--violet-pale); color: var(--violet); }
:root:not([data-menu="claro"]) .profile-row { border-top-color: rgb(255 255 255 / 13%); }
:root:not([data-menu="claro"]) .avatar { border-color: rgb(255 255 255 / 20%); background: rgb(255 255 255 / 12%); color: #fff; }
:root:not([data-menu="claro"]) .profile-copy strong { color: #fff; }
:root:not([data-menu="claro"]) .profile-copy small { color: rgb(255 255 255 / 62%); }
:root:not([data-menu="claro"]) .logout-button { color: rgb(255 255 255 / 68%); }
:root:not([data-menu="claro"]) .logout-button:hover { background: rgb(255 255 255 / 10%); color: #fff; }

:root:not([data-menu="claro"]) .login-aside { background: linear-gradient(160deg, #42216d 0%, #2e1650 100%); color: #efe8f8; }
:root:not([data-menu="claro"]) .login-aside::after { border-color: rgb(255 255 255 / 14%); box-shadow: 0 0 0 46px rgb(255 255 255 / 4%), 0 0 0 95px rgb(255 255 255 / 3%), 0 0 0 145px rgb(255 255 255 / 2%); }
:root:not([data-menu="claro"]) .login-aside .brand-name { color: #fff; }
:root:not([data-menu="claro"]) .login-aside .brand-name span { color: #e3a3c4; }
:root:not([data-menu="claro"]) .login-aside .brand-tagline { color: rgb(255 255 255 / 66%); }
:root:not([data-menu="claro"]) .login-message .eyebrow { color: #d9c2f0; }
:root:not([data-menu="claro"]) .login-message h1 { color: #fff; }
:root:not([data-menu="claro"]) .login-message h1 em { color: #e3a3c4; }
:root:not([data-menu="claro"]) .login-message > p:last-child { color: rgb(255 255 255 / 74%); }
:root:not([data-menu="claro"]) .login-edition { color: rgb(255 255 255 / 58%); }
:root:not([data-menu="claro"]) .login-edition span { color: #e3a3c4; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes enter { from { transform: translateY(7px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

@media (min-width: 1500px) {
  .page-content { padding-right: 56px; padding-left: 56px; }
  .client-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 1180px) {
  .sidebar { width: 224px; }
  .main-content { margin-left: 224px; }
  .page-content { padding-right: 28px; padding-left: 28px; }
  .topbar { padding-right: 28px; padding-left: 28px; }
  .client-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .sidebar { position: fixed; inset: auto 0 0; width: 100%; height: 64px; flex-direction: row; align-items: center; padding: 5px 8px calc(5px + env(safe-area-inset-bottom)); border-top: 1px solid rgb(220 210 235 / 12%); }
  .sidebar > .brand, .workspace-label, .sidebar-bottom { display: none; }
  .primary-nav { display: grid; width: 100%; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; gap: 2px; }
  .nav-link { min-height: 50px; flex-direction: column; justify-content: center; gap: 3px; padding: 4px 3px; border-radius: 4px; font-size: 10px; }
  .nav-link.is-active::before { inset: auto 25% 0; width: auto; height: 2px; }
  .nav-link svg { width: 19px; height: 19px; }
  .nav-count { display: none; }
  .main-content { margin-left: 0; padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .topbar { height: 49px; padding: 0 18px; }
  .topbar-system, .topbar-dot { display: none; }
  .page-content { padding: 31px 18px 34px; }
  .page-heading { align-items: flex-start; }
  .page-heading h1 { font-size: 28px; }
  .page-description { max-width: 360px; font-size: 12px; line-height: 1.45; }
  .page-heading > .button { min-height: 38px; gap: 6px; padding: 0 10px; font-size: 11px; white-space: nowrap; }
  .client-toolbar { margin-top: 25px; }
  .search-box { width: 100%; }
  .search-box kbd { display: none; }
  .results-label { display: none; }
  .client-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .client-card { min-height: 198px; padding: 14px 13px 13px; }
  .client-name { margin-top: 13px; font-size: 13px; }
  .type-badge { max-width: 65%; padding: 4px 6px; font-size: 10px; }
  .card-stats { gap: 14px; }
  .stat { gap: 4px; }
  .stat-value { font-size: 14px; }
  .stat-label { font-size: 10px; }
  .login-aside { position: relative; width: 100%; min-height: 245px; padding: 23px 24px 20px; }
  .login-message { padding: 36px 0 30px; }
  .login-message .eyebrow { font-size: 10px; }
  .login-message h1 { max-width: 420px; margin: 10px 0; font-size: 29px; }
  .login-message > p:last-child { margin: 0; font-size: 12px; }
  .login-edition { font-size: 10px; }
  .login-content { min-height: auto; margin: 0; padding: 38px 24px 45px; }
}
@media (max-width: 390px) {
  .page-heading { gap: 10px; }
  .page-heading > .button { padding: 0 8px; }
  .page-heading > .button svg { width: 14px; height: 14px; }
  .client-grid { grid-template-columns: 1fr; }
  .client-card { min-height: 182px; padding: 16px; }
  .client-name { font-size: 14px; }
  .card-stats { gap: 24px; }
  .login-aside { min-height: 225px; }
  .login-message h1 { font-size: 26px; }
}
/* Ajustes de celular para ventanas, formularios y tarjetas de equipo */
@media (max-width: 760px) {
  .dialog-form { padding: 20px 18px 18px; }
  .dialog-heading h2 { font-size: 20px; }
  .dialog-actions { flex-wrap: wrap; }
  .dialog-actions .button { flex: 1 1 auto; }
  .detail-data { gap: 12px; }
  .task-period { flex-wrap: wrap; }
  .task-period select:first-child { flex: 1 1 100%; }
  .task-period input { flex: 0 0 96px; }
  .task-period select:last-child { flex: 1 1 0; }
  .card-footer { flex-wrap: wrap; row-gap: 8px; }
  .record-actions { margin-left: auto; }
  /* 16px evita que Safari en iPhone haga zoom al tocar un campo */
  .dialog-form input, .dialog-form select, .dialog-form textarea,
  .task-form input, .task-form select, .task-form textarea,
  .login-form input, .search-box input { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
/* Inicio: buscador arriba, pestañas y una sola lista más grande */
.dashboard .dashboard-toolbar { margin: 0 0 18px; }
.dashboard .search-box { min-height: 54px; }
.dashboard .search-box input { font-size: 16px; }
.dashboard-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.dashboard-tab { display: inline-flex; min-height: 42px; align-items: center; gap: 8px; padding: 0 16px; border: 1px solid #e3ddeb; border-radius: 999px; background: #fff; color: #4f4862; font: inherit; font-size: 15px; font-weight: 550; cursor: pointer; transition: background .16s ease, border-color .16s ease, color .16s ease; }
.dashboard-tab:hover { border-color: #cdbfe0; background: #f8f4fc; }
.dashboard-tab span { min-width: 24px; padding: 1px 7px; border-radius: 999px; background: #f1edf6; color: #6c6680; font-size: 13px; text-align: center; }
.dashboard-tab.is-active { border-color: var(--violet); background: var(--violet); color: #fff; }
.dashboard-tab.is-active span { background: rgb(255 255 255 / 20%); color: #fff; }
.dashboard-tab:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }
.dashboard-panel { padding: 22px 24px; }
.dashboard .dashboard-list { gap: 12px; }
.dashboard .dashboard-item { padding: 18px 18px 18px 20px; }
.dashboard .dashboard-item-copy { gap: 6px; }
.dashboard .dashboard-item-copy strong { font-size: 17px; }
.dashboard .dashboard-item-copy > span { font-size: 15px; }
.dashboard .task-type-badge, .dashboard .priority-badge { font-size: 13px; }
.dashboard .dashboard-item .button { min-height: 42px; padding: 0 16px; font-size: 14px; }
.dashboard .dashboard-empty { padding: 26px 14px; font-size: 15px; }
.dashboard .dashboard-more summary { font-size: 15px; }

/* Menú lateral más angosto */
.sidebar { width: 228px; padding: 24px 12px 16px; }
.main-content { margin-left: 228px; }
.brand { gap: 9px; margin-bottom: 40px; }
.brand-mark { width: 40px; height: 40px; }
.brand-name { font-size: 22px; }
.brand-tagline { font-size: 11px; }
.nav-link { min-height: 44px; gap: 11px; font-size: 14px; }
.nav-link svg { width: 19px; height: 19px; }
@media (max-width: 1180px) {
  .sidebar { width: 204px; }
  .main-content { margin-left: 204px; }
}
@media (max-width: 760px) {
  .sidebar { width: 100%; padding: 5px 8px calc(5px + env(safe-area-inset-bottom)); }
  .main-content { margin-left: 0; }
  .nav-link { min-height: 50px; gap: 3px; font-size: 10px; }
  .dashboard-tab { min-height: 38px; padding: 0 12px; font-size: 14px; }
  .dashboard-panel { padding: 14px; }
  .dashboard .dashboard-item { padding: 14px; }
  .dashboard .dashboard-item-copy strong { font-size: 16px; }
  .dashboard .dashboard-item-copy > span { font-size: 14px; }
}
/* Título: lugar - equipo. Debajo, la tarea en violeta. */
.dashboard .dashboard-item-copy > .dashboard-where { display: flex; align-items: flex-start; gap: 8px; color: #1f1a2c; font-size: 20px; font-weight: 700; line-height: 1.3; }
.dashboard .dashboard-item-copy > .dashboard-task { overflow-wrap: anywhere; color: var(--violet); font-size: 13px; font-weight: 550; }
@media (max-width: 760px) {
  .dashboard .dashboard-item-copy > .dashboard-where { font-size: 18px; }
  .dashboard .dashboard-item-copy > .dashboard-task { font-size: 12px; }
}

/* Checklist del preventivo */
.task-group { margin: 10px 0 0; color: #5b5470; font-size: 13px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; }
.task-group span { color: #8d87a0; font-weight: 500; }
.task-item.is-checklist { padding-top: 9px; padding-bottom: 9px; border-left: 3px solid #9cc5a3; }
.task-copy-row { display: grid; gap: 6px; padding: 2px 2px 4px; }
.task-copy-row label { color: #4f4862; font-size: 13px; font-weight: 550; }
.task-copy-row .task-hint { margin: 0; }
.task-copy-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.task-copy-controls select { min-width: 0; min-height: 40px; flex: 1 1 260px; padding: 0 10px; border: 1px solid #e6e1ee; border-radius: 4px; background: #fff; color: #2d2740; font: inherit; font-size: 14px; }
.task-copy-controls .button { min-height: 40px; }

.checklist-box { position: relative; margin: 16px 0 0; padding: 12px 14px 14px; border: 1px solid #e6e1ee; border-radius: 5px; }
.checklist-box legend { padding: 0 6px; color: #2d2740; font-size: 14px; font-weight: 600; }
.checklist-box legend span { color: #736d85; font-weight: 500; }
.checklist-all { position: absolute; top: -2px; right: 14px; padding: 0 6px; background: #fff; }
.checklist { display: grid; gap: 4px; max-height: 320px; overflow-y: auto; margin: 4px 0 0; padding: 0; list-style: none; }
.checklist label { display: flex; align-items: flex-start; gap: 10px; margin: 0; padding: 8px 6px; border-radius: 4px; color: #2d2740; font-size: 15px; font-weight: 450; cursor: pointer; }
.checklist label:hover { background: #f8f4fc; }
.checklist input[type=checkbox] { width: 19px; height: 19px; min-height: 0; flex: 0 0 auto; margin: 1px 0 0; padding: 0; accent-color: var(--violet); }
.checklist-empty { padding: 10px 6px; color: #736d85; font-size: 14px; }

.history-checklist summary, .detail-checklist summary { width: fit-content; color: var(--violet); font-size: 14px; font-weight: 550; cursor: pointer; }
.history-checklist ul, .detail-checklist ol { display: grid; gap: 3px; margin: 6px 0 2px; padding: 0 0 0 4px; list-style: none; }
.detail-checklist ol { padding-left: 22px; list-style: decimal; }
.history-checklist li, .detail-checklist li { padding: 0 !important; border: 0 !important; color: #4a4459; font-size: 14px; }
.history-checklist li.is-done span { color: #3f8a4f; font-weight: 700; }
.history-checklist li.is-missing { color: #8a8398; }
.history-checklist li.is-missing span { color: #c0392b; font-weight: 700; }
.detail-checklist-empty { color: #8a8398; font-size: 13px; }
.detail-list .history-checklist li { display: flex; align-items: baseline; gap: 8px; }
.history-checklist li span[aria-hidden] { width: 14px; flex: 0 0 auto; text-align: center; }

/* Inicio: botón para cargar una orden de servicio */
.dashboard .dashboard-toolbar #new-order-button { min-height: 54px; flex: 0 0 auto; gap: 8px; padding: 0 20px; font-size: 15px; white-space: nowrap; }
.dashboard .dashboard-toolbar .results-label { margin-left: auto; }
@media (max-width: 760px) {
  .dashboard .dashboard-toolbar { flex-wrap: wrap; gap: 10px; }
  .dashboard .dashboard-toolbar #new-order-button { width: 100%; min-height: 46px; justify-content: center; }
}

/* Inicio: buscador hasta el botón y botón de cada tarea centrado */
.dashboard .dashboard-toolbar .search-box { flex: 1 1 auto; width: auto; max-width: none; }
.dashboard .dashboard-toolbar .results-label { margin-left: 0; }
@media (min-width: 761px) {
  .dashboard .dashboard-item { align-items: center; }
}
@media (max-width: 760px) {
  .dashboard .dashboard-toolbar .search-box { flex-basis: 100%; }
}

/* Orden de servicio: tareas extra */
.order-items-box { margin-bottom: 4px; }
.order-items { display: grid; gap: 6px; margin: 4px 0 10px; padding: 0; list-style: none; }
.order-items:empty { display: none; }
.order-items li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 6px 6px 10px; border-radius: 4px; background: #f6f3fa; color: #2d2740; font-size: 14px; }
.order-items li span { overflow-wrap: anywhere; }
.order-items .icon-button { width: 30px; height: 30px; flex: 0 0 auto; }
.order-item-add { display: flex; gap: 8px; }
.order-item-add input { flex: 1 1 auto; min-width: 0; margin: 0; }
.order-item-add .button { flex: 0 0 auto; }
.dashboard .dashboard-item-copy > .dashboard-order-items { display: grid; gap: 2px; margin: 0; padding-left: 18px; color: var(--violet); font-size: 13px; font-weight: 500; }
.dashboard .dashboard-item .dashboard-buttons .button { width: 100%; }
.checklist-box legend .required-mark { color: var(--violet); font-weight: 600; }
.dashboard .dashboard-item-copy > .dashboard-order-items { gap: 3px; padding-left: 16px; list-style: disc; font-size: 13px; font-weight: 550; }
.dashboard .dashboard-item-copy > .dashboard-order-items li::marker { color: #b9a9cf; }

/* Inicio: tareas a 14 px, siempre con viñeta, y acción principal destacada */
.dashboard .dashboard-item-copy > .dashboard-task { font-size: 14px; }
.dashboard .dashboard-item-copy > .dashboard-order-items { font-size: 14px; }
.dashboard .dashboard-item .button-main-action { border-color: #cdbbe4; color: var(--violet); font-weight: 600; }
.dashboard .dashboard-item .button-main-action:hover { border-color: var(--violet); background: #f6f1fb; }
.dashboard .dashboard-item .dashboard-edit { align-self: center; padding: 4px 6px; font-size: 13px; }
@media (max-width: 760px) {
  .dashboard .dashboard-item-copy > .dashboard-task, .dashboard .dashboard-item-copy > .dashboard-order-items { font-size: 13px; }
  .dashboard .dashboard-item .dashboard-edit { width: auto; }
}

/* Clientes, instituciones y equipos en tabla */
.records-table tbody tr.is-clickable { cursor: pointer; }
.records-table tbody tr.is-clickable:focus-visible td { background: #f6f1fb; outline: none; }
.records-table tbody tr.is-clickable:focus-visible td:first-child { box-shadow: inset 3px 0 0 var(--violet); }
.records-table .record-actions { justify-content: flex-end; margin: 0; }
.records-table .condition-badge { margin: 0; }

/* Confirmación para eliminar */
.confirm-dialog { width: min(420px, calc(100vw - 28px)); }
.confirm-dialog .dialog-form { text-align: center; }
.confirm-icon { display: grid; width: 52px; height: 52px; margin: 4px auto 14px; place-items: center; border-radius: 50%; background: #fff0ef; color: var(--danger); }
.confirm-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.confirm-dialog h2 { margin: 0; color: #1f1a2c; font-size: 20px; font-weight: 650; }
.confirm-name { margin: 10px 0 0; padding: 8px 12px; border-radius: 4px; background: #f6f3fa; color: #2d2740; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.confirm-message { margin: 12px 0 0; color: #625b73; font-size: 14px; line-height: 1.5; }
.confirm-dialog .form-error { padding: 8px 12px; border-radius: 4px; background: #fff8f6; }
.confirm-dialog .dialog-actions { justify-content: center; }
.button-danger { background: var(--danger); color: #fff; box-shadow: 0 2px 4px rgb(166 62 54 / 18%); }
.button-danger:hover { background: #8f332c; }
.button-danger:disabled { opacity: .6; cursor: default; }

/* Confirmación para eliminar */
.confirm-dialog { width: min(420px, calc(100vw - 28px)); }
.confirm-dialog .dialog-form { text-align: center; }
.confirm-icon { display: grid; width: 52px; height: 52px; margin: 4px auto 14px; place-items: center; border-radius: 50%; background: #fff0ef; color: var(--danger); }
.confirm-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.confirm-dialog h2 { margin: 0; color: #1f1a2c; font-size: 20px; font-weight: 650; }
.confirm-name { margin: 10px 0 0; padding: 8px 12px; border-radius: 4px; background: #f6f3fa; color: #2d2740; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.confirm-message { margin: 12px 0 0; color: #625b73; font-size: 14px; line-height: 1.5; }
.confirm-dialog .form-error { padding: 8px 12px; border-radius: 4px; background: #fff8f6; }
.confirm-dialog .dialog-actions { justify-content: center; }
.button-danger { background: var(--danger); color: #fff; box-shadow: 0 2px 4px rgb(166 62 54 / 18%); }
.button-danger:hover { background: #8f332c; }
.button-danger:disabled { opacity: .6; cursor: default; }

/* Listados: solo el título, sin la bajada de arriba */
.page-heading, .page-heading:not(#x) { align-items: center; }

/* Historial del cliente: equipo - institución arriba de cada trabajo */
.detail-list .history-where { color: #1f1a2c; font-size: 16px; font-weight: 700; line-height: 1.3; }

/* Reporte dentro del historial */
.history-report summary { cursor: pointer; color: var(--violet); font-size: 14px; font-weight: 600; }
.history-report-body { display: grid; gap: 8px; margin-top: 8px; padding: 10px 12px; border-radius: 5px; background: #faf8fc; }
.history-report-body p { margin: 0; color: #2d2740; font-size: 14px; white-space: pre-line; }
.report-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.report-table th { padding: 6px 8px; border-bottom: 1px solid #e0dae9; color: #625b73; font-weight: 600; text-align: left; }
.report-table td { padding: 6px 8px; border-bottom: 1px solid #ece8f2; color: #2d2740; vertical-align: top; }
.report-table tr:last-child td { border-bottom: 0; }
.report-table .is-number { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Reporte de servicio: pantalla con el formato de la hoja de Hemovida */
.report-dialog { width: min(820px, calc(100vw - 28px)); max-height: min(95vh, 980px); }
.report-sheet { position: relative; padding: 30px 34px 24px; }
.report-close { position: absolute; top: 12px; right: 12px; }
.report-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding-bottom: 18px; border-bottom: 1px solid #ece8f2; }
.report-brand { display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto; align-items: center; column-gap: 6px; }
.report-brand-name { color: #2b2533; font-size: 30px; font-weight: 650; letter-spacing: -.01em; line-height: 1; }
.report-brand-name span { color: #9b70bd; }
.report-brand-mark { grid-row: 1 / span 2; grid-column: 2; width: 46px; height: 46px; }
.report-brand-tagline { justify-self: end; margin-top: 2px; color: #4a4459; font-size: 9px; font-weight: 700; letter-spacing: .12em; }
.report-heading { display: grid; justify-items: end; gap: 10px; padding-right: 30px; }
.report-heading h2 { margin: 0; color: #2b2533; font-size: 26px; font-weight: 800; letter-spacing: .01em; }
.report-line { display: flex; align-items: flex-end; gap: 8px; min-width: 0; }
.report-line > .report-label, .dialog-form .report-line > label.report-label { flex: 0 0 auto; margin: 0; padding-bottom: 5px; color: #2d2740; font-size: 14px; font-weight: 550; white-space: nowrap; }
.report-value { flex: 1 1 auto; min-width: 0; min-height: 30px; padding: 4px 2px 5px; border-bottom: 1px solid #cfc8da; color: #1f1a2c; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.dialog-form .report-line input, .dialog-form .report-line select, .dialog-form .report-line textarea { flex: 1 1 auto; min-width: 0; min-height: 30px; padding: 4px 2px 5px; border: 0; border-bottom: 1px solid #cfc8da; border-radius: 0; background: transparent; box-shadow: none; font-size: 14px; }
.dialog-form .report-line input:focus, .dialog-form .report-line select:focus, .dialog-form .report-line textarea:focus { border-bottom-color: var(--violet); box-shadow: 0 1px 0 var(--violet); }
.report-date label { margin: 0; padding-bottom: 5px; color: #625b73; font-size: 13px; font-weight: 550; }
.dialog-form .report-date input { width: 150px; flex: 0 0 auto; }
.report-fields { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px 22px; margin: 20px 0 22px; }
.report-line.is-half { grid-column: span 3; }
.report-line.is-third { grid-column: span 2; }
.report-line.is-full { grid-column: 1 / -1; }
.report-line.is-block { display: grid; gap: 6px; }
.dialog-form .report-line.is-block textarea { min-height: 66px; padding: 6px 2px; resize: vertical; background: repeating-linear-gradient(transparent 0 29px, #e3dde9 29px 30px); line-height: 30px; padding-top: 0; }
.report-panel { margin: 0 0 16px; padding: 12px 16px 10px; border-radius: 4px; background: #ebe8ef; }
.report-grid { display: grid; align-items: center; gap: 0 10px; }
.report-grid.is-tasks { grid-template-columns: minmax(0, 1fr) 150px 80px 30px; }
.report-grid.is-parts { grid-template-columns: 80px minmax(0, 1fr) 140px 30px; }
.report-grid-head { padding-bottom: 6px; border-bottom: 1px solid #c9c2d3; color: #2d2740; font-size: 14px; font-weight: 550; }
.report-grid-head > span:nth-child(n+2) { text-align: center; }
.report-grid.is-parts.report-grid-head > span:nth-child(2) { text-align: center; }
.report-grid.is-parts.report-grid-head > span:first-child { text-align: left; }
.report-row { border-bottom: 1px solid #d6d0de; }
.dialog-form .report-row input { min-height: 36px; padding: 0 4px; border: 0; border-radius: 0; background: transparent; box-shadow: none; font-size: 14px; }
.dialog-form .report-row input:focus { background: rgb(255 255 255 / 70%); box-shadow: inset 0 -2px 0 var(--violet); }
.dialog-form .report-row [data-field="fecha"], .dialog-form .report-row [data-field="horas"], .dialog-form .report-row [data-field="cantidad"] { text-align: center; }
.report-grid.is-tasks .report-row > *, .report-row > input { border-left: 0; }
.report-grid.is-tasks.report-row > input:nth-child(n+2), .report-grid.is-parts.report-row > input:nth-child(2), .report-grid.is-parts.report-row > input:nth-child(3) { border-left: 1px solid #c9c2d3 !important; }
.report-remove { width: 30px; height: 30px; color: #8a849a; }
.report-remove:hover { background: #fff0ef; color: var(--danger); }
.report-add { margin-top: 8px; font-size: 13px; }
.report-empty { margin: 8px 0 0; color: #8a849a; font-size: 13px; }
@media (max-width: 680px) {
  .report-sheet { padding: 22px 16px 18px; }
  .report-top { flex-direction: column; gap: 12px; }
  .report-heading { justify-items: start; padding-right: 0; }
  .report-heading h2 { font-size: 21px; }
  .report-fields { grid-template-columns: 1fr; }
  .report-line.is-half, .report-line.is-third { grid-column: 1 / -1; }
  .report-grid-head { display: none; }
  .report-grid.is-tasks { grid-template-columns: minmax(0, 1fr) 70px 30px; }
  .report-grid.is-tasks [data-field="descripcion"] { grid-column: 1 / -1; border-bottom: 1px dashed #d6d0de; }
  .report-grid.is-parts { grid-template-columns: 64px minmax(0, 1fr) 30px; }
  .report-grid.is-parts [data-field="codigo"] { grid-column: 1 / span 2; }
}

/* Reporte: diagnóstico en el bloque gris, las fallas una al lado de la otra */
.report-diagnosis { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.report-diagnosis:empty { display: none; }
.report-diagnosis-row { display: inline-flex; align-items: center; max-width: 100%; padding: 0 2px 0 10px; border: 1px solid #d6d0de; border-radius: 4px; background: #fff; }
.dialog-form .report-diagnosis-row input { width: auto; max-width: 100%; min-width: 0; min-height: 32px; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; color: #1f1a2c; font-size: 14px; font-weight: 550; }
.report-diagnosis-row:focus-within { border-color: var(--violet); box-shadow: 0 0 0 3px rgb(118 81 165 / 12%); }
.report-diagnosis-row .report-remove { width: 26px; height: 26px; }

/* Reporte: fallas con el mismo fondo gris y renglones más marcados */
.report-diagnosis-row { border-color: #a89fb6; background: transparent; }
.report-grid-head { border-bottom: 1.5px solid #9f95ae; }
.report-row { border-bottom: 1px solid #a89fb6; }
.report-grid.is-tasks.report-row > input:nth-child(n+2), .report-grid.is-parts.report-row > input:nth-child(2), .report-grid.is-parts.report-row > input:nth-child(3) { border-left-color: #a89fb6 !important; }

/* Historial: los trabajos con reporte se abren al tocarlos */
.detail-list li.history-has-report { cursor: pointer; border-radius: 5px; transition: background .15s; }
.detail-list li.history-has-report:hover, .detail-list li.history-has-report:focus-visible { background: #f6f1fb; outline: none; }
.detail-list li.history-has-report:focus-visible { box-shadow: inset 3px 0 0 var(--violet); }
.history-report-link { color: var(--violet) !important; font-size: 14px !important; font-weight: 600; }

/* Reporte en modo lectura */
.report-sheet.is-view .report-heading { gap: 6px; }
.report-sheet.is-view .report-date .report-value { min-width: 130px; text-align: center; }
.report-grid.is-view-tasks { grid-template-columns: minmax(0, 1fr) 130px 80px; }
.report-grid.is-view-parts { grid-template-columns: 80px minmax(0, 1fr) 140px; }
.report-sheet.is-view .report-row { min-height: 38px; padding: 8px 0; color: #1f1a2c; font-size: 14px; }
.report-sheet.is-view .report-row > span { overflow-wrap: anywhere; }
.report-sheet.is-view .report-row > span + span { align-self: stretch; display: grid; align-items: center; border-left: 1px solid #a89fb6; }
.report-sheet.is-view .is-center { text-align: center; justify-content: center; }
.report-total { padding: 8px 0 2px; color: #2d2740; font-size: 14px; font-weight: 700; }
.report-diagnosis-row.is-static { padding: 6px 12px; color: #1f1a2c; font-size: 14px; font-weight: 550; }
@media (max-width: 680px) {
  .report-grid.is-view-tasks { grid-template-columns: minmax(0, 1fr) 92px 50px; }
  .report-grid.is-view-parts { grid-template-columns: 50px minmax(0, 1fr) 80px; }
  .report-sheet.is-view .report-grid-head { display: grid; font-size: 12px; }
}

/* Reporte: calendario para elegir un día o un rango en el mismo cuadro */
.range-picker { position: relative; }
.range-button { display: inline-flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 190px; min-height: 32px; padding: 4px 2px 5px; border: 0; border-bottom: 1px solid #cfc8da; background: transparent; color: #1f1a2c; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }
.range-button:hover, .range-button[aria-expanded="true"] { border-bottom-color: var(--violet); }
.range-button:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }
.range-button svg { width: 18px; height: 18px; fill: none; stroke: #625b73; stroke-width: 1.7; stroke-linecap: round; }
.range-popover { position: absolute; top: calc(100% + 6px); right: 0; z-index: 20; width: 284px; padding: 12px; border: 1px solid #e0dae9; border-radius: 6px; background: #fff; box-shadow: 0 16px 40px rgb(28 18 44 / 18%); }
.range-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.range-nav strong { color: #1f1a2c; font-size: 14px; font-weight: 650; }
.range-nav strong::first-letter { text-transform: uppercase; }
.range-nav .icon-button { width: 32px; height: 32px; font-size: 20px; line-height: 1; }
.range-nav .icon-button:disabled { opacity: .3; cursor: default; }
.range-weekdays, .range-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px 0; text-align: center; }
.range-weekdays span { padding: 4px 0; color: #8a849a; font-size: 11px; font-weight: 600; }
.range-day { height: 34px; border: 0; background: transparent; color: #2d2740; font: inherit; font-size: 13px; cursor: pointer; }
.range-day:hover:not(:disabled) { background: #f1ebf8; }
.range-day:disabled { color: #cbc5d6; cursor: default; }
.range-day.is-today { font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.range-day.is-between { background: #ece3f6; border-radius: 0; }
.range-day.is-start, .range-day.is-end { background: var(--violet); color: #fff; font-weight: 650; }
.range-day.is-start { border-radius: 6px 0 0 6px; }
.range-day.is-end { border-radius: 0 6px 6px 0; }
.range-day.is-start.is-end { border-radius: 6px; }
.range-day:focus-visible { outline: 2px solid var(--violet); outline-offset: -2px; }
.range-hint { margin: 10px 0 0; color: #625b73; font-size: 12px; line-height: 1.4; }
.range-actions { display: flex; justify-content: flex-end; margin-top: 8px; }
.range-actions .button { min-height: 34px; padding: 0 14px; font-size: 13px; }
@media (max-width: 680px) { .range-popover { right: auto; left: 0; } }

/* Orden de servicio: elegir institución y equipo en listas */
.picker { border: 1px solid #e6e1ee; border-radius: 6px; background: #fff; }
.picker-search { display: flex; align-items: center; gap: 8px; padding: 0 12px; border-bottom: 1px solid #ece8f2; color: #8a849a; }
.picker-search svg { width: 17px; height: 17px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.dialog-form .picker-search input { min-height: 42px; padding: 0; border: 0; box-shadow: none; }
.picker-list { display: grid; gap: 4px; max-height: 248px; margin: 0; padding: 6px; overflow-y: auto; list-style: none; }
.picker-list.is-equipment { max-height: 220px; padding: 0; }
.picker-option { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 9px 12px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.picker-option:hover, .picker-option:focus-visible { border-color: #e3d8f0; background: #f8f4fc; outline: none; }
.picker-list.is-equipment .picker-option { border-color: #e6e1ee; background: #fff; }
.picker-list.is-equipment .picker-option:hover { border-color: #cdbbe4; background: #f8f4fc; }
.picker-option.is-selected { border-color: var(--violet) !important; background: #f4eefb !important; box-shadow: 0 0 0 1px var(--violet); }
.picker-main { display: grid; gap: 2px; min-width: 0; }
.picker-main strong { color: #1f1a2c; font-size: 14px; font-weight: 650; overflow-wrap: anywhere; }
.picker-main small { color: #736d85; font-size: 12.5px; overflow-wrap: anywhere; }
.picker-check { display: grid; width: 22px; height: 22px; flex: 0 0 auto; place-items: center; border-radius: 50%; color: transparent; font-size: 13px; font-weight: 700; }
.picker-option.is-selected .picker-check { background: var(--violet); color: #fff; }
.picker-empty { padding: 14px 12px; color: #8a849a; font-size: 13px; }
.picker-chosen { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border: 1px solid #e3d8f0; border-radius: 6px; background: #f8f4fc; }
.picker-chosen .text-button { flex: 0 0 auto; font-size: 13px; }
.picker-label { display: block; margin: 15px 0 6px; color: #4a4459; font-size: 13px; font-weight: 550; }
.picker-label > span { color: var(--violet); }
#order-dialog { width: min(560px, calc(100vw - 28px)); }

/* Inicio: técnico asignado a la orden */
.dashboard .task-badges .dashboard-tech { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 4px; background: #f1ecf7; color: #4a3d63; font-size: 12.5px; font-weight: 600; }
.dashboard .task-badges .dashboard-tech::before { content: ""; width: 12px; height: 12px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21c1.5-4 4.5-6 8-6s6.5 2 8 6'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21c1.5-4 4.5-6 8-6s6.5 2 8 6'/%3E%3C/svg%3E") center / contain no-repeat; }

/* Reporte: responsable técnico abajo, como en la hoja (firma y aclaración) */
.report-signatures { display: flex; justify-content: flex-start; margin: 30px 0 4px; }
.report-signature { display: grid; justify-items: center; gap: 8px; width: min(320px, 100%); }
.dialog-form .report-signature select, .report-signature-name { width: 100%; min-height: 34px; padding: 4px 2px 6px; border: 0; border-bottom: 1.5px solid #6f6680; border-radius: 0; background: transparent; box-shadow: none; color: #1f1a2c; font-size: 15px; font-weight: 600; text-align: center; text-align-last: center; }
.report-signature-name { display: block; }
.report-signature p { margin: 0; color: #4a4459; font-size: 14px; }
.report-signature p b { color: #1f1a2c; font-weight: 700; }

/* Técnicos: responsable + los que acompañan */
.tech-picker { display: grid; gap: 8px; }
.tech-extras { display: grid; gap: 8px; }
.tech-extras:empty { display: none; }
.tech-extra { display: flex; align-items: center; gap: 6px; }
.tech-extra select { flex: 1 1 auto; }
.tech-remove { width: 32px; height: 32px; flex: 0 0 auto; color: #8a849a; }
.tech-remove:hover { background: #fff0ef; color: var(--danger); }
.tech-picker > .tech-add, .report-signature > .tech-add { justify-self: start; margin-top: 0; font-size: 13px; }
.report-signature .tech-extras { width: 100%; gap: 4px; }
.report-signature .tech-extra { position: relative; }
.report-signature .tech-extra .tech-remove { position: absolute; right: -36px; }
.report-signature > .tech-add { justify-self: center; }

/* Orden de servicio: buscador de institución con fondo gris para diferenciarlo de la lista */
.picker { overflow: hidden; }
.picker-search { background: #ebe8ef; border-bottom-color: #d6d0de; color: #625b73; }
.dialog-form .picker-search input { background: transparent; color: #1f1a2c; }
.dialog-form .picker-search input::placeholder { color: #7d768c; }
.picker-search:focus-within { background: #e4dfeb; box-shadow: inset 0 -2px 0 var(--violet); }

/* Orden de servicio: "+ Agregar tarea" debajo del campo, a todo el ancho */
.order-item-add { flex-direction: column; align-items: stretch; }
.order-item-add .order-item-button { width: 100%; justify-content: center; border-style: dashed; border-color: #cdbbe4; color: var(--violet); font-weight: 600; }
.order-item-add .order-item-button:hover { border-style: solid; background: #f8f4fc; }
