/* Aina Institute — colores corporativos */
:root {
  --brand-orange: #F5A623;
  --brand-orange-dark: #D88E1A;
  --brand-red: #C0392B;
  --brand-red-dark: #A93226;
  --bg: #f7f8fa;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--text); -webkit-tap-highlight-color: transparent;
}
a { color: var(--brand-red); }

.center { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: linear-gradient(135deg, var(--brand-orange) 0%, var(--brand-red) 100%); }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.topbar .who { font-weight: 600; }
.topbar .sub { font-size: 12px; color: var(--muted); }
.topbar a { color: var(--brand-red); text-decoration: none; padding: 8px 14px; border-radius: 8px; background: #f3f4f6; font-size: 14px; }

.tabs { background: #fff; border-bottom: 1px solid var(--border); padding: 0 12px; display: flex; gap: 4px; overflow-x: auto; }
.tabs a { padding: 12px 16px; text-decoration: none; color: var(--muted); font-size: 14px; font-weight: 500; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.active { color: var(--brand-orange); border-bottom-color: var(--brand-orange); }

.container { max-width: 1200px; margin: 16px auto; padding: 0 12px; }
.container.narrow { max-width: 780px; }

.card { background: #fff; border-radius: 12px; padding: 16px; margin: 12px 0; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.card h1, .card h2, .card h3 { margin-top: 0; }

h1 { font-size: 22px; margin: 0.5em 0; }
h2 { font-size: 18px; margin: 0.4em 0; }
.muted { color: var(--muted); font-size: 14px; }

.flash { background: #dcfce7; color: #166534; padding: 10px 14px; border-radius: 8px; margin: 10px 0; border: 1px solid #86efac; }
.error { background: #fee2e2; color: #991b1b; padding: 10px 14px; border-radius: 8px; margin: 10px 0; border: 1px solid #fca5a5; }
.alert-red { background: #fee2e2; color: #991b1b; padding: 10px 14px; border-radius: 8px; margin: 6px 0; border: 1px solid #fca5a5; font-size: 14px; }
.alert-yellow { background: #fef3c7; color: #92400e; padding: 10px 14px; border-radius: 8px; margin: 6px 0; border: 1px solid #fcd34d; font-size: 14px; }

label { display: block; margin: 10px 0; font-size: 14px; font-weight: 500; }
label .lbl { display: block; margin-bottom: 4px; }
input, select, textarea { width: 100%; padding: 10px 12px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 15px; font-family: inherit; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand-orange); box-shadow: 0 0 0 3px rgba(245,166,35,0.2); }
textarea { min-height: 60px; resize: vertical; }

button, .btn { background: var(--brand-orange); color: #fff; border: 0; padding: 10px 18px; border-radius: 8px; font-size: 15px; cursor: pointer; text-decoration: none; display: inline-block; font-weight: 500; }
button:hover, .btn:hover { background: var(--brand-orange-dark); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.danger, .btn.danger { background: var(--brand-red); }
button.danger:hover, .btn.danger:hover { background: var(--brand-red-dark); }
button.secondary, .btn.secondary { background: #e5e7eb; color: var(--text); }
button.secondary:hover, .btn.secondary:hover { background: #d1d5db; }
button.big { width: 100%; padding: 16px; font-size: 17px; }

form.card { width: 100%; max-width: 360px; }
form.card h1 { color: var(--brand-red); text-align: center; }
form.card .sub { text-align: center; color: var(--muted); margin: 0 0 16px; }

.row-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.row-actions form { display: inline; margin: 0; }

table { width: 100%; border-collapse: collapse; margin-top: 4px; font-size: 14px; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; }
th { background: #f9fafb; font-weight: 600; font-size: 13px; color: #374151; }
td.num { font-variant-numeric: tabular-nums; }
.table-scroll { overflow-x: auto; margin: 0 -16px; padding: 0 16px; }
.table-scroll table { min-width: 900px; }
.table-scroll.wide table { min-width: 1100px; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.b-green { background: #dcfce7; color: #166534; }
.b-yellow { background: #fef3c7; color: #92400e; }
.b-red { background: #fee2e2; color: #991b1b; }
.b-blue { background: #dbeafe; color: #1e40af; }
.b-orange { background: #ffedd5; color: #9a3412; }
.b-purple { background: #ede9fe; color: #5b21b6; }
.b-gray { background: #e5e7eb; color: #374151; }

.row-festivo { background: #fff7e6; }
.row-vacaciones { background: #e7f5ff; }
.row-bolsa { background: #f3e8ff; }
.row-baja { background: #ffe4e6; }
.row-permiso { background: #ecfccb; }
.row-libre { background: #f3f4f6; }

.clock-time { font-size: 48px; font-weight: 800; color: var(--brand-red); font-variant-numeric: tabular-nums; line-height: 1; }
.clock-date { font-size: 16px; color: var(--muted); text-transform: capitalize; margin-bottom: 8px; }
.clock-top { display: flex; flex-direction: column; gap: 4px; }
@media (min-width: 640px) {
  .clock-top { flex-direction: row; justify-content: space-between; align-items: flex-end; }
  .clock-time { font-size: 56px; }
}

.status-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 12px 0; }
@media (min-width: 640px) { .status-grid { grid-template-columns: repeat(4, 1fr); } }
.status-box { background: #f9fafb; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.status-box .lbl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.status-box .val { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 2px; }

.progress { height: 12px; border-radius: 999px; background: #e5e7eb; overflow: hidden; }
.progress > div { height: 100%; background: var(--brand-orange); transition: width 0.3s; }
.progress.full > div { background: #16a34a; }
.progress-line { display: flex; justify-content: space-between; font-size: 13px; margin: 12px 0 4px; }

.btn-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
@media (min-width: 640px) { .btn-grid { grid-template-columns: repeat(4, 1fr); } }

.metrics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 12px 0; }
@media (min-width: 768px) { .metrics { grid-template-columns: repeat(3, 1fr); } }
.metrics.q4 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 768px) { .metrics.q4 { grid-template-columns: repeat(4, 1fr); } }
.metric { background: #fff; border-radius: 12px; padding: 14px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.metric .lbl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.metric .val { font-size: 24px; font-weight: 700; margin-top: 4px; }

.filters { display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 768px) { .filters { grid-template-columns: repeat(5, 1fr); } }

.calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.calendar .dow { text-align: center; font-size: 11px; font-weight: 700; color: var(--muted); padding: 4px 0; }
.calendar .day { aspect-ratio: 1/1; border: 1px solid var(--border); border-radius: 8px; padding: 6px; cursor: pointer; background: #fff; font-size: 12px; text-decoration: none; color: inherit; display: flex; flex-direction: column; justify-content: space-between; }
.calendar .day:hover { box-shadow: 0 0 0 2px var(--brand-orange); }
.calendar .day .n { font-weight: 700; font-size: 14px; }
.calendar .day .lab { font-size: 10px; opacity: 0.8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendar .day .dot { width: 6px; height: 6px; border-radius: 50%; background: #2563eb; display: inline-block; }
.calendar .empty { aspect-ratio: 1/1; }
.calendar .weekend .n { color: var(--muted); }
.cal-festivo { background: #fff7e6; }
.cal-vacaciones { background: #e7f5ff; }
.cal-bolsa { background: #f3e8ff; }
.cal-baja { background: #ffe4e6; }
.cal-permiso { background: #ecfccb; }
.cal-libre { background: #f3f4f6; }

.month-nav { display: flex; align-items: center; gap: 8px; }
.month-nav .lab { min-width: 180px; text-align: center; font-weight: 600; text-transform: capitalize; }

.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; padding: 12px; z-index: 100; }
.modal { background: #fff; border-radius: 12px; max-width: 480px; width: 100%; max-height: 90vh; overflow-y: auto; padding: 20px; }
.modal h3 { margin-top: 0; }
.modal .notice { background: #fff7e6; border: 1px solid #fcd34d; color: #92400e; padding: 10px; border-radius: 8px; font-size: 13px; margin-bottom: 12px; }
.modal .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 480px) { .grid-2 { grid-template-columns: 1fr; } }

.absences { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; text-align: center; font-size: 11px; margin-top: 8px; }
.absences > div { border-radius: 6px; padding: 4px; }
.absences .v { font-weight: 700; font-size: 16px; display: block; }
