:root{--ink:#1c1b1a;--muted:#5c5a57;--paper:#f7f1e8;--paper-2:#efe6d8;--accent:#a13d2d;--line:#d7cdbd}
*{box-sizing:border-box}
body{margin:0;font-family:"Iowan Old Style","Palatino","Garamond",serif;color:var(--ink);background:#f9f4ec}
.topbar{display:flex;justify-content:space-between;align-items:center;padding:14px 18px;border-bottom:1px solid var(--line);background:var(--paper-2)}
.title{font-size:20px;font-weight:700}
.subtitle{font-size:12px;color:var(--muted)}
.user-box{display:flex;gap:12px;align-items:center}
.content{padding:18px;max-width:1400px;margin:0 auto}
.nav-tabs{display:flex;gap:8px;margin-bottom:14px}
.tab-link{padding:8px 12px;border:1px solid var(--line);text-decoration:none;color:var(--ink);background:#fff}
.tab-link.active{background:var(--accent);color:#fff}
.card{background:#fff;border:1px solid var(--line);padding:16px;margin-bottom:16px}
.card-tight{padding:12px 16px}
.form label{display:block;margin-bottom:10px;font-size:14px}
input:not([type="checkbox"]),select,textarea{width:100%;padding:6px;border:1px solid var(--line);font-family:inherit}
input[type="checkbox"]{width:auto;padding:0;border:none}
.row{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.grid{display:grid;grid-template-columns:1fr 1fr 1fr;gap:12px;margin-bottom:12px}
.profile-grid{margin-top:12px}
.info-box{border:1px solid var(--line);background:var(--paper);padding:10px}
.row-actions{display:flex;gap:8px;align-items:center}
.row-actions-wrap{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.primary{background:var(--accent);color:#fff;border:none;padding:8px 12px;cursor:pointer}
.ghost{border:1px solid var(--line);padding:6px 10px;background:#fff;cursor:pointer}
.table{width:100%;border-collapse:collapse;font-size:14px}
.table th,.table td{border:1px solid var(--line);padding:4px 6px;text-align:left;vertical-align:middle}
.weekend-row td{background:#f1f1f1}
.planning-grid th{text-align:center;white-space:nowrap}
.planning-grid td{min-width:110px}
.planning-grid td:first-child{min-width:115px}
.date-gray{background:#e3e3e3}
.hole-cell{background:#ffd6d6}
.manager-lock-cell{background:#fff5b8}
.transversal-overflow-cell{background:#dff6f3}
.alert{background:#fff3e0;border:1px solid #f1c27d;padding:8px;margin-bottom:10px}
.muted{color:var(--muted)}
.status-line{margin:8px 0}
.dot{display:inline-block;width:10px;height:10px;border-radius:50%;margin-right:6px;vertical-align:middle}
.dot-green{background:#2f8f46}
.dot-red{background:#c83d3d}
.status-pill{display:inline-flex;align-items:center;gap:8px;font-size:13px;font-weight:600}
.status-dot{display:inline-block;width:12px;height:12px;border-radius:50%;border:1px solid #555}
.status-green{background:#2f8f46}
.status-red{background:#c83d3d}
.inline-form{display:inline}
.inline-action{display:inline-block;margin-right:4px;margin-bottom:0;text-decoration:none;padding:4px 8px;line-height:1.1;font-size:12px}
.actions-cell{white-space:nowrap}
.table-scroll{display:block;width:100%;max-width:100%;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch}
.period-table-scroll{
  display:block;
  width:calc(100% + 32px);
  max-width:none;
  margin:0 -16px;
  padding:0 16px 8px;
  overflow-x:auto;
  overflow-y:hidden;
  -webkit-overflow-scrolling:touch;
}
.period-table{font-size:11px}
.period-table{width:max-content;min-width:100%}
.period-table th,.period-table td{padding:2px 3px;white-space:nowrap;vertical-align:top}
.period-table td[rowspan]{vertical-align:top}
.period-table input[type="number"]{width:56px;min-width:56px;padding:2px 3px;font-size:11px}
.period-table input[type="date"]{width:118px;min-width:118px;padding:2px 3px;font-size:11px}
.period-table .actions-cell{min-width:220px;width:220px;white-space:normal}
.period-table .actions-cell .inline-form{display:block;margin-bottom:4px}
.period-table .actions-cell .inline-action{display:block;width:100%;min-width:0;text-align:center;margin:0 0 4px}
.vacation-table .actions-cell{min-width:190px;width:190px}
.vacation-table input[type="number"]{width:54px;min-width:54px}
.accounts-table-scroll{
  display:block;
  width:calc(100% + 32px);
  max-width:none;
  margin:0 -16px;
  padding:0 16px 8px;
  overflow-x:auto;
  overflow-y:hidden;
  -webkit-overflow-scrolling:touch;
}
.accounts-table{
  width:100%;
  font-size:12px;
  table-layout:fixed;
}
.accounts-table th,.accounts-table td{
  padding:3px 4px;
  white-space:normal;
  vertical-align:top;
}
.accounts-table th:nth-child(1),.accounts-table td:nth-child(1){width:18%}
.accounts-table th:nth-child(2),.accounts-table td:nth-child(2){width:34%}
.accounts-table th:nth-child(3),.accounts-table td:nth-child(3){width:30%}
.accounts-table th:nth-child(4),.accounts-table td:nth-child(4){width:18%}
.accounts-table .actions-cell{
  min-width:190px;
  width:190px;
  white-space:normal;
}
.accounts-table .actions-cell .inline-form{
  display:block;
  margin-bottom:4px;
}
.accounts-table .actions-cell .inline-action{
  display:block;
  width:100%;
  min-width:0;
  text-align:center;
  margin:0 0 4px;
}
.account-user-cell{vertical-align:top}
.account-user-name{font-weight:700}
.account-user-mail{font-size:11px;color:var(--muted);word-break:break-word;margin-top:2px}
.account-line{display:flex;flex-wrap:wrap;gap:6px 12px;line-height:1.35}
.account-status-cell{word-break:break-word}
.account-status-list{display:flex;flex-wrap:wrap;gap:6px}
.account-period-pill{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:2px 6px;
  border:1px solid var(--line);
  border-radius:999px;
  font-size:11px;
  line-height:1.2;
  background:#faf6ef;
}
.account-period-pill.sent{background:#eef8f0}
.account-period-pill.not-sent{background:#fff1f1}
.account-row-sub td{border-top:none}
.sort-btn{
  border:none;
  background:transparent;
  font:inherit;
  color:inherit;
  padding:0;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  gap:4px;
}
.sort-ind{
  font-size:11px;
  color:var(--muted);
  min-width:14px;
  text-align:center;
}
.period-picker-form{
  display:flex;
  flex-direction:column;
  gap:12px;
  margin-top:8px;
}
.period-picker-buttons{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.period-pick-btn{
  appearance:none;
  -webkit-appearance:none;
  border:1px solid var(--line);
  background:#fff;
  color:var(--ink);
  padding:10px 12px;
  cursor:pointer;
  min-width:190px;
  text-align:left;
  font:inherit;
  border-radius:10px;
  transition:transform .12s ease, border-color .12s ease, box-shadow .12s ease, background .12s ease;
}
.period-pick-btn:hover{
  transform:translateY(-1px);
  border-color:#b79f84;
  box-shadow:0 6px 18px rgba(80, 53, 36, .08);
}
.period-pick-btn.pending{
  background:#ffbf66;
  border:4px solid #b66300;
  color:#5a2a00;
  padding:7px 9px;
  box-shadow:0 0 0 5px rgba(182, 99, 0, .28);
  transform:translateY(-1px) scale(1.01);
}
.period-pick-btn.current{
  background:#c83d3d;
  border:4px solid #9f2727;
  color:#fff;
  padding:7px 9px;
  box-shadow:0 0 0 5px rgba(159, 39, 39, .24);
}
.period-pick-btn:focus-visible{
  outline:4px solid rgba(52, 117, 195, .35);
  outline-offset:2px;
}
.period-pick-title{
  display:block;
  font-weight:700;
  font-size:15px;
  margin-bottom:6px;
}
.period-pick-meta{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.mini-pill{
  display:inline-flex;
  align-items:center;
  gap:6px;
  border:1px solid var(--line);
  background:#fff;
  padding:3px 8px;
  font-size:12px;
  font-weight:600;
}
.mini-pill.active{
  border-color:var(--accent);
  color:var(--accent);
}
.mini-pill.ok{
  color:#2f8f46;
}
.mini-pill.warn{
  color:#c83d3d;
}
.period-pick-btn.current .mini-pill{
  background:rgba(255,255,255,.92);
  color:var(--ink);
}
.period-pick-btn.pending .mini-pill.active{
  border-color:var(--accent);
  color:var(--accent);
}
.period-pick-btn.pending .mini-pill{
  background:rgba(255,255,255,.9);
  color:#5a2a00;
  border-color:#d4a264;
}
.section-head{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:flex-start;
  flex-wrap:wrap;
  margin-bottom:10px;
}
.current-period-row td{
  background:#f9d7d7;
}

.calendar-wrap{display:grid;gap:14px;margin-top:12px}
.month{border:1px solid var(--line);padding:10px;background:#fff}
.month-title{font-weight:700;margin-bottom:8px}
.days{display:grid;grid-template-columns:repeat(7,1fr);gap:6px}
.day{border:1px solid var(--line);padding:6px;background:#fcfaf7;min-height:150px}
.day .date{font-weight:700;font-size:12px}
.day.weekend{background:#fff6dd}
.field{margin-top:6px;font-size:12px}
.field label{display:block;color:var(--muted);margin-bottom:2px}
.check-inline{display:inline-flex;align-items:center;gap:4px;margin-right:10px;color:var(--ink)}

select.value-impossible{background:#ff9e9e}
select.value-prefer_no{background:#ffe3f0}
select.value-possible{background:#dff3e3}
select.value-requested{background:#dbe9ff}

.vac-ca-calendar{border:1px solid var(--line);padding:8px;background:#fff;margin:6px 0}
.vac-month{margin-bottom:8px}
.vac-month-title{font-size:12px;font-weight:700;margin-bottom:4px}
.vac-days{display:grid;grid-template-columns:repeat(7,1fr);gap:4px}
.vac-day{border:1px solid var(--line);padding:4px;min-height:42px;background:#fcfaf7;font-size:11px}
.vac-day.weekend{background:#fff6dd}
.vac-day label{display:flex;align-items:center;gap:4px;color:var(--ink)}
.vac-date{font-weight:700;margin-bottom:4px}
.vac-count{font-size:10px;color:var(--muted);margin-bottom:4px}
.vac-ca-line{display:flex;align-items:center;gap:6px}

@media (max-width: 980px){
  .row{grid-template-columns:1fr}
  .grid{grid-template-columns:1fr}
  .row-actions{flex-wrap:wrap}
  .period-pick-btn{min-width:unset;width:100%}
  .content{padding:12px}
}
