/* =============================================
   LaHuella – Design System
   Mobile-first · Responsive · Elegant
   ============================================= */

:root {
    --lh-primary: #7b0015;
    --lh-primary-hover: #5a0010;
    --lh-primary-light: #fef2f4;
    --lh-sidebar-bg: #1a1a2e;
    --lh-sidebar-hover: #25253f;
    --lh-sidebar-text: #9a9ab0;
    --lh-sidebar-active-text: #ffffff;
    --lh-sidebar-width: 260px;
    --lh-body-bg: #f0f2f5;
    --lh-card-bg: #ffffff;
    --lh-text: #2d3436;
    --lh-text-muted: #6c757d;
    --lh-border: #e9ecef;
    --lh-topbar-height: 60px;
    --lh-radius: 0.75rem;
    --lh-shadow: 0 1px 3px rgba(0,0,0,0.08);
    --lh-shadow-lg: 0 4px 12px rgba(0,0,0,0.1);
}

/* ── Base ──────────────────────────────────── */
html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
}
@media (min-width: 768px)  { html { font-size: 15px; } }
@media (min-width: 1200px) { html { font-size: 16px; } }

body {
    background: var(--lh-body-bg);
    color: var(--lh-text);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    margin: 0;
    overflow-x: hidden;
}

a { color: var(--lh-primary); }
a:hover { color: var(--lh-primary-hover); }

/* ── Sidebar ──────────────────────────────── */
.lh-sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--lh-sidebar-width);
    background: var(--lh-sidebar-bg);
    color: var(--lh-sidebar-text);
    display: flex;
    flex-direction: column;
    z-index: 1045;
    transition: transform .3s cubic-bezier(.4,0,.2,1);
    overflow-y: auto;
}
@media (max-width: 991.98px) {
    .lh-sidebar { transform: translateX(-100%); }
    .lh-sidebar.open { transform: translateX(0); box-shadow: var(--lh-shadow-lg); }
}

.lh-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 1044;
    opacity: 0;
    transition: opacity .3s ease;
}
.lh-sidebar-backdrop.open { display: block; opacity: 1; }

.lh-sidebar-brand {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.lh-sidebar-brand a {
    color: #fff;
    text-decoration: none;
    font-size: 1.35rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: .6rem;
    letter-spacing: -.02em;
}
.lh-sidebar-logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: 8px;
    background: rgba(255,255,255,.1);
    padding: 3px;
    flex-shrink: 0;
}

/* ── Welcome Hero ─────────────────────────── */
.lh-hero {
    background: linear-gradient(135deg, var(--lh-sidebar-bg) 0%, #2d2d4e 100%);
    border-radius: var(--lh-radius);
    color: #fff;
    padding: 2rem 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    position: relative;
    overflow: hidden;
}
.lh-hero::after {
    content: '';
    position: absolute;
    right: -40px;
    top: -40px;
    width: 180px;
    height: 180px;
    background: rgba(255,255,255,.06);
    border-radius: 50%;
}
.lh-hero-logo {
    width: 72px;
    height: 72px;
    object-fit: contain;
    border-radius: 16px;
    background: rgba(255,255,255,.15);
    padding: 8px;
    flex-shrink: 0;
}
@media (max-width: 575.98px) {
    .lh-hero { flex-direction: column; text-align: center; padding: 1.5rem 1.25rem; }
    .lh-hero-logo { width: 56px; height: 56px; }
}
.lh-hero h1 { font-size: 1.4rem; font-weight: 700; margin: 0 0 .25rem; }
.lh-hero p  { margin: 0; opacity: .85; font-size: .9rem; }

/* ── Quick Actions ────────────────────────── */
.lh-quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
    padding: 1.25rem .75rem;
    background: var(--lh-card-bg);
    border-radius: var(--lh-radius);
    box-shadow: var(--lh-shadow);
    text-decoration: none;
    color: var(--lh-text);
    transition: all .2s ease;
    text-align: center;
}
.lh-quick-action:hover {
    box-shadow: var(--lh-shadow-lg);
    transform: translateY(-2px);
    color: var(--lh-primary);
}
.lh-quick-action i {
    font-size: 1.6rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}
.lh-quick-action span {
    font-size: .8rem;
    font-weight: 600;
}

