* { margin:0; padding:0; box-sizing:border-box; }
body { font-family:'Inter',system-ui,sans-serif; background:#f4f7fc; }
.loading-overlay { position:fixed; top:0; left:0; width:100%; height:100%; background:rgba(255,255,255,0.9); display:none; justify-content:center; align-items:center; z-index:9999; }
.loading-overlay.show { display:flex; }
.loader-spinner { background:white; padding:30px 40px; border-radius:16px; box-shadow:0 10px 40px rgba(0,0,0,0.1); text-align:center; }
.toast-container { position:fixed; top:10px; left:50%; transform:translateX(-50%); z-index:9999; width:90%; max-width:350px; }
.toast { font-size:.85rem; border-radius:12px; box-shadow:0 4px 15px rgba(0,0,0,0.2); }
.badge-status { padding:3px 12px; border-radius:40px; font-weight:600; font-size:.65rem; display:inline-block; }
.badge-status.pendiente { background:#ffeed9; color:#b56f1a; }
.badge-status.en-progreso { background:#d9edff; color:#1a6b9e; }
.badge-status.finalizado { background:#d7f0df; color:#1a7a4a; }
.badge-status.asignado { background:#fff3cd; color:#856404; }
.badge-status.pausado { background:#d6d8db; color:#383d41; }
.badge-tecnico { padding:2px 8px; border-radius:40px; font-size:.6rem; font-weight:600; margin:1px; display:inline-block; }
.badge-tecnico.asignado { background:#fff3cd; color:#856404; }
.badge-tecnico.en-progreso { background:#cce5ff; color:#004085; }
.badge-tecnico.pausado { background:#d6d8db; color:#383d41; }
.badge-tecnico.finalizado { background:#d4edda; color:#155724; }
.btn-primary-custom { background:#0b1a33; border:none; border-radius:40px; padding:6px 20px; font-weight:600; color:#fff; font-size:.85rem; transition:all .15s; }
.btn-primary-custom:hover { background:#1a3152; color:#fff; }
.btn-edit { background:#ffc107; border:none; border-radius:40px; padding:3px 12px; font-weight:600; color:#000; font-size:.7rem; }
.btn-delete { background:#dc3545; border:none; border-radius:40px; padding:3px 12px; font-weight:600; color:#fff; font-size:.7rem; }
.btn-view { background:#17a2b8; border:none; border-radius:40px; padding:3px 12px; font-weight:600; color:#fff; font-size:.7rem; }
.btn-print { background:#6c757d; border:none; border-radius:40px; padding:3px 12px; font-weight:600; color:#fff; font-size:.7rem; }
.table-custom thead th { background:#f4f8fe; color:#1f3a5f; font-weight:600; font-size:.65rem; text-transform:uppercase; letter-spacing:.3px; padding:8px 10px; border-bottom:2px solid #e2ecf5; }
.table-custom td { padding:8px 10px; vertical-align:middle; border-bottom:1px solid #eef3f9; font-size:.85rem; color:#1d334a; }
.table-custom tbody tr:hover { background:#f8fbfe; }
.form-control, .form-select { border-radius:8px; border:1px solid #dde6ef; padding:6px 12px; font-size:.85rem; background:#fafcfe; }
.form-control:focus, .form-select:focus { border-color:#6fc2f0; box-shadow:0 0 0 3px rgba(111,194,240,0.15); outline:none; }
.search-global { position:relative; }
.search-global .search-icon { position:absolute; left:12px; top:50%; transform:translateY(-50%); color:#6b7f94; }
.search-global input { padding-left:35px; border-radius:40px; border:1px solid #dde6ef; padding:8px 16px 8px 35px; font-size:.85rem; width:100%; background:#fafcfe; }
.ui-autocomplete { max-height:200px; overflow-y:auto; border-radius:10px !important; border:1px solid #dde6ef !important; box-shadow:0 8px 30px rgba(0,0,0,0.1) !important; background:white !important; padding:5px 0 !important; z-index:9999 !important; }
.ui-autocomplete .ui-menu-item { padding:8px 16px !important; font-size:.85rem !important; border-bottom:1px solid #f0f4f8 !important; cursor:pointer !important; }
.ui-autocomplete .ui-menu-item.ui-state-focus { background:#eef3f9 !important; border:none !important; margin:0 !important; }
.sidebar { width:240px; background:linear-gradient(180deg,#0b1a33,#122b4a); color:#e6edf5; height:100vh; position:fixed; padding:20px 16px; overflow-y:auto; z-index:1000; }
.sidebar-brand { display:flex; align-items:center; gap:10px; font-weight:700; font-size:1.2rem; padding-bottom:20px; border-bottom:1px solid rgba(255,255,255,0.06); margin-bottom:20px; }
.sidebar-brand i { font-size:1.8rem; color:#6fc2f0; }
.sidebar-brand small { font-weight:400; font-size:.65rem; opacity:.6; display:block; }
.sidebar-nav { list-style:none; padding:0; }
.sidebar-nav li { margin-bottom:4px; }
.sidebar-nav a { display:flex; align-items:center; gap:12px; padding:8px 14px; border-radius:8px; color:#b6cbe0; text-decoration:none; font-weight:500; font-size:.85rem; transition:all .15s; cursor:pointer; }
.sidebar-nav a:hover { background:rgba(255,255,255,0.06); color:#fff; }
.sidebar-nav a.active { background:rgba(111,194,240,0.18); color:#fff; }
.sidebar-nav a i { font-size:1.1rem; width:20px; text-align:center; }
.sidebar-nav .badge-dot { margin-left:auto; background:#ef6b6b; color:#fff; font-size:.55rem; padding:2px 8px; border-radius:30px; }
.sidebar-footer { border-top:1px solid rgba(255,255,255,0.06); padding-top:16px; margin-top:auto; font-size:.75rem; opacity:.6; }
.main-content { margin-left:240px; padding:20px 24px; min-height:100vh; }
.topbar { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:12px; margin-bottom:20px; }
.topbar-left h4 { font-weight:700; color:#0b1a33; font-size:1.3rem; }
.topbar-left p { color:#6b7f94; font-size:.85rem; }
.stats-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(140px,1fr)); gap:12px; margin-bottom:20px; }
.stat-card { background:#fff; border-radius:12px; padding:14px 16px; border:1px solid #eef3f9; }
.stat-card .stat-label { font-size:.65rem; text-transform:uppercase; color:#7a8fa5; font-weight:600; }
.stat-card .stat-number { font-size:1.5rem; font-weight:700; color:#0b1a33; }
.card-custom { background:#fff; border-radius:12px; border:1px solid #eaf0f6; overflow:hidden; margin-bottom:20px; }
.card-header-custom { padding:12px 16px; background:#fafcfe; border-bottom:1px solid #eaf0f6; display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:8px; }
.card-header-custom h5 { font-weight:700; font-size:.95rem; color:#0b1a33; margin:0; display:flex; align-items:center; gap:8px; }
.card-body-custom { padding:16px; }
.section-content { display:none; }
.section-content.active-section { display:block; }
.modal-content { border-radius:12px; border:none; }
.modal-lg { max-width:900px; }
.sidebar-toggle { display:none; background:#0b1a33; border:none; color:#fff; font-size:1.2rem; padding:4px 12px; border-radius:8px; }
.foto-miniatura { width:80px; height:80px; object-fit:cover; border-radius:8px; border:1px solid #ddd; cursor:pointer; transition:all .2s; }
.foto-miniatura:hover { border-color:#0b1a33; transform:scale(1.05); }
.firma-preview { max-width:300px; border:1px solid #ddd; border-radius:8px; padding:10px; background:white; }
.firma-preview img { max-width:100%; }
.canvas-firma { border:2px dashed #ddd; border-radius:8px; cursor:crosshair; background:white; width:100%; max-width:500px; height:200px; }
.material-item { display:flex; align-items:center; gap:10px; padding:8px 12px; background:#f8f9fa; border-radius:8px; margin-bottom:5px; }
.material-item .nombre { flex:1; font-weight:500; }
.material-item .cantidad { width:80px; }
.material-item .precio { width:100px; text-align:right; }
.material-item .total { width:100px; text-align:right; font-weight:600; }
.material-item .btn-remove { color:#dc3545; cursor:pointer; }
.tab-panel { display:block; }
.tab-panel[style*="display:none"] { display:none !important; }
.list-group-item.active { background-color:#0b1a33; border-color:#0b1a33; color:#fff; }
.list-group-item.active small { color:#ccc; }
.tecnico-modern-wrap { background:#f8fbff; border:1px solid #dde8f3; border-radius:12px; padding:12px 8px; }
.tecnico-panel { background:#fff; border:1px solid #dde8f3; border-radius:10px; padding:10px; }
.tecnico-panel-assigned { background:#fcfdff; }
.tecnico-panel-header { display:flex; align-items:center; justify-content:space-between; font-size:.75rem; text-transform:uppercase; font-weight:700; color:#48637e; margin-bottom:8px; }
.tecnico-panel-list { height:180px; overflow-y:auto; border:1px solid #edf2f7; border-radius:8px; background:#fbfdff; }
.tecnico-action-buttons .btn { min-width:42px; }
.form-control#descM, .form-control#descT, textarea#descM, textarea#descT { min-height:94px; resize:vertical; }
#calendar {
    border: 1px solid #d9e4ef;
    border-radius: 16px;
    padding: 14px;
    background: linear-gradient(180deg, #fbfdff 0%, #f5f9ff 100%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
}
.fc .fc-toolbar {
    border: 1px solid #e0e9f3;
    border-radius: 14px;
    padding: 10px 12px;
    background: linear-gradient(90deg, #f7fbff 0%, #edf5ff 100%);
    margin-bottom: 12px !important;
}
.fc .fc-toolbar-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #183657;
    letter-spacing: .2px;
}
.fc .fc-button {
    background: #12385f !important;
    border-color: #12385f !important;
    color: #fff !important;
    border-radius: 999px !important;
    padding: 6px 14px !important;
    font-size: .78rem !important;
    font-weight: 600 !important;
    box-shadow: 0 2px 8px rgba(18,56,95,0.24);
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.fc .fc-button:hover {
    background: #0f2f4f !important;
    border-color: #0f2f4f !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(18,56,95,0.28);
}
.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active {
    background: #0a263f !important;
    border-color: #0a263f !important;
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.18);
}
.fc .fc-col-header-cell {
    background: #eef5ff;
    border-color: #dbe6f2 !important;
}
.fc .fc-col-header-cell-cushion {
    color: #2d4d6f;
    font-weight: 700;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .35px;
    padding: 9px 4px;
}
.fc .fc-daygrid-day {
    background: #ffffff;
}
.fc .fc-day-other {
    background: #f7fafe;
}
.fc .fc-daygrid-day-number {
    font-size: .82rem;
    color: #23466d;
    font-weight: 600;
    padding: 6px 8px;
}
.fc .fc-day-today {
    background: linear-gradient(180deg, #fff7e7 0%, #fff2d9 100%) !important;
}
.fc .fc-daygrid-day.fc-day-sat,
.fc .fc-daygrid-day.fc-day-sun {
    background: #f9fcff;
}
.fc .fc-daygrid-event-harness {
    margin-top: 2px;
}
.fc .fc-event {
    cursor: pointer;
    border-radius: 10px !important;
    padding: 3px 7px !important;
    font-size: .72rem !important;
    border: 1px solid rgba(255,255,255,0.28) !important;
    box-shadow: 0 2px 8px rgba(15,36,62,0.18);
    transition: transform .12s ease, box-shadow .12s ease;
}
.fc .fc-event:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15,36,62,0.24);
}
.fc .fc-event .fc-event-title {
    font-weight: 600;
    line-height: 1.2;
}
.fc .fc-event .evento-cal-wrap {
    display: grid;
    gap: 1px;
}
.fc .fc-event .evento-cal-line {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.fc .fc-event .evento-cal-hora {
    font-size: .68rem;
    font-weight: 700;
    opacity: .95;
}
.fc .fc-event .evento-cal-tecnico {
    font-size: .67rem;
    font-weight: 600;
    opacity: .92;
}
.fc .fc-event .evento-cal-tipo {
    font-size: .67rem;
    font-weight: 700;
    opacity: .98;
}
.fc .fc-event .evento-cal-trabajo {
    font-size: .66rem;
    opacity: .92;
}
.fc .fc-timegrid-slot,
.fc .fc-timegrid-axis,
.fc .fc-daygrid-day,
.fc .fc-scrollgrid,
.fc .fc-scrollgrid td,
.fc .fc-scrollgrid th {
    border-color: #dfe8f2 !important;
}
.fc .fc-list-day-cushion {
    background: #ecf4ff !important;
}
.fc .fc-list-event:hover td {
    background: #f1f7ff !important;
}
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    float:none;
    display:block;
    margin:0 0 16px 0;
}
.dataTables_wrapper .dataTables_length {
    margin-bottom:28px !important;
    padding-bottom:8px;
}
.dataTables_wrapper div.dataTables_length {
    margin-bottom:22px !important;
    padding-bottom:4px !important;
}
.dataTables_wrapper div.dataTables_filter {
    margin-bottom:20px !important;
}
.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label {
    display:inline-flex;
    align-items:center;
    gap:8px;
    font-size:.8rem;
    color:#48637e;
}
.dataTables_wrapper .dataTables_length select {
    min-width:72px;
    height:30px;
    border-radius:8px;
    border:1px solid #dde6ef;
    background:#fff;
}
.dataTables_wrapper .dataTables_info {
    padding-top:18px;
    font-size:.8rem;
    color:#6b7f94;
}
.dataTables_wrapper .dataTables_paginate {
    padding-top:16px;
}
.dataTables_wrapper table.dataTable {
    margin-top:16px !important;
}
.dataTables_wrapper div.dataTables_length + table.dataTable,
.dataTables_wrapper div.dataTables_filter + table.dataTable {
    margin-top:12px !important;
}
.card-trabajo { background:#fff; border-radius:12px; border:none; box-shadow:0 2px 10px rgba(0,0,0,0.06); margin-bottom:12px; overflow:hidden; padding:15px; transition:all 0.2s; }
.card-trabajo:hover { box-shadow:0 4px 20px rgba(0,0,0,0.10); }
.card-trabajo.finalizado { opacity:0.7; background:#f8f9fa; }
.card-trabajo .campo { display:flex; margin-bottom:4px; font-size:.85rem; }
.card-trabajo .campo .label { font-weight:600; min-width:100px; color:#1d334a; }
.card-trabajo .campo .valor { color:#2d4059; word-break:break-word; }
.card-trabajo .campo .valor.sin-datos { color:#6b7f94; font-style:italic; }
.card-trabajo .tiempo-activo { animation: pulse 2s infinite; }
@keyframes pulse { 0% { opacity:1; } 50% { opacity:0.5; } 100% { opacity:1; } }
@media (max-width:768px) {
    .sidebar{ transform:translateX(-100%); width:240px; position:fixed; }
    .sidebar.open{ transform:translateX(0); }
    .main-content{ margin-left:0; padding:12px; }
    .sidebar-toggle{ display:inline-flex; }
    .stats-grid{ grid-template-columns:repeat(2,1fr); }
    .row .col-md-2 { flex-direction:row !important; gap:8px; }
    .tecnico-panel-list { height:140px; }
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        text-align:left;
    }
}