/* WMS – Gestión de Residuos | style.css */
:root {
    --sidebar-bg:     #163d26;
    --sidebar-hover:  rgba(255,255,255,.08);
    --sidebar-active: rgba(39,174,96,.22);
    --sidebar-text:   rgba(255,255,255,.65);
    --sidebar-text-h: #ffffff;
    --sidebar-accent: #7fe8a8;
    --sidebar-width:  210px;
    --green:          #27ae60;
    --green-d:        #1a8a4a;
    --blue:           #2980b9;
    --orange:         #e67e22;
    --red:            #c0392b;
    --purple:         #8e44ad;
    --bg:             #f2f5f3;
    --surface:        #ffffff;
    --border:         #dde5de;
    --text:           #1e2b20;
    --muted:          #6b7c6d;
    --radius:         6px;
    --shadow:         0 2px 8px rgba(0,0,0,.09);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body { font-family: 'Segoe UI', Arial, sans-serif; background: var(--bg); color: var(--text); display: flex; min-height: 100vh; }

/* ── SIDEBAR ── */
.sidebar {
    width: var(--sidebar-width); flex-shrink: 0;
    background: var(--sidebar-bg);
    display: flex; flex-direction: column;
    position: fixed; top: 0; left: 0; height: 100vh;
    overflow-y: auto; z-index: 200;
}
.sidebar-brand {
    padding: 15px 12px 13px;
    display: flex; align-items: center; gap: 9px;
    border-bottom: 1px solid rgba(255,255,255,.1);
    flex-shrink: 0;
}
.sidebar-brand .brand-ico {
    width: 32px; height: 32px; border-radius: 8px;
    background: var(--green); display: flex; align-items: center; justify-content: center;
    font-size: 17px; flex-shrink: 0;
}
.sidebar-brand .brand-name { font-size: 11.5px; color: #c8e6d0; line-height: 1.3; }
.sidebar-brand .brand-name strong { display: block; font-size: 13.5px; color: #fff; font-weight: 700; }
.nav-section {
    padding: 12px 14px 3px;
    font-size: 9px; font-weight: 700; letter-spacing: .1em;
    text-transform: uppercase; color: rgba(255,255,255,.3);
}
.nav-item {
    display: flex; align-items: center; gap: 9px;
    padding: 7px 12px; margin: 1px 6px;
    font-size: 12.5px; color: var(--sidebar-text);
    border-radius: 5px; text-decoration: none;
    transition: background .12s, color .12s;
    cursor: pointer;
}
.nav-item:hover { background: var(--sidebar-hover); color: var(--sidebar-text-h); }
.nav-item.active { background: var(--sidebar-active); color: var(--sidebar-accent); }
.nav-item i { font-size: 15px; width: 16px; text-align: center; flex-shrink: 0; }
.nav-badge {
    margin-left: auto; font-size: 10px; font-weight: 600;
    background: rgba(39,174,96,.3); color: var(--sidebar-accent);
    padding: 1px 7px; border-radius: 10px;
}
.sidebar-footer {
    margin-top: auto; padding: 10px 8px;
    border-top: 1px solid rgba(255,255,255,.08); flex-shrink: 0;
}
.user-pill {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 8px; border-radius: 6px; cursor: pointer;
}
.user-pill:hover { background: rgba(255,255,255,.07); }
.user-avatar {
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--green); display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.user-info .u-name { font-size: 12px; color: #d4eadb; font-weight: 600; }
.user-info .u-role { font-size: 10px; color: rgba(255,255,255,.4); }
.user-logout { margin-left: auto; color: rgba(255,100,100,.6); font-size: 14px; text-decoration: none; }
.user-logout:hover { color: #ff8080; }

/* ── MAIN ── */
.main-wrap { margin-left: var(--sidebar-width); flex: 1; display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
    position: sticky; top: 0; z-index: 100;
    background: var(--surface); border-bottom: 1px solid var(--border);
    padding: 0 22px; height: 50px;
    display: flex; align-items: center; justify-content: space-between;
    box-shadow: var(--shadow);
}
.breadcrumb { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.breadcrumb strong { color: var(--text); font-weight: 600; }
.breadcrumb span { opacity: .5; }
.topbar-actions { display: flex; gap: 8px; }
.page-content { padding: 20px 22px; flex: 1; }

/* ── STATS ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px,1fr)); gap: 12px; margin-bottom: 20px; }
.stat-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 14px 16px;
    border-left: 4px solid var(--green); box-shadow: var(--shadow);
}
.stat-card.blue   { border-left-color: var(--blue); }
.stat-card.orange { border-left-color: var(--orange); }
.stat-card.purple { border-left-color: var(--purple); }
.stat-value { font-size: 26px; font-weight: 700; color: var(--text); line-height: 1; }
.stat-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-top: 4px; }

/* ── CARDS ── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 18px; }
.card-header {
    padding: 11px 16px; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    background: #f7faf8;
}
.card-header h3 { font-size: 13px; font-weight: 600; color: #163d26; display: flex; align-items: center; gap: 6px; }
.card-body { padding: 16px; }

/* ── TABLA ── */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.tbl th { background: #163d26; color: rgba(255,255,255,.85); padding: 8px 12px; text-align: left; font-weight: 600; white-space: nowrap; }
table.tbl th:first-child { border-radius: 0; }
table.tbl td { padding: 7px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; color: var(--text); }
table.tbl tr:hover td { background: #f0f7f2; }
table.tbl tr:last-child td { border-bottom: none; }

/* ── BOTONES ── */
.btn { display: inline-flex; align-items: center; gap: 5px; padding: 6px 14px; border-radius: var(--radius); border: none; cursor: pointer; font-size: 12.5px; font-weight: 500; text-decoration: none; transition: filter .15s, transform .1s; white-space: nowrap; }
.btn:active { transform: scale(.97); }
.btn-primary  { background: #163d26; color: #fff; }
.btn-primary:hover { filter: brightness(1.2); }
.btn-success  { background: var(--green); color: #fff; }
.btn-success:hover { background: var(--green-d); }
.btn-danger   { background: var(--red); color: #fff; }
.btn-danger:hover { filter: brightness(1.1); }
.btn-secondary{ background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: #f0f0f0; }
.btn-sm { padding: 4px 9px; font-size: 11.5px; }
.btn-xs { padding: 2px 7px; font-size: 11px; }
.btn-group { display: flex; gap: 6px; flex-wrap: wrap; }

/* ── FORMULARIOS ── */
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 14px; }
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group.span2 { grid-column: span 2; }
.form-group.full  { grid-column: 1/-1; }
label.lbl { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
input[type=text], input[type=date], input[type=number], input[type=email],
input[type=password], select, textarea {
    padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--radius);
    font-size: 13px; color: var(--text); background: #fff; width: 100%;
    transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(39,174,96,.15);
}
textarea { resize: vertical; min-height: 75px; }
.form-actions { display: flex; gap: 8px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }

/* ── FILTROS ── */
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; padding: 12px 14px; background: #f7faf8; border: 1px solid var(--border); border-radius: var(--radius); }
.filter-bar .form-group { margin: 0; }
.filter-bar label.lbl { font-size: 10px; }
.filter-bar input, .filter-bar select { font-size: 12px; padding: 5px 8px; min-width: 140px; }

/* ── BADGES ── */
.badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.badge-entrada   { background: #d4edda; color: #155724; }
.badge-salida    { background: #f8d7da; color: #721c24; }
.badge-excedente { background: #fff3cd; color: #856404; }
.badge-merma     { background: #e2e3e5; color: #383d41; }

/* ── ALERTS ── */
.alert { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 14px; font-size: 12.5px; display: flex; align-items: center; gap: 8px; }
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-danger   { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-warning  { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }

/* ── PAGINATION ── */
.pager { display: flex; gap: 4px; margin-top: 12px; align-items: center; }
.pager a, .pager span { padding: 4px 9px; border-radius: var(--radius); border: 1px solid var(--border); font-size: 12px; text-decoration: none; color: var(--text); }
.pager a:hover { background: #163d26; color: #fff; border-color: #163d26; }
.pager .cur { background: #163d26; color: #fff; border-color: #163d26; }
.pager .info { border: none; color: var(--muted); font-size: 11.5px; }

/* ── LOGIN ── */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(145deg, #163d26 0%, #0a2015 100%); }
.login-box { background: #fff; border-radius: 12px; padding: 36px 30px; width: 340px; box-shadow: 0 12px 40px rgba(0,0,0,.3); }
.login-logo { text-align: center; margin-bottom: 22px; }
.login-logo .ico { width: 52px; height: 52px; background: var(--green); border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 26px; margin-bottom: 10px; }
.login-logo h2 { font-size: 17px; color: #163d26; font-weight: 700; }
.login-logo p  { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ── FOOTER ── */
.site-footer { text-align: center; color: var(--muted); font-size: 11px; padding: 14px; border-top: 1px solid var(--border); }

/* ── MISC ── */
.text-muted { color: var(--muted); }
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 14px; }
.section-title { font-size: 13.5px; font-weight: 600; color: #163d26; margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .main-wrap { margin-left: 0; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .form-grid { grid-template-columns: 1fr; }
}
