/* =====================================================
   ALVIFY — Dirección B "Arco-reloj"
   ===================================================== */

:root {
  color-scheme: light;

  /* Backgrounds */
  --bg:          #ffffff;
  --surface:     #ffffff;
  --surface2:    #f4f3f0;
  --sidebar:     #faf9f7;
  --hover:       #f1f0ec;

  /* Borders */
  --border:      #dedcd7;
  --border-soft: #ecebe7;
  --border-hover:#b9b7b1;

  /* Text */
  --text:        #191816;
  --text-muted:  #5e5c58;
  --text-faint:  #8d8b86;

  /* Brand */
  --brand:       #3372ff;
  --brand-dark:  #1f5ae6;
  --brand-soft:  #e8efff;
  --accent:      #fef373;
  --ink:         #141414;

  /* Semantic */
  --success:     #1f9d55;
  --danger:      #d93838;
  --focus:       #3372ff;

  /* Shape */
  --radius:      10px;
  --radius-md:   20px;
  --radius-lg:   24px;
  --radius-pill: 999px;

  /* Motion */
  --dur:         220ms;
  --dur-fast:    120ms;
  --ease:        cubic-bezier(0.22, 1, 0.36, 1);

  /* Typography */
  --font:        'Onest', system-ui, -apple-system, sans-serif;
  --font-accent: 'Onest', system-ui, -apple-system, sans-serif;
}

/* ---- RESET ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
button, input, select, textarea { font-family: var(--font); font-size: inherit; }
fieldset { border: none; padding: 0; }

/* ---- BASE ---- */
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* =====================================================
   LOGO
   ===================================================== */

.logo-dot { fill: var(--brand); }

.sidebar-logo { display: block; height: 26px; width: 82px; align-self: flex-start; color: var(--ink); margin: 4px 8px 28px; }
.login-logo   { display: block; width: min(340px, 80%); height: auto; align-self: flex-start; color: var(--ink); }

/* =====================================================
   SCREENS + LAYOUT CON SIDEBAR
   ===================================================== */

.screen { display: none; }
.screen.active { display: block; }

#screen-app.active {
  background: linear-gradient(to right, var(--sidebar) 248px, var(--bg) 248px);
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: var(--sidebar);
  border-right: 1px solid var(--border-soft);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.side-nav { display: flex; flex-direction: column; gap: 4px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: none;
  border: none;
  color: var(--text);
  padding: 11px 12px;
  border-radius: var(--radius-pill);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background var(--dur-fast), color var(--dur-fast);
}
.nav-item:hover { background: var(--hover); }
.nav-item.active { background: var(--ink); color: #fff; font-weight: 600; }
.nav-icon { width: 20px; height: 20px; flex-shrink: 0; }

.side-user {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 4px;
}

.user-chip {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.main { position: relative; min-width: 0; overflow: hidden; }

/* =====================================================
   LOGIN
   ===================================================== */

#screen-login.active { display: flex; min-height: 100vh; }

.login-hero {
  background: var(--sidebar);
  border-right: 1px solid var(--border-soft);
  flex: 0 0 46%;
  position: relative;
  overflow: hidden;
  padding: 72px 56px;
  min-height: 100vh;
}

.login-claim {
  margin-top: 22px;
  color: var(--text-muted);
  font-size: 20px;
}

.login-hero .arch-art {
  position: absolute;
  right: 12%;
  bottom: -14%;
  width: 56%;
  max-width: 380px;
}

.login-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  background: var(--bg);
}

.login-form { width: 100%; max-width: 340px; }
.login-logo-mobile { display: none; width: 34px; height: auto; margin-bottom: 20px; }

.login-form h2 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: -0.6px;
}

.login-sub { color: var(--text-muted); font-size: 15px; margin-bottom: 28px; }

/* =====================================================
   INICIO — saludo + arco decorativo
   ===================================================== */

.hello { margin-bottom: 28px; }
.hello h1 { font-size: 44px; font-weight: 800; letter-spacing: -1.4px; line-height: 1.05; }
.hello p  { color: var(--text-muted); font-size: 17px; margin-top: 8px; }

#tab-register.active { position: relative; min-height: 100vh; }
#tab-register .page-layout { position: relative; z-index: 1; }

.arch-home {
  position: absolute;
  right: 4%;
  bottom: -60px;
  width: 340px;
  z-index: 0;
  pointer-events: none;
}

/* =====================================================
   TAB CONTENT
   ===================================================== */

