  :root {
    --navy: #1E2D60;
    --navy-mid: #2A3D80;
    --navy-dark: #141F45;
    --blue: #2563EB;
    --blue-light: #EFF6FF;
    --gold: #F59E0B;
    --gold-light: #FFFBEB;
    --white: #FFFFFF;
    --gray-100: #F5F7FB;
    --gray-200: #E8ECF4;
    --gray-400: #94A3B8;
    --gray-600: #4B5C6B;
    --green: #166534;
    --green-light: #F0FDF4;
    --green-mid: #16A34A;
    --orange: #C2410C;
    --orange-light: #FFF7ED;
    --purple: #6D28D9;
    --purple-light: #F5F3FF;
    --red: #DC2626;
    --red-light: #FEF2F2;
    --teal: #0F766E;
    --teal-light: #F0FDFA;
    --amber: #D97706;
    --amber-light: #FFFBEB;
    --rose: #BE185D;
    --rose-light: #FDF2F8;
    --op-color: var(--green);
    --op-bg: var(--green-light);
    --adm-color: var(--blue);
    --adm-bg: var(--blue-light);
    --com-color: var(--orange);
    --com-bg: var(--orange-light);
    --ger-color: var(--purple);
    --ger-bg: var(--purple-light);
    --radius: 10px;
    --radius-lg: 16px;
    --shadow: 0 2px 16px rgba(30,45,96,0.09);
    --shadow-lg: 0 8px 40px rgba(30,45,96,0.14);
  }

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

  body {
    font-family: 'DM Sans', sans-serif;
    background: var(--gray-100);
    color: var(--navy);
    min-height: 100vh;
  }

  /* TOP BAR */
  .topbar {
    background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy-mid) 100%);
    padding: 0 32px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 24px rgba(20,31,69,0.35);
  }
  .topbar-logo {
    display: flex;
    align-items: center;
    gap: 14px;
  }
  .topbar-logo .logo-mark {
    width: 36px; height: 36px;
    background: var(--gold);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Fraunces', serif;
    font-weight: 700;
    color: var(--navy);
    font-size: 16px;
    letter-spacing: -1px;
  }
  .topbar-logo .logo-text {
    font-family: 'Fraunces', serif;
    font-weight: 600;
    color: white;
    font-size: 18px;
    letter-spacing: -0.3px;
  }
  .topbar-logo .logo-sub {
    font-family: 'DM Sans', sans-serif;
    color: var(--gray-400);
    font-size: 12px;
    font-weight: 400;
    margin-top: 1px;
  }
  .topbar-actions {
    display: flex;
    gap: 10px;
    align-items: center;
  }
  /* Buttons sitting on the dark topbar need light text/border */
  .topbar-actions .btn-outline {
    color: rgba(255,255,255,0.85);
    border-color: rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.08);
  }
  .topbar-actions .btn-outline:hover {
    color: white;
    border-color: rgba(255,255,255,0.6);
    background: rgba(255,255,255,0.16);
  }

  /* TABS */
  .tabs {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
    padding: 0 32px;
    display: flex;
    gap: 4px;
  }
  .tab-btn {
    padding: 12px 20px;
    background: none;
    border: none;
    color: var(--gray-400);
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
  }
  .tab-btn:hover { color: white; }
  .tab-btn.active {
    color: var(--gold);
    border-bottom-color: var(--gold);
  }

  /* MAIN LAYOUT */
  .main { max-width: 1280px; margin: 0 auto; padding: 28px 24px 60px; }

  /* PAGE */
  .page { display: none; }
  .page.active {
    display: block;
    animation: pageEnter 0.2s ease forwards;
  }
  @keyframes pageEnter {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  /* CARDS */
  .card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 20px;
  }
  .card-header {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .card-header h3 {
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    color: white;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .gold-bar { height: 4px; background: var(--gold); }
  .card-body { padding: 20px; }

  /* FORM FIELDS */
  .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
  .form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
  .form-group { display: flex; flex-direction: column; gap: 5px; }
  .form-group label {
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }
  .form-group input, .form-group select {
    padding: 9px 12px;
    border: 1.5px solid var(--gray-200);
    border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    color: var(--navy);
    background: white;
    transition: border-color 0.2s;
    outline: none;
  }
  .form-group input:focus, .form-group select:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.10);
  }

  /* SCHEDULE TABLE */
  .schedule-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
  }
  .schedule-table th {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
    color: white;
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
  }
  .schedule-table td {
    padding: 9px 14px;
    border-bottom: 1px solid var(--gray-200);
  }
  .schedule-table tr:nth-child(even) td { background: var(--gray-100); }
  .schedule-table select {
    padding: 5px 8px;
    border: 1.5px solid var(--gray-200);
    border-radius: 6px;
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    color: var(--navy);
    outline: none;
    cursor: pointer;
  }
  .badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
  }
  .badge-completa { background: var(--green-light); color: var(--green); }
  .badge-media { background: var(--orange-light); color: var(--orange); }
  .badge-nolaboral { background: var(--gray-200); color: var(--gray-600); }

  /* CATEGORIES */
  .cat-list { display: flex; flex-direction: column; gap: 6px; }
  .cat-item {
    display: grid;
    grid-template-columns: 1fr 130px 32px;
    gap: 8px;
    align-items: center;
  }
  .cat-item input, .cat-item select {
    padding: 7px 10px;
    border: 1.5px solid var(--gray-200);
    border-radius: 7px;
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    color: var(--navy);
    outline: none;
  }
  .cat-item input:focus, .cat-item select:focus { border-color: var(--blue); }
  .btn-remove {
    width: 28px; height: 28px;
    background: var(--red-light);
    color: var(--red);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s;
  }
  .btn-remove:hover { background: #FFCDD2; }

  /* BUTTONS */
  .btn {
    padding: 9px 18px;
    border-radius: 8px;
    border: none;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.18s;
    white-space: nowrap;
  }
  .btn-primary { background: var(--navy); color: white; }
  .btn-primary:hover { background: var(--navy-mid); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(13,27,75,0.25); }
  .btn-gold { background: var(--gold); color: white; }
  .btn-gold:hover { background: #D97706; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(245,158,11,0.35); }
  .btn-outline {
    background: transparent;
    border: 1.5px solid var(--gray-200);
    color: var(--navy);
  }
  .btn-outline:hover { border-color: var(--navy); background: var(--gray-100); }
  .btn-green { background: var(--green-mid); color: white; }
  .btn-green:hover { background: var(--green); transform: translateY(-1px); }
  .btn-sm { padding: 6px 12px; font-size: 12px; }

  /* KPI STRIP */
  .kpi-strip {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
    margin-bottom: 20px;
  }
  .kpi-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow);
    border-top: 4px solid transparent;
    transition: transform 0.2s;
  }
  .kpi-card:hover { transform: translateY(-2px); }
  .kpi-card .kpi-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--gray-600);
    margin-bottom: 8px;
  }
  .kpi-card .kpi-value {
    font-family: 'Fraunces', serif;
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 4px;
  }
  .kpi-card .kpi-sub { font-size: 11px; color: var(--gray-400); }

  /* PROGRESS BAR */
  .progress-wrap { background: var(--gray-200); border-radius: 99px; height: 8px; overflow: hidden; }
  .progress-fill {
    height: 100%;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--blue), var(--gold));
    transition: width 0.6s cubic-bezier(0.34,1.56,0.64,1);
  }

  /* WEEKLY TRACKER BAR */
  .weekly-bar {
    background: white;
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
  }
  .weekly-bar .wb-label { font-size: 12px; font-weight: 600; color: var(--gray-600); white-space: nowrap; }
  .weekly-bar .wb-nums { font-family: 'DM Mono', monospace; font-size: 13px; color: var(--navy); white-space: nowrap; }
  .weekly-bar .wb-bar { flex: 1; }
  .weekly-bar .wb-pct { font-family: 'Fraunces', serif; font-size: 22px; font-weight: 700; color: var(--navy); white-space: nowrap; }

  /* REGISTRO TABLE */
  .registro-header {
    background: white;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    overflow: hidden;
    box-shadow: var(--shadow);
  }
  .registro-body {
    background: white;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
  }

  .reg-table { width: 100%; border-collapse: collapse; }
  .reg-table thead tr {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
  }
  .reg-table thead th {
    padding: 12px 10px;
    color: white;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    text-align: left;
    white-space: nowrap;
  }
  .reg-table thead th:first-child { padding-left: 16px; }

  .reg-table tbody tr {
    border-bottom: 1px solid var(--gray-200);
    transition: background 0.15s;
  }
  .reg-table tbody tr:hover { background: var(--gray-100); }
  .reg-table tbody tr:nth-child(even) td { background: #FAFBFD; }
  .reg-table tbody tr:nth-child(even):hover td { background: var(--gray-100); }

  .reg-table td {
    padding: 6px 8px;
    vertical-align: middle;
  }
  .reg-table td:first-child { padding-left: 14px; }

  .reg-table input, .reg-table select {
    width: 100%;
    padding: 7px 9px;
    border: 1.5px solid transparent;
    border-radius: 7px;
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    color: var(--navy);
    background: transparent;
    outline: none;
    transition: all 0.18s;
  }
  .reg-table input:focus, .reg-table select:focus {
    border-color: var(--blue);
    background: white;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.10);
  }

  /* DATE CELL — calendar input */
  .date-cell {
    position: relative;
    min-width: 130px;
  }
  .date-cell input[type="date"] {
    width: 100%;
    padding: 7px 9px;
    border: 1.5px solid var(--gray-200);
    border-radius: 7px;
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    color: var(--navy);
    background: var(--gold-light);
    outline: none;
    cursor: pointer;
    transition: all 0.18s;
  }
  .date-cell input[type="date"]:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(249,168,37,0.15);
  }
  input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.7;
  }
  input[type="time"] {
    min-width: 80px;
    padding: 7px 9px;
    border: 1.5px solid var(--gray-200);
    border-radius: 7px;
    font-family: 'DM Mono', monospace;
    font-size: 12px;
    color: var(--navy);
    background: transparent;
    outline: none;
    transition: all 0.18s;
  }
  input[type="time"]:focus {
    border-color: var(--blue);
    background: white;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.10);
  }

  .dur-badge {
    font-family: 'DM Mono', monospace;
    font-size: 12px;
    font-weight: 500;
    color: var(--blue);
    background: var(--blue-light);
    padding: 4px 10px;
    border-radius: 20px;
    white-space: nowrap;
    text-align: center;
    display: inline-block;
    min-width: 52px;
  }

  .tipo-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
  }

  /* Dashboard charts area */
  .dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
  .bar-chart { display: flex; flex-direction: column; gap: 10px; }
  .bar-item { display: flex; align-items: center; gap: 10px; font-size: 12px; }
  .bar-item .bar-label { width: 180px; font-size: 11px; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .bar-item .bar-track { flex: 1; height: 20px; background: var(--gray-200); border-radius: 4px; overflow: hidden; }
  .bar-item .bar-fill { height: 100%; border-radius: 4px; transition: width 0.6s cubic-bezier(0.34,1.56,0.64,1); display: flex; align-items: center; padding-left: 8px; }
  .bar-item .bar-fill span { font-size: 10px; font-weight: 600; color: white; white-space: nowrap; }
  .bar-item .bar-hrs { font-family: 'DM Mono', monospace; font-size: 11px; color: var(--gray-600); width: 45px; text-align: right; }

  .dist-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--gray-200); font-size: 13px; }
  .dist-row:last-child { border-bottom: none; }
  .dist-tipo { width: 120px; font-weight: 600; }
  .dist-pct { font-family: 'DM Mono', monospace; font-size: 14px; font-weight: 600; width: 50px; }
  .dist-track { flex: 1; height: 12px; background: var(--gray-200); border-radius: 99px; overflow: hidden; }
  .dist-fill { height: 100%; border-radius: 99px; transition: width 0.6s; }
  .dist-bench { font-size: 11px; color: var(--gray-400); width: 70px; text-align: right; }
  .dist-status { font-size: 11px; width: 70px; text-align: right; }

  /* Footer actions */
  .action-bar {
    background: white;
    border-top: 1px solid var(--gray-200);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    bottom: 0;
    z-index: 50;
    box-shadow: 0 -4px 20px rgba(13,27,75,0.08);
  }
  .action-bar-left { display: flex; gap: 8px; align-items: center; }
  .action-bar-right { display: flex; gap: 8px; align-items: center; }

  /* NOTIFICATION */
  .toast {
    position: fixed;
    bottom: 80px;
    right: 24px;
    background: var(--navy);
    color: white;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    z-index: 999;
    display: flex;
    align-items: center;
    gap: 8px;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.35s cubic-bezier(0.34,1.56,0.64,1);
  }
  .toast.show { transform: translateY(0); opacity: 1; }

  /* responsive */
  @media(max-width: 900px) {
    .kpi-strip { grid-template-columns: repeat(2,1fr); }
    .dash-grid { grid-template-columns: 1fr; }
  }

  /* USER LOGIN MODAL */
  .modal-overlay {
    position: fixed; inset: 0;
    background: rgba(20,31,69,0.65);
    backdrop-filter: blur(6px);
    z-index: 9999;
    display: flex; align-items: center; justify-content: center;
  }
  .modal-box {
    background: white;
    border-radius: 20px;
    padding: 40px;
    width: 420px;
    box-shadow: 0 24px 80px rgba(30,45,96,0.28);
    text-align: center;
  }
  .modal-logo {
    width: 56px; height: 56px;
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 16px;
    font-family: 'Fraunces', serif;
    font-size: 22px; font-weight: 700;
    color: var(--gold);
  }
  .modal-title {
    font-family: 'Fraunces', serif;
    font-size: 22px; font-weight: 700;
    color: var(--navy); margin-bottom: 6px;
  }
  .modal-sub { font-size: 13px; color: var(--gray-600); margin-bottom: 28px; }
  .modal-input {
    width: 100%; padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: 10px;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px; color: var(--navy);
    outline: none; margin-bottom: 12px;
    transition: border-color 0.2s;
  }
  .modal-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,0.12); }
  .modal-btn {
    width: 100%; padding: 13px;
    background: var(--navy); color: white;
    border: none; border-radius: 10px;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px; font-weight: 700;
    cursor: pointer; transition: all 0.2s;
    margin-top: 4px;
  }
  .modal-btn:hover { background: var(--navy-mid); transform: translateY(-1px); }
  .modal-users {
    margin-top: 20px; padding-top: 16px;
    border-top: 1px solid var(--gray-200);
    text-align: left;
  }
  .modal-users-title { font-size: 11px; font-weight: 600; color: var(--gray-400); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
  .user-chip {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--gray-100); border: 1.5px solid var(--gray-200);
    border-radius: 20px; padding: 5px 12px;
    font-size: 12px; font-weight: 600; color: var(--navy);
    cursor: pointer; margin: 3px; transition: all 0.15s;
  }
  .user-chip:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-light); }
  .user-indicator {
    display: flex; align-items: center; gap: 8px;
    background: rgba(255,255,255,0.12);
    border-radius: 8px; padding: 6px 12px;
    cursor: pointer;
  }
  .user-indicator:hover { background: rgba(255,255,255,0.2); }
  .user-dot {
    width: 8px; height: 8px;
    background: var(--gold); border-radius: 50%;
  }
  .save-indicator {
    font-size: 11px; color: var(--gold);
    opacity: 0; transition: opacity 0.4s;
  }
  .save-indicator.show { opacity: 1; }


  /* FILTER BAR */
  .filter-bar {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px;
    background: var(--gray-100);
    border-bottom: 1px solid var(--gray-200);
    flex-wrap: wrap;
  }
  .filter-label { font-size: 11px; font-weight: 600; color: var(--gray-600); text-transform: uppercase; letter-spacing: 0.4px; }
  .filter-btns { display: flex; gap: 4px; }
  .filter-btn {
    padding: 5px 14px; border-radius: 20px;
    border: 1.5px solid var(--gray-200);
    background: white; color: var(--gray-600);
    font-family: 'DM Sans', sans-serif;
    font-size: 12px; font-weight: 600;
    cursor: pointer; transition: all 0.18s;
  }
  .filter-btn:hover { border-color: var(--navy); color: var(--navy); }
  .filter-btn.active { background: var(--navy); color: white; border-color: var(--navy); }
  .filter-count {
    font-size: 11px; color: var(--gray-400);
    margin-left: auto;
  }
  /* AUTOCOMPLETE */
  .ac-wrap { position: relative; }
  .ac-dropdown {
    position: absolute; top: calc(100% + 4px); left: 0; right: 0;
    background: white;
    border: 1.5px solid var(--blue);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(30,45,96,0.14);
    z-index: 500;
    max-height: 180px; overflow-y: auto;
  }
  .ac-item {
    padding: 8px 12px;
    font-size: 12px; color: var(--navy);
    cursor: pointer;
    border-bottom: 1px solid var(--gray-200);
    transition: background 0.12s;
  }
  .ac-item:last-child { border-bottom: none; }
  .ac-item:hover { background: var(--blue-light); }
  .ac-item mark { background: var(--gold-light); color: var(--navy); font-weight: 700; border-radius: 2px; }
  /* ROW HIDDEN BY FILTER */
  .row-hidden { display: none !important; }


  /* ABSENCE / VACATION */

  .absence-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
  .absence-form { display: flex; flex-direction: column; gap: 10px; }
  .absence-table { width: 100%; border-collapse: collapse; font-size: 13px; }
  .absence-table th {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%); color: white;
    padding: 10px 14px; text-align: left;
    font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.4px;
  }
  .absence-table td {
    padding: 9px 14px; border-bottom: 1px solid var(--gray-200);
    vertical-align: middle;
  }
  .absence-table tr:nth-child(even) td { background: var(--gray-100); }
  .absence-table tr:hover td { background: var(--blue-light); }
  .absence-badge {
    display: inline-block; padding: 3px 10px;
    border-radius: 20px; font-size: 11px; font-weight: 700;
  }
  .vac-strip {
    display: grid; grid-template-columns: repeat(4,1fr); gap: 14px;
    margin-bottom: 20px;
  }
  .vac-card {
    background: white; border-radius: var(--radius-lg);
    padding: 16px; box-shadow: var(--shadow);
    border-top: 4px solid transparent; text-align: center;
  }
  .vac-card .vc-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.6px; color: var(--gray-600); margin-bottom: 8px; }
  .vac-card .vc-value { font-family: 'Fraunces', serif; font-size: 28px; font-weight: 700; line-height:1; }
  .vac-card .vc-sub { font-size: 11px; color: var(--gray-400); margin-top: 4px; }
  .timeline-bar {
    height: 28px; background: var(--gray-200);
    border-radius: 6px; overflow: hidden;
    position: relative; margin-top: 8px;
  }
  .timeline-fill {
    height: 100%; border-radius: 6px;
    display: flex; align-items: center;
    padding: 0 10px; font-size: 11px; font-weight: 700; color: white;
    transition: width 0.6s cubic-bezier(0.34,1.56,0.64,1);
    white-space: nowrap;
  }


  /* ACTIVITY LIBRARY */
  .lib-cat-block { margin-bottom: 14px; border: 1.5px solid var(--gray-200); border-radius: 10px; overflow: hidden; }
  .lib-cat-header {
    padding: 9px 14px;
    display: flex; align-items: center; justify-content: space-between;
    cursor: pointer; user-select: none;
    border-radius: 6px 6px 0 0;
  }
  .lib-cat-header span { font-size: 12px; font-weight: 700; }
  .lib-cat-header .lib-toggle { font-size: 11px; color: var(--gray-400); transition: transform 0.2s; }
  .lib-cat-body { padding: 10px 14px; display: flex; flex-direction: column; gap: 6px; }
  .lib-item {
    display: grid; grid-template-columns: 1fr 32px;
    gap: 6px; align-items: center;
  }
  .lib-item input {
    padding: 6px 10px;
    border: 1.5px solid var(--gray-200); border-radius: 7px;
    font-family: 'DM Sans', sans-serif; font-size: 12px;
    color: var(--navy); outline: none; width: 100%;
    transition: border-color 0.18s;
  }
  .lib-item input:focus { border-color: var(--blue); }
  .lib-add-row {
    margin-top: 4px;
    display: flex; gap: 8px; align-items: center;
  }
  .lib-add-input {
    flex: 1; padding: 6px 10px;
    border: 1.5px dashed var(--gray-200); border-radius: 7px;
    font-family: 'DM Sans', sans-serif; font-size: 12px;
    color: var(--navy); outline: none;
    background: var(--gray-100);
  }
  .lib-add-input:focus { border-color: var(--blue); border-style: solid; background: white; }
  .lib-add-input::placeholder { color: var(--gray-400); font-style: italic; }
  .btn-lib-add {
    padding: 5px 12px; border-radius: 6px;
    background: var(--blue-light); color: var(--blue);
    border: none; font-family: 'DM Sans', sans-serif;
    font-size: 12px; font-weight: 700; cursor: pointer;
    white-space: nowrap; transition: background 0.15s;
  }
  .btn-lib-add:hover { background: var(--blue); color: white; }
  /* AC suggestion pill style */
  .ac-item mark { background: rgba(249,168,37,0.3); border-radius: 2px; font-weight: 700; }


  /* RANGE FILTER */
  .filter-range {
    display: none; align-items: center; gap: 6px;
    animation: fadeIn 0.2s ease;
  }
  .filter-range.visible { display: flex; }
  .filter-range input[type="date"] {
    padding: 4px 10px;
    border: 1.5px solid var(--gray-200); border-radius: 20px;
    font-family: 'DM Mono', monospace; font-size: 12px;
    color: var(--navy); outline: none; background: var(--gold-light);
    cursor: pointer; transition: border-color 0.18s;
  }
  .filter-range input[type="date"]:focus { border-color: var(--gold); }
  .filter-range .range-sep { font-size: 11px; color: var(--gray-400); }
  .filter-range .range-apply {
    padding: 4px 12px; border-radius: 20px;
    background: var(--navy); color: white;
    border: none; font-family: 'DM Sans', sans-serif;
    font-size: 12px; font-weight: 600; cursor: pointer;
    transition: background 0.15s;
  }
  .filter-range .range-apply:hover { background: var(--blue); }
  @keyframes fadeIn { from { opacity:0; transform:translateY(-4px); } to { opacity:1; transform:translateY(0); } }

  /* DASH FILTER BAR */
  .dash-filter-bar {
    background: white; border-radius: var(--radius-lg);
    padding: 12px 18px; margin-bottom: 16px;
    box-shadow: var(--shadow);
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  }
  .dash-filter-label { font-size: 11px; font-weight: 700; color: var(--gray-600); text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap; }
  .dash-period-badge {
    font-size: 12px; font-weight: 600; color: var(--navy);
    background: var(--blue-light); border-radius: 20px;
    padding: 4px 12px; margin-left: auto;
  }


  /* ACTIVITY QUICK-SELECT PANEL */
  .act-panel {
    position: absolute; top: calc(100% + 3px); left: 0; right: 0;
    background: white;
    border: 1.5px solid var(--blue);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(30,45,96,0.14);
    z-index: 600;
    max-height: 220px;
    overflow-y: auto;
  }
  .act-panel-header {
    padding: 6px 10px;
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
    color: white;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border-radius: 6px 6px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .act-panel-header span { opacity: 0.6; font-weight: 400; font-size: 9px; }
  .act-panel-item {
    padding: 8px 12px;
    font-size: 12px; color: var(--navy);
    cursor: pointer;
    border-bottom: 1px solid var(--gray-200);
    transition: background 0.12s;
    display: flex; align-items: center; gap: 6px;
  }
  .act-panel-item:last-child { border-bottom: none; }
  .act-panel-item:hover { background: var(--blue-light); }
  .act-panel-item::before { content: '›'; color: var(--blue); font-weight: 700; }
  .act-panel-item.ac-match mark { background: rgba(245,158,11,0.30); border-radius: 2px; font-weight: 700; }
  .act-panel-empty {
    padding: 12px; text-align: center;
    font-size: 12px; color: var(--gray-400); font-style: italic;
  }

/* ── CRONÓMETRO ─────────────────────────────────────────────────────────── */
.crono-panel {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--white); border: 1.5px solid var(--gold);
  border-radius: 10px; padding: 10px 16px; margin-bottom: 12px;
}
#crono-idle { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
#crono-timers-list { display: flex; flex-direction: column; width: 100%; gap: 0; }
.crono-timer-card {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 7px 0; border-top: 1px solid var(--gray-200); margin-top: 4px;
}
.crono-stop-btn { background: var(--red) !important; color: white !important; border: none !important; }
.crono-label { font-size: 13px; font-weight: 700; color: var(--gold); white-space: nowrap; }
.crono-display { font-family: 'DM Mono', monospace; font-size: 22px; font-weight: 700; color: var(--navy); min-width: 90px; }
.crono-info { font-size: 12px; color: var(--gray-600); }
#crono-cat, #crono-act {
  padding: 6px 10px; border: 1.5px solid var(--gray-200); border-radius: 7px;
  font-family: 'DM Sans', sans-serif; font-size: 12px; color: var(--navy);
  background: white; outline: none; cursor: pointer;
}
#crono-act:disabled { background: var(--gray-100); cursor: not-allowed; color: var(--gray-400); }

