/* ============================================================
   CME Control — main.css v3.0
   Sistema de diseño: Google-inspired, paleta CME semántica
   Fuentes cargadas desde core/includes/header.php
   ============================================================ */

/* --- Reset y base ----------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: #202124;
  background: #F1F3F4;
  -webkit-font-smoothing: antialiased;
}

/* --- Tokens de color -------------------------------------- */
:root {
  --color-primary:      #1A73E8;
  --color-primary-bg:   #E8F0FE;
  --color-primary-dark: #1557B0;

  --color-success:      #34A853;
  --color-success-bg:   #E6F4EA;
  --color-success-dark: #137333;

  --color-warning:      #FBBC04;
  --color-warning-bg:   #FEF9E7;
  --color-warning-dark: #B06000;

  --color-danger:       #EA4335;
  --color-danger-bg:    #FCE8E6;
  --color-danger-dark:  #A32D2D;

  --color-surface:      #FFFFFF;
  --color-bg:           #F1F3F4;
  --color-text:         #202124;
  --color-text-sec:     #5F6368;
  --color-text-hint:    #9AA0A6;
  --color-border:       #DADCE0;
  --color-border-light: #F1F3F4;

  --radius-sm:  6px;
  --radius-md:  8px;
  --radius-lg:  12px;
  --radius-xl:  16px;
  --radius-full: 9999px;

  --shadow-card: 0 1px 3px rgba(60,64,67,0.08), 0 1px 2px rgba(60,64,67,0.06);
  --shadow-elevated: 0 4px 12px rgba(60,64,67,0.12);

  --sidebar-expanded:  200px;
  --sidebar-collapsed: 56px;
  --topbar-height:     56px;

  --transition: 0.2s ease;
}

/* --- LOGIN ------------------------------------------------ */
.login-body {
  background: var(--color-bg);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.login-wrap {
  width: 100%;
  max-width: 400px;
}

.login-logo {
  text-align: center;
  margin-bottom: 1.75rem;
}

.cubes {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.cube {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0;
}

.cube-y { background: #F9AB00; }
.cube-b { background: #1A73E8; }
.cube-r { background: #EA4335; }

.cube-sm { width: 22px; height: 22px; font-size: 10px; border-radius: 4px; }

.login-sub {
  margin-top: 10px;
  font-size: 0.8125rem;
  color: var(--color-text-sec);
  letter-spacing: 0.02em;
}

.login-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: var(--shadow-card);
}

.login-title {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 1.5rem;
}

.login-hint {
  font-size: 0.75rem;
  color: var(--color-text-hint);
  text-align: center;
  margin-top: 1rem;
}

/* --- FORMULARIOS ------------------------------------------ */
.field-group { margin-bottom: 1.125rem; }

.field-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-sec);
  margin-bottom: 5px;
}

.field-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-family: inherit;
  color: var(--color-text);
  background: var(--color-surface);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.field-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(26,115,232,0.12);
}

.field-input::placeholder { color: var(--color-text-hint); }

select.field-input { cursor: pointer; }
textarea.field-input { resize: vertical; min-height: 80px; }

/* --- BOTONES ---------------------------------------------- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 20px;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background var(--transition), transform 0.1s;
}

.btn-primary:hover  { background: var(--color-primary-dark); }
.btn-primary:active { transform: scale(0.98); }

.btn-success {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 16px;
  background: var(--color-success);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background var(--transition);
}

.btn-success:hover { background: var(--color-success-dark); }

.btn-danger-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 16px;
  background: var(--color-surface);
  color: var(--color-danger);
  border: 1px solid var(--color-danger);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background var(--transition);
}

.btn-danger-outline:hover { background: var(--color-danger-bg); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 14px;
  background: transparent;
  color: var(--color-text-sec);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background var(--transition);
}

.btn-ghost:hover { background: var(--color-bg); }

.btn-block { width: 100%; }

.btn-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: transparent;
  border: 1px solid var(--color-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-text-sec);
  transition: background var(--transition);
}

.btn-icon:hover { background: var(--color-bg); }

/* --- ALERTAS ---------------------------------------------- */
.alert {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
}

.alert-error {
  background: var(--color-danger-bg);
  color: var(--color-danger-dark);
  border: 1px solid rgba(234,67,53,0.2);
}

.alert-success {
  background: var(--color-success-bg);
  color: var(--color-success-dark);
  border: 1px solid rgba(52,168,83,0.2);
}

.alert-warning {
  background: var(--color-warning-bg);
  color: var(--color-warning-dark);
  border: 1px solid rgba(251,188,4,0.3);
}

/* --- LAYOUT APP ------------------------------------------- */
.app-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* Topbar */
.app-topbar {
  height: var(--topbar-height);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  flex-shrink: 0;
  z-index: 100;
}

.topbar-toggle {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-text-sec);
  flex-shrink: 0;
  transition: background var(--transition);
}

