/* Panel de administración · usa los tokens de styles.css */
body.adm { background: var(--paper); color: var(--ink); font-family: var(--font-body); margin: 0; }
.a-wrap { width: min(1240px, 100% - 32px); margin-inline: auto; }
.a-top { background: var(--white); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.a-top .a-wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 62px; }
.a-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-size: 15px; letter-spacing: .02em; }
.a-brand b { font-weight: 800; letter-spacing: .12em; }
.a-brand small { display: block; font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.a-user { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--muted); }
.a-user span { max-width: 28ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.a-demo { background: var(--amber-bg); border-bottom: 1px solid #F0D58A; font-size: 14px; }
.a-demo .a-wrap { padding: 10px 0; }
.a-demo code { background: rgba(0,0,0,.06); padding: 1px 6px; border-radius: 4px; }
#aMain { padding: 24px 0 64px; }
.a-login { max-width: 420px; margin: 40px auto; background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 28px; }
.a-login h1 { font-size: 26px; margin: 0 0 6px; font-weight: 600; }
.a-login form { display: grid; gap: 16px; margin-top: 18px; }
.a-err { color: var(--red); font-size: 14px; margin: 0; min-height: 0; }
.a-err:empty { display: none; }

.a-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-bottom: 22px; }
.a-stat { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.a-stat small { display: block; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.a-stat b { display: block; font-size: 28px; font-weight: 600; margin: 4px 0 2px; }
.a-stat span { font-size: 14px; color: var(--muted); }
.a-stat.alert { border-color: #F0D58A; background: #FFFBEF; }

.a-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.a-tabs button { font: inherit; font-weight: 600; font-size: 15px; background: none; border: 0; border-bottom: 3px solid transparent; padding: 10px 16px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.a-tabs button.on { color: var(--ink); border-bottom-color: var(--green); }
.a-tabs i { font-style: normal; background: var(--amber); color: #3b2a00; font-size: 12px; font-weight: 800; border-radius: 999px; padding: 1px 8px; margin-left: 4px; }

.a-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin-bottom: 14px; }
.a-nav { display: flex; align-items: center; gap: 8px; }
.a-nav h2 { font-size: 20px; font-weight: 600; margin: 0 10px; min-width: 9.5em; text-align: center; text-transform: capitalize; }
.a-legend { display: flex; gap: 14px; font-size: 13px; color: var(--muted); }
.a-legend .k::before { content: ""; display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.k.conf::before { background: var(--green); } .k.pend::before { background: var(--amber); } .k.block::before { background: repeating-linear-gradient(45deg, #7C93A1, #7C93A1 3px, #A9BAC4 3px, #A9BAC4 6px); }
.a-scroll { overflow-x: auto; background: var(--white); border: 1px solid var(--line); border-radius: 12px; }
.a-help { font-size: 13px; margin: 10px 2px 0; }

.gantt { display: grid; grid-template-columns: 150px repeat(var(--n), minmax(34px, 1fr)); min-width: 1100px; position: relative; }
.g-h { font-size: 11px; text-align: center; padding: 6px 0; color: var(--muted); border-bottom: 1px solid var(--line); border-left: 1px solid #EDF4F6; line-height: 1.25; }
.g-h b { display: block; font-size: 13px; color: var(--ink); font-weight: 600; }
.g-h.we { background: #F4F8FA; } .g-h.td { background: var(--sky); } .g-h.td b { color: var(--blue-d); }
.g-v { padding: 12px 14px; font-weight: 600; font-size: 14px; border-bottom: 1px solid var(--line); background: var(--white); display: flex; align-items: center; position: sticky; left: 0; z-index: 3; }
.g-v small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; }
.g-c { border: 0; border-left: 1px solid #EDF4F6; border-bottom: 1px solid var(--line); background: transparent; cursor: pointer; padding: 0; min-height: 44px; }
.g-c.we { background: #F8FBFC; } .g-c.td { background: #EEF8FD; }
.g-c:hover { background: var(--mint); }
.g-b { z-index: 2; margin: 4px 2px; border: 0; border-radius: 7px; font: inherit; font-size: 12.5px; font-weight: 700; text-align: left; padding: 0 9px; cursor: pointer; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; min-height: 34px; box-shadow: 0 1px 2px rgba(16,48,63,.15); }
.g-b.confirmada { background: var(--green); color: #fff; }
.g-b.pendiente { background: var(--amber); color: #3b2a00; }
.g-b.bloqueo { background: repeating-linear-gradient(45deg, #7C93A1, #7C93A1 6px, #93A8B4 6px, #93A8B4 12px); color: #fff; }
.g-b.cl { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: 0; } .g-b.cr { border-top-right-radius: 0; border-bottom-right-radius: 0; margin-right: 0; }
.g-b:focus-visible, .g-c:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }

.a-cards { display: grid; gap: 14px; }
.a-item { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; display: grid; gap: 10px; }
.a-item.pending { border-left: 5px solid var(--amber); } .a-item.unread { border-left: 5px solid var(--blue); }
.a-item header { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; align-items: baseline; }
.a-item h3 { margin: 0; font-size: 17px; font-weight: 600; }
.a-item .when { font-size: 14px; color: var(--muted); }
.a-item .row { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; }
.a-item .row a { color: var(--blue-d); }
.a-item .note { font-size: 14px; background: var(--paper); border-radius: 8px; padding: 8px 12px; white-space: pre-wrap; }
.a-item .warn { font-size: 14px; background: var(--red-bg); color: var(--red); border-radius: 8px; padding: 8px 12px; }
.a-item .acts { display: flex; flex-wrap: wrap; gap: 8px; }
.a-empty { text-align: center; color: var(--muted); padding: 40px 10px; background: var(--white); border: 1px dashed var(--line); border-radius: 12px; }
.a-pill { display: inline-block; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 2px 10px; }
.a-pill.confirmada { background: var(--mint); color: var(--green-d); } .a-pill.pendiente { background: var(--amber-bg); color: #8a5a00; }
.a-pill.cancelada { background: #EEF2F4; color: var(--muted); } .a-pill.bloqueo { background: #E6ECEF; color: #4B6472; }

.a-filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.a-filters input, .a-filters select { font: inherit; font-size: 14px; background: var(--white); border: 1.5px solid var(--line); border-radius: 10px; padding: 9px 12px; color: var(--ink); }
.a-filters input { flex: 1 1 240px; }
.a-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 760px; }
.a-table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--line); }
.a-table td { padding: 11px 14px; border-bottom: 1px solid #EDF4F6; vertical-align: top; }
.a-table tr[data-id] { cursor: pointer; } .a-table tr[data-id]:hover td { background: var(--paper); }
.a-table tr.cancelada td { opacity: .55; }

.a-modal { position: fixed; inset: 0; background: rgba(16,48,63,.45); z-index: 100; display: grid; place-items: start center; overflow-y: auto; padding: 24px 12px; }
.a-card { background: var(--white); border-radius: 14px; width: min(680px, 100%); padding: 24px; margin: auto; }
.a-card h3 { margin: 0 0 16px; font-size: 20px; font-weight: 600; }
.a-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.a-grid .field.full { grid-column: 1 / -1; }
.a-card select, .a-card input, .a-card textarea { font: inherit; color: var(--ink); background: var(--paper); border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; min-width: 0; }
.a-extras { font-size: 14px; background: var(--paper); border-radius: 10px; padding: 10px 12px; min-height: 42px; }
.a-actions { display: flex; gap: 10px; margin-top: 18px; align-items: center; } .a-actions span { flex: 1; }
.a-del { color: var(--red); border-color: #E7B9B1; }
.a-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 11px 20px; border-radius: 999px; font-size: 14px; z-index: 200; box-shadow: 0 6px 24px rgba(0,0,0,.25); }
@media (max-width: 640px) {
  .a-grid { grid-template-columns: 1fr; }
  .a-nav h2 { min-width: 0; font-size: 17px; }
  .a-user span { display: none; }
}
@media (max-width: 640px) {
  .a-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
  .a-stat { padding: 10px 10px 8px; } .a-stat small { font-size: 10px; letter-spacing: .04em; }
  .a-stat b { font-size: 19px; margin: 3px 0 0; } .a-stat span { display: none; }
  .a-demo { font-size: 13px; } #aMain { padding-top: 14px; }
}
