/* Yummy Jungle — panel admin */
:root { --verde: #1b5e20; --amarillo: #ffc107; --fondo: #f4f6f4; }
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Segoe UI', system-ui, sans-serif; background: var(--fondo); display: flex; min-height: 100vh; }

.sidebar {
  width: 230px; background: #12291a; color: #cfe3d1; flex-shrink: 0;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sidebar .brand { display: block; padding: 1.2rem; font-weight: 800; font-size: 1.1rem; color: #fff; text-decoration: none; }
.sidebar nav { flex: 1; overflow-y: auto; }
.sidebar nav a { display: block; padding: .55rem 1.2rem; color: #cfe3d1; text-decoration: none; }
.sidebar nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-group { border-bottom: 1px solid rgba(255,255,255,.06); }
.nav-group summary { padding: .8rem 1.2rem; color: #fff; cursor: pointer; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; list-style: none; }
.nav-group summary::-webkit-details-marker { display: none; }
.nav-group summary::after { content: '+'; float: right; font-size: 1rem; line-height: .8; opacity: .7; }
.nav-group[open] summary::after { content: '−'; }
.nav-group summary:hover, .nav-group summary:focus-visible { background: rgba(255,255,255,.08); outline: none; }
.nav-group a { padding-left: 1.8rem; }
.sidebar-footer { padding: .8rem 1.2rem; border-top: 1px solid rgba(255,255,255,.1); }
.sidebar-footer a { display: block; color: #cfe3d1; text-decoration: none; padding: .3rem 0; font-size: .9rem; }

.content { flex: 1; padding: 2rem; max-width: 1100px; }
h1 { margin-bottom: 1.2rem; color: var(--verde); }
h2 { margin: 1.5rem 0 .8rem; color: var(--verde); }
h3 { margin: 1.2rem 0 .6rem; }

.flash { background: #e8f5e9; border: 1px solid #a5d6a7; padding: .8rem 1rem; border-radius: 8px; margin-bottom: 1.2rem; }
.error { background: #ffebee; border: 1px solid #ef9a9a; color: #b71c1c; padding: .6rem; border-radius: 6px; margin-bottom: .8rem; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.stat { background: #fff; border-radius: 10px; padding: 1.2rem; text-align: center; box-shadow: 0 1px 6px rgba(0,0,0,.07); }
.stat-num { display: block; font-size: 1.6rem; font-weight: 800; color: var(--verde); }

.page-heading { margin-bottom: 1.4rem; }
.page-heading h1 { margin: .15rem 0 .35rem; }
.page-heading .muted { max-width: 760px; }
.admin-submenu-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin: 1.5rem 0; }
.admin-area-card { display: flex; flex-direction: column; gap: .55rem; min-height: 150px; padding: 1.15rem 1.2rem; background: #fff; border: 1px solid #dce6dc; border-radius: 10px; color: #24472a; text-decoration: none; box-shadow: 0 2px 8px rgba(0,0,0,.06); transition: border-color .15s ease, background .15s ease, transform .15s ease, box-shadow .15s ease; }
.admin-area-card:hover, .admin-area-card:focus-visible { border-color: #6fa875; background: #f7fbf7; box-shadow: 0 4px 12px rgba(27,94,32,.12); transform: translateY(-1px); outline: none; }
.admin-area-card strong { color: var(--verde); font-size: 1rem; }
.admin-area-card span { color: #68756a; font-size: .9rem; line-height: 1.45; }
.admin-area-card b { margin-top: auto; color: var(--verde); font-size: .85rem; }

table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 1px 6px rgba(0,0,0,.07); margin-bottom: 1.5rem; }
th, td { padding: .65rem .8rem; text-align: left; border-bottom: 1px solid #eee; font-size: .92rem; }
th { background: #e8f0e8; }
.thumb { width: 70px; height: 48px; object-fit: cover; border-radius: 6px; }
.low-stock td { background: #fff8e1; }

.btn { display: inline-block; background: var(--verde); color: #fff; padding: .6rem 1.2rem; border-radius: 8px; border: none; text-decoration: none; font-weight: 600; cursor: pointer; font-size: .92rem; }
.btn:hover { background: #0d3d12; }
.btn-secondary { background: #607d8b; }
.btn-danger { background: #c62828; }
.btn-small { padding: .35rem .8rem; font-size: .85rem; }
.actions { display: flex; gap: .6rem; flex-wrap: wrap; margin: 1rem 0; align-items: center; }

.tag { display: inline-block; padding: .2rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 700; border: none; cursor: pointer; background: #eee; }
.tag-on, .tag-pagada, .tag-emitida, .tag-pagado, .tag-recibida { background: #c8e6c9; color: #1b5e20; }
.tag-off, .tag-anulada, .tag-anulado { background: #ffcdd2; color: #b71c1c; }
.tag-borrador { background: #ffe0b2; color: #e65100; }
.tag-kardex-venta { background: #ffcdd2; color: #b71c1c; }
.tag-kardex-compra { background: #c8e6c9; color: #1b5e20; }
.tag-kardex-anulacion_venta, .tag-kardex-anulacion_compra { background: #d1c4e9; color: #4527a0; }
.tag-kardex-ajuste { background: #bbdefb; color: #0d47a1; }
.tag-abierta { background: #bbdefb; color: #0d47a1; }
.tag-cerrada { background: #ffe0b2; color: #e65100; }
.tag-revisada { background: #c8e6c9; color: #1b5e20; }
.tag-rol-vendedor { background: #e3f2fd; color: #0d47a1; }
.tag-rol-supervisor { background: #e0f2f1; color: #00695c; }
.tag-rol-jefe { background: #fff3e0; color: #e65100; }
.tag-rol-manager { background: #f3e5f5; color: #6a1b9a; }
.tag-rol-admin { background: #263238; color: #fff; }
.text-bad { color: #c62828; }
.text-good { color: #1b5e20; }
.link-action { background: none; border: none; color: var(--verde); cursor: pointer; text-decoration: underline; font-size: .92rem; }
.stat-good { outline: 2px solid #a5d6a7; }
.stat-bad { outline: 2px solid #ef9a9a; }
.row-good td { background: #e8f5e9; }
.row-bad td { background: #ffebee; }

.link-danger { background: none; border: none; color: #c62828; cursor: pointer; text-decoration: underline; font-size: .92rem; }
.row-actions { display: flex; gap: .8rem; align-items: center; }
.row-actions form { margin: 0; }

.form-card { background: #fff; border-radius: 10px; padding: 1.5rem; max-width: 560px; box-shadow: 0 1px 6px rgba(0,0,0,.07); }
.form-card.wide { max-width: 860px; }
.form-card label { display: block; margin-bottom: .9rem; font-weight: 600; font-size: .9rem; }
.form-card input[type=text], .form-card input[type=number], .form-card input[type=email],
.form-card input[type=url], .form-card input[type=password], .form-card select, .form-card textarea {
  display: block; width: 100%; padding: .5rem .6rem; border: 1px solid #cfd8cf; border-radius: 6px; margin-top: .25rem; font-size: .95rem;
}
.form-card .check { display: flex; align-items: center; gap: .5rem; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; }
.form-actions { display: flex; gap: .6rem; margin-top: 1rem; }

.filter-bar { display: flex; gap: 1rem; align-items: end; margin-bottom: 1.5rem; background: #fff; padding: 1rem; border-radius: 10px; }
.filter-bar label { font-size: .85rem; font-weight: 600; }
.filter-bar input { display: block; padding: .4rem; border: 1px solid #cfd8cf; border-radius: 6px; }

.detail-grid { display: grid; grid-template-columns: 1fr 220px; gap: 1.5rem; margin-bottom: 1rem; }
.totals-box { background: #fff; border-radius: 10px; padding: 1rem; box-shadow: 0 1px 6px rgba(0,0,0,.07); }
.totals-box .total { font-size: 1.15rem; color: var(--verde); }
.report-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; }
.executive-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.3rem; }
.executive-heading h1 { margin: .15rem 0 .35rem; }
.eyebrow { color: #6b796d; font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.muted, .panel-caption, .stat-note { color: #68756a; }
.executive-kpis .stat { text-align: left; }
.executive-kpis .stat-num { font-size: 1.45rem; }
.trend { display: block; margin-top: .45rem; font-size: .75rem; font-weight: 700; }
.trend-up { color: #2e7d32; }
.trend-down { color: #c62828; }
.dashboard-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.dashboard-panel { background: #fff; border: 1px solid #dce6dc; border-radius: 10px; padding: 1rem 1.2rem; box-shadow: 0 2px 8px rgba(0,0,0,.06); min-width: 0; }
.dashboard-panel-wide { grid-column: 1 / -1; }
.business-grid { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .9rem; }
.business-card { border: 1px solid #e3eae3; background: #fff; box-shadow: 0 2px 6px rgba(18,41,26,.04); }
.business-card:hover { border-color: #c7d7c8; }
.panel-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.panel-heading h2 { margin: 0; font-size: 1.05rem; }
.panel-heading a { color: var(--verde); font-size: .8rem; font-weight: 700; }
.card-meta { margin: .15rem 0 .8rem; }
.tag-default-on { background: #edf7ee; color: #1b5e20; border: 1px solid #b8d7be; }
.tag-default-off { background: #fff1f1; color: #b71c1c; border: 1px solid #efb4b4; }
.business-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .9rem; margin: 0 0 1.2rem; }
.summary-item { background: #fff; border: 1px solid #dfe9df; border-radius: 10px; padding: .9rem 1rem; box-shadow: 0 2px 8px rgba(0,0,0,.04); }
.summary-item span { display: block; font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #5f7160; margin-bottom: .35rem; }
.summary-item strong { font-size: 1.45rem; color: #143a1d; }
.sales-chart { display: flex; align-items: end; gap: .28rem; height: 12rem; padding: .5rem 0 1.3rem; border-bottom: 1px solid #dce6dc; }
.sales-column { display: flex; position: relative; align-items: end; justify-content: center; height: 100%; flex: 1; min-width: 3px; }
.sales-bar { width: 100%; min-height: 3px; border-radius: 4px 4px 0 0; background: linear-gradient(180deg, #66bb6a, #2e7d32); transition: opacity .15s ease; }
.sales-bar:hover { opacity: .7; }
.sales-column small { position: absolute; bottom: -1.1rem; color: #68756a; font-size: .65rem; white-space: nowrap; }
.ranking-row { display: grid; grid-template-columns: minmax(6rem, 1.2fr) minmax(4rem, 2fr) auto; align-items: center; gap: .65rem; margin-bottom: .8rem; font-size: .82rem; }
.ranking-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranking-track { height: .55rem; overflow: hidden; background: #e5ede5; border-radius: 999px; }
.ranking-track i { display: block; height: 100%; border-radius: inherit; background: #2e7d32; }
.ranking-row strong { min-width: 4rem; color: var(--verde); text-align: right; font-size: .78rem; }
.section-title { margin-top: 1.4rem; }
.operating-balance { max-width: 760px; margin: -0.4rem 0 1.5rem; background: #fff; border: 1px solid #dce6dc; border-radius: 10px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,.05); }
.operating-balance > div { display: flex; justify-content: space-between; gap: 1rem; padding: .7rem 1rem; border-bottom: 1px solid #edf1ed; }
.operating-balance > div:last-child { border-bottom: 0; font-weight: 800; }
.operating-balance strong { color: var(--verde); }
.operating-balance .balance-positive { background: #e8f5e9; }
.operating-balance .balance-negative { background: #ffebee; }
.operating-balance .balance-negative strong { color: #c62828; }
.quick-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
.quick-action { display: grid; grid-template-columns: 2rem 1fr auto; align-items: center; gap: .65rem; min-height: 3.1rem; padding: .65rem .75rem; border: 1px solid #d7e2d8; border-radius: 8px; background: #fff; color: #24472a; text-decoration: none; font-weight: 600; font-size: .9rem; box-shadow: 0 1px 3px rgba(0,0,0,.05); transition: border-color .15s ease, background .15s ease, transform .15s ease, box-shadow .15s ease; }
.quick-action:hover, .quick-action:focus-visible { border-color: #6fa875; background: #f3f8f3; box-shadow: 0 3px 9px rgba(27,94,32,.12); transform: translateY(-1px); outline: none; }
.quick-action-icon { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 6px; background: #e8f2e8; font-size: 1.15rem; }
.quick-action-arrow { color: var(--verde); font-size: 1.1rem; transition: transform .15s ease; }
.quick-action:hover .quick-action-arrow, .quick-action:focus-visible .quick-action-arrow { transform: translateX(3px); }

.finance-charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.chart-card { background: #fff; border: 1px solid #dce6dc; border-radius: 10px; padding: 1rem 1.2rem; box-shadow: 0 2px 8px rgba(0,0,0,.08); min-width: 0; }
.chart-card-wide { grid-column: 1 / -1; }
.chart-card h3 { color: var(--verde); margin: 0 0 1rem; }
.bar-group { margin-bottom: .9rem; }
.bar-label, .bar-row, .account-row { display: flex; align-items: center; gap: .7rem; font-size: .85rem; }
.bar-label { justify-content: space-between; margin-bottom: .25rem; }
.bar-label strong { color: var(--verde); }
.bar-row { margin-bottom: .35rem; }
.bar-row > b { min-width: 5.5rem; text-align: right; font-size: .78rem; }
.bar-key { width: 3.8rem; color: #5b685d; font-size: .75rem; }
.bar-line { display: block; height: .7rem; background: #e1e9e1; border: 1px solid #c6d4c7; border-radius: 999px; overflow: hidden; flex: 1; }
.bar { display: block; height: 100%; min-width: 2px; border-radius: inherit; }
.bar-sales, .bar-inflow { background: #2e7d32; }
.bar-expenses, .bar-outflow { background: #ef6c00; }
.chart-legend { display: flex; gap: 1rem; margin-top: 1rem; color: #5b685d; font-size: .78rem; }
.legend-dot { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; margin-right: .3rem; }
.legend-dot.sales { background: #2e7d32; }
.legend-dot.expenses { background: #ef6c00; }
.comparison-chart { display: grid; gap: 1rem; }
.comparison-group { display: grid; gap: .55rem; }
.comparison-group > strong { font-size: .85rem; color: #405143; }
.comparison-row { display: grid; grid-template-columns: 4.8rem minmax(3rem, 1fr) auto; align-items: center; gap: .5rem; font-size: .78rem; margin-bottom: .25rem; }
.comparison-row b { min-width: 5.5rem; text-align: right; }
.account-row { margin-bottom: .75rem; }
.account-row > span:first-child { width: 9rem; }
.account-row > strong { min-width: 6.5rem; text-align: right; }
.chart-empty { min-height: 7rem; display: grid; place-items: center; padding: 1rem; border: 1px dashed #b8c8b9; border-radius: 8px; color: #68756a; background: #f7faf7; font-size: .9rem; text-align: center; }

/* Ficha de empleado */
.ficha-head { display: flex; gap: 1.2rem; align-items: center; background: #fff; border-radius: 10px; padding: 1.2rem; box-shadow: 0 1px 6px rgba(0,0,0,.07); margin-bottom: 1.2rem; }
.ficha-head img { width: 90px; height: 90px; object-fit: cover; border-radius: 50%; background: #e8f0e8; }
.ficha-head .ficha-foto-vacia { width: 90px; height: 90px; border-radius: 50%; background: #e8f0e8; display: flex; align-items: center; justify-content: center; font-size: 2rem; }
.ficha-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.ficha-card { background: #fff; border-radius: 10px; padding: 1rem; box-shadow: 0 1px 6px rgba(0,0,0,.07); }
.ficha-card h3 { color: var(--verde); margin-bottom: .5rem; margin-top: 0; }
.ficha-card dl { display: grid; grid-template-columns: auto 1fr; gap: .25rem .8rem; font-size: .9rem; margin: 0; }
.ficha-card dt { font-weight: 600; color: #555; }
.ficha-card dd { margin: 0; }

/* Login */
.login-page { align-items: center; justify-content: center; display: flex; }
.login-card { background: #fff; padding: 2.5rem; border-radius: 14px; box-shadow: 0 4px 20px rgba(0,0,0,.12); width: 340px; }
.login-card h1 { font-size: 1.4rem; text-align: center; }
.login-card h2 { text-align: center; font-size: .95rem; color: #666; margin-bottom: 1.5rem; }
.login-card label { display: block; margin-bottom: 1rem; font-weight: 600; font-size: .9rem; }
.login-card input { display: block; width: 100%; padding: .55rem; border: 1px solid #cfd8cf; border-radius: 6px; margin-top: .25rem; }
.login-card .btn { width: 100%; }

@media (max-width: 760px) {
  body { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; }
  .detail-grid { grid-template-columns: 1fr; }
  .finance-charts { grid-template-columns: 1fr; }
  .chart-card-wide { grid-column: auto; }
  .account-row > span:first-child { width: 7rem; }
  .quick-actions { grid-template-columns: 1fr; }
  .executive-heading { flex-direction: column; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-panel-wide { grid-column: auto; }
  .admin-submenu-grid { grid-template-columns: 1fr; }
}
