/* =====================================================
   EPAM — Sistema de Gestión de Talleres
   Tema: naranja/rojo — navbar superior
   ===================================================== */

:root {
    --primary:       #c0392b;   /* rojo principal */
    --primary-dark:  #922b21;   /* rojo oscuro (hover) */
    --primary-light: #fadbd8;   /* rojo claro (fondo badge) */
    --accent:        #e67e22;   /* naranja acento */
    --accent-dark:   #ca6f1e;
    --navbar-height: 64px;
    --body-bg:       #fafafa;
    --card-radius:   10px;
    --text:          #1a1a1a;
    --text-muted:    #666;
    --border:        #e0e0e0;
}

* { box-sizing: border-box; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 16px;
    background: var(--body-bg);
    margin: 0;
    min-height: 100vh;
    color: var(--text);
}

/* ── Navbar principal ── */
.top-navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--navbar-height);
    background: var(--primary);
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,.25);
    display: flex;
    align-items: center;
}

.navbar-inner {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 0;
}

/* Logo / marca */
.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
    margin-right: 24px;
}

.navbar-brand img { height: 40px; filter: brightness(0) invert(1); }

.brand-text { line-height: 1.15; }
.brand-title { display: block; color: #fff; font-size: 1.1rem; font-weight: 800; letter-spacing: .3px; }
.brand-sub   { display: block; color: rgba(255,255,255,.65); font-size: .68rem; text-transform: uppercase; letter-spacing: .8px; }

/* Links de navegación */
.navbar-links {
    display: flex;
    align-items: stretch;
    list-style: none;
    margin: 0;
    padding: 0;
    height: var(--navbar-height);
    flex: 1;
}

.navbar-links li a {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 0 16px;
    color: rgba(255,255,255,.85);
    text-decoration: none;
    font-size: .95rem;
    font-weight: 500;
    height: 100%;
    border-bottom: 3px solid transparent;
    transition: background .18s, color .18s, border-color .18s;
    white-space: nowrap;
}

.navbar-links li a i { font-size: 1.05rem; }

.navbar-links li a:hover {
    background: rgba(255,255,255,.12);
    color: #fff;
    border-bottom-color: rgba(255,255,255,.5);
}

.navbar-links li a.active {
    background: rgba(0,0,0,.18);
    color: #fff;
    border-bottom-color: #fff;
    font-weight: 700;
}

/* Separador en navbar */
.navbar-sep {
    width: 1px;
    height: 28px;
    background: rgba(255,255,255,.2);
    margin: 0 8px;
    flex-shrink: 0;
}

/* Usuario + logout */
.navbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    flex-shrink: 0;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0,0,0,.2);
    border-radius: 24px;
    padding: 4px 14px 4px 6px;
    color: #fff;
}

.user-avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: .8rem;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

.user-fullname { font-size: .85rem; font-weight: 600; }
.user-role     { font-size: .72rem; color: rgba(255,255,255,.65); }

.btn-logout {
    color: rgba(255,255,255,.75);
    font-size: 1.2rem;
    text-decoration: none;
    padding: 6px 8px;
    border-radius: 6px;
    transition: color .18s, background .18s;
    display: flex; align-items: center;
}
.btn-logout:hover { color: #fff; background: rgba(255,255,255,.15); }

/* Hamburger (mobile) */
.navbar-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px 8px;
    margin-left: auto;
}

/* ── Main content ── */
.page-main {
    padding-top: var(--navbar-height);
    min-height: 100vh;
}

.page-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 28px 24px 60px;
}

/* Breadcrumb bar */
.breadcrumb-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    font-size: .88rem;
}

.breadcrumb-bar a { color: var(--primary); text-decoration: none; }
.breadcrumb-bar a:hover { text-decoration: underline; }
.breadcrumb-bar .sep { color: #bbb; }
.breadcrumb-bar .current { color: var(--text-muted); }

/* ── Page header ── */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.page-header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

.page-header p { color: var(--text-muted); margin: 4px 0 0; font-size: .95rem; }

/* ── Cards ── */
.card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    margin-bottom: 0;
}

.card-header {
    background: #fff;
    border-bottom: 1px solid var(--border);
    border-radius: var(--card-radius) var(--card-radius) 0 0 !important;
    padding: 16px 20px;
    font-weight: 600;
    font-size: 1rem;
    color: var(--text);
}

.card-body { padding: 20px; }
.card-footer { padding: 14px 20px; border-top: 1px solid var(--border); background: #fafafa; border-radius: 0 0 var(--card-radius) var(--card-radius); }

/* ── Stat cards ── */
.stat-card {
    border-radius: var(--card-radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid var(--border);
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    transition: transform .18s, box-shadow .18s;
    text-decoration: none;
    color: inherit;
}

.stat-card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,.1); color: inherit; }