/* ── TRANSICIONES GLOBALES ───────────────────────────────────────────────── */
.btn { transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease, border-color 0.12s ease; }
.filter-btn { transition: all 0.15s ease; }
input:not([type='range']), select, textarea { transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.card { transition: box-shadow 0.2s ease; }
.kpi-card { transition: transform 0.15s ease, box-shadow 0.15s ease; }
.dur-badge { transition: background 0.2s ease, color 0.2s ease; }

.crono-timer-card { animation: slideDown 0.2s ease; }
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
tr[data-rowid] { animation: rowEnter 0.3s ease; }
@keyframes rowEnter {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── HOVER / FOCUS CONSISTENTES ─────────────────────────────────────────── */
.tab-btn:hover:not(.active) { background: rgba(255,255,255,0.12); }
.filter-btn:hover:not(.active) { background: var(--blue-light); border-color: var(--blue); color: var(--blue); }
input:not([type='checkbox']):not([type='range']):hover, select:hover { border-color: var(--gray-400) !important; }

.btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.btn:focus:not(:focus-visible),
input:focus:not(:focus-visible),
select:focus:not(:focus-visible) { outline: none; }

.btn:active:not(:disabled) { transform: translateY(0) !important; box-shadow: none !important; }
.filter-btn:active { transform: scale(0.97); }

/* ── JERARQUÍA DE BOTONES ────────────────────────────────────────────────── */
.btn-gold {
  font-weight: 700;
  letter-spacing: 0.3px;
  box-shadow: 0 2px 8px rgba(245,158,11,0.25);
}
.btn-gold:hover { box-shadow: 0 4px 16px rgba(245,158,11,0.40) !important; }

.btn-outline {
  border: 1.5px solid var(--gray-300);
  color: var(--gray-600);
  font-weight: 500;
}
.btn-outline:hover { border-color: var(--navy); color: var(--navy); background: var(--gray-100); }

.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none !important; box-shadow: none !important; }
.btn.btn-sm { font-size: 11px; padding: 5px 10px; }

/* ── RESPONSIVIDAD ───────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .topbar { padding: 0 12px; gap: 8px; }
  .topbar-logo .logo { font-size: 12px; }
  #topbar-export-btns { display: none; }

  .tabs { gap: 0; padding: 0 4px; overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab-btn { font-size: 11px; padding: 10px 12px; }

  .main { padding: 16px 12px 60px; }

  .info-grid { grid-template-columns: 1fr !important; }
  .dash-grid { grid-template-columns: 1fr !important; }
  .config-grid { grid-template-columns: 1fr !important; }
  .form-grid { grid-template-columns: 1fr !important; }
  .form-grid-3 { grid-template-columns: 1fr 1fr !important; }

  .crono-panel { flex-direction: column; align-items: flex-start; gap: 8px; }
  #crono-idle { flex-wrap: wrap; }

  .reg-table-wrap, .absence-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  .filter-bar { flex-wrap: wrap; gap: 6px; }
}

@media (max-width: 480px) {
  .kpi-strip { grid-template-columns: 1fr 1fr !important; }
  .vac-strip { grid-template-columns: 1fr 1fr !important; }

  .tab-btn .tab-text { display: none; }
  .tab-btn { padding: 10px 14px; font-size: 16px; }

  .action-bar { flex-direction: column; align-items: stretch; height: auto; padding: 8px 12px; gap: 6px; }
  .action-bar-right { flex-wrap: wrap; justify-content: flex-end; }

  .card-body { padding: 12px !important; }
  .card-header { padding: 10px 14px !important; }

  .modal-box { width: calc(100vw - 32px); padding: 28px 20px; }
}
