    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }

    body {
      font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
      background: #E8F4F8;
      height: 100vh;
      overflow: hidden;
    }

    .app-container {
      display: flex;
      height: 100vh;
    }

    /* ── SIDEBAR ── */
    .sidebar {
      width: 250px;
      background: #ebecec;
      color: white;
      flex-shrink: 0;
      overflow-y: auto;
      box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    }

    .sidebar-header {
      padding: 20px;
      background: #e4280f;
      border-bottom: 1px solid rgba(255,255,255,0.1);
      text-align: center;
    }

    .sidebar-logo {
      max-width: 120px;
      max-height: 60px;
      margin-bottom: 10px;
    }

    .sidebar-header h1 {
      font-size: 1.2rem;
      font-weight: 600;
      text-align: center;
    }

    .nav-menu {
      list-style: none;
      padding: 20px 0;
    }

    .nav-item {
      margin: 5px 15px;
    }

    .nav-link {
      display: flex;
      align-items: center;
      padding: 12px 15px;
      color: rgba(231,237,238,0.959);
      text-decoration: none;
      border-radius: 8px;
      transition: all 0.3s ease;
      cursor: pointer;
      font-size: 0.9rem;
      background: #5DADE2;
      font-weight: 600;
    }

    .nav-link:hover {
      background: rgba(230,8,8,0.918);
      color: white;
      transform: translateX(5px);
    }

    .nav-link.active {
      background: rgba(230,8,8,0.918);
      color: white;
      transform: translateX(5px);
    }

    .nav-icon {
      margin-right: 10px;
      font-size: 1.1rem;
      width: 20px;
      text-align: center;
    }

    /* ── MAIN CONTENT ── */
    .main-content {
      flex: 1;
      overflow-y: auto;
      background: #FAFBFC;
    }

    .content-header {
      background: white;
      padding: 20px 30px;
      border-bottom: 1px solid #e9ecef;
      box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    }

    .content-header h2 {
      color: #2E86AB;
      font-size: 1.5rem;
      font-weight: 600;
    }

    .content-body {
      padding: 30px;
    }

    /* ── TABS ── */
    .tab-content {
      display: none;
      animation: fadeIn 0.3s ease;
    }

    .tab-content.active {
      display: block;
    }

    @keyframes fadeIn {
      from { opacity: 0; transform: translateY(10px); }
      to   { opacity: 1; transform: translateY(0); }
    }

    /* ── CARDS ── */
    .card {
      background: white;
      border-radius: 12px;
      box-shadow: 0 4px 6px rgba(0,0,0,0.06);
      margin-bottom: 25px;
      overflow: hidden;
      border: 1px solid #E5F2F7;
    }

    .card-header {
      padding: 20px;
      background: #F0F8FC;
      border-bottom: 1px solid #E5F2F7;
      font-weight: 600;
      color: #2E86AB;
    }

    .card-body {
      padding: 25px;
    }

    /* ── FORM ── */
    .form-grid {
      display: grid;
      grid-template-columns: repeat(3,1fr);
      gap: 20px;
      margin-bottom: 20px;
    }

    .form-grid-2 {
      display: grid;
      grid-template-columns: repeat(2,1fr);
      gap: 20px;
      margin-bottom: 20px;
    }

    .form-group {
      display: flex;
      flex-direction: column;
      position: relative;
    }

    .form-group label {
      margin-bottom: 8px;
      font-weight: 600;
      color: #2E86AB;
      font-size: 0.9rem;
    }

    input, select, textarea {
      padding: 12px;
      border: 2px solid #E5F2F7;
      border-radius: 8px;
      font-size: 0.9rem;
      transition: all 0.3s ease;
      background: white;
    }

    input:focus, select:focus, textarea:focus {
      outline: none;
      border-color: #5DADE2;
      box-shadow: 0 0 0 3px rgba(93,173,226,0.1);
    }

    .textarea-control {
      resize: vertical;
      min-height: 80px;
      max-height: 160px;
    }

    /* ── BUTTONS ── */
    .btn {
      padding: 12px 20px;
      border: none;
      border-radius: 8px;
      font-size: 0.9rem;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.3s ease;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
    }

    .btn:hover {
      transform: translateY(-2px);
      box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    }

    .btn-primary   { background: #5DADE2; color: white; }
    .btn-success   { background: #28a745; color: white; }
    .btn-danger    { background: #dc3545; color: white; }
    .btn-warning   { background: #ffc107; color: #212529; }
    .btn-secondary { background: #6c757d; color: white; }
    .btn-info      { background: #17a2b8; color: white; }

    .actions {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
      margin-bottom: 20px;
    }

    /* ── MESSAGES ── */
    .message {
      padding: 12px 15px;
      border-radius: 8px;
      margin: 15px 0;
      font-weight: 500;
    }

    .message.success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
    .message.error   { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
    .message.warning { background: #fff3cd; color: #856404; border: 1px solid #ffeaa7; }
    .message.info    { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }

    /* ── TABLES ── */
    .table-container {
      overflow-x: auto;
      border-radius: 8px;
      box-shadow: 0 2px 8px rgba(0,0,0,0.08);
      border: 1px solid #E5F2F7;
    }

    table {
      width: 100%;
      border-collapse: collapse;
      background: white;
    }

    th, td {
      padding: 12px 15px;
      text-align: left;
      border-bottom: 1px solid #E5F2F7;
    }

    th {
      background: #F0F8FC;
      font-weight: 600;
      color: #2E86AB;
      font-size: 0.9rem;
    }

    tr:hover { background: #F8FBFD; }

    /* ── STATS ── */
    .stats-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
      gap: 20px;
      margin-bottom: 30px;
    }

    .stat-card {
      background: white;
      padding: 25px;
      border-radius: 12px;
      text-align: center;
      box-shadow: 0 4px 6px rgba(0,0,0,0.06);
      border: 1px solid #E5F2F7;
    }

    .stat-value {
      font-size: 2rem;
      font-weight: 700;
      color: #2E86AB;
      margin-bottom: 5px;
    }

    .stat-label {
      color: #6c757d;
      font-size: 0.9rem;
      font-weight: 500;
    }

    /* ── LOADING ── */
    .loading {
      display: none;
      text-align: center;
      padding: 20px;
      color: #5DADE2;
      font-style: italic;
    }

    /* ── ESTADO BADGES ── */
    .badge {
      display: inline-block;
      padding: 4px 10px;
      border-radius: 20px;
      font-size: 0.8rem;
      font-weight: 600;
      white-space: nowrap;
    }

    .badge-pendiente  { background: #fff3cd; color: #856404; }
    .badge-gestion    { background: #cce5ff; color: #004085; }
    .badge-realizado  { background: #d4edda; color: #155724; }
    .badge-cerrado    { background: #e2e3e5; color: #383d41; }
    .badge-rechazado  { background: #f8d7da; color: #721c24; }

    /* ── AUTOCOMPLETE ── */
    .ac-wrap {
      position: relative;
    }
    .ac-input {
      width: 100%;
      padding: 10px 14px;
      border: 1px solid #ced4da;
      border-radius: 8px;
      font-size: 0.9rem;
      color: #495057;
      background: white;
      transition: border-color 0.2s, box-shadow 0.2s;
      outline: none;
    }
    .ac-input:focus {
      border-color: #5DADE2;
      box-shadow: 0 0 0 3px rgba(93,173,226,0.15);
    }
    .ac-input:disabled {
      background: #f8f9fa;
      cursor: not-allowed;
      color: #adb5bd;
    }
    .ac-input.ac-valid {
      border-color: #28a745;
      background: #f8fff9;
    }
    .ac-list {
      display: none;
      position: absolute;
      top: 100%;
      left: 0;
      right: 0;
      background: white;
      border: 1px solid #ced4da;
      border-top: none;
      border-radius: 0 0 8px 8px;
      max-height: 220px;
      overflow-y: auto;
      z-index: 9999;
      list-style: none;
      box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    }
    .ac-list.open {
      display: block;
    }
    .ac-list li {
      padding: 9px 14px;
      cursor: pointer;
      font-size: 0.88rem;
      color: #495057;
      border-bottom: 1px solid #f0f0f0;
      transition: background 0.15s;
    }
    .ac-list li:last-child { border-bottom: none; }
    .ac-list li:hover,
    .ac-list li.ac-highlighted {
      background: #EBF5FB;
      color: #2E86AB;
    }
    .ac-list li.ac-no-results {
      color: #adb5bd;
      cursor: default;
      font-style: italic;
    }

    /* ── SECCIÓN CONDICIONAL DEL FORMULARIO ── */
    .seccion-condicional {
      display: none;
      border-top: 2px dashed #E5F2F7;
      padding-top: 20px;
      margin-top: 10px;
    }

    .seccion-condicional.visible {
      display: block;
      animation: fadeIn 0.3s ease;
    }

    .seccion-label {
      font-size: 0.75rem;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      color: #6c757d;
      font-weight: 700;
      margin-bottom: 15px;
    }

    /* ── MODAL TICKET CONFIRMACIÓN ── */
    .modal {
      display: none;
      position: fixed;
      z-index: 10000;
      left: 0; top: 0;
      width: 100%; height: 100%;
      background-color: rgba(0,0,0,0.55);
      justify-content: center;
      align-items: center;
      animation: fadeIn 0.3s ease;
    }

    .modal.show { display: flex; }

    .modal-ticket {
      background: white;
      border-radius: 16px;
      width: 480px;
      max-width: 95%;
      overflow: hidden;
      box-shadow: 0 20px 60px rgba(0,0,0,0.3);
      animation: slideDown 0.3s ease;
    }

    .modal-ticket-header {
      background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
      color: white;
      padding: 30px;
      text-align: center;
    }

    .modal-ticket-header .ticket-icon {
      font-size: 3rem;
      margin-bottom: 10px;
    }

    .modal-ticket-header h2 {
      margin: 0;
      font-size: 1.4rem;
    }

    .ticket-numero {
      background: rgba(255,255,255,0.2);
      border-radius: 12px;
      padding: 12px 24px;
      margin-top: 15px;
      display: inline-block;
      font-size: 1.6rem;
      font-weight: 700;
      letter-spacing: 1px;
    }

    .modal-ticket-body {
      padding: 25px 30px;
    }

    .ticket-detail-row {
      display: flex;
      justify-content: space-between;
      padding: 8px 0;
      border-bottom: 1px solid #f0f0f0;
      font-size: 0.9rem;
    }

    .ticket-detail-row:last-child { border-bottom: none; }

    .ticket-detail-label { color: #6c757d; font-weight: 500; }
    .ticket-detail-value { color: #212529; font-weight: 600; text-align: right; max-width: 60%; }

    .modal-ticket-actions {
      padding: 15px 30px 25px;
      display: flex;
      justify-content: center;
      gap: 12px;
    }

    @keyframes slideDown {
      from { transform: translateY(-30px); opacity: 0; }
      to   { transform: translateY(0);     opacity: 1; }
    }

    /* ── PESTAÑA GESTIÓN: LOGIN ── */
    .login-box {
      max-width: 380px;
      margin: 40px auto;
      background: white;
      border-radius: 16px;
      box-shadow: 0 8px 30px rgba(0,0,0,0.12);
      overflow: hidden;
    }

    .login-box-header {
      background: linear-gradient(135deg, #e4280f 0%, #c91c0a 100%);
      color: white;
      padding: 30px;
      text-align: center;
    }

    .login-box-header .login-icon { font-size: 2.5rem; margin-bottom: 8px; }
    .login-box-header h3 { margin: 0; font-size: 1.2rem; }
    .login-box-header p  { margin: 5px 0 0; font-size: 0.85rem; opacity: 0.85; }

    .login-box-body { padding: 30px; }

    .login-box-body .form-group label { color: #2E86AB; }

    .login-error {
      background: #f8d7da;
      color: #721c24;
      border: 1px solid #f5c6cb;
      border-radius: 8px;
      padding: 10px 14px;
      font-size: 0.88rem;
      margin-bottom: 15px;
      display: none;
    }

    /* ── PESTAÑA GESTIÓN: PANEL PRINCIPAL ── */
    .gestion-header {
      background: white;
      border-bottom: 1px solid #e9ecef;
      padding: 14px 20px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      position: sticky;
      top: 0;
      z-index: 100;
      box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    }

    .gestion-header .usuario-info {
      display: flex;
      align-items: center;
      gap: 10px;
      font-weight: 600;
      color: #2E86AB;
      font-size: 0.95rem;
    }

    .gestion-header .usuario-avatar {
      width: 36px;
      height: 36px;
      background: #5DADE2;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      color: white;
      font-size: 1.1rem;
    }

    /* ── MINI DASHBOARD GESTIÓN ── */
    .mini-stats {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 12px;
      padding: 16px;
    }

    .mini-stat {
      background: white;
      border-radius: 12px;
      padding: 16px;
      text-align: center;
      box-shadow: 0 2px 8px rgba(0,0,0,0.07);
      border: 1px solid #E5F2F7;
    }

    .mini-stat .m-val  { font-size: 1.8rem; font-weight: 700; }
    .mini-stat .m-lbl  { font-size: 0.8rem; color: #6c757d; margin-top: 3px; }

    .m-val.pendiente  { color: #856404; }
    .m-val.gestion    { color: #004085; }
    .m-val.realizado  { color: #155724; }
    .m-val.cerrado    { color: #383d41; }

    /* ── TICKET CARDS (mobile) ── */
    .tickets-lista { padding: 0 12px 20px; }

    .tkt-card {
      background: white;
      border-radius: 12px;
      box-shadow: 0 2px 8px rgba(0,0,0,0.07);
      border: 1px solid #E5F2F7;
      margin-bottom: 12px;
      overflow: hidden;
      transition: box-shadow 0.2s;
    }

    .tkt-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.12); }

    .tkt-card-top {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 12px 14px 8px;
    }

    .tkt-id {
      font-weight: 700;
      color: #2E86AB;
      font-size: 0.9rem;
    }

    .tkt-card-body {
      padding: 0 14px 10px;
      font-size: 0.85rem;
      color: #495057;
      line-height: 1.6;
    }

    .tkt-card-body .tkt-row { margin-bottom: 2px; }
    .tkt-card-body .tkt-lbl { color: #6c757d; font-weight: 600; }

    .tkt-card-footer {
      padding: 10px 14px;
      border-top: 1px solid #f0f0f0;
      background: #fafbfc;
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
    }

    .tkt-card-footer .btn { font-size: 0.82rem; padding: 8px 14px; }

    .tkt-card.estado-pendiente  { border-left: 4px solid #ffc107; }
    .tkt-card.estado-gestion    { border-left: 4px solid #17a2b8; }
    .tkt-card.estado-realizado  { border-left: 4px solid #28a745; }
    .tkt-card.estado-cerrado    { border-left: 4px solid #6c757d; opacity: 0.8; }
    .tkt-card.estado-rechazado  { border-left: 4px solid #dc3545; opacity: 0.8; }

    .m-val.rechazado { color: #721c24; }

    .filtros-gestion {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      padding: 12px 16px;
      background: #f8f9fa;
      border-bottom: 1px solid #e9ecef;
    }

    .filtros-gestion .btn { font-size: 0.78rem; padding: 6px 12px; }

    .loading-gestion {
      text-align: center;
      padding: 30px;
      color: #5DADE2;
      font-style: italic;
    }

    /* ── ÁREA SELECTOR ── */
    .area-selector-wrap {
      background: #f0f8fc;
      border-radius: 10px;
      padding: 16px 20px;
      margin-bottom: 20px;
      border: 2px solid #bee3f7;
    }

    .area-selector-wrap .seccion-label { margin-bottom: 10px; }

    /* ── FOTO UPLOAD ── */
    input[type="file"] {
      padding: 10px 12px;
      border: 2px dashed #5DADE2;
      border-radius: 8px;
      background: #f8fbfc;
      cursor: pointer;
      font-size: 0.88rem;
    }

    input[type="file"]:hover { border-color: #2E86AB; }

    .foto-preview-wrap {
      display: flex;
      align-items: center;
      gap: 12px;
      margin-top: 10px;
    }

    .foto-preview-wrap img {
      max-width: 180px;
      max-height: 130px;
      border-radius: 8px;
      border: 2px solid #E5F2F7;
      object-fit: cover;
    }

    /* ── GEOLOCALIZACIÓN ── */
    .input-geo-wrap {
      display: flex;
      gap: 8px;
      align-items: stretch;
    }

    .input-geo-wrap input { flex: 1; }

    .btn-geo {
      padding: 12px 14px !important;
      flex-shrink: 0;
      font-size: 1rem !important;
    }

    /* ── SELECT DESHABILITADO ── */
    select:disabled {
      background: #f2f2f2;
      color: #aaa;
      cursor: not-allowed;
      border-color: #e0e0e0;
    }

    /* ── FILTRO DE FECHA ── */
    .fecha-filtro-bar {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
      margin-bottom: 15px;
      padding: 10px 14px;
      background: #f0f8fc;
      border-radius: 8px;
      border: 1px solid #bee3f7;
    }
    .fecha-filtro-label {
      font-size: 0.85rem;
      font-weight: 600;
      color: #2E86AB;
      white-space: nowrap;
    }
    .fecha-filtro-bar input[type="date"] {
      padding: 6px 10px;
      border: 2px solid #bee3f7;
      border-radius: 6px;
      font-size: 0.85rem;
      background: white;
      color: #212529;
      max-width: 150px;
    }

    /* ── RESPONSIVE ── */
    @media (max-width: 768px) {
      .sidebar {
        width: 100%;
        height: auto;
        position: fixed;
        top: 0; left: -100%;
        z-index: 1000;
        transition: left 0.3s ease;
      }
      .sidebar.open { left: 0; }
      .main-content { width: 100%; }
      .form-grid, .form-grid-2 { grid-template-columns: 1fr; }
      .actions { flex-direction: column; }
      .modal-ticket { width: 95%; }
    }