.tab-content { display: none; }
.tab-content.active { display: block; }

/* =====================================================
   PAGE LAYOUT
   ===================================================== */

.page-layout {
  max-width: 820px;
  padding: 64px 72px 72px;
}

/* =====================================================
   CARDS
   ===================================================== */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px 32px;
  margin-bottom: 16px;
  box-shadow: 0 1px 2px rgba(20,20,20,0.04), 0 8px 24px rgba(20,20,20,0.04);
}

.card h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 14px;
  letter-spacing: -0.2px;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 22px;
  letter-spacing: -0.5px;
}

/* =====================================================
   FORM SECTIONS (fieldsets con eyebrow)
   ===================================================== */

.form-section {
  margin-bottom: 24px;
}

.form-section + .form-section {
  border-top: 1px solid var(--border-soft);
  padding-top: 24px;
}

.eyebrow {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 16px;
}

/* =====================================================
   FORM GRID
   ===================================================== */

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
}

.form-grid.two-col {
  grid-template-columns: 1fr 1fr;
}

/* =====================================================
   FIELDS
   ===================================================== */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.optional {
  color: var(--text-faint);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

/* Fecha standalone (no en grid) */
.date-field {
  margin-bottom: 16px;
  max-width: 200px;
}

/* =====================================================
   INPUTS, TEXTAREA
   ===================================================== */

.field input[type="text"],
.field input[type="date"],
.field input[type="time"],
.field input[type="number"],
.field input[type="password"],
.field textarea {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 14px;
  width: 100%;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}

.field textarea {
  resize: vertical;
  min-height: 68px;
  line-height: 1.5;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(51,114,255,0.18);
}

.field input::placeholder,
.field textarea::placeholder { color: var(--text-faint); }

/* =====================================================
   SELECT WRAPPER (custom dropdown)
   ===================================================== */

.select { position: relative; }

.select select {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  padding: 10px 36px 10px 12px;
  font-size: 14px;
  font-family: var(--font);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}

.select select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(51,114,255,0.18);
}

.select select option { background: var(--surface); }

.select select:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.select-chevron {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-faint);
  pointer-events: none;
}

/* Search en filters de reporte (directo, sin .field) */
.report-filters input[type="date"] {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 14px;
  font-family: var(--font);
}

/* Admin add-row inputs (directo, sin .field) */
.add-row input {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  padding: 8px 10px;
  font-size: 13px;
  font-family: var(--font);
}

.add-row input::placeholder { color: var(--text-faint); }

.add-row input:focus {
  outline: none;
  border-color: var(--brand);
}

/* =====================================================
   BUTTONS
   ===================================================== */

.btn-primary {
  background: var(--brand);
  min-height: 44px;
  color: white;
  border: none;
  border-radius: var(--radius-pill);
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  white-space: nowrap;
  transition: background var(--dur-fast), transform var(--dur-fast);
}

.btn-primary:hover { background: var(--brand-dark); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary.full { width: 100%; margin-top: 16px; }

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 9px 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font);
  white-space: nowrap;
  transition: border-color var(--dur-fast), background var(--dur-fast);
}

.btn-secondary:hover { border-color: var(--border-hover); background: var(--surface2); }
.btn-secondary.small { padding: 6px 14px; font-size: 12px; }

.btn-ghost {
  background: none;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font);
  transition: color var(--dur-fast), border-color var(--dur-fast);
}

.btn-ghost:hover { color: var(--text); border-color: var(--border-hover); }
.btn-ghost.small { padding: 5px 12px; font-size: 12px; }

/* =====================================================
   MODE TOGGLE (preciso / rápido)
   ===================================================== */

.mode-toggle-wrap { margin-bottom: 16px; }

.mode-toggle {
  display: inline-flex;
  gap: 3px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 3px;
}

.mode-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  border-radius: var(--radius-pill);
  padding: 6px 16px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font);
  transition: background var(--dur-fast), color var(--dur-fast);
}

.mode-btn.active {
  background: var(--brand);
  color: white;
  font-weight: 600;
}

.mode-btn:not(.active):hover { color: var(--text); }

/* =====================================================
   TIME FIELDS
   ===================================================== */

.time-fields { width: 100%; }

/* =====================================================
   FORM FOOTER + DURATION
   ===================================================== */

.form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 20px;
  border-top: 1px solid var(--border-soft);
}

.duration-display {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.duration-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-faint);
}