.topbar-toggle:hover { background: var(--color-bg); }

.topbar-brand { display: flex; align-items: center; gap: 8px; }

.obra-pill {
  background: var(--color-primary-bg);
  color: var(--color-primary);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.topbar-username {
  font-size: 0.8125rem;
  color: var(--color-text-sec);
  display: none;
}

@media (min-width: 640px) { .topbar-username { display: block; } }

.topbar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-primary-bg);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  flex-shrink: 0;
  cursor: pointer;
}

.topbar-avatar-admin {
  background: #FEF3E2;
  color: #BA7517;
}

/* Cuerpo: sidebar + contenido */
.app-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Sidebar */
.app-sidebar {
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  width: var(--sidebar-expanded);
  flex-shrink: 0;
  transition: width var(--transition);
  overflow: hidden;
  overflow-y: auto;
}

.app-sidebar.collapsed { width: var(--sidebar-collapsed); }

.nav-section-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--color-text-hint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 14px 16px 4px;
  white-space: nowrap;
  overflow: hidden;
}

.app-sidebar.collapsed .nav-section-label { opacity: 0; height: 0; padding: 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: var(--color-text-sec);
  font-size: 0.875rem;
  font-weight: 400;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  border-radius: 0;
  overflow: hidden;
}

.nav-item:hover {
  background: var(--color-bg);
  color: var(--color-text);
}

.nav-item.active {
  background: var(--color-primary-bg);
  color: var(--color-primary);
  font-weight: 500;
}

.nav-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.nav-label { overflow: hidden; }
.app-sidebar.collapsed .nav-label { display: none; }
.app-sidebar.collapsed .nav-item { justify-content: center; padding: 12px 0; }

.nav-bottom {
  margin-top: auto;
  border-top: 1px solid var(--color-border);
}

/* Contenido principal */
.app-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  background: var(--color-bg);
}

/* --- CARDS ------------------------------------------------ */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-card);
}

.card-title {
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 1rem;
}

/* --- STAT CARDS ------------------------------------------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--color-text);
  line-height: 1.2;
  margin-bottom: 2px;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--color-text-sec);
}

/* --- WORKER CARDS ----------------------------------------- */
.worker-list { display: flex; flex-direction: column; gap: 8px; }

.worker-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-left-width: 3px;
}

.worker-card.estado-dentro { border-left-color: var(--color-success); }
.worker-card.estado-fuera  { border-left-color: var(--color-border); }

.worker-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-primary-bg);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  font-weight: 600;
  flex-shrink: 0;
}

.worker-name {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 2px;
}

.worker-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  color: var(--color-text-sec);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot-green  { background: var(--color-success); }
.status-dot-gray   { background: var(--color-text-hint); }
.status-dot-yellow { background: var(--color-warning); }

.worker-actions { margin-left: auto; display: flex; gap: 8px; flex-shrink: 0; }

/* --- BADGES ----------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 500;
}

.badge-success { background: var(--color-success-bg); color: var(--color-success-dark); }
.badge-warning { background: var(--color-warning-bg); color: var(--color-warning-dark); }
.badge-danger  { background: var(--color-danger-bg);  color: var(--color-danger-dark); }
.badge-primary { background: var(--color-primary-bg); color: var(--color-primary-dark); }
.badge-gray    { background: var(--color-bg); color: var(--color-text-sec); border: 1px solid var(--color-border); }

/* --- SYNC BAR --------------------------------------------- */
.sync-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--color-text-sec);
  padding: 8px 16px;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  flex-shrink: 0;
}

/* --- TABLAS ----------------------------------------------- */
.table-wrap { overflow-x: auto; }

table.cme-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.cme-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-sec);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

.cme-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--color-border-light);
  color: var(--color-text);
  vertical-align: middle;
}

.cme-table tr:last-child td { border-bottom: none; }
.cme-table tbody tr:hover { background: var(--color-bg); }

/* --- PAGE HEADER ------------------------------------------ */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 12px;
}

