/* ═══════════════════════════════════════════
   VARIABLES Y RESET
═══════════════════════════════════════════ */
:root {
  /* CICAR corporate: blue · red · yellow */
  --primary:       #1a5fa8;   /* CICAR blue  */
  --primary-dark:  #134a85;
  --primary-light: #dce9f7;
  --accent-red:    #cc2222;   /* CICAR red   */
  --accent-yellow: #f5c200;   /* CICAR yellow*/
  --secondary:     #5a6e82;
  --success:       #2e8c5e;
  --warning:       #e8a000;
  --danger:        #cc2222;
  --info:          #1a5fa8;
  --bg:            #f0f4f8;
  --bg-card:       #ffffff;
  --border:        #d0dae4;
  --text:          #1a2535;
  --text-muted:    #5a6e82;
  --sidebar-w:     178px;
  --navbar-h:      62px;
  --radius:        8px;
  --shadow:        0 1px 4px rgba(0,0,0,.08);
  --shadow-md:     0 4px 12px rgba(0,0,0,.12);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', system-ui, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; }
a { text-decoration: none; color: inherit; }

/* ═══ SCREENS ═══ */
.screen { width: 100%; min-height: 100vh; }
.screen.hidden { display: none; }
.screen.active { display: block; }
.hidden { display: none !important; }

/* ═══ LOGIN ═══ */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0d3a6e 0%, #1a5fa8 60%, #1e78c8 100%);
}
.login-box {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 40px 36px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-md);
}
.login-logo-wrap { text-align: center; margin-bottom: 16px; }
.login-logo {
  height: 72px; width: auto;
  object-fit: contain;
  border-radius: 6px;
}
.login-box h1 { font-size: 1.4rem; font-weight: 700; color: var(--accent-red); margin-bottom: 4px; text-align: center; }
.login-subtitle { color: var(--text-muted); text-align: center; margin-bottom: 24px; font-size: 13px; }
.field-group { margin-bottom: 16px; }
.field-group label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 13px; }
.field-group input {
  width: 100%; padding: 10px 12px;
  border: 1.5px solid var(--border); border-radius: var(--radius);
  font-size: 14px; transition: border-color .2s;
}
.field-group input:focus { outline: none; border-color: var(--primary); }
.error-msg { background: #fad5d5; color: var(--accent-red); padding: 10px 12px; border-radius: var(--radius); margin-bottom: 12px; font-size: 13px; }

/* ═══ BUTTONS ═══ */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius);
  font-size: 13px; font-weight: 600; cursor: pointer;
  border: none; transition: background .15s, opacity .15s;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover:not(:disabled) { background: #059669; }
.btn-export-pdf {
  background: transparent; color: var(--text-muted);
  border: 1px dashed var(--border); font-size: 11px; padding: 4px 10px;
}
.btn-export-pdf:hover:not(:disabled) { background: var(--bg); color: var(--text); border-color: var(--text-muted); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #dc2626; }
.btn-outline { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover:not(:disabled) { background: var(--primary-light); }
.btn-outline-sm {
  background: transparent; color: var(--secondary);
  border: 1.5px solid var(--border); padding: 6px 12px;
  font-size: 12px; border-radius: 6px; cursor: pointer;
  font-weight: 600; transition: background .15s;
}
.btn-outline-sm:hover { background: var(--border); }
.btn-outline-sm:disabled { opacity: .4; cursor: not-allowed; pointer-events: none; }
.btn-full { width: 100%; justify-content: center; padding: 11px; font-size: 15px; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-icon { padding: 5px 8px; font-size: 13px; }

/* ═══ NAVBAR ═══ */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--navbar-h);
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,.22);
}
.navbar-brand {
  display: flex; align-items: center; gap: 10px;
}
.navbar-logo {
  height: 42px; width: auto;
  border-radius: 4px;
  background: #fff;
  padding: 2px 4px;
  object-fit: contain;
}
.navbar-title {
  font-size: 1rem; font-weight: 700; letter-spacing: .3px;
  color: #fff;
}
.navbar-right { display: flex; align-items: center; gap: 10px; }
.nav-user { font-size: 13px; }
.role-badge {
  font-size: 11px; font-weight: 700; padding: 2px 8px;
  border-radius: 20px; background: rgba(255,255,255,.25); text-transform: uppercase;
}

/* ═══ APP BODY ═══ */
.app-body {
  display: flex;
  min-height: 100vh;
  padding-top: var(--navbar-h);
}

/* ═══ SIDEBAR ═══ */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  padding: 16px 0;
  position: fixed;
  top: var(--navbar-h);
  bottom: 0;
  left: 0;
  overflow-y: auto;
}
.side-nav { display: flex; flex-direction: column; gap: 2px; padding: 0 8px; }
.side-link {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; border-radius: var(--radius);
  color: var(--text-muted); font-weight: 600; font-size: 13px;
  transition: background .15s, color .15s;
}
.side-link:hover { background: var(--bg); color: var(--text); }
.side-link.active { background: var(--primary-light); color: var(--primary); }

/* ═══ MAIN CONTENT ═══ */
.main-content {
  flex: 1;
  padding: 16px 16px 24px;
  overflow-x: hidden;
}
.main-content.with-sidebar { margin-left: var(--sidebar-w); }

/* ═══ VIEWS ═══ */
.view { display: none; }
.view.active { display: block; }

.view-header {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
  margin-bottom: 20px;
}
.view-header h2 { font-size: 1.2rem; font-weight: 700; }
.header-actions { display: flex; gap: 8px; align-items: center; }

/* ═══ SCHEDULE HEADER ═══ */
.schedule-header-left {
  display: flex; align-items: center; gap: 14px; flex-shrink: 0;
}
.schedule-header-right {
  display: flex; align-items: flex-start;
}
.week-nav {
  display: flex; align-items: center; gap: 8px;
}
.week-label {
  font-size: 13px; font-weight: 600;
  min-width: 200px; text-align: center;
  background: var(--bg); padding: 6px 12px; border-radius: 6px;
  border: 1px solid var(--border);
}
.schedule-actions { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.sched-actions-row { display: flex; gap: 8px; align-items: center; }
.sched-actions-subrow { display: flex; justify-content: flex-end; min-height: 0; }

/* ═══ SELECT ═══ */
.select-ctrl {
  padding: 7px 10px; border-radius: var(--radius);
  border: 1.5px solid var(--border); background: var(--bg-card);
  font-size: 13px; cursor: pointer;
}
.select-ctrl:focus { outline: none; border-color: var(--primary); }

/* ═══ OFFICE BUBBLE ═══ */
#office-bubble-wrap.office-bubble-active {
  border: 1.5px solid #b8cfe8;
  border-radius: 10px;
  background: #f4f8fd;
  padding: 0 10px 10px;
}
.office-bubble-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 8px 4px 6px;
}
#office-bubble-wrap.office-bubble-active .table-wrapper {
  border-radius: 0 0 8px 8px;
}

/* ═══ TABLE WRAPPER / SCHEDULE TABLE ═══ */
.table-wrapper { overflow-x: auto; border-radius: var(--radius); }

.schedule-table {
  border-collapse: collapse;
  min-width: 100%;
  background: var(--bg-card);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  overflow: hidden;
}
.schedule-table th, .schedule-table td {
  border: 1px solid var(--border);
  padding: 0;
  white-space: nowrap;
}
.schedule-table th {
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  text-align: center;
  padding: 7px 6px;
}
.schedule-table th.th-name { background: var(--primary-dark); text-align: left; padding-left: 10px; min-width: 120px; }
.schedule-table td.td-name {
  font-weight: 600; font-size: 12px;
  padding: 0 8px;
  min-width: 110px; height: 32px;
  vertical-align: middle;
}