.duracion-preview {
  font-size: 44px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
}

/* =====================================================
   ENTRY LIST (historial)
   ===================================================== */

.entry-list { display: flex; flex-direction: column; }

.week-group { margin-bottom: 28px; }

.week-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.9px;
}

.week-total { color: var(--brand); font-size: 13px; font-weight: 700; letter-spacing: 0; }

.entry-row {
  display: grid;
  grid-template-columns: 78px minmax(140px, auto) minmax(0, 1fr) auto auto auto;
  gap: 12px;
  align-items: center;
  padding: 11px 8px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 13px;
  border-radius: var(--radius);
  margin: 0 -8px;
  transition: background var(--dur-fast);
}

.entry-row:last-child { border-bottom: none; }
.entry-row:hover { background: var(--surface2); }

.entry-date {
  color: var(--text-faint);
  font-size: 12px;
  white-space: nowrap;
}

.entry-proyecto { font-weight: 600; font-size: 13px; }

.entry-proyecto small {
  display: block;
  font-weight: 400;
  color: var(--text-muted);
  font-size: 11px;
  margin-top: 2px;
}

.entry-desc {
  color: var(--text-muted);
  font-size: 12px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag {
  display: inline-block;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 3px 10px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  color: var(--text-muted);
}

.entry-duracion {
  font-weight: 700;
  text-align: right;
  font-size: 14px;
  white-space: nowrap;
}

.entry-actions { display: flex; gap: 2px; }

.btn-icon {
  background: none;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  padding: 5px 7px;
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1;
  transition: background var(--dur-fast), color var(--dur-fast);
}

.btn-icon:hover                           { background: var(--surface2); color: var(--text); }
.btn-icon.repeat-icon:hover               { background: var(--surface2); color: var(--brand); }
.btn-icon.edit-icon:hover                 { background: var(--surface2); color: var(--text); }
.btn-icon:not(.repeat-icon):not(.edit-icon):hover { background: var(--surface2); color: var(--danger); }

/* =====================================================
   GOAL WIDGET
   ===================================================== */

.goal-widget {
  background: var(--surface2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 16px;
}

.goal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.goal-title {
  font-weight: 700;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.9px;
  font-size: 10px;
}

.goal-numbers {
  font-weight: 700;
  font-size: 14px;
}

.goal-numbers span { color: var(--brand); }

.goal-edit-btn {
  background: none;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: var(--radius);
  font-family: var(--font);
  transition: color var(--dur-fast);
}

.goal-edit-btn:hover { color: var(--text-muted); }

.progress-track {
  background: var(--border);
  border-radius: 99px;
  height: 6px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--brand);
  transition: width 0.5s var(--ease);
}

.progress-fill.over { background: var(--success); }

/* =====================================================
   SEARCH BAR
   ===================================================== */

.search-bar { margin-bottom: 16px; }

.search-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 14px;
  font-family: var(--font);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}

.search-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(51,114,255,0.18);
}

.search-input::placeholder { color: var(--text-faint); }

/* =====================================================
   REPORTS
   ===================================================== */

.report-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-end;
  margin-bottom: 24px;
}

.custom-dates { display: flex; gap: 10px; }

.report-result { margin-top: 8px; }

.report-summary {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 24px;
  margin-bottom: 24px;
  background: var(--surface2);
  border-radius: var(--radius-md);
}

.total-horas {
  font-size: 56px;
  font-weight: 800;
  letter-spacing: -1.5px;
  color: var(--brand);
  line-height: 1;
  margin-bottom: 6px;
}

.total-label {
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  font-weight: 600;
}

/* ---- BAR CHART ---- */
.chart-container {
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chart-row {
  display: grid;
  grid-template-columns: 130px 1fr 54px;
  align-items: center;
  gap: 10px;
}

.chart-label {
  text-align: right;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
  font-weight: 500;
}

.chart-track {
  background: var(--surface2);
  border-radius: 99px;
  height: 8px;
  overflow: hidden;
}

.chart-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--brand);
  transition: width 0.6s var(--ease);
}

.chart-value {
  font-weight: 700;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ---- Report table ---- */
.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.report-table th {
  text-align: left;
  padding: 8px 12px;
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  border-bottom: 1px solid var(--border);
}

.report-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-soft);
}

.export-buttons {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  justify-content: flex-end;
}

/* =====================================================
   ADMIN
   ===================================================== */

.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

.admin-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  max-height: 240px;
  overflow-y: auto;
}