.page-title {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--color-text);
}

/* --- UTILIDADES ------------------------------------------- */
.text-sec   { color: var(--color-text-sec); }
.text-hint  { color: var(--color-text-hint); }
.text-sm    { font-size: 0.8125rem; }
.text-xs    { font-size: 0.75rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }

/* --- RESPONSIVE ------------------------------------------- */
@media (max-width: 768px) {
  .app-sidebar { width: var(--sidebar-collapsed); }
  .app-sidebar .nav-label { display: none; }
  .app-sidebar .nav-item { justify-content: center; padding: 12px 0; }
  .app-sidebar .nav-section-label { opacity: 0; height: 0; padding: 0; }
  .app-sidebar.expanded { width: var(--sidebar-expanded); }
  .app-sidebar.expanded .nav-label { display: block; }
  .app-sidebar.expanded .nav-item { justify-content: flex-start; padding: 10px 16px; }
  .app-sidebar.expanded .nav-section-label { opacity: 1; height: auto; padding: 14px 16px 4px; }
  .app-content { padding: 1rem; }
}

/* --- TOAST ------------------------------------------------ */
.cme-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  padding: 11px 20px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  color: #fff;
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 9999;
  white-space: nowrap;
  box-shadow: var(--shadow-elevated);
  pointer-events: none;
}

.cme-toast-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.cme-toast-success { background: var(--color-success); }
.cme-toast-error   { background: var(--color-danger); }
.cme-toast-warning { background: var(--color-warning-dark); }