/* Alternating row tints — two shades of CICAR blue */
.schedule-table tr:nth-child(odd)  td { background: #f0f6ff; }
.schedule-table tr:nth-child(even) td { background: #dce9f7; }

/* Separator row in schedule table */
.schedule-sep-row td {
  padding: 0 !important;
  height: 5px;
  background: linear-gradient(to right, var(--primary-light), var(--primary-dark), var(--primary-light)) !important;
  border-left: none !important;
  border-right: none !important;
}
.schedule-sep-row.has-label td {
  height: auto;
  padding: 2px 10px !important;
  text-align: center;
}
.sep-label {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #fff;
  opacity: 0.9;
}

/* Logged-in user's own row — slightly warmer highlight so it stands out */
.schedule-table tr.own-row td         { background: #cfe3f7 !important; }
.schedule-table tr.own-row td.td-name { font-weight: 700; }

/* Celda de turno */
.shift-cell {
  text-align: center; vertical-align: middle;
  height: 32px; min-width: 76px;
  cursor: default;
  position: relative;
}
/* Smaller pills inside the schedule table */
.schedule-table .shift-pill { font-size: 10px; padding: 4px 8px; border-radius: 5px; }
.shift-cell.editable { cursor: pointer; }
.shift-cell.editable:hover::after {
  content: '';
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.07);
  pointer-events: none;
}

.shift-pill {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  padding: 5px 10px; border-radius: 6px; min-width: 32px;
  color: #fff;
  white-space: nowrap;
  max-width: 100px; overflow: hidden; text-overflow: ellipsis;
}
.shift-pill.libre { background: #e2e8f0; color: #64748b; }
.shift-pill.draft-pill { background: #8e9bb5 !important; }
/* In-progress draft: left half = shift colour, right half = draft grey */
.shift-pill.draft-pill.draft-inprogress {
  background: linear-gradient(to right, var(--shift-color) 50%, #8e9bb5 50%) !important;
}
/* Hybrid pill: dept/office manager modified this draft cell — diagonal split */
.shift-pill.hybrid-pill {
  background: linear-gradient(135deg, var(--shift-color, #7a8fa8) 52%, #b5c0d0 52%) !important;
  border: 1.5px solid rgba(0,0,0,0.18) !important;
  outline: 2px solid rgba(255,255,255,0.55);
  outline-offset: -3px;
}
.publish-no-changes-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-muted); cursor: pointer;
}

/* ═══ CARD GRID ═══ */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.divisions-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 20px; }
.card {
  background: var(--bg-card); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 18px;
  box-shadow: var(--shadow);
}
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.card-title { font-weight: 700; font-size: 15px; }
.card-actions { display: flex; gap: 6px; }
.color-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; margin-right: 6px; }

/* ═══ DATA TABLE ═══ */
.data-table-wrapper { overflow-x: auto; }
.data-table {
  width: 100%; border-collapse: collapse;
  background: var(--bg-card); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.data-table th {
  background: var(--primary); color: #fff;
  text-align: left; padding: 10px 14px; font-size: 13px; font-weight: 700;
}
.data-table td {
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  font-size: 13px; vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #f7f3ec; }
.td-actions { display: flex; gap: 6px; }

/* ── USUARIOS PANEL ── */
.users-filter-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.users-total-count {
  font-size: 12px; color: var(--text-muted); font-weight: 500;
}
.users-role-section {
  margin-bottom: 10px;
  border: 1.5px solid var(--border); border-radius: 10px; overflow: hidden;
}
.users-role-header {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; background: var(--bg);
  cursor: pointer; user-select: none;
}
.users-role-header:hover { background: #f0f4f8; }
.users-role-chevron {
  font-size: 10px; color: var(--text-muted); width: 12px; text-align: center;
}
.users-role-count {
  font-size: 12px; font-weight: 700; color: var(--text-muted);
  background: var(--border); border-radius: 20px; padding: 1px 8px;
}
.users-unassigned-badge {
  font-size: 11px; font-weight: 600;
  background: #fee2e2; color: #991b1b;
  border-radius: 20px; padding: 1px 8px; margin-left: auto;
}
.users-office-cell {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px;
}
.users-office-dot {
  width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0;
}
.users-no-office {
  font-size: 12px; color: #b91c1c; font-style: italic;
}
.users-mgmt-cell {
  color: #5b3ea8; font-size: 12px; font-style: italic;
}
.users-managed-flat-label {
  color: #5b3ea8;
}
.users-div-section {
  border-top: 1px solid var(--border);
}
.users-div-header {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px 8px 28px; background: var(--bg-card);
  cursor: pointer; user-select: none;
}
.users-div-header:hover { background: #f0f4f8; }
.users-div-name {
  font-size: 13px; font-weight: 600; flex: 1;
}
.users-unassigned-flat {
  border-top: 1px dashed var(--border);
}
.users-unassigned-flat-label {
  display: block; font-size: 11px; font-weight: 600;
  color: #b91c1c; padding: 6px 14px 4px 28px;
  background: #fff5f5;
}
.users-inner-table {
  margin: 0; border-radius: 0; box-shadow: none;
}

/* ═══ MODAL ═══ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.modal-box {
  background: var(--bg-card); border-radius: 12px;
  width: 100%; max-width: 520px;
  box-shadow: var(--shadow-md);
  max-height: 90vh; display: flex; flex-direction: column;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 1rem; font-weight: 700; }
.modal-close {
  background: none; border: none; font-size: 22px;
  cursor: pointer; color: var(--text-muted); line-height: 1;
}
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex; gap: 8px; justify-content: flex-end;
}

/* ═══ FORM ELEMENTS (inside modal) ═══ */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 13px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 9px 12px;
  border: 1.5px solid var(--border); border-radius: var(--radius);
  font-size: 13px; background: var(--bg-card);
}
.form-group input:focus, .form-group select:focus { outline: none; border-color: var(--primary); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ═══ MANAGER MULTI-CHECKBOX ═══ */
.mgr-checkbox-list {
  border: 1.5px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  max-height: 180px;
  overflow-y: auto;
  background: #fafcff;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mgr-checkbox-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 2px;
  cursor: pointer;
  border-radius: 4px;
  font-size: 13px;
}
.mgr-checkbox-item:hover { background: #eef4ff; }
.mgr-checkbox-item input[type=checkbox] { accent-color: var(--primary); width: 15px; height: 15px; cursor: pointer; }

/* ═══ BADGE ROLES ═══ */
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 20px;
  font-size: 11px; font-weight: 700;
}
.badge-admin    { background: #fad5d5; color: var(--accent-red); }
.badge-manager  { background: #fff3cc; color: #7a5a00; }
.badge-hr       { background: #e0f0e8; color: var(--success); }
.badge-owner    { background: #ede8f8; color: #5b3ea8; }
.badge-user     { background: #d4e6f7; color: var(--primary); }
.badge-viewer   { background: #e8edf2; color: var(--secondary); }

/* ═══ MISC ═══ */
.hint-text { color: var(--text-muted); font-size: 13px; padding: 24px 0; }
.empty-state { text-align: center; padding: 40px; color: var(--text-muted); }
.empty-state .empty-icon { font-size: 2.5rem; margin-bottom: 10px; line-height: 1; }

/* ═══ GENERATE WEEKS MODAL ═══ */
.week-preview {
  background: var(--bg); border-radius: 8px; padding: 12px;
  font-size: 12px; margin-top: 8px;
}

/* ═══ SHIFT PICKER (inline en celda) ═══ */
.shift-picker-dropdown {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  min-width: 160px;
  max-width: 480px;
  padding: 6px 0;
}
.shift-picker-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; cursor: pointer;
  font-size: 13px; font-weight: 600;
  transition: background .12s;
}
.shift-picker-item:hover { background: var(--bg); }
.shift-picker-item .sp-dot {
  width: 10px; height: 10px; border-radius: 50%;
}
.libre-item { color: var(--text-muted); }
.shift-picker-columns {
  display: flex; gap: 0;
}
.shift-picker-col {
  flex: 1; border-right: 1px solid var(--border);
  padding-bottom: 4px;
}
.shift-picker-col:last-child { border-right: none; }
.shift-picker-col-special { background: #f8f4ff; }
.picker-col-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text-muted);
  padding: 6px 14px 4px;
}

/* Responsive tweaks */
/* ═══ MOBILE NAV (hamburger + drawer) — base styles (hidden on desktop) ═══ */
.btn-hamburger {
  display: none;                /* shown only on phones via the media query */
  align-items: center; justify-content: center;
  background: transparent; border: none; color: var(--text, #1a2733);
  padding: 6px; margin-right: 4px; cursor: pointer; border-radius: 8px;
}
.btn-hamburger:active { background: rgba(0,0,0,0.06); }
.sidebar-backdrop { display: none; }

/* ═══ INDIVIDUAL VIEW — mobile week strip (hidden on desktop) ═══ */
.individual-week-strip { display: none; gap: 4px; margin-bottom: 14px; }
.iws-day {
  flex: 1 1 0; min-width: 0;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 7px 2px; border: 1.5px solid var(--border); border-radius: 10px;
  background: var(--bg-card); color: var(--text, #1a2733); cursor: pointer;
}
.iws-day.today { border-color: var(--primary); }
.iws-day.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.iws-abbr { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; }
.iws-date { font-size: 14px; font-weight: 700; line-height: 1; }
.iws-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted); }
.iws-dot[data-empty] { background: transparent; }
.iws-day.active .iws-dot { box-shadow: 0 0 0 1.5px rgba(255,255,255,.7); }

/* ════════════════════════ PHONE LAYOUT (≤ 640px) ════════════════════════ */
@media (max-width: 640px) {
  /* Navbar */
  .btn-hamburger { display: inline-flex; }
  .navbar { padding: 0 10px; }
  .navbar-title { font-size: 14px; }
  .nav-user { display: none; }              /* save room; role badge stays */

  /* Sidebar → off-canvas drawer */
  .sidebar {
    display: block; position: fixed; top: 0; left: 0; bottom: 0; z-index: 1000;
    width: 80%; max-width: 300px; transform: translateX(-100%);
    transition: transform .25s ease; overflow-y: auto;
    box-shadow: 0 0 30px rgba(0,0,0,.35);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar.hidden { display: none; }        /* stay hidden until logged in */
  .main-content.with-sidebar { margin-left: 0; }
  .sidebar-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 999;
  }
  .sidebar-backdrop.show { display: block; }

  /* Content spacing */
  .main-content { padding: 14px 12px; }
  .view-header { flex-direction: column; align-items: stretch; gap: 8px; }
  .view-header h2 { font-size: 18px; }
  .header-actions { flex-wrap: wrap; gap: 8px; }
  .header-actions .select-ctrl,
  .header-actions .btn,
  .header-actions input[type="search"] { width: 100%; }
  .form-row { grid-template-columns: 1fr; }

  /* Wide tables fall back to horizontal scroll */
  .table-wrapper, .data-table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .user-scope-tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }

  /* Schedule header: week selector must fit the screen (was clipped — the label
     had a fixed 200px min-width and the row couldn't shrink) */
  .schedule-header-left { flex-shrink: 1; width: 100%; gap: 8px; }
  .week-nav { width: 100%; justify-content: space-between; gap: 6px; }
  .week-label { min-width: 0; flex: 1 1 auto; font-size: 12px; padding: 6px 6px; line-height: 1.25; }
  #btn-prev-week, #btn-next-week { flex: 0 0 auto; white-space: nowrap; padding: 6px 9px; }
  .schedule-header-right { width: 100%; }
  .schedule-actions { align-items: stretch; width: 100%; }
  .sched-actions-row { flex-wrap: wrap; }
  .sched-actions-row .select-ctrl, .sched-actions-row .btn { flex: 1 1 auto; }
  .sched-actions-subrow { justify-content: flex-start; }

  /* Horario (standard user): today-focused — week strip + one day card */
  .individual-week-strip { display: flex; }
  .individual-days-grid { display: block; grid-template-columns: none; }
  .individual-days-grid .individual-day-card { display: none; }
  .individual-days-grid .individual-day-card.is-active-day {
    display: flex; min-height: auto; padding: 18px 16px; gap: 10px;
  }
  .individual-day-card.is-active-day .idc-day-name { font-size: 13px; }
  .individual-day-card.is-active-day .idc-shift-name { font-size: 13px; }
  .individual-day-card.is-active-day .idc-shift-time { font-size: 15px; }

  /* Notificaciones: stack the tree over the cards */
  .notif-split { flex-direction: column; }
  .notif-folder-panel { width: 100%; max-width: none; max-height: 240px; }
  .notif-main-panel { width: 100%; }

  /* Mi bandeja / Mi cuenta / Aprobaciones: single column */
  #account-content, #inbox-content, #approvals-content { width: 100%; }
  #account-content .form-row { grid-template-columns: 1fr; }

  /* Modals near full-screen */
  .modal-box, .modal-box--wide { width: 94vw; max-width: 94vw; }
}

/* ═══ NOTIFICACIÓN BADGE ═══ */
.notif-badge {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700;
  min-width: 18px; height: 18px; padding: 0 4px;
  border-radius: 10px; margin-left: 4px;
}

/* ═══ DRAFT INDICATOR ═══ */
.draft-indicator {
  display: inline-flex; align-items: center; gap: 4px;
  background: #fff8d6; color: #7a5a00;
  border: 1.5px solid var(--accent-yellow);
  padding: 5px 10px; border-radius: 6px;
  font-size: 12px; font-weight: 600;
}

/* ═══ PENDING CELL ═══ */
.shift-cell.has-pending {
  background: #fffbe6 !important;
  outline: 2px solid var(--accent-yellow);
  outline-offset: -2px;
}
.pending-indicator {
  font-size: 11px; margin-left: 3px;
  cursor: help;
}

/* ═══ MANAGER EDIT (celda) ═══ */
.shift-cell.manager-edit:hover::after { background: rgba(0,0,0,0.1); }
.picker-header {
  padding: 6px 14px 8px;
  font-size: 11px; font-weight: 700;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

/* ═══ USER SHIFT MENU ═══ */
.user-shift-menu {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  min-width: 200px;
  padding: 6px 0;
}
.shift-cell.user-cell { cursor: pointer; }

/* ═══ NO SCHEDULE NOTICE ═══ */
.no-schedule-notice {
  margin-top: 12px; padding: 12px 16px;
  background: #fff8d6; border-radius: 8px;
  border-left: 4px solid var(--accent-yellow);
  font-size: 13px; color: #7a5a00;
}

/* ═══ APPROVALS PANEL ═══ */
.approval-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.approval-card.approval-type-edit   { border-left: 4px solid var(--warning); }
.approval-card.approval-type-swap   { border-left: 4px solid var(--info); }
.approval-card.approval-type-review { border-left: 4px solid var(--secondary); }

.approval-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px; flex-wrap: wrap; gap: 6px;
}
.approval-type-badge {
  font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 20px;
  background: var(--bg); color: var(--text);
}
.approval-meta { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }

.approval-detail {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; margin-bottom: 10px; flex-wrap: wrap;
}
.approval-emp { font-weight: 700; }
.approval-note {
  font-size: 12px; color: var(--text-muted);
  font-style: italic; margin-top: 4px;
  background: var(--bg); padding: 6px 10px; border-radius: 6px; width: 100%;
}
.approval-footer {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px;
  padding-top: 10px; border-top: 1px solid var(--border);
}
.approval-who { font-size: 12px; color: var(--text-muted); }
.approval-actions { display: flex; gap: 6px; }

/* ── SWAP CONTEXT (approval card) ── */
.swap-context {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.swap-ctx-employee { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.swap-ctx-name { font-size: 12px; font-weight: 700; min-width: 130px; }
.swap-ctx-role { font-weight: 400; color: var(--text-muted); }
.swap-ctx-days { display: flex; gap: 6px; flex-wrap: wrap; }
.swap-ctx-cell {
  display: flex; flex-direction: column; align-items: center;
  gap: 3px; padding: 4px 8px; border-radius: 6px;
}
.swap-ctx-cell.swap-ctx-highlight {
  background: rgba(26,95,168,0.07);
  border: 1.5px solid var(--primary);
}
.swap-ctx-daylabel {
  font-size: 10px; font-weight: 600; color: var(--text-muted);
  text-align: center; white-space: nowrap;
}
.swap-ctx-highlight .swap-ctx-daylabel { color: var(--primary); }
.swap-ctx-weeklabel { font-size: 9px; font-weight: 400; }
.swap-ctx-warning {
  font-size: 11px; color: #7a4800;
  background: #fff8e6; border: 1px solid #f5c200;
  border-radius: 6px; padding: 5px 8px; line-height: 1.6;
}

/* ── STATISTICS TAB ── */
.stats-yearend-banner {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: #fff8e6; border: 1.5px solid var(--accent-yellow);
  border-radius: 10px; padding: 12px 16px; margin-bottom: 18px;
  font-size: 13px; color: #7a4800;
}
.stat-section {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.stat-office-card {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 10px; padding: 14px 16px;
}
.stat-office-title {
  font-size: 14px; font-weight: 700;
  margin-bottom: 10px; display: flex; align-items: center;
}
.stat-bar-row {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 5px;
}
.stat-bar-label {
  width: 44px; flex-shrink: 0;
  font-size: 12px; font-weight: 600; color: var(--text-muted);
  text-align: right;
}
.stat-bar-track {
  flex: 1; background: var(--border);
  border-radius: 4px; height: 20px; overflow: hidden;
}
.stat-bar {
  height: 100%; border-radius: 4px;
  display: flex; align-items: center; justify-content: flex-end;
  padding-right: 6px; min-width: 28px;
  transition: width 0.3s ease;
}
.stat-bar-count {
  font-size: 11px; font-weight: 700; color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.stat-special-tag {
  font-size: 11px; font-weight: 600;
  border: 1.5px solid; border-radius: 6px;
  padding: 2px 8px;
}

/* ═══ DIVISION CARDS ═══ */
.division-card { padding: 0; overflow: hidden; }
.division-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.division-card-header .card-title { font-size: 15px; font-weight: 700; flex: 1; }

.div-emp-list { padding: 6px 0; }
.div-empty-hint { font-size:12px; color:var(--text-muted); padding: 10px 16px; font-style: italic; }

.div-emp-row {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.div-emp-row:last-child { border-bottom: none; }
.div-emp-pos {
  width: 20px; text-align: right;
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  flex-shrink: 0;
}
.div-emp-name { flex: 1; font-weight: 600; }
.div-emp-actions { display: flex; gap: 3px; margin-left: auto; flex-shrink: 0; }

.btn-nav-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 5px; cursor: pointer; font-size: 12px;
  color: var(--text-muted); transition: background .12s;
}
.btn-nav-icon:hover:not(:disabled) { background: var(--border); color: var(--text); }
.btn-nav-icon:disabled { opacity: .3; cursor: not-allowed; }
.btn-nav-icon.danger:hover:not(:disabled) { background: #f5dada; color: var(--danger); border-color: var(--danger); }

/* Footer with two action buttons */
.div-card-footer {
  display: flex; gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
}
.div-add-btn, .div-sep-btn {
  flex: 1; text-align: center; font-size: 12px; justify-content: center;
}
.div-sep-btn { color: var(--text-muted); }

/* Placeholder (vacant slot) row in division panel */
.div-ph-row {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 16px;
  border-bottom: 1px solid var(--border);
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 6px,
    rgba(0,0,0,.03) 6px,
    rgba(0,0,0,.03) 12px
  );
}
.div-ph-label {
  flex: 1; font-size: 12px; font-style: italic;
  color: var(--text-muted); letter-spacing: .02em;
}
.div-ph-row .div-emp-actions { margin-left: auto; }
.div-ph-row:hover .div-drag-handle { opacity: 1; }
.div-ph-row.row-dragging { opacity: 0.35; }
.div-ph-row.drop-above { box-shadow: inset 0 2px 0 var(--primary); }
.div-ph-row.drop-below { box-shadow: inset 0 -2px 0 var(--primary); }

/* Separator row in division panel */
.div-sep-row {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 16px;
  border-bottom: 1px solid var(--border);
}
.div-sep-line {
  flex: 1;
  height: 2px;
  background: linear-gradient(to right, var(--primary-light), var(--border), var(--primary-light));
  border-radius: 1px;
}
.div-sep-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  letter-spacing: 0.4px;
}

/* ═══ EMPLOYEE LINK CELL ═══ */
.emp-link-cell { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.emp-username  { font-size: 11px; color: var(--text-muted); font-family: monospace; }
.emp-link-btn  { font-size: 12px; padding: 4px 10px; }
.btn-link-icon {
  background: none; border: none; cursor: pointer;
  font-size: 14px; padding: 2px 4px; border-radius: 4px;
  opacity: .7; transition: opacity .12s;
}
.btn-link-icon:hover { opacity: 1; }

/* ═══ SHIFT TYPE CARDS ═══ */
.shifts-list-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.shift-card {
  display: flex; flex-direction: row;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.shift-card-draggable { cursor: default; transition: box-shadow .15s; }
.shift-card-draggable:hover { box-shadow: var(--shadow-md); }
.shift-card-dragging  { opacity: 0.4; }
.shift-drop-above { box-shadow: 0 -3px 0 0 var(--primary); }
.shift-drop-below { box-shadow: 0 3px 0 0 var(--primary); }
.shift-drag-handle {
  display: flex; align-items: center; padding: 0 6px;
  color: var(--text-muted); font-size: 14px; cursor: grab;
  opacity: 0; transition: opacity .15s;
}
.shift-card-draggable:hover .shift-drag-handle { opacity: 1; }
.shift-section-divider {
  grid-column: 1 / -1;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-muted);
  padding: 10px 4px 4px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}
.shift-color-band { width: 8px; flex-shrink: 0; }
.shift-card-body  { flex: 1; padding: 14px 16px; }
.shift-card-top   { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.shift-card-name  { font-weight: 700; font-size: 14px; }
.shift-card-preview { display: flex; align-items: center; gap: 10px; }
.shift-card-time  { font-size: 12px; color: var(--text-muted); }

/* ═══ INBOX CARDS (bandeja de usuario) ═══ */
.inbox-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.inbox-card.incoming { border-left: 4px solid var(--info); }
.inbox-card.sent     { border-left: 4px solid var(--secondary); }
.inbox-card.sent.status-approved { border-left-color: var(--success); }
.inbox-card.sent.status-rejected { border-left-color: var(--danger); }
.inbox-card.sent.status-waiting  { border-left-color: var(--warning); }

.inbox-card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px; flex-wrap: wrap; gap: 6px;
}
.inbox-type-badge {
  font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 20px;
  background: var(--bg); color: var(--text);
}
.inbox-meta   { font-size: 12px; color: var(--text-muted); }
.inbox-detail { font-size: 13px; margin-bottom: 10px; line-height: 1.6; }
.inbox-footer {
  display: flex; gap: 6px;
  padding-top: 10px; border-top: 1px solid var(--border);
}


/* ═══ COVERAGE BADGES (in schedule day headers) ═══ */
.cov-row {
  display: flex; align-items: center; gap: 3px;
  margin-top: 4px; flex-wrap: wrap; justify-content: center;
}
.cov-badge {
  display: inline-flex; align-items: center;
  font-size: 9px; font-weight: 700;
  padding: 1px 5px; border-radius: 10px;
  white-space: nowrap; cursor: default;
}
.btn-cov-auto {
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.45);
  color: #fff; cursor: pointer;
  padding: 2px 5px;
  border-radius: 4px; line-height: 1;
  display: inline-flex; align-items: center;
  transition: background .12s;
}
.btn-cov-auto:hover { background: rgba(255,255,255,.35); }

/* ═══ SHIFT FLAG BADGES (on shift type cards) ═══ */
.shift-flag-badge {
  display: inline-block;
  font-size: 10px; font-weight: 700;
  padding: 1px 7px; border-radius: 10px;
  margin-left: 4px;
}
.shift-flag-badge.guard    { background: #d4e6f7; color: var(--primary); }
.shift-flag-badge.absence  { background: #f7e8e8; color: var(--accent-red); }
.shift-flag-badge.vacation { background: #ede9fe; color: #5b21b6; }

/* ═══ DIVISION GROUPS ═══ */
.division-group { margin-bottom: 28px; }
.division-group-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius) var(--radius) 0 0;
  user-select: none;
}
.div-collapse-arrow {
  font-size: 9px; color: rgba(255,255,255,.7);
  transition: transform .15s; flex-shrink: 0;
}
.div-collapse-arrow-group { font-size: 10px; }
.dept-header {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 9px 12px; cursor: pointer;
  border-radius: 6px 6px 0 0;
  user-select: none;
  transition: background .12s;
}
.dept-header:hover { background: #eef2f7; }
.dept-header .div-collapse-arrow { color: var(--text-muted); }
.dept-collapsed .dept-header { border-radius: 6px; }
.division-group-name { font-size: 1rem; font-weight: 700; color: #fff; }
.division-group-actions { display: flex; gap: 6px; align-items: center; }
.division-group-header .btn-outline-sm {
  background: rgba(255,255,255,.15);
  color: #fff;
  border-color: rgba(255,255,255,.4);
}
.division-group-header .btn-outline-sm:hover { background: rgba(255,255,255,.28); }
.division-group .divisions-grid {
  padding: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
}

/* ═══ COMPANY BUBBLES ═══ */
.company-bubble { margin-bottom: 36px; }
.company-bubble-header {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  padding: 14px 18px;
  background: linear-gradient(135deg, #0a2a50, #1a5fa8);
  color: #fff;
  border-radius: var(--radius) var(--radius) 0 0;
  cursor: pointer;
  user-select: none;
}
.company-bubble-body {
  padding: 16px;
  border: 2px solid #1a5fa8;
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  background: #f4f8ff;
}
.company-bubble-actions { display: flex; gap: 6px; align-items: center; }
.company-bubble-header .btn-outline-sm {
  background: rgba(255,255,255,.15);
  color: #fff;
  border-color: rgba(255,255,255,.4);
}
.company-bubble-header .btn-outline-sm:hover { background: rgba(255,255,255,.28); }
.company-cif-badge {
  font-size: 11px; background: rgba(255,255,255,.18); color: #fff;
  padding: 2px 8px; border-radius: 10px; font-weight: 600; letter-spacing: .5px;
}
.company-vac-badge {
  font-size: 11px; background: rgba(255,255,255,.13); color: rgba(255,255,255,.9);
  padding: 2px 8px; border-radius: 10px;
}
.company-bubble-body .division-group { margin-bottom: 16px; }
.company-bubble-body .division-group:last-child { margin-bottom: 0; }

/* ═══ VACATION ENVELOPE BUTTON (in schedule table) ═══ */
.btn-vac-envelope {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 1px 3px; margin-left: 4px;
  border: none; background: none; cursor: pointer;
  color: var(--primary); opacity: 0.65; vertical-align: middle;
  border-radius: 3px; transition: opacity .12s, background .12s;
  line-height: 1;
}
.btn-vac-envelope:hover { opacity: 1; background: #dbeafe; }

/* ═══ VACATION SLIP CARD (inbox) ═══ */
.vac-slip-card {
  border: 2px solid #1a5fa8 !important;
  background: #fff;
}
.vac-slip-letterhead {
  display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  padding: 14px 16px 10px;
  background: linear-gradient(135deg, #0a2a50, #1a5fa8);
  border-radius: 6px 6px 0 0;
  color: #fff;
  margin: -1px -1px 0 -1px;
}
.vac-slip-company-name { font-size: 1.05rem; font-weight: 800; letter-spacing: .3px; }
.vac-slip-cif { font-size: 11px; color: rgba(255,255,255,.75); margin-top: 2px; }
.vac-slip-title {
  font-size: 11px; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; color: rgba(255,255,255,.85);
  align-self: flex-end; text-align: right;
}
.vac-slip-table {
  width: 100%; border-collapse: collapse;
  font-size: 13px; margin: 12px 0 10px;
}
.vac-slip-table td {
  padding: 5px 10px; border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.vac-slip-table td:first-child {
  font-weight: 600; color: var(--text-muted); width: 45%; font-size: 12px;
}
.vac-slip-sign-row {
  display: flex; gap: 12px; margin: 12px 0 4px;
}
.vac-slip-sig-box {
  flex: 1; border: 1px dashed var(--border); border-radius: 6px;
  padding: 10px 12px; text-align: center; background: #f8fafc;
}
.vac-slip-sig-label {
  font-size: 11px; color: var(--text-muted); font-weight: 600;
  text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px;
}
.vac-slip-sig-name { font-size: 13px; font-weight: 600; color: var(--primary); }
.vac-slip-signed {
  text-align: center; padding: 10px; background: #e6f7ee;
  border-radius: 6px; color: var(--success); font-weight: 600; font-size: 13px;
  margin: 10px 0 4px;
}
.vac-slip-preview {
  font-size: 13px;
}
.vac-slip-preview .vac-slip-header-preview {
  padding: 12px 14px; background: linear-gradient(135deg, #0a2a50, #1a5fa8);
  border-radius: 6px; color: #fff; margin-bottom: 12px;
}
.vac-slip-preview .vac-slip-table { margin: 0; }
.vac-slip-preview .vac-slip-table td { padding: 4px 8px; font-size: 12px; }

/* ═══ DELETE WEEKS FAB ═══ */
/* ═══ DELETE WEEKS FAB GROUP ═══ */
.delete-weeks-fab {
  display: flex; gap: 10px; align-items: center; justify-content: flex-end;
  margin-top: 24px; padding-right: 4px;
}
.fab-icon-btn {
  width: 44px; height: 44px;
  padding: 0; font-size: 18px;
  border-radius: 50%;
  box-shadow: var(--shadow-md);
  display: flex; align-items: center; justify-content: center;
}
/* ═══ EMPLOYEE SEARCH LIST (Organigrama assign modal) ═══ */
.emp-search-list {
  max-height: 260px; overflow-y: auto;
  border: 1px solid var(--border); border-radius: 6px;
  margin-top: 4px;
}
.emp-search-item {
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px 14px; cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background .12s;
}
.emp-search-item:last-child { border-bottom: none; }
.emp-search-item:hover { background: #f0f5fa; }
.emp-search-name { font-weight: 600; font-size: 13px; }
.emp-search-meta { font-size: 11px; color: var(--text-muted); }
.emp-search-empty { font-size: 12px; color: var(--text-muted); padding: 12px 14px; font-style: italic; margin: 0; }
.emp-search-item--selected { background: #e8f0f8; border-left: 3px solid var(--primary); }
.emp-selected-tag {
  display: inline-block; padding: 5px 14px;
  background: #e8f0f8; border: 1px solid var(--border); border-radius: 20px;
  font-weight: 600; font-size: 13px; color: var(--primary);
}
.form-static-value { margin: 0; font-size: 14px; font-weight: 500; padding: 5px 0; }

.btn-orange           { background: #e67e00; color: #fff; }
.btn-orange:hover:not(:disabled) { background: #c96e00; }
.btn-yellow           { background: #d4a800; color: #fff; }
.btn-yellow:hover:not(:disabled) { background: #b89000; }

/* Tooltip */
.fab-tooltip-wrap { position: relative; display: flex; }
.fab-tooltip {
  position: absolute;
  bottom: calc(100% + 8px); right: 0;
  background: #1a2535; color: #fff;
  font-size: 12px; line-height: 1.6;
  padding: 10px 14px; border-radius: 6px;
  white-space: normal; width: 340px;
  box-shadow: var(--shadow-md);
  pointer-events: none;
  opacity: 0; transition: opacity .15s;
  z-index: 51;
}
.fab-tooltip-wrap:hover .fab-tooltip { opacity: 1; }

/* ═══ CHECKBOX LABEL (in modal forms) ═══ */
.checkbox-label {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; font-weight: 600; font-size: 13px;
  margin-bottom: 0;
}
.checkbox-label input[type="checkbox"] {
  width: 16px; height: 16px; flex-shrink: 0; cursor: pointer;
}

/* ═══════════════════════════════════════════
   NOTIFICACIONES
═══════════════════════════════════════════ */
.notif-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  border-left: 4px solid var(--border);
  margin-bottom: 12px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
  transition: border-color .15s;
}
.notif-unread {
  border-left-color: var(--primary);
  background: #f0f6ff;
}
.notif-read {
  border-left-color: var(--border);
  opacity: .85;
}
.notif-card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px; gap: 8px; flex-wrap: wrap;
}
.notif-title {
  font-weight: 700; font-size: 14px; flex: 1;
}
.notif-actions {
  display: flex; gap: 6px; align-items: center; flex-shrink: 0;
}
.notif-body {
  font-size: 13px; color: var(--text); margin-bottom: 10px; white-space: pre-wrap;
}
.notif-footer {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 6px;
}
.notif-meta {
  font-size: 11px; color: var(--text-muted);
}
.notif-target-badge {
  font-size: 11px; background: var(--primary-light); color: var(--primary);
  padding: 2px 8px; border-radius: 20px; font-weight: 600;
}
.notif-read-indicator {
  font-size: 11px; color: var(--success); font-weight: 600;
}

/* ─── NOTIFICACIONES: SPLIT PANEL ─── */
.notif-split {
  display: flex;
  gap: 0;
  min-height: 520px;
  height: calc(100vh - 190px);
}
.notif-folder-panel {
  width: 250px;
  min-width: 210px;
  flex-shrink: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px 0 0 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.notif-main-panel {
  flex: 1;
  min-width: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: none;
  border-radius: 0 10px 10px 0;
  overflow-y: auto;
  padding: 20px;
}
.notif-folder-header {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  position: sticky;
  top: 0;
  background: var(--bg-card);
  z-index: 1;
  min-height: 36px;
}
.notif-folder-item { border-bottom: 1px solid var(--border); }
.notif-folder-item:last-child { border-bottom: none; }
.notif-folder-title {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
  font-weight: 600;
  font-size: 13px;
  background: #f8fafc;
  user-select: none;
}
.notif-folder-title .folder-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.notif-folder-actions { display: none; gap: 2px; flex-shrink: 0; }
.notif-folder-title:hover .notif-folder-actions { display: flex; }
.notif-folder-arrow {
  font-size: 9px; color: var(--text-muted); flex-shrink: 0; width: 12px; text-align: center;
}
.notif-folder-handle {
  cursor: grab; color: var(--text-muted); font-size: 14px; padding: 0 2px;
  opacity: 0; transition: opacity .15s; flex-shrink: 0;
}
.notif-folder-title:hover .notif-folder-handle { opacity: 1; }
.notif-folder-handle:active { cursor: grabbing; }
.notif-folder-item.folder-dragging { opacity: 0.35; }
.notif-folder-item.notif-drop-above { box-shadow: inset 0 2px 0 var(--primary); }
.notif-folder-item.notif-drop-below { box-shadow: inset 0 -2px 0 var(--primary); }
.notif-file-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px 8px 24px;
  font-size: 13px;
  cursor: pointer;
  transition: background .1s;
  border-bottom: 1px solid #f0f4f8;
  user-select: none;
}
.notif-file-item:last-child { border-bottom: none; }
.notif-file-item:hover { background: #eef4ff; }
.notif-file-item.selected { background: #dbeafe; color: var(--primary); font-weight: 600; }
.notif-file-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif-file-actions { display: none; gap: 2px; flex-shrink: 0; }
.notif-file-item:hover .notif-file-actions,
.notif-file-item.selected .notif-file-actions { display: flex; }
.notif-add-file-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px 7px 24px;
  font-size: 12px;
  color: var(--primary);
  cursor: pointer;
  opacity: .7;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
}
.notif-add-file-btn:hover { opacity: 1; background: #f0f6ff; }
.notif-folder-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  background: var(--primary);
  color: #fff;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}
.notif-vis-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 10px;
  flex-shrink: 0;
  margin-left: 3px;
  white-space: nowrap;
  cursor: default;
}
.notif-vis-group    { background: #dbeafe; color: #1e40af; }
.notif-vis-dept     { background: #fef9c3; color: #854d0e; }
.notif-vis-division { background: #dcfce7; color: #166534; }

.notif-panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.notif-panel-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: var(--text-muted);
  font-size: 14px;
  gap: 8px;
  text-align: center;
}
.notif-hint-icon { line-height: 1; }

/* ═══════════════════════════════════════════
   HISTORIAL
═══════════════════════════════════════════ */
.history-list {
  display: flex; flex-direction: column; gap: 6px;
}
.history-entry {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  box-shadow: var(--shadow);
}
.history-entry-left {
  display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0;
}
.history-entry-desc {
  font-size: 13px; color: var(--text); word-break: break-word;
}
.history-entry-right {
  display: flex; flex-direction: column; align-items: flex-end; gap: 2px;
  flex-shrink: 0;
}
.history-entry-actor {
  font-size: 11px; color: var(--text-muted); font-weight: 600;
}
.history-entry-time {
  font-size: 11px; color: var(--text-muted);
}
.history-type-badge {
  font-size: 10px; font-weight: 700; padding: 2px 8px;
  border-radius: 20px; white-space: nowrap; flex-shrink: 0;
  text-transform: uppercase; letter-spacing: .5px;
}
.history-type-edit     { background: #fef3c7; color: #92400e; }
.history-type-publish  { background: #d1fae5; color: #065f46; }
.history-type-pending  { background: #dbeafe; color: #1e40af; }
.history-type-approved { background: #d1fae5; color: #065f46; }
.history-type-rejected { background: #fee2e2; color: #991b1b; }
.history-type-swap     { background: #f3f4f6; color: #374151; }
.history-type-schedule { background: #ede9fe; color: #5b21b6; }
.history-type-notif    { background: #fef9c3; color: #854d0e; }
.history-meta {
  font-size: 12px; color: var(--text-muted);
  padding: 0 2px 8px; font-weight: 500;
}
.hist-delete-locked {
  opacity: 0.5; cursor: not-allowed;
}

/* ═══════════════════════════════════════════
   MI CUENTA
═══════════════════════════════════════════ */
.account-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  max-width: 480px;
  box-shadow: var(--shadow);
}
.account-info {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 4px;
}
.account-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: #f4f7fb;
}
.account-avatar-wrap {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}
.account-avatar-img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}
.btn-avatar-edit {
  position: absolute;
  bottom: -4px;
  right: -6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  cursor: pointer;
  line-height: 1;
  box-shadow: var(--shadow);
}
.btn-avatar-edit:hover { background: var(--bg); }
.account-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.account-sep {
  border: none;
  border-top: 1px solid var(--border);
  margin: 18px 0;
}
.account-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 14px;
}
.account-form { display: flex; flex-direction: column; gap: 2px; }
.acc-msg {
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 4px;
}
.acc-msg.hidden { display: none; }
.acc-msg-ok    { background: #d1fae5; color: #065f46; }
.acc-msg-error { background: #fee2e2; color: #991b1b; }
.acc-field-note { font-size: 11px; color: var(--text-muted); font-weight: 400; }

/* ── Shift color customization grid ── */
.shift-color-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.shift-color-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
}
.shift-color-name {
  flex: 1;
  font-size: 13px;
  color: var(--text);
}
.shift-color-input {
  width: 36px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px;
  cursor: pointer;
  background: none;
}
.btn-reset-color {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-muted);
  padding: 2px 6px;
  line-height: 1.4;
}
.btn-reset-color:hover { color: var(--accent-red); border-color: var(--accent-red); }
.btn-reset-color.hidden { display: none; }

/* ═══════════════════════════════════════════
   INBOX — MENSAJES DEL SISTEMA
═══════════════════════════════════════════ */
.inbox-card.system-msg {
  border-left: 4px solid var(--success);
}
.inbox-card.system-msg.unread {
  background: #f0fdf4;
}
.inbox-reply-area { margin-top: 10px; }
.inbox-reply-area textarea {
  width: 100%; padding: 8px; font-size: 12px;
  border: 1.5px solid var(--border); border-radius: 8px;
  resize: vertical; box-sizing: border-box; font-family: inherit;
}
.inbox-thread-reply {
  margin-top: 8px; padding: 8px 12px;
  background: var(--bg-alt, #f8f9fa); border-radius: 8px;
  font-size: 12px; border-left: 3px solid var(--primary);
}

/* ═══════════════════════════════════════════
   WEEK PICKER BUTTON
═══════════════════════════════════════════ */
.btn-week-pick {
  cursor: pointer; background: none; border: 1px solid var(--border);
  border-radius: 6px; padding: 4px 10px; font-size: 13px; font-weight: 600;
  color: var(--text); font-family: inherit;
}
.btn-week-pick:hover { background: var(--primary-light); border-color: var(--primary); }

/* ═══════════════════════════════════════════
   MANAGER BAR
═══════════════════════════════════════════ */
.manager-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 0; border-bottom: 1px solid var(--border); margin-bottom: 12px;
}
.manager-chip {
  display: flex; align-items: center; gap: 6px; background: var(--primary-light);
  border-radius: 20px; padding: 4px 12px; font-size: 12px; font-weight: 600;
  color: var(--primary);
}
.manager-chip button {
  background: none; border: none; cursor: pointer; font-size: 12px;
  color: var(--primary); padding: 0 4px; font-weight: 700;
}

/* ═══════════════════════════════════════════
   MULTI-OFFICE SECTION HEADERS
═══════════════════════════════════════════ */
.office-section { margin-bottom: 28px; }
.office-section-collapsed { margin-bottom: 8px; }
.dept-bubble-body > .office-section { margin-bottom: 16px; }
.dept-bubble-body > .office-section-collapsed { margin-bottom: 6px; }
.office-section-header {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
  padding: 6px 10px; background: var(--bg); border-radius: 6px;
  border-left: 4px solid var(--border);
}
.office-section-title { font-weight: 700; font-size: 13px; }
/* Group-level bubble — outermost container */
.group-bubble {
  border: 2px solid #93b8d8;
  border-radius: 12px;
  background: #eaf2fb;
  padding: 0 10px 12px;
}
.group-bubble-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 9px 4px 7px;
}
.group-bubble-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--primary);
  letter-spacing: 0.2px;
}
.group-bubble-body {
  display: flex; flex-direction: column; gap: 10px;
}
/* Shared manager tag used in group and dept bubble headers */
.bubble-mgr-tag {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}
/* Dept bubbles inside a group bubble: tighter outer margin */
.group-bubble-body .dept-bubble { margin: 0; }
/* Dept section header gets space-between so manager tag goes to the right */
.dept-section-header {
  justify-content: space-between;
}

.dept-bubble {
  border: 1.5px solid #b8cfe8;
  border-radius: 10px;
  background: #f4f8fd;
  margin: 16px 0 20px;
  padding: 0 10px 10px;
}
.dept-bubble-collapsed {
  padding-bottom: 0;
}
.dept-bubble-body {
  margin-top: 4px;
}
.dept-section-header {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 4px 6px;
  background: transparent;
  border-left: none;
  border-radius: 0;
}
.dept-section-title { font-weight: 700; font-size: 13px; color: var(--primary); letter-spacing: 0.2px; }
.dept-section-header .sched-collapse-arrow { color: var(--primary); }
.sched-collapsible {
  cursor: pointer; user-select: none; transition: background .12s;
}
.sched-collapsible:hover { background: #eef2f7; }
.dept-section-header.sched-collapsible:hover { background: #e6f0fb; border-radius: 6px; }
.sched-collapse-arrow {
  font-size: 9px; color: var(--text-muted); flex-shrink: 0;
}

/* ═══════════════════════════════════════════
   USER SCOPE TABS & OFFICE BANNER
═══════════════════════════════════════════ */
.user-scope-tabs {
  display: flex; gap: 4px; flex-wrap: wrap;
}
.scope-tab {
  padding: 6px 14px; border-radius: 20px;
  font-size: 12px; font-weight: 600;
  background: var(--bg); color: var(--text-muted);
  border: 1.5px solid var(--border);
  cursor: pointer; transition: background .15s, color .15s, border-color .15s;
}
.scope-tab:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }
.scope-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.user-office-banner {
  font-size: 13px; font-weight: 700;
  color: var(--primary); padding: 6px 14px;
  background: var(--primary-light);
  border-radius: 6px; margin-bottom: 10px;
  border-left: 4px solid var(--primary);
}

/* ═══════════════════════════════════════════
   CROSS-OFFICE BADGE (in schedule cells)
═══════════════════════════════════════════ */
.cross-office-badge {
  position: absolute;
  top: 2px; right: 2px;
  font-size: 8px; font-weight: 700;
  padding: 1px 3px; border-radius: 3px;
  border: 1px solid;
  background: rgba(255,255,255,.9);
  line-height: 1.3;
  max-width: 38px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; pointer-events: none;
}

/* Manager bar chip label */
.manager-chip .chip-label {
  font-size: 10px; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase;
  letter-spacing: .3px; margin-right: 4px;
}
.manager-chip.officer-chip {
  background: #fff8e7; color: #7a5a00;
  border: 1px solid var(--accent-yellow);
}
.manager-chip.oncall-chip {
  background: #f0fdf4; color: #065f46;
  border: 1px solid #6ee7b7;
}
.mgr-phone-btn {
  background: none; border: none; cursor: pointer;
  font-size: 13px; padding: 0 2px; line-height: 1;
  vertical-align: middle;
  transition: transform .15s;
}
.mgr-phone-btn:hover { transform: scale(1.2); }
.chip-in-shift {
  color: #22c55e; font-size: 8px; margin-right: 2px;
  vertical-align: middle;
}
.mgr-oncall-section {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  border-left: 3px solid #6ee7b7; padding-left: 10px;
  margin-left: 4px;
}
.oncall-section-label {
  font-size: 11px; font-weight: 700; color: #065f46;
  text-transform: uppercase; letter-spacing: .3px;
  margin-right: 4px; white-space: nowrap;
}

/* ── Office type badges in division card ── */
.mgr-office-badge, .enc-office-badge, .one-person-badge {
  font-size: 13px; margin-left: 4px; vertical-align: middle;
  filter: drop-shadow(0 0 1px rgba(0,0,0,.2));
}
.hidden-office-badge {
  display: inline-block; margin-left: 6px; padding: 1px 6px;
  font-size: 10px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase;
  background: #f3e8ff; color: #7c3aed; border: 1px solid #c4b5fd;
  border-radius: 4px; vertical-align: middle;
}
.division-card--hidden {
  opacity: .75;
}
.division-card--hidden .division-card-header {
  background: repeating-linear-gradient(
    135deg,
    transparent,
    transparent 6px,
    rgba(124,58,237,.05) 6px,
    rgba(124,58,237,.05) 12px
  );
}
.btn-hide-toggle { color: var(--text-muted); }
.btn-hide-toggle.btn-hide-active { color: #7c3aed; background: #f3e8ff; border-color: #c4b5fd; }

/* ── Cycle phase badge in schedule table header ── */
.cycle-phase-badge {
  display: inline-block;
  font-size: 11px; font-weight: 700; letter-spacing: .3px;
  background: #e0edff; color: var(--primary);
  border: 1px solid #b3d0f5; border-radius: 10px;
  padding: 1px 7px; margin-left: 6px; vertical-align: middle;
  white-space: nowrap;
}

/* ── One-person ghost rows (non-active cycle slots) ── */
.one-person-ghost-row td {
  opacity: .55;
}
.one-person-ghost-row .td-name {
  color: var(--text-muted);
  font-style: italic;
  font-size: 12px;
}

/* ── SVG eye button for visibility config ── */
.btn-eye {
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--primary); opacity: .75;
}
.btn-eye:hover { opacity: 1; color: var(--primary); }
.btn-eye svg { pointer-events: none; }

/* ── Encargados chip in manager bar ── */
.manager-chip.enc-chip {
  background: #f0f4ff; color: #1e3a8a;
  border: 1px solid #93c5fd;
}
.enc-section-label {
  color: #1e40af;
}

/* ── Visibility config modal checkboxes ── */
.vis-check-list {
  max-height: 320px; overflow-y: auto;
  border: 1px solid var(--border); border-radius: 6px; padding: 10px;
}
.vis-group-header {
  font-size: 11px; font-weight: 700; color: var(--primary);
  text-transform: uppercase; letter-spacing: .4px;
  padding: 6px 0 4px; border-bottom: 1px solid var(--border); margin-bottom: 4px;
}
.vis-check-item {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 4px; font-size: 13px; cursor: pointer; border-radius: 4px;
}
.vis-check-item:hover { background: var(--bg); }

/* ═══════════════════════════════════════════
   OFFICER BADGE & BUTTON
═══════════════════════════════════════════ */
.officer-badge {
  font-size: 12px; color: var(--accent-yellow);
  filter: drop-shadow(0 0 1px rgba(0,0,0,.35));
  margin-left: 2px; vertical-align: middle;
}
.btn-nav-icon.officer-active {
  background: var(--accent-yellow); color: #7a5a00;
  border-color: #d4a800;
}
.btn-nav-icon.officer-active:hover:not(:disabled) {
  background: #e6b800; border-color: #c9a000;
}

/* ═══════════════════════════════════════════
   ROW DRAG HANDLE & DROP INDICATORS
═══════════════════════════════════════════ */
.div-drag-handle {
  cursor: grab; color: var(--text-muted);
  font-size: 15px; padding: 0 4px;
  user-select: none; flex-shrink: 0;
  opacity: 0; transition: opacity .15s;
}
.div-emp-row:hover .div-drag-handle,
.div-sep-row:hover .div-drag-handle { opacity: 1; }
.div-drag-handle:active { cursor: grabbing; }

.div-emp-row.row-dragging,
.div-sep-row.row-dragging { opacity: 0.35; }

.div-emp-row.drop-above,
.div-sep-row.drop-above { box-shadow: inset 0 2px 0 var(--primary); }
.div-emp-row.drop-below,
.div-sep-row.drop-below { box-shadow: inset 0 -2px 0 var(--primary); }

/* ═══════════════════════════════════════════
   CARD DRAG HANDLE & REORDER INDICATORS
═══════════════════════════════════════════ */
.card-drag-handle {
  cursor: grab; color: var(--text-muted);
  font-size: 15px; padding: 0 6px 0 0;
  user-select: none; flex-shrink: 0;
  opacity: 0; transition: opacity .15s;
}
.division-card-header:hover .card-drag-handle { opacity: 1; }
.card-drag-handle:active { cursor: grabbing; }

.division-card.card-reordering { opacity: 0.35; }
.division-card.card-drop-left  { box-shadow: inset 3px 0 0 var(--primary), var(--shadow); }
.division-card.card-drop-right { box-shadow: inset -3px 0 0 var(--primary), var(--shadow); }

/* ═══════════════════════════════════════════
   DRAG & DROP — DIVISIONES TAB
═══════════════════════════════════════════ */
.division-card[draggable="true"] { cursor: grab; }
.division-card[draggable="true"]:active { cursor: grabbing; }
.division-card.dragging { opacity: 0.35; box-shadow: none; }

.dept-drop-zone { transition: background .15s, outline .15s; border-radius: var(--radius); }
.dept-drop-zone.drag-over {
  outline: 2px dashed var(--primary);
  outline-offset: 2px;
  background: var(--primary-light) !important;
}
.ungrouped-drop-zone { min-height: 64px; padding: 8px 0; }

/* ═══════════════════════════════════════════
   DRAFT PREVIEW (user/viewer sees muted draft)
═══════════════════════════════════════════ */
.shift-pill.draft-preview {
  background: #8e9bb5 !important; opacity: 0.85;
}

/* ═══════════════════════════════════════════
   REST VIOLATION BADGE (< 12h rest between shifts)
═══════════════════════════════════════════ */
.rest-violation-badge {
  position: absolute;
  top: 2px; left: 2px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent-red);
  border: 1.5px solid #fff;
  pointer-events: none;
  z-index: 2;
}

/* ═══════════════════════════════════════════
   INDIVIDUAL VIEW (employee's personal schedule)
═══════════════════════════════════════════ */
.individual-view { padding: 4px 0; }

.individual-header {
  margin-bottom: 14px;
  padding: 12px 16px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border-left: 4px solid var(--primary);
  box-shadow: var(--shadow);
}
.individual-emp-name {
  font-size: 17px; font-weight: 700; color: var(--text);
}
.individual-emp-subtitle {
  font-size: 12px; color: var(--text-muted); margin-top: 2px;
}

.individual-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}
@media (max-width: 800px) {
  .individual-days-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
}

.individual-day-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  padding: 10px 8px;
  display: flex; flex-direction: column; gap: 6px;
  cursor: default;
  transition: border-color .15s, box-shadow .15s;
  min-height: 90px;
}
.individual-day-card[onclick] { cursor: pointer; }
.individual-day-card[onclick]:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}
.individual-day-card.rest-violated {
  border-color: var(--accent-red);
  background: #fff5f5;
}

.idc-day {
  display: flex; justify-content: space-between; align-items: baseline;
}
.idc-day-name {
  font-size: 11px; font-weight: 700;
  color: var(--primary); text-transform: uppercase; letter-spacing: .4px;
}
.idc-date { font-size: 10px; color: var(--text-muted); }

.idc-shift-info { text-align: center; }
.idc-shift-name {
  font-size: 10px; color: var(--text-muted); margin-top: 4px; line-height: 1.3;
}
.idc-shift-time { font-size: 11px; font-weight: 700; color: var(--text); margin-top: 2px; }
.idc-shift-pending { font-weight: 400; font-style: italic; color: var(--text-muted); }
.idc-draft-label { font-weight: 400; font-style: italic; }
.idc-no-shift { text-align: center; color: var(--text-muted); font-size: 18px; padding: 8px 0; }

.idc-rest-warning {
  font-size: 10px; font-weight: 700;
  color: var(--accent-red);
  display: flex; align-items: center; gap: 3px;
  margin-top: auto; padding-top: 4px;
}
.idc-rest-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent-red);
  flex-shrink: 0;
}

/* ─── PADLOCK BUTTON (employee reorder) ─── */
.btn-padlock {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  padding: 2px 5px;
  margin-left: 6px;
  vertical-align: middle;
  transition: background 0.15s;
}
.btn-padlock:hover { background: var(--border); }
.btn-padlock.unlocked { border-color: var(--accent-yellow); background: #fff8dc; }

/* Drag-over highlight for reorderable rows */
.schedule-table tbody tr[draggable="true"]:hover { background: #f0f4ff; }

/* ─── TOGGLE SWITCH (email prefs) ─── */
.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 6px 0; gap: 12px; }
.toggle-label { font-size: 13px; color: var(--text); flex: 1; }
.toggle-input { display: none; }
.toggle-switch {
  width: 36px; height: 20px; background: var(--border); border-radius: 10px;
  position: relative; cursor: pointer; transition: background .2s; flex-shrink: 0;
}
.toggle-switch::after {
  content: ''; position: absolute; width: 16px; height: 16px; background: #fff;
  border-radius: 50%; top: 2px; left: 2px; transition: left .2s; box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.toggle-input:checked + .toggle-switch { background: var(--primary); }
.toggle-input:checked + .toggle-switch::after { left: 18px; }

/* ─── EVENT DOT in schedule table ─── */
.event-dot { color: var(--primary); font-size: 9px; margin-left: 4px; vertical-align: middle; }

/* ─── EVENT CARDS in individual view ─── */
.idc-events { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.idc-event { display: flex; align-items: flex-start; gap: 6px; padding: 5px 8px; border-radius: 6px; font-size: 12px; }
.employee-event { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }
.company-event { background: #fef9ee; border: 1px solid #fcd34d; color: #78350f; }
.idc-event-icon { flex-shrink: 0; }
.idc-event-text { flex: 1; line-height: 1.4; }
.idc-event-btn { background: none; border: none; cursor: pointer; color: var(--text-muted); font-size: 12px; padding: 0 2px; flex-shrink: 0; }
.idc-event-btn:hover { color: var(--text); }
.btn-add-event {
  background: none; border: 1px dashed var(--border); border-radius: 6px;
  color: var(--text-muted); font-size: 11px; padding: 4px 8px; cursor: pointer;
  width: 100%; text-align: center; margin-top: 4px;
}
.btn-add-event:hover { border-color: var(--primary); color: var(--primary); }

/* ─── EVENT POPUP in admin modal ─── */
.ev-popup-list { display: flex; flex-direction: column; gap: 10px; max-height: 420px; overflow-y: auto; }
.ev-popup-day { padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: #fafbfc; }
.ev-popup-day-header { font-size: 13px; margin-bottom: 4px; }
.ev-popup-date { font-size: 11px; color: var(--text-muted); font-weight: 400; margin-left: 6px; }
.ev-popup-event { display: flex; align-items: flex-start; gap: 6px; padding: 5px 8px; border-radius: 6px; font-size: 12px; }

/* ═══════════════════════════════════════════════════════
   SANCIONES
   ═══════════════════════════════════════════════════════ */

/* ─── Severity pills ─── */
.severity-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 9px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .3px;
  text-transform: uppercase;
  white-space: nowrap;
}
.sev-leve      { background: #fef9c3; color: #854d0e; border: 1px solid #fcd34d; }
.sev-grave     { background: #ffedd5; color: #9a3412; border: 1px solid #fb923c; }
.sev-muy-grave { background: #fee2e2; color: #991b1b; border: 1px solid #f87171; }

/* ─── Severity radio group ─── */
.severity-radio-group { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 4px; }
.severity-radio-label { display: flex; align-items: center; gap: 5px; cursor: pointer; }
.severity-radio-label input[type=radio] { cursor: pointer; accent-color: var(--primary); }
.severity-radio-label input[type=radio]:checked + .severity-pill { box-shadow: 0 0 0 2px #1a5fa880; }

/* ─── Sanction dot indicator (schedule table + employees tab) ─── */
.sanction-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  font-size: 9px;
  font-weight: 700;
  margin-left: 5px;
  flex-shrink: 0;
  vertical-align: middle;
  line-height: 1;
}
.sanction-leve      { background: #fcd34d; color: #78350f; }
.sanction-grave     { background: #f97316; color: #fff; }
.sanction-muy-grave { background: #cc2222; color: #fff; }
.sanction-count     { width: auto; min-width: 14px; padding: 0 4px; border-radius: 7px; }

/* ─── Sanctions view layout ─── */
.sanctions-layout {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 900px;
}
.sanctions-form-section,
.sanctions-search-section {
  padding: 20px 24px;
}
.sanctions-section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 16px 0;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

/* ─── Form fields ─── */
.form-input {
  width: 100%;
  padding: 8px 11px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  background: #fff;
  color: var(--text);
  box-sizing: border-box;
  font-family: inherit;
  transition: border-color .15s;
}
.form-input:focus { outline: none; border-color: var(--primary); }
.sanctions-form { display: flex; flex-direction: column; gap: 14px; }
.sanc-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .sanc-field-row { grid-template-columns: 1fr; } }
.sanc-textarea { resize: vertical; min-height: 90px; }
.required-star { color: var(--accent-red); font-size: 12px; }

/* ─── Upload area ─── */
.sanc-upload-area { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sanc-upload-btn  { cursor: pointer; font-size: 13px; padding: 6px 14px; }
.sanc-doc-label   { font-size: 12px; color: var(--text-muted); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ─── Form actions ─── */
.sanc-form-actions { display: flex; gap: 10px; padding-top: 4px; flex-wrap: wrap; }

/* ─── Filter row ─── */
.sanc-filter-row { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }

/* ─── Sanctions list ─── */
.sanc-list { display: flex; flex-direction: column; gap: 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.sanc-list-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background .12s;
  background: #fff;
}
.sanc-list-row:last-child { border-bottom: none; }
.sanc-list-row:hover { background: #f5f8ff; }
.sanc-list-row--selected { background: #f0f6ff !important; }
.sanc-list-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sanc-list-sanc-name { font-size: 13px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sanc-list-emp-name  { font-size: 12px; color: var(--text-muted); }
.sanc-list-office    { font-size: 11px; color: var(--text-muted); }
.sanc-list-date { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.sanc-chevron   { font-size: 10px; color: var(--text-muted); flex-shrink: 0; }
.sanc-more-hint { font-size: 12px; padding: 8px 0 2px; }

/* ─── Sanction detail card ─── */
.sanc-detail-card {
  margin-top: 12px;
  border-radius: 8px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid var(--border);
}
.sanc-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.sanc-detail-header-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sanc-detail-title { font-size: 15px; font-weight: 700; color: var(--text); }
.sanc-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 8px;
}
.sanc-detail-desc {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}
.sanc-detail-doc { padding-top: 6px; border-top: 1px solid var(--border); }
.sanc-doc-btn { font-size: 12px; }

/* ═══ WIDE MODAL ═══ */
.modal-box--wide { max-width: 650px; }

/* ═══ EMPLOYEE NAME BUTTON IN TABLE ═══ */
.btn-emp-name {
  background: none; border: none; cursor: pointer; padding: 0;
  font-weight: 600; color: var(--primary); font-size: inherit;
  text-align: left;
}
.btn-emp-name:hover { text-decoration: underline; }

/* ═══ EMPLOYEE PROFILE MODAL ═══ */
.prof-top-bar {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; margin-bottom: 4px;
}
.prof-header {
  display: flex; align-items: center; gap: 16px; flex: 1;
}
.prof-pdf-btn { flex-shrink: 0; align-self: flex-start; }
.prof-avatar {
  width: 64px; height: 64px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--border); flex-shrink: 0;
}
.prof-avatar-placeholder {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--bg-alt); border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); flex-shrink: 0;
}
.prof-name { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.prof-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.prof-section { margin-top: 14px; }
.prof-section-title {
  font-size: 11px; font-weight: 700; color: var(--primary);
  letter-spacing: .06em; text-transform: uppercase; margin: 0 0 7px;
}
.prof-info-row {
  display: flex; gap: 8px; align-items: center;
  font-size: 13px; margin-bottom: 5px; color: var(--text);
}
.prof-info-label {
  color: var(--text-muted); min-width: 68px; font-size: 12px;
}
.prof-sanctions-list { display: flex; flex-direction: column; gap: 5px; }
.prof-sanction-row   { display: flex; gap: 8px; align-items: center; }
.prof-start-date-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ═══ SALARY SECTION ═══ */
.salary-editor { display: flex; flex-direction: column; gap: 6px; }
.salary-fields-row { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.salary-field-group { display: flex; flex-direction: column; gap: 3px; }
.sal-field-label {
  font-size: 10px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.5px;
}
.sal-input-wrap { display: flex; align-items: center; gap: 3px; }
.sal-number-input {
  width: 82px; padding: 5px 7px; border: 1px solid var(--border);
  border-radius: 6px; font-size: 13px;
}
.sal-number-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px #d0e4f7; }
.sal-currency { font-size: 12px; color: var(--text-muted); }
.sal-inc-check-row { display: flex; align-items: center; gap: 6px; height: 30px; }
.sal-inc-check-row input[type="checkbox"] {
  width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; flex-shrink: 0;
}
.sal-pct-select {
  border: 1px solid var(--border); border-radius: 6px;
  padding: 4px 6px; font-size: 13px; cursor: pointer;
}
.salary-history-timeline {
  display: flex; align-items: center; gap: 0;
  overflow-x: auto; padding: 4px 2px 6px;
}
.salary-history-item {
  background: #f0f5fc; border: 1px solid var(--border);
  border-radius: 8px; padding: 7px 10px; min-width: 88px;
  flex-shrink: 0;
}
.sal-hist-date {
  font-size: 10px; font-weight: 700; color: var(--primary);
  margin-bottom: 4px; white-space: nowrap;
}
.sal-hist-val { font-size: 11px; color: #4a5e72; line-height: 1.5; }
.sal-hist-connector {
  font-size: 18px; color: var(--border); flex-shrink: 0;
  padding: 0 5px; user-select: none;
}
.salary-readonly-row { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.sal-ro-field { display: flex; flex-direction: column; gap: 2px; }
.sal-ro-val { font-size: 15px; font-weight: 700; color: var(--primary); }

/* ═══ UNIFORM / EPI SECTION ═══ */
.uniform-summary-grid {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px;
}
.uniform-summary-item {
  display: flex; flex-direction: column; align-items: center;
  min-width: 76px; background: var(--bg-alt); border-radius: 8px;
  padding: 8px 10px; border: 1px solid var(--border);
}
.uniform-summary-count {
  font-size: 1.3rem; font-weight: 700; color: var(--primary); line-height: 1.1;
}
.uniform-summary-label {
  font-size: 10px; color: var(--text-muted); margin-top: 3px; text-align: center;
}
.uniform-last3 { margin-bottom: 10px; }
.uniform-section-subtitle {
  font-size: 11px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .04em; margin: 0 0 6px;
}
.uniform-delivery-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; padding: 4px 0;
  border-bottom: 1px solid var(--border);
}
.uniform-delivery-row:last-child { border-bottom: none; }
.uniform-delivery-date { color: var(--text-muted); min-width: 78px; }
.uniform-delivery-type { flex: 1; color: var(--text); }
.uniform-delivery-qty  { font-weight: 600; color: var(--primary); }
.uniform-type-tabs {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px;
}
.uniform-type-tab {
  background: var(--bg-alt); border: 1.5px solid var(--border);
  border-radius: 20px; padding: 3px 11px; font-size: 11px;
  font-weight: 600; cursor: pointer; color: var(--text-dark);
  transition: background .12s, color .12s;
}
.uniform-type-tab:hover  { background: #e5eef7; }
.uniform-type-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.uniform-expanded {
  background: var(--bg-alt); border-radius: 8px;
  padding: 10px 12px; margin-bottom: 10px;
  border: 1px solid var(--border);
}
.uniform-add-form {
  background: var(--bg-alt); border-radius: 8px;
  padding: 12px; margin-top: 10px;
  border: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 8px;
}
.uniform-add-form-row { display: flex; gap: 8px; flex-wrap: wrap; }
.uniform-delivery-entry { display: flex; flex-direction: column; }
.uniform-delivery-note {
  font-size: 11px; color: var(--text-muted);
  font-style: italic; padding: 2px 4px 4px 80px;
  white-space: pre-wrap; word-break: break-word;
}

/* ── Employee profile — vacation slips ── */
.prof-vacations-list { display: flex; flex-direction: column; gap: 8px; }
.prof-vac-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 12px; background: var(--bg-alt);
  border: 1px solid var(--border); border-radius: 8px;
}
.prof-vac-period { flex: 1; font-size: 13px; font-weight: 600; min-width: 160px; }
.prof-vac-days   { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.prof-vac-signed { font-size: 11px; color: var(--text-muted); white-space: nowrap; }

/* ═══ PRINT — Estadísticas PDF ═══ */
@media print {
  /* Hide chrome */
  .sidebar,
  #stats-header-controls,
  .stats-pdf-btn,
  .stats-yearend-banner button,
  .stats-yearend-banner .btn { display: none !important; }

  /* Collapse sidebar margin */
  body { background: #fff !important; }
  .main-content, .main-content.with-sidebar {
    margin-left: 0 !important;
    padding: 12px 20px !important;
    box-shadow: none !important;
  }

  /* Force background colors/fills to print */
  .stat-bar {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .stat-bar-track {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Prevent cards from splitting across pages */
  .stat-office-card {
    break-inside: avoid;
    page-break-inside: avoid;
    border: 1px solid #ccc !important;
  }

  /* Tighter grid for print */
  .stat-section {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }

  /* Style the view-header title for print */
  #view-stats .view-header {
    border-bottom: 2px solid #1a5fa8;
    padding-bottom: 8px;
    margin-bottom: 16px;
  }
}