.admin-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  background: var(--surface2);
  border-radius: var(--radius);
  font-size: 13px;
}

.admin-item.inactive { opacity: 0.4; }

.add-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

.full-width-card { grid-column: 1 / -1; }

/* =====================================================
   MODAL
   ===================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20,20,20,0.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-header h2 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-soft);
}

/* =====================================================
   ASANA TAG (en listado)
   ===================================================== */

.asana-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-faint);
  background: var(--surface2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-pill);
  padding: 2px 8px;
  margin-top: 3px;
  text-decoration: none;
  max-width: 180px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  transition: border-color var(--dur-fast), color var(--dur-fast);
}

.asana-tag:hover { border-color: var(--border-hover); color: var(--text-muted); }

/* =====================================================
   MISC
   ===================================================== */

.empty-state {
  color: var(--text-faint);
  text-align: center;
  padding: 40px 24px;
  font-style: italic;
}

.error-msg {
  color: var(--danger);
  font-size: 13px;
  margin-top: 8px;
}

.hidden { display: none !important; }

/* =====================================================
   MUSIC BAR
   ===================================================== */

.music-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px 14px 18px;
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 520px;
}

.music-bar-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-faint);
  display: flex;
  align-items: center;
  gap: 8px;
}
.music-bar-label::before {
  content: '';
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 1px rgba(20,20,20,0.12);
}

.music-bar-track { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.music-bar-info  { display: flex; flex-direction: column; min-width: 0; }

.music-bar-title,
.music-bar-artist { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.music-bar-title  { font-weight: 700; font-size: 15px; }
.music-bar-artist { color: var(--text-muted); font-size: 13px; }

.music-bar-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius-pill);
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background var(--dur-fast), transform var(--dur-fast);
}
.music-bar-btn:hover  { background: #000; }
.music-bar-btn:active { transform: scale(0.97); }

/* =====================================================
   TOAST
   ===================================================== */

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 8px 32px rgba(20,20,20,0.14);
  z-index: 999;
  transition: opacity 0.3s;
  white-space: nowrap;
}

.toast.success { border-color: var(--success); color: var(--success); }
.toast.error   { border-color: var(--danger);  color: var(--danger);  }

/* =====================================================
   RESPONSIVE
   ===================================================== */

@media (max-width: 1100px) {
  .arch-home { width: 240px; right: 2%; opacity: 0.9; }
}

@media (max-width: 860px) {
  .form-grid { grid-template-columns: 1fr 1fr; }
  .admin-grid { grid-template-columns: 1fr 1fr; }
  .full-width-card { grid-column: 1 / -1; }
  .page-layout { padding: 40px 32px 56px; }
  .arch-home { display: none; }
}

@media (max-width: 720px) {
  #screen-app.active { grid-template-columns: 1fr; background: var(--bg); }
  .sidebar {
    position: sticky; top: 0; z-index: 100;
    height: auto; flex-direction: row; align-items: center;
    padding: 10px 12px; gap: 8px;
    border-right: none; border-bottom: 1px solid var(--border-soft);
  }
  .sidebar-logo { height: 20px; width: 63px; margin: 0 4px 0 0; flex-shrink: 0; align-self: center; }
  .side-nav { flex-direction: row; flex: 1; gap: 2px; overflow-x: auto; }
  .nav-item { padding: 8px 10px; font-size: 13px; gap: 6px; width: auto; white-space: nowrap; }
  .nav-icon { width: 16px; height: 16px; }
  .side-user { margin: 0; padding: 0; }
  .user-chip { display: none; }
  .entry-row { grid-template-columns: 72px auto minmax(0,1fr) auto auto; gap: 8px; }
}

@media (max-width: 600px) {
  .page-layout { padding: 24px 16px 40px; }
  .hello h1 { font-size: 32px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid.two-col { grid-template-columns: 1fr 1fr; }
  .admin-grid { grid-template-columns: 1fr; }
  .login-hero { display: none; }
  .login-logo-mobile { display: block; }
  .login-panel { min-height: 100vh; padding: 40px 24px; }
  .modal-box { padding: 20px; max-height: 95vh; border-radius: var(--radius-md); }
  .chart-row { grid-template-columns: 90px 1fr 44px; }
  .date-field { max-width: 100%; }
  .duracion-preview { font-size: 34px; }
  .nav-item span { display: none; }
}

@media (max-width: 480px) {
  .entry-row {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 6px 10px;
  }
}