/* --- EMPTY STATE ------------------------------------------ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  text-align: center;
}

.empty-icon {
  color: var(--color-text-hint);
  margin-bottom: 1rem;
}

.empty-title {
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 0.5rem;
}

.empty-desc {
  font-size: 0.875rem;
  color: var(--color-text-sec);
  max-width: 320px;
}

/* ── PAGE HEADER ─────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
}
.page-title   { font-size: 1.375rem; font-weight: 600; color: var(--color-text); margin: 0; }
.page-subtitle{ font-size: .875rem;  color: var(--color-text-sec); margin: 4px 0 0; }

/* ── STATS GRID ──────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--color-surface);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
  transition: opacity .3s;
}
.stat-card--loading { opacity: .5; }
.stat-card__icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-card__icon--blue   { background: #e8f0fe; color: var(--color-primary); }
.stat-card__icon--green  { background: #e6f4ea; color: var(--color-success); }
.stat-card__icon--yellow { background: #fef7e0; color: #f29900; }
.stat-card__icon--red    { background: #fce8e6; color: var(--color-danger); }
.stat-card__body  { display: flex; flex-direction: column; gap: 2px; }
.stat-card__value { font-size: 1.75rem; font-weight: 700; color: var(--color-text); line-height: 1; }
.stat-card__label { font-size: .8rem; color: var(--color-text-sec); }

/* ── CARD ────────────────────────────────────────────────── */
.card          { background: var(--color-surface); border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.08); overflow: hidden; }
.card-header   { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid #e8eaed; }
.card-title    { font-size: 1rem; font-weight: 600; color: var(--color-text); margin: 0; }
.card-body     { padding: 20px; }
.card-body.p-0 { padding: 0; }
.mt-4          { margin-top: 24px; }

/* ── TABLA ───────────────────────────────────────────────── */
.tabla { width: 100%; border-collapse: collapse; font-size: .875rem; }
.tabla thead th {
  text-align: left; padding: 10px 16px;
  font-size: .75rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .04em; color: var(--color-text-sec);
  border-bottom: 1px solid #e8eaed; background: #f8f9fa;
}
.tabla tbody tr { border-bottom: 1px solid #f1f3f4; }
.tabla tbody tr:last-child { border-bottom: none; }
.tabla tbody tr:hover { background: #f8f9fa; }
.tabla tbody td { padding: 12px 16px; color: var(--color-text); vertical-align: middle; }
.td-acciones   { text-align: right; white-space: nowrap; }

/* ── BADGES ──────────────────────────────────────────────── */
.badge            { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: .75rem; font-weight: 500; }
.badge-success    { background: #e6f4ea; color: #137333; }
.badge-warning    { background: #fef7e0; color: #b06000; }
.badge-danger     { background: #fce8e6; color: #c5221f; }
.badge-primary    { background: #e8f0fe; color: #1557b0; }
.badge-secondary  { background: #f1f3f4; color: var(--color-text-sec); }

/* ── BOTONES EXTRA ───────────────────────────────────────── */
.btn-sm  { padding: 6px 14px; font-size: .8125rem; }
.btn-xs  { padding: 4px 10px; font-size: .75rem; border-radius: 6px; }
.btn-outline {
  background: transparent; border: 1px solid #dadce0;
  color: var(--color-text); border-radius: 8px; padding: 8px 16px;
  font-size: .875rem; font-weight: 500; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.btn-outline:hover { background: #f1f3f4; border-color: #bdc1c6; }
.btn-link { background: none; border: none; color: var(--color-primary); cursor: pointer; font-size: inherit; padding: 0; text-decoration: underline; }
.text-sec  { color: var(--color-text-sec); }

/* ── FORMULARIOS ─────────────────────────────────────────── */
.form-grid  { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group--full { grid-column: 1 / -1; }
.form-label { font-size: .8125rem; font-weight: 500; color: var(--color-text); }
.form-control {
  padding: 8px 12px; border: 1px solid #dadce0; border-radius: 8px;
  font-size: .875rem; color: var(--color-text); background: #fff;
  outline: none; transition: border-color .15s;
  font-family: inherit;
}
.form-control:focus { border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(26,115,232,.15); }
textarea.form-control { resize: vertical; }

/* ── MODAL ───────────────────────────────────────────────── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.45); z-index: 1000;
  align-items: center; justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal {
  background: #fff; border-radius: 16px;
  width: min(640px, 95vw); max-height: 90vh;
  overflow-y: auto; box-shadow: 0 8px 32px rgba(0,0,0,.2);
  display: none; flex-direction: column;
}
.modal.active { display: flex; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 16px; border-bottom: 1px solid #e8eaed;
  position: sticky; top: 0; background: #fff; z-index: 1;
}
.modal-title  { font-size: 1.0625rem; font-weight: 600; color: var(--color-text); margin: 0; }
.modal-close  { background: none; border: none; cursor: pointer; color: var(--color-text-sec); padding: 4px; border-radius: 6px; display: flex; }
.modal-close:hover { background: #f1f3f4; color: var(--color-text); }
.modal-body   { padding: 20px 24px; flex: 1; }
.modal-footer { padding: 16px 24px; border-top: 1px solid #e8eaed; display: flex; justify-content: flex-end; gap: 10px; }

/* ── EMPTY STATE ─────────────────────────────────────────── */
.empty-state       { text-align: center; padding: 48px 24px; }
.empty-state__icon { font-size: 2.5rem; display: block; margin-bottom: 12px; }
.empty-state p     { color: var(--color-text-sec); margin: 0; font-size: .9375rem; }

/* ── RESPONSIVE ADMIN ────────────────────────────────────── */
@media (max-width: 600px) {
  .stats-grid  { grid-template-columns: 1fr 1fr; }
  .form-grid   { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; }
  .tabla thead { display: none; }
  .tabla tbody td { display: block; padding: 6px 16px; }
  .tabla tbody td:first-child { padding-top: 12px; }
  .tabla tbody td:last-child  { padding-bottom: 12px; }
}
@media (max-width: 400px) {
  .stats-grid { grid-template-columns: 1fr; }
}

/* ── DETALLE DE OBRA ─────────────────────────────────────── */
.page-header__back   { display: flex; flex-direction: column; gap: 4px; }
.btn-back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .8125rem; color: var(--color-text-sec);
  text-decoration: none; margin-bottom: 4px;
}
.btn-back:hover { color: var(--color-primary); }

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}
.info-item         { display: flex; flex-direction: column; gap: 3px; }
.info-item--full   { grid-column: 1 / -1; }
.info-label        { font-size: .75rem; color: var(--color-text-sec); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
.info-value        { font-size: .9375rem; color: var(--color-text); font-weight: 500; }

.mb-4              { margin-bottom: 24px; }
.mt-3              { margin-top: 16px; }

.btn-danger {
  background: var(--color-danger); color: #fff; border: none;
  border-radius: 8px; padding: 8px 16px; font-size: .875rem;
  font-weight: 500; cursor: pointer;
}
.btn-danger:hover { background: #c5221f; }
.btn-danger-outline {
  background: transparent; border: 1px solid var(--color-danger);
  color: var(--color-danger); border-radius: 6px;
  padding: 4px 10px; font-size: .75rem; cursor: pointer;
}
.btn-danger-outline:hover { background: #fce8e6; }