/* ============================================================
   PERRUKERÍA CANINA — Estilos principales
   ============================================================ */

:root {
    --sidebar-w: 260px;
    --brand-color: #5c3d8f;
    --brand-light: #7b55b5;
    --accent: #e91e8c;
    --bg: #f0f2f7;
    --card-bg: #fff;
    --text: #1e1e2e;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', system-ui, sans-serif; background: var(--bg); color: var(--text); }

/* ── SIDEBAR ── */
.sidebar {
    position: fixed; top: 0; left: 0;
    width: var(--sidebar-w); height: 100vh;
    background: #01CCC9;
    display: flex; flex-direction: column;
    overflow-y: auto; overflow-x: hidden;
    z-index: 1050; transition: transform .3s ease;
    -webkit-overflow-scrolling: touch;
}

.sidebar-brand {
    display: flex; align-items: center; gap: 12px;
    padding: 24px 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,.1);
}
.brand-icon { font-size: 2rem; }
.brand-name { color: #fff; font-size: 1.1rem; font-weight: 700; line-height: 1; }
.brand-sub  { color: rgba(255,255,255,.5); font-size: .7rem; text-transform: uppercase; letter-spacing: 1px; }

.sidebar-user {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 20px;
    background: rgba(255,255,255,.06);
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.user-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--accent); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: .95rem; flex-shrink: 0;
}
.user-name  { color: #fff; font-size: .85rem; font-weight: 600; }
.user-role  { color: rgba(255,255,255,.5); font-size: .7rem; }

.sidebar-nav { flex: 1; padding: 12px 0; }
.nav-section {
    color: rgba(255,255,255,.35); font-size: .65rem;
    text-transform: uppercase; letter-spacing: 1.5px;
    padding: 12px 20px 4px;
}
.sidebar-nav .nav-link, .sidebar-footer .nav-link {
    display: flex; align-items: center; gap: 10px;
    color: #fff;
    padding: 10px 20px; text-decoration: none;
    border-left: 3px solid transparent;
    transition: all .2s;
}
.sidebar-nav .nav-link:hover, .sidebar-footer .nav-link:hover {
    background: rgba(255,255,255,.08);
    color: #fff; border-left-color: rgba(255,255,255,.3);
}
.sidebar-nav .nav-link.active {
    background: rgba(255,255,255,.12);
    color: #fff; border-left-color: var(--accent);
    font-weight: 600;
}
.sidebar-nav .nav-link i, .sidebar-footer .nav-link i { font-size: 1rem; }

.sidebar-footer {
    border-top: 1px solid rgba(255,255,255,.1);
    padding: 8px 0;
}
.sidebar-footer .nav-link.text-danger { color: #ff8080 !important; }
.sidebar-footer .nav-link.text-danger:hover { background: rgba(239,68,68,.15); }

/* ── MAIN CONTENT ── */
.main-content {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    padding: 28px 32px;
}

/* ── PAGE HEADER ── */
.page-header {
    margin-bottom: 24px;
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 12px;
}
.page-title { font-size: 1.6rem; font-weight: 700; color: var(--text); }
.page-subtitle { color: var(--text-muted); font-size: .9rem; margin-top: 2px; }

/* ── STAT CARDS ── */
.stat-card {
    background: var(--card-bg); border-radius: 16px;
    padding: 20px 24px; box-shadow: 0 2px 12px rgba(0,0,0,.06);
    border: 1px solid var(--border); position: relative; overflow: hidden;
    transition: transform .2s, box-shadow .2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.1); }
.stat-card .stat-icon {
    width: 52px; height: 52px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; margin-bottom: 14px;
}
.stat-card .stat-value { font-size: 2rem; font-weight: 800; line-height: 1; margin-bottom: 4px; }
.stat-card .stat-label { color: var(--text-muted); font-size: .85rem; }
.stat-purple { background: #f3e8ff; color: var(--brand-color); }
.stat-pink   { background: #fce7f3; color: var(--accent); }
.stat-green  { background: #d1fae5; color: var(--success); }
.stat-orange { background: #fef3c7; color: var(--warning); }
.stat-blue   { background: #dbeafe; color: var(--info); }
.stat-red    { background: #fee2e2; color: var(--danger); }

/* ── CARDS ── */
.card {
    background: var(--card-bg); border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: 0 2px 12px rgba(0,0,0,.05);
}
.card-header {
    background: transparent; border-bottom: 1px solid var(--border);
    padding: 16px 20px; font-weight: 600;
}

/* ── AGENDA TABLE ── */
.agenda-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.agenda-table th {
    background: linear-gradient(135deg, var(--brand-color), var(--brand-light));
    color: #fff; padding: 10px 12px; text-align: left; font-weight: 600;
}
.agenda-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.agenda-table tr:last-child td { border-bottom: none; }
.agenda-table tr:hover td { background: rgba(92,61,143,.04); }
.hora-badge {
    background: var(--brand-color); color: #fff;
    padding: 4px 10px; border-radius: 20px;
    font-weight: 700; font-size: .82rem; white-space: nowrap;
}

/* ── STATUS BADGES ── */
.badge-estado {
    padding: 4px 10px; border-radius: 20px; font-size: .75rem; font-weight: 600;
}
.estado-pendiente   { background: #fef9c3; color: #92400e; }
.estado-confirmada  { background: #dbeafe; color: #1e40af; }
.estado-recibida    { background: #ede9fe; color: #5b21b6; }
.estado-en_proceso  { background: #fce7f3; color: #9d174d; }
.estado-lista       { background: #d1fae5; color: #065f46; }
.estado-retirada    { background: #f3f4f6; color: #374151; }
.estado-cancelada   { background: #fee2e2; color: #991b1b; }

/* ── QUICK ACTION BUTTONS ── */
.btn-wa {
    background: #25d366; border: none; color: #fff;
    border-radius: 8px; padding: 6px 14px; font-size: .8rem;
    font-weight: 600; text-decoration: none; display: inline-flex;
    align-items: center; gap: 6px; transition: opacity .2s;
}
.btn-wa:hover { opacity: .85; color: #fff; }
.btn-wa-gray { background: #6b7280; }

/* ── LOGIN PAGE ── */
.login-page {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: #01CCC9;
}
.login-card {
    background: #fff; border-radius: 24px;
    padding: 40px; width: 100%; max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo .logo-icon { font-size: 3.5rem; display: block; margin-bottom: 8px; }
.login-logo h2 { color: var(--brand-color); font-weight: 800; font-size: 1.5rem; }
.login-logo p  { color: var(--text-muted); font-size: .85rem; }

/* ── OVERLAY MOBILE ── */
.overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.5);
    z-index: 1040; opacity: 0; visibility: hidden;
    transition: opacity .3s, visibility .3s;
}
.overlay.active { opacity: 1; visibility: visible; }

.sidebar-toggle {
    position: fixed; top: 14px; left: 14px; z-index: 1060;
    background: var(--brand-color); border: none; color: #fff;
    width: 42px; height: 42px; border-radius: 10px;
    font-size: 1.3rem; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 12px rgba(92,61,143,.4);
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; padding: 70px 16px 20px; }
    .page-title { font-size: 1.3rem; }
}

/* ── ARTIGRID OVERRIDES ── */
.artigrid-wrapper .table { font-size: .85rem; }
.artigrid-wrapper .btn-sm { font-size: .78rem; }
