/* VARIABLES Y TEMA OFICIAL GARDA SOLUCIONES IT */
:root {
    --bg-main: #f1f5f9;
    --bg-card: #ffffff;
    --primary: #0f172a;
    --primary-light: #1e293b;
    --accent: #0ea5e9;
    --accent-hover: #0284c7;
    --border: #e2e8f0;
    --text-dark: #334155;
    --text-muted: #64748b;
    
    /* Estados de Proceso */
    --st-pending: #f59e0b;
    --st-progress: #0ea5e9;
    --st-done: #10b981;
    --st-warranty: #64748b;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
body { background-color: var(--bg-main); color: var(--text-dark); height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
.hidden { display: none !important; }
.full-width { width: 100%; }
.text-center { text-align: center; }
h1, h2, h3, h4 { margin-bottom: 0.5rem; line-height: 1.3; }
p { margin-bottom: 1rem; line-height: 1.6; }

/* Botones */
button { cursor: pointer; border: none; border-radius: 8px; font-weight: 600; transition: 0.2s; padding: 0.8rem 1.2rem; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 0.95rem; }
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-2px); box-shadow: 0 4px 10px rgba(14, 165, 233, 0.25); }
.btn-secondary { background: #e2e8f0; color: var(--primary); }
.btn-secondary:hover { background: #cbd5e1; }
.btn-danger { background: #fee2e2; color: #ef4444; }
.btn-danger:hover { background: #fecaca; }
.btn-outline-white { background: transparent; border: 1px solid rgba(255,255,255,0.2); color: white; }
.btn-outline-white:hover { background: rgba(255,255,255,0.1); }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: 50%; }

/* Formularios */
.input-std { width: 100%; padding: 0.85rem; border: 1px solid var(--border); border-radius: 8px; background: #f8fafc; color: var(--primary); outline: none; transition: 0.2s; font-size: 0.95rem; }
.input-std:focus { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15); }
.form-group { margin-bottom: 1.2rem; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.85rem; color: var(--primary); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }

/* Bloque Semáforo */
.semaforo-block { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: 15px; margin: 15px 0; }
.semaforo-block h4 { font-size: 0.95rem; color: var(--primary); margin-bottom: 10px; }

/* Login */
.view-section { display: none; height: 100vh; width: 100vw; }
.view-section.active { display: flex; }
#view-login { justify-content: center; align-items: center; background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%); }
.login-box { background: white; padding: 3rem 2.5rem; border-radius: 16px; box-shadow: 0 20px 40px rgba(0,0,0,0.15); width: 90%; max-width: 420px; text-align: center; }
.img-logo-login { width: 100px; margin-bottom: 1rem; }
.input-group { position: relative; margin-bottom: 1.2rem; }
.input-group i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 1.1rem; }
.input-group input { padding-left: 45px !important; }

/* Dashboard Layout */
.dashboard-layout { display: flex; flex-direction: row !important; }
.sidebar { width: 260px; background: var(--primary); color: white; display: flex; flex-direction: column; z-index: 10; }
.sidebar-header { padding: 1.5rem; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(255,255,255,0.1); }
.sidebar-menu { list-style: none; flex: 1; padding: 1.2rem 0; }
.sidebar-menu li a { display: flex; align-items: center; gap: 12px; padding: 0.9rem 1.5rem; color: #cbd5e1; text-decoration: none; font-size: 0.95rem; transition: 0.2s; }
.sidebar-menu li a:hover, .sidebar-menu li.active a { background: rgba(255,255,255,0.06); color: white; border-left: 4px solid var(--accent); }
.sidebar-footer { padding: 1.2rem; border-top: 1px solid rgba(255,255,255,0.1); }

.main-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; background: #f8fafc; }
.top-nav { background: white; padding: 1rem 1.8rem; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); }
.search-box { position: relative; width: 380px; }
.search-box i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.search-box input { width: 100%; padding: 0.65rem 1rem 0.65rem 42px; border: 1px solid var(--border); border-radius: 20px; background: #f8fafc; outline: none; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.earnings-pill { background: #ecfdf5; color: #059669; padding: 0.5rem 1rem; border-radius: 20px; font-weight: 700; display: flex; align-items: center; gap: 8px; border: 1px solid #a7f3d0; font-size: 1rem; }
.btn-reset-money { background: transparent; color: inherit; padding: 0; width: auto; height: auto; }

/* Dashboard Plegable */
.dash-card { margin: 15px 1.8rem 0; background: white; border-radius: 10px; border: 1px solid var(--border); box-shadow: 0 2px 4px rgba(0,0,0,0.02); overflow: hidden; }
.dash-toggle-btn { width: 100%; padding: 12px 16px; background: #f8fafc; border: none; text-align: left; font-size: 1rem; font-weight: bold; color: var(--text-dark); cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.dash-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 15px; padding: 15px; border-top: 1px solid var(--border); }
.chart-wrapper { height: 230px; display: flex; align-items: center; justify-content: center; }

/* Filtros */
.filter-bar { background: white; padding: 0.8rem 1.8rem; border-bottom: 1px solid var(--border); display: flex; gap: 10px; align-items: center; }
.filter-tabs { display: flex; gap: 10px; }
.filter-btn { background: #f8fafc; color: var(--text-muted); border: 1px solid var(--border); border-radius: 20px; padding: 0.45rem 1rem; font-size: 0.85rem; font-weight: 600; }
.filter-btn:hover { background: #e2e8f0; color: var(--primary); }
.filter-btn.active { background: var(--primary); color: white; border-color: var(--primary); }

/* Kanban Board */
.board { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.2rem; padding: 1.5rem 1.8rem; overflow-y: auto; }
.column { background: #f1f5f9; border-radius: 12px; display: flex; flex-direction: column; max-height: 100%; border: 1px solid #e2e8f0; }
.col-head { padding: 12px 16px; font-weight: 800; display: flex; justify-content: space-between; align-items: center; border-bottom: 3px solid #e2e8f0; font-size: 0.95rem; }
.count-pill { background: white; color: var(--text-dark); padding: 3px 8px; border-radius: 12px; font-size: 0.8rem; font-weight: bold; border: 1px solid var(--border); }
.st-pending { border-bottom-color: var(--st-pending); }
.st-progress { border-bottom-color: var(--st-progress); }
.st-done { border-bottom-color: var(--st-done); }
.st-warranty { border-bottom-color: var(--st-warranty); }

.ticket-list { padding: 12px; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; flex: 1; }
.ticket-card { background: white; border: 1px solid var(--border); border-radius: 10px; padding: 1rem; cursor: pointer; transition: 0.2s; position: relative; border-left: 4px solid #ccc; box-shadow: 0 2px 4px rgba(0,0,0,0.02); }
.ticket-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 6px 12px rgba(0,0,0,0.06); }
.prio-high { border-left-color: #ef4444; }
.prio-low { border-left-color: var(--accent); }
.tc-header { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 0.8rem; color: var(--text-muted); }
.cat-badge { font-size: 0.7rem; padding: 2px 6px; border-radius: 4px; font-weight: bold; }
.cat-hw { background: #fee2e2; color: #b91c1c; }
.cat-sw { background: #e0e7ff; color: #4338ca; }
.cat-net { background: #fef3c7; color: #b45309; }
.tc-title { font-weight: 700; font-size: 0.95rem; color: var(--primary); margin-bottom: 6px; }
.tc-client { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 12px; }
.tc-footer { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid #f1f5f9; padding-top: 8px; }
.tc-price { font-weight: 800; color: var(--primary); font-size: 1rem; }
.tc-actions { display: flex; gap: 6px; }
.btn-move { background: #f1f5f9; color: var(--text-dark); border-radius: 6px; }
.btn-move:hover { background: var(--primary); color: white; }

/* Modales */
.modal { position: fixed; top:0; left:0; width:100%; height:100%; background:rgba(15, 23, 42, 0.65); backdrop-filter: blur(4px); display:flex; justify-content:center; align-items:center; z-index:1000; }
.modal-content { background: white; border-radius: 14px; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 40px rgba(0,0,0,0.2); }
.btn-close-modal { background: #f1f5f9; color: var(--text-muted); width: 32px; height: 32px; border-radius: 50%; padding: 0; display:flex; align-items:center; justify-content:center; }
.btn-close-modal:hover { background: #fee2e2; color: #ef4444; }
.form-modal { width: 90%; max-width: 620px; padding: 2rem; }
.modal-header-clean { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; border-bottom: 1px solid var(--border); padding-bottom: 0.8rem; }
.modal-header-clean h3 { color: var(--primary); font-size: 1.25rem; margin: 0; }

.ticket-view-modal { width: 92%; max-width: 1050px; padding: 0; }
.ticket-view-header { background: #f8fafc; padding: 1.5rem 2rem; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: flex-start; }
.status-badge { padding: 4px 10px; border-radius: 16px; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; margin-bottom: 8px; display: inline-block; color: white; }
.badge-pending { background: var(--st-pending); }
.badge-progress { background: var(--st-progress); }
.badge-done { background: var(--st-done); }
.badge-warranty { background: var(--st-warranty); }
.tv-subtitle { font-size: 0.9rem; color: var(--text-muted); margin-top: 6px; }
.ticket-view-body { display: grid; grid-template-columns: 2fr 1fr; gap: 2rem; padding: 2rem; background: #fff; }
.tv-box { border: 1px solid var(--border); border-radius: 10px; padding: 1.4rem; margin-bottom: 1.4rem; background: white; }
.tv-box h4 { font-size: 0.9rem; color: var(--primary); text-transform: uppercase; border-bottom: 1px solid var(--border); padding-bottom: 8px; margin-bottom: 14px; font-weight: 800; }
.tv-text-muted { color: var(--text-dark); font-size: 0.95rem; line-height: 1.5; }
.timeline-container { max-height: 300px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; margin-bottom: 15px; }
.tl-item { background: #f8fafc; border-left: 3px solid var(--accent); padding: 10px 14px; border-radius: 0 6px 6px 0; font-size: 0.9rem; }
.tl-date { font-size: 0.75rem; color: var(--text-muted); font-weight: 700; margin-bottom: 4px; }
.client-info-card { display: flex; align-items: center; gap: 12px; margin-bottom: 15px; }
.client-info-card i { font-size: 2.5rem; color: #cbd5e1; }
.btn-wa { background: #25D366; color: white; }
.btn-wa:hover { background: #128C7E; }

/* Portal Cliente */
.client-bg { justify-content: center; align-items: center; background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%); }
.client-result-card { background: white; padding: 3rem 2.5rem; border-radius: 16px; box-shadow: 0 20px 40px rgba(0,0,0,0.12); width: 100%; text-align: center; }
.stepper { display: flex; justify-content: space-between; margin: 2.5rem 0; position: relative; }
.stepper::before { content: ''; position: absolute; top: 20px; left: 10%; width: 80%; height: 4px; background: #e2e8f0; z-index: 1; border-radius: 2px; }
.step { position: relative; z-index: 2; text-align: center; flex: 1; }
.step-icon { width: 44px; height: 44px; border-radius: 50%; background: #f1f5f9; color: #94a3b8; display: flex; align-items: center; justify-content: center; margin: 0 auto 10px; font-size: 1.2rem; font-weight: bold; border: 4px solid white; }
.step.active .step-icon { background: var(--accent); color: white; }
.step.completed .step-icon { background: var(--st-done); color: white; }
.step-label { font-size: 0.9rem; font-weight: 700; color: var(--text-muted); }
.step.active .step-label, .step.completed .step-label { color: var(--primary); }

.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; text-align: center; }
.calendar-day { padding: 8px 0; border-radius: 6px; font-size: 0.8rem; font-weight: 600; background: #f8fafc; border: 1px solid #e2e8f0; }
.day-active { background: #ecfdf5; border-color: #10b981; color: #065f46; }

/* =========================================
   IMPRESIÓN TÉRMICA OPTIMIZADA (58mm / 80mm)
   ========================================= */
#print-area { display: none; }
@media print {
    @page { margin: 0; size: auto; }
    #view-login, #view-admin, #view-client-search, #view-client-res, .modal, .view-section { display: none !important; }
    body, html { display: block !important; background: white !important; margin: 0 !important; padding: 0 !important; height: auto !important; }
    #print-area { display: block !important; position: absolute !important; top: 0 !important; left: 0 !important; width: 58mm !important; margin: 0 !important; padding: 0 !important; color: black !important; background: white !important; visibility: visible !important; z-index: 9999 !important; }
    .print-card { width: 58mm !important; margin: 0 auto; padding: 5px 6px; font-family: 'Courier New', Courier, monospace; color: black !important; }
    .print-header { text-align: center; margin-bottom: 8px; border-bottom: 1px dashed #000; padding-bottom: 6px; }
    .print-info { font-size: 10px; line-height: 1.35; margin-bottom: 6px; }
}

/* Responsividad Móvil */
.mobile-menu-btn { display: none; }
@media (max-width: 900px) {
    .board { grid-template-columns: 1fr; }
    .sidebar { width: 100%; height: auto; position: sticky; top: 0; }
    .sidebar-menu { display: none; }
    .sidebar-menu.show-menu { display: flex; flex-direction: column; }
    .mobile-menu-btn { display: block; background: none; border: none; font-size: 1.4rem; color: white; }
    .dashboard-layout { flex-direction: column !important; }
    .ticket-view-body { grid-template-columns: 1fr; }
}