.lh-sidebar-nav { flex: 1; padding: 1rem 0; }

.lh-sidebar-section {
    padding: .5rem 1.5rem;
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: rgba(255,255,255,.3);
    margin-top: .5rem;
}

.lh-nav-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .65rem 1.5rem;
    color: var(--lh-sidebar-text);
    text-decoration: none;
    font-size: .9rem;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: all .15s ease;
}
.lh-nav-link:hover { color: #fff; background: var(--lh-sidebar-hover); }
.lh-nav-link.active {
    color: var(--lh-sidebar-active-text);
    background: var(--lh-sidebar-hover);
    border-left-color: #e84a6f;
}
.lh-nav-link i { font-size: 1.15rem; width: 1.25rem; text-align: center; opacity: .7; }
.lh-nav-link.active i,
.lh-nav-link:hover i { opacity: 1; }

.lh-sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255,255,255,.08);
}
.lh-sidebar-footer .btn {
    width: 100%;
    color: var(--lh-sidebar-text);
    border-color: rgba(255,255,255,.15);
    font-size: .85rem;
}
.lh-sidebar-footer .btn:hover { color: #fff; background: rgba(255,255,255,.08); }

/* ── Main Area ────────────────────────────── */
.lh-main {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left .3s cubic-bezier(.4,0,.2,1);
}
@media (min-width: 992px) { .lh-main { margin-left: var(--lh-sidebar-width); } }

/* ── Topbar ───────────────────────────────── */
.lh-topbar {
    height: var(--lh-topbar-height);
    background: var(--lh-card-bg);
    border-bottom: 1px solid var(--lh-border);
    display: flex;
    align-items: center;
    padding: 0 1rem;
    position: sticky;
    top: 0;
    z-index: 1020;
    gap: .75rem;
}
@media (min-width: 768px) { .lh-topbar { padding: 0 1.5rem; } }

.lh-topbar-toggle {
    border: none;
    background: none;
    font-size: 1.4rem;
    color: var(--lh-text);
    padding: .25rem;
    cursor: pointer;
    line-height: 1;
}
.lh-topbar-title {
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--lh-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Content ──────────────────────────────── */
.lh-content { flex: 1; padding: 1rem; }
@media (min-width: 768px)  { .lh-content { padding: 1.5rem 2rem; } }
@media (min-width: 1200px) { .lh-content { padding: 2rem 2.5rem; } }

/* ── Page Header ──────────────────────────── */
.lh-page-header {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    margin-bottom: 1.5rem;
}
@media (min-width: 576px) {
    .lh-page-header { flex-direction: row; align-items: center; justify-content: space-between; }
}
.lh-page-header h1 { font-size: 1.5rem; font-weight: 700; margin: 0; color: var(--lh-text); }

/* ── Cards ────────────────────────────────── */
.lh-card {
    background: var(--lh-card-bg);
    border: none;
    border-radius: var(--lh-radius);
    box-shadow: var(--lh-shadow);
}
.lh-card .card-header {
    background: transparent;
    border-bottom: 1px solid var(--lh-border);
    padding: 1rem 1.25rem;
    font-weight: 600;
}
.lh-card .card-body { padding: 1.25rem; }
.lh-card .card-footer {
    background: transparent;
    border-top: 1px solid var(--lh-border);
    padding: 1rem 1.25rem;
}

/* ── Stats Cards ──────────────────────────── */
.lh-stat-card {
    background: var(--lh-card-bg);
    border: none;
    border-radius: var(--lh-radius);
    box-shadow: var(--lh-shadow);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: box-shadow .2s ease;
}
.lh-stat-card:hover { box-shadow: var(--lh-shadow-lg); }

.lh-stat-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}
.lh-stat-icon.red    { background: #fef2f4; color: #7b0015; }
.lh-stat-icon.blue   { background: #e8f4fd; color: #0c63e4; }
.lh-stat-icon.green  { background: #e6f9f0; color: #0f8a4f; }
.lh-stat-icon.orange { background: #fff4e6; color: #d46b08; }
.lh-stat-icon.purple { background: #f3e8ff; color: #7c3aed; }

.lh-stat-value { font-size: 1.5rem; font-weight: 700; line-height: 1.2; color: var(--lh-text); }
.lh-stat-label { font-size: .8rem; color: var(--lh-text-muted); margin-top: .1rem; }

/* ── Table Wrap ───────────────────────────── */
.lh-table-wrap {
    background: var(--lh-card-bg);
    border-radius: var(--lh-radius);
    box-shadow: var(--lh-shadow);
    overflow: hidden;
}
.lh-table-header {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--lh-border);
}
@media (min-width: 576px) {
    .lh-table-header { flex-direction: row; align-items: center; justify-content: space-between; }
}
.lh-table-header h2 { font-size: 1.15rem; font-weight: 600; margin: 0; }

.lh-table { margin-bottom: 0; }
.lh-table thead th {
    background: #fafbfc;
    border-bottom: 2px solid var(--lh-border);
    font-size: .78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--lh-text-muted);
    padding: .75rem 1rem;
    white-space: nowrap;
}
.lh-table tbody td {
    padding: .75rem 1rem;
    vertical-align: middle;
    font-size: .9rem;
    border-bottom: 1px solid var(--lh-border);
}
.lh-table tbody tr:last-child td { border-bottom: none; }
.lh-table tbody tr:hover { background: var(--lh-primary-light); }

/* ── Mobile Card List ─────────────────────── */
.lh-mobile-list { padding: 0; }
.lh-mobile-item {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--lh-border);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: .75rem;
}
.lh-mobile-item:last-child { border-bottom: none; }
.lh-mobile-item-main { flex: 1; min-width: 0; }
.lh-mobile-item-title { font-weight: 600; font-size: .95rem; color: var(--lh-text); margin-bottom: .2rem; }
.lh-mobile-item-sub { font-size: .8rem; color: var(--lh-text-muted); }
.lh-mobile-item-actions { flex-shrink: 0; display: flex; gap: .4rem; }

/* ── Buttons ──────────────────────────────── */
.btn {
    border-radius: .5rem;
    font-weight: 500;
    font-size: .875rem;
    padding: .45rem 1rem;
}
.btn-sm { border-radius: .375rem; padding: .3rem .65rem; font-size: .8rem; }
.btn:focus, .btn:active:focus { box-shadow: 0 0 0 .15rem rgba(123,0,21,.2); }

.btn-primary { background-color: var(--lh-primary); border-color: var(--lh-primary); color: #fff; }
.btn-primary:hover,
.btn-primary:active { background-color: var(--lh-primary-hover); border-color: var(--lh-primary-hover); color: #fff; }
.btn-primary:focus { box-shadow: 0 0 0 .25rem rgba(123,0,21,.25); }

.btn-outline-primary { color: var(--lh-primary); border-color: var(--lh-primary); }
.btn-outline-primary:hover,
.btn-outline-primary:active { background-color: var(--lh-primary); border-color: var(--lh-primary); color: #fff; }

/* ── Forms ────────────────────────────────── */
.form-control, .form-select {
    border-radius: .5rem;
    border: 1px solid #d1d5db;
    font-size: .9rem;
    padding: .55rem .85rem;
}
/* El caret de .form-select es una imagen de fondo de 16px dibujada a .75rem del
   borde derecho: necesita espacio reservado o se superpone al texto. El padding
   de arriba pisa el padding-right de Bootstrap, así que hay que devolverlo. */
.form-select { padding-right: 2.25rem; }
.form-control:focus, .form-select:focus {
    border-color: var(--lh-primary);
    box-shadow: 0 0 0 .2rem rgba(123,0,21,.12);
}
.form-label { font-weight: 500; font-size: .85rem; color: #374151; margin-bottom: .35rem; }
.form-check-input:checked { background-color: var(--lh-primary); border-color: var(--lh-primary); }
.form-check-input:focus { box-shadow: 0 0 0 .2rem rgba(123,0,21,.15); }

/* ── Alerts ───────────────────────────────── */
.alert { border-radius: var(--lh-radius); border: none; font-size: .9rem; }

/* ── Badges ───────────────────────────────── */
.lh-badge {
    display: inline-flex; align-items: center; gap: .3rem;
    padding: .3rem .65rem; border-radius: 50rem;
    font-size: .75rem; font-weight: 600;
}
.lh-badge-success { background: #e6f9f0; color: #0f8a4f; }
.lh-badge-warning { background: #fff4e6; color: #d46b08; }
.lh-badge-danger  { background: #fef2f4; color: #be123c; }
.lh-badge-info    { background: #e8f4fd; color: #0c63e4; }
.lh-badge-neutral { background: #eef1f5; color: #475569; }

/* ── Detail Pages ─────────────────────────── */
.lh-detail dt {
    font-size: .8rem; font-weight: 600; color: var(--lh-text-muted);
    text-transform: uppercase; letter-spacing: .03em; padding-bottom: .25rem;
}
.lh-detail dd {
    font-size: .95rem; color: var(--lh-text);
    padding-bottom: .75rem; border-bottom: 1px solid var(--lh-border); margin-bottom: .75rem;
}
.lh-detail dd:last-of-type { border-bottom: none; margin-bottom: 0; }

/* ── Empty State ──────────────────────────── */
.lh-empty { text-align: center; padding: 3rem 1.5rem; color: var(--lh-text-muted); }
.lh-empty i { font-size: 2.5rem; opacity: .4; margin-bottom: .75rem; display: block; }
.lh-empty p { margin: 0; font-size: .95rem; }

/* ── Toast ────────────────────────────────── */
.toast.bg-success { background-color: #0f8a4f !important; color: #fff !important; }
.toast.bg-danger  { background-color: #be123c !important; color: #fff !important; }
.toast.bg-warning { background-color: #d46b08 !important; color: #fff !important; }

/* ── Notifications ────────────────────────── */
.notif-unread { background: var(--lh-primary-light); font-weight: 600; }
.notif-unread .fw-semibold { font-weight: 700 !important; }

/* ── Scrollbar ────────────────────────────── */
.lh-sidebar::-webkit-scrollbar { width: 4px; }
.lh-sidebar::-webkit-scrollbar-track { background: transparent; }
.lh-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 2px; }

/* ── User Card (Sidebar) ──────────────────── */
.lh-user-card {
    margin: 0 .75rem .75rem;
    padding: .75rem 1rem;
    background: rgba(255,255,255,.06);
    border-radius: .6rem;
    border: 1px solid rgba(255,255,255,.08);
}
.lh-user-card-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--lh-primary);
    color: #fff;
    font-size: .9rem;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.lh-user-card-name {
    font-size: .85rem;
    font-weight: 600;
    color: #fff;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.lh-user-card-role {
    font-size: .7rem;
    color: rgba(255,255,255,.5);
    margin-top: .1rem;
}
.lh-user-card-talleres {
    margin-top: .5rem;
    padding-top: .5rem;
    border-top: 1px solid rgba(255,255,255,.08);
    display: flex;
    flex-wrap: wrap;
    gap: .3rem;
}
.lh-user-card-taller-chip {
    display: inline-flex; align-items: center; gap: .25rem;
    background: rgba(232,74,111,.18);
    color: #f48fb1;
    border-radius: 50rem;
    font-size: .68rem;
    font-weight: 600;
    padding: .2rem .55rem;
}

/* ── Profile Card (Home) ──────────────────── */
.lh-profile-card {
    background: var(--lh-card-bg);
    border-radius: var(--lh-radius);
    box-shadow: var(--lh-shadow);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}
.lh-profile-avatar {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: var(--lh-primary);
    color: #fff;
    font-size: 1.3rem;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.lh-profile-name { font-size: 1.1rem; font-weight: 700; color: var(--lh-text); margin-bottom: .2rem; }
.lh-profile-meta { font-size: .82rem; color: var(--lh-text-muted); }
.lh-profile-talleres { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .5rem; }
.lh-profile-taller-chip {
    display: inline-flex; align-items: center; gap: .25rem;
    background: var(--lh-primary-light);
    color: var(--lh-primary);
    border-radius: 50rem;
    font-size: .75rem;
    font-weight: 600;
    padding: .25rem .65rem;
}

/* ── Animation ────────────────────────────── */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.lh-content > * { animation: fadeIn .25s ease; }

/* ── Print ────────────────────────────────── */
@media print {
    .lh-sidebar, .lh-topbar, .lh-sidebar-backdrop { display: none !important; }
    .lh-main { margin-left: 0 !important; }
}

