/* =====================================================================
   ADC Catering — módulo de administración
   ===================================================================== */
body.admin { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; background: #f4efe7; }
.sidebar { background: var(--ink); color: rgba(247,242,234,.8); padding: 1.25rem .9rem; display: flex; flex-direction: column; gap: 1.5rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar .brand { padding: .25rem .5rem; }
.sidebar nav { display: grid; gap: 2px; }
.sidebar a { display: flex; align-items: center; gap: .7rem; padding: .62rem .75rem; border-radius: 8px; color: rgba(247,242,234,.78); text-decoration: none; font-size: var(--t-sm); }
.sidebar a:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar a[aria-current] { background: rgba(176,141,87,.18); color: #fff; }
.sidebar a[aria-current] .ico { color: var(--gold); }
.sidebar .count { margin-left: auto; background: var(--wine); color: #fff; font-size: .7rem; padding: .05rem .5rem; border-radius: 999px; }
.sidebar-foot { margin-top: auto; display: grid; gap: 2px; border-top: 1px solid rgba(255,255,255,.1); padding-top: 1rem; }
.ico { width: 18px; height: 18px; flex: none; }

.admin-main { min-width: 0; }
.topbar { display: flex; align-items: center; gap: 1rem; padding: 1rem 2rem; border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 20; }
.topbar h1 { font-family: var(--f-body); font-size: 1.15rem; font-weight: 600; margin: 0; letter-spacing: 0; }
.topbar-user { margin-left: auto; font-size: var(--t-sm); color: var(--muted); }
.nav-toggle--admin { display: none; }
.admin-content { padding: 1.5rem 2rem 3rem; max-width: 1400px; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 1.25rem 1.4rem; margin-bottom: 1.25rem; min-width: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .9rem; flex-wrap: wrap; }
.panel-head h2 { font-family: var(--f-body); font-size: 1rem; font-weight: 600; margin: 0; letter-spacing: 0; }
.panel-head a { font-size: var(--t-sm); }
.panel .panel-head:not(:first-child) { margin-top: 1.5rem; }
.stack { display: grid; align-content: start; min-width: 0; }
.admin-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.admin-grid--wide { grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); }
.admin-grid > .panel { margin-bottom: 0; }

.kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem; margin-bottom: 1.25rem; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 1rem 1.2rem; text-decoration: none; color: var(--ink); display: grid; gap: .25rem; transition: border-color .15s; }
a.kpi:hover { border-color: var(--gold); color: var(--ink); }
.kpi span { font-size: var(--t-xs); color: var(--muted); }
.kpi strong { font-size: 1.75rem; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.1; }

.table-wrap { overflow-x: auto; margin-inline: -.4rem; }
.row-link { cursor: pointer; }
.row-link:hover td { background: #faf6ef; }
.table a { text-decoration: none; font-weight: 500; }
.thumb { width: 54px; height: 54px; object-fit: cover; border-radius: 8px; }

.toolbar { display: flex; align-items: center; gap: .6rem; margin-bottom: 1rem; flex-wrap: wrap; }
.toolbar input[type=search] { max-width: 320px; }
.toolbar select { width: auto; }
.toolbar .cal-title { font-size: 1.6rem; min-width: 210px; text-align: center; }
.spacer { flex: 1; }
.page-actions { display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem; flex-wrap: wrap; }

.event-list, .msg-list, .list { list-style: none; padding: 0; margin: 0; display: grid; }
.event-list li { display: flex; gap: .9rem; align-items: center; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.event-list li:last-child, .msg-list li:last-child, .list li:last-child { border-bottom: 0; }
.event-list small { display: block; color: var(--muted); font-size: var(--t-xs); }
.date-chip { width: 48px; text-align: center; background: var(--bg); border-radius: 8px; padding: .3rem 0; font-size: var(--t-xs); text-transform: uppercase; color: var(--muted); line-height: 1.2; }
.date-chip b { display: block; font-size: 1.2rem; color: var(--wine); }
.msg-list li, .list li { padding: .7rem 0; border-bottom: 1px solid var(--line); font-size: var(--t-sm); }
.msg-list p { margin: .2rem 0 0; color: var(--ink-2); }

.templates { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .9rem; }
.templates .chip { font-size: var(--t-xs); padding: .35rem .8rem; }
.wa-form { display: grid; gap: .6rem; }
.wa-form .btn { justify-self: start; }
.btn .ico { width: 16px; height: 16px; }

.tabs { overflow-x: auto; white-space: nowrap; display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; }
.tabs a { padding: .6rem 1rem; text-decoration: none; color: var(--ink-2); font-size: var(--t-sm); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a[aria-current] { color: var(--ink); border-bottom-color: var(--wine); font-weight: 500; }
.cards-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 1.25rem; }
.cards-list .panel { margin: 0; }
.consulta .panel-head { align-items: flex-start; }
.consulta blockquote { margin: 0 0 1rem; padding: .9rem 1rem; background: var(--bg); border-radius: 10px; font-size: var(--t-sm); }
.consulta details { margin-bottom: .75rem; }
.consulta summary { cursor: pointer; font-weight: 500; font-size: var(--t-sm); margin-bottom: .75rem; color: var(--wine); }
.row-actions { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.row-actions form { display: inline; }
.danger { color: var(--bad) !important; }

/* Calendario admin */
.admin-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.admin-cal-dow { font-size: var(--t-xs); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: .25rem .5rem; }
.admin-cal-day { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; min-height: 112px; padding: .4rem; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.admin-cal-day.is-empty { background: transparent; border-color: transparent; }
.admin-cal-day.is-pasada { opacity: .5; }
.admin-cal-day.is-limitada { border-color: #e7c88f; }
.admin-cal-day.is-ocupada { background: #fbf0f0; border-color: #e8c4c4; }
.admin-cal-day.is-bloqueada { background: repeating-linear-gradient(135deg, #efe9df 0 6px, #f6f1e9 6px 12px); }
.day-num { align-self: flex-start; border: 0; background: none; font-weight: 600; font-size: var(--t-sm); padding: .15rem .4rem; border-radius: 6px; cursor: pointer; }
.day-num:hover { background: var(--surface-2); }
.ev { display: block; font-size: .72rem; padding: .2rem .4rem; border-radius: 5px; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--surface-2); color: var(--ink-2); }
.ev--confirmada { background: #e5f2e9; color: #2c6a43; }
.ev--nueva, .ev--en_proceso, .ev--cotizada { background: #fdf0d9; color: #8a5a12; }
.ev--block { background: var(--ink-2); color: #fff; }
.modal { border: 0; border-radius: 14px; padding: 1.5rem; width: min(440px, 92vw); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal::backdrop { background: rgba(20,14,10,.45); }
.modal h2 { font-family: var(--f-body); font-size: 1.05rem; }
.modal h2::first-letter { text-transform: uppercase; }
@media (max-width: 760px) { .admin-cal-day { min-height: 64px; } .ev { font-size: 0; height: 6px; padding: 0; } .admin-cal-dow { padding: 0; text-align: center; } }

/* Fotos */
.dropzone { display: grid; place-items: center; text-align: center; border: 1.5px dashed var(--line); border-radius: 12px; padding: 1.75rem 1rem; background: var(--bg); cursor: pointer; position: relative; margin-bottom: 1rem; transition: border-color .15s; }
.dropzone:hover, .dropzone.is-over { border-color: var(--wine); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone output { font-size: var(--t-xs); color: var(--wine); margin-top: .5rem; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; }
.photo-card { border: 1px solid var(--line); border-radius: 12px; padding: .75rem; display: grid; gap: .4rem; background: #fff; }
.photo-card.is-hidden { opacity: .65; }
.photo-thumb { position: relative; border-radius: 8px; overflow: hidden; aspect-ratio: 4/3; background: var(--surface-2); }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pill { position: absolute; top: 8px; left: 8px; background: var(--wine); color: #fff; font-size: .68rem; padding: .15rem .55rem; border-radius: 999px; }
.pill--muted { left: auto; right: 8px; background: var(--ink-2); }
.photo-card .field { font-size: var(--t-xs); }
.photo-card .field input, .photo-card .field select { padding: .45rem .6rem; font-size: var(--t-sm); }
.checks { display: flex; gap: 1rem; }

/* Menús */
.switch { width: 40px; height: 22px; border-radius: 999px; background: var(--line); border: 0; position: relative; cursor: pointer; transition: background .15s; }
.switch span { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; }
.switch.is-on { background: var(--ok); }
.switch.is-on span { left: 21px; }
.platos { display: grid; gap: .5rem; margin-bottom: .75rem; }
.plato-row { display: grid; grid-template-columns: 180px 1fr 36px; gap: .5rem; }
.plato-row input, .items-table input { width: 100%; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.icon-btn { width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 1.2rem; color: var(--muted); }
.icon-btn:hover { color: var(--bad); border-color: var(--bad); }
.preview-img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 10px; margin-bottom: 1rem; background: var(--surface-2); }
@media (max-width: 600px) { .plato-row { grid-template-columns: 1fr 36px; } .plato-row input:first-child { grid-column: 1 / -1; } }

/* Cotización */
.items-table td { padding: .4rem .35rem; }
.items-table input.num { text-align: right; max-width: 120px; margin-left: auto; display: block; }
.items-table td:first-child { min-width: 260px; width: 100%; }
.items-table td:nth-child(2), .items-table td:nth-child(3) { width: 110px; min-width: 96px; }
.items-table td:nth-child(4) { white-space: nowrap; padding-top: .9rem; }
.inline-add select { padding: .45rem .7rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: var(--t-sm); }
.totals { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) 1.4fr; gap: 1rem; align-items: start; margin: 1.25rem 0; padding-top: 1rem; border-top: 1px solid var(--line); }
.sum { margin: 0; display: grid; gap: .3rem; background: var(--bg); border-radius: 10px; padding: .8rem 1rem; font-size: var(--t-sm); }
.sum div { display: flex; justify-content: space-between; gap: 1rem; }
.sum dt { color: var(--muted); } .sum dd { margin: 0; font-variant-numeric: tabular-nums; }
.sum .grand { font-weight: 600; font-size: 1.05rem; border-top: 1px solid var(--line); padding-top: .3rem; }
.sum .grand dt { color: var(--ink); }
.copy-field { display: flex; gap: .4rem; margin: .5rem 0 1rem; }
.copy-field input { flex: 1; min-width: 0; padding: .5rem .7rem; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); font-size: var(--t-xs); }
.form--inline { display: flex; gap: .5rem; }
.form--inline select { width: auto; flex: 1; }

/* Login */
.login-page { min-height: 100vh; display: grid; place-items: center; background: var(--ink) url('../img/login-bg.jpg') center/cover; padding: 1rem; }
.login-box { width: min(400px, 100%); display: grid; gap: 1rem; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.login-box h1 { font-family: var(--f-body); font-size: 1.1rem; font-weight: 600; margin: .5rem 0 0; letter-spacing: 0; }
.login-box .form { display: grid; gap: .75rem; }

.print-body { background: #fff; }

@media (max-width: 1200px) { .kpis { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 1500px) { .totals { grid-template-columns: repeat(4, minmax(0, 1fr)); } .sum { grid-column: 1 / -1; max-width: 360px; margin-left: auto; width: 100%; } }
@media (max-width: 700px) { .totals { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1000px) {
  body.admin { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 60; transform: translateX(-100%); transition: transform .25s; }
  .sidebar.is-open { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.4); }
  .nav-toggle--admin { display: block; }
  .topbar { padding: .75rem 1rem; }
  .topbar-user { display: none; }
  .admin-content { padding: 1rem 1rem 3rem; }
  .admin-grid, .admin-grid--wide { grid-template-columns: 1fr; }
}
@media (max-width: 640px) { .kpis { grid-template-columns: repeat(2, 1fr); } .cards-list { grid-template-columns: 1fr; } }

/* ADC administración */
.sidebar{background:#101010!important}.sidebar .brand-text{color:#f3e6c9}.topbar{background:#fffefa}.kpi{border-top:3px solid #c6a15c}