.stat-icon {
    width: 56px; height: 56px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.stat-icon.red    { background: #fadbd8; color: var(--primary); }
.stat-icon.orange { background: #fdebd0; color: var(--accent); }
.stat-icon.green  { background: #d5f5e3; color: #1e8449; }
.stat-icon.blue   { background: #d6eaf8; color: #1a5276; }
.stat-icon.purple { background: #e8daef; color: #6c3483; }
.stat-icon.teal   { background: #d0ece7; color: #0e6655; }

.stat-value { font-size: 1.9rem; font-weight: 700; color: var(--text); line-height: 1; }
.stat-label { font-size: .85rem; color: var(--text-muted); margin-top: 3px; }

/* ── Tables ── */
.table { margin: 0; font-size: .93rem; }

.table thead th {
    background: #f5f5f5;
    color: #444;
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    border-bottom: 2px solid var(--border);
    padding: 12px 16px;
    white-space: nowrap;
}

.table tbody td {
    padding: 13px 16px;
    vertical-align: middle;
    color: var(--text);
    border-bottom: 1px solid #f0f0f0;
    font-size: .93rem;
}

.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #fff8f7; }

/* ── Buttons ── */
.btn {
    border-radius: 8px;
    font-size: .9rem;
    font-weight: 600;
    padding: .5rem 1.1rem;
}

.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }

.btn-warning { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-warning:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }

.btn-sm { padding: .3rem .65rem; font-size: .82rem; border-radius: 6px; }
.btn-lg { padding: .65rem 1.4rem; font-size: 1rem; }

/* ── Forms ── */
.form-label { font-size: .9rem; font-weight: 600; color: #333; margin-bottom: 5px; }
.form-label-sm { font-size: .82rem; }

.form-control, .form-select {
    border-radius: 8px;
    border: 1.5px solid #ccc;
    font-size: .95rem;
    padding: .45rem .75rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(192,57,43,.15);
    outline: none;
}

/* ── Badges ── */
.badge { font-size: .78rem; font-weight: 700; border-radius: 6px; padding: .35em .65em; }

/* Badges personalizados */
.badge-pendiente { background: #fdebd0; color: #784212; border: 1px solid #f0b27a; }
.badge-pagado    { background: #d5f5e3; color: #1e8449; }
.badge-anulado   { background: #f9ebea; color: #922b21; }

/* ── Alertas de pago pendiente ── */
.pago-pendiente-alert {
    background: #fef9e7;
    border: 1.5px solid #f9a825;
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: .93rem;
    font-weight: 500;
    color: #7d6608;
}

/* ── Asistencia ── */
.asistencia-presente { color: #1e8449; font-weight: 700; }
.asistencia-ausente  { color: var(--primary); }
.asistencia-sincarga { color: #999; }

/* ── Login page ── */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--accent) 100%);
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 16px;
    padding: 44px 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
}

/* ── Tabs ── */
.nav-tabs .nav-link {
    color: var(--text-muted);
    font-weight: 600;
    font-size: .93rem;
    border-radius: 8px 8px 0 0;
}

.nav-tabs .nav-link.active {
    color: var(--primary);
    border-color: var(--border) var(--border) #fff;
}

/* ── Print ── */
@media print {
    .top-navbar, .breadcrumb-bar, .no-print,
    .card-footer, .page-header .btn,
    .card:has(form), form.row { display: none !important; }
    .page-main  { padding-top: 0 !important; }
    .page-wrapper { padding: 0 !important; }
    .card { box-shadow: none !important; border: 1px solid #999 !important; break-inside: avoid; }
    .card-header { background: #eee !important; color: #111 !important; }
    .table { font-size: 9pt !important; }
    .badge { border: 1px solid #999 !important; color: #111 !important; background: none !important; }
    .print-title { display: block !important; }
    @page { size: A4 landscape; margin: 12mm; }
}
.print-title { display: none; font-size: 13pt; font-weight: bold; margin-bottom: 6px; }

/* ── Responsive mobile ── */
@media (max-width: 991.98px) {
    .navbar-links { display: none; flex-direction: column; position: absolute; top: var(--navbar-height); left: 0; right: 0; background: var(--primary-dark); height: auto; padding-bottom: 12px; z-index: 999; }
    .navbar-links.open { display: flex; }
    .navbar-links li a { padding: 14px 20px; border-bottom: 1px solid rgba(255,255,255,.08); border-left: none; }
    .navbar-links li a.active { border-left: 4px solid #fff; border-bottom-color: rgba(255,255,255,.08); }
    .navbar-toggle { display: block; }
    .user-chip .user-role, .user-chip .user-fullname { display: none; }
    .page-wrapper { padding: 20px 16px 40px; }
}

@media (max-width: 576px) {
    .page-header { flex-direction: column; }
    .page-header .btn { width: 100%; text-align: center; }
    .stat-card { padding: 14px; }
    .stat-value { font-size: 1.5rem; }
}
