/* admin-enhancements.css — Apex Mobile & Computer Repairs
   Admin dashboard: missing styles, polish, mobile responsive
   Load AFTER style.css */

/* ===========================================================
   MISSING STATUS PILL COLORS
   style.css only defines received, diagnosed, repairing, ready
   =========================================================== */

   .status-pill.waiting_parts {
    background: #FEF3C7;
    color: #92400E;
  }
  
  .status-pill.delivered {
    background: #E0E7FF;
    color: #3730A3;
  }
  
  /* ===========================================================
     MISSING: delete-btn, login card, field-label, wizard-actions
     =========================================================== */
  
  .delete-btn {
    background: var(--paper);
    border: 1px solid var(--line);
    color: var(--red);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
  }
  
  .delete-btn:hover {
    background: #FEE2E2;
    border-color: var(--red);
  }
  
  /* Login card polish */
  #wizard-card-login,
  #loginBox {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 32px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  }
  
  #loginBox h2 {
    font-family: var(--display);
    font-size: 1.4rem;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
  }
  
  #loginBox input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 16px;
    margin-bottom: 12px;
    transition: border-color 0.15s;
  }
  
  #loginBox input:focus {
    outline: none;
    border-color: var(--ink);
  }
  
  #loginBox .wizard-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 16px;
  }
  
  /* ===========================================================
     ADMIN TABLE — better structure
     =========================================================== */
  
  .admin-table {
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
  }
  
  .admin-table thead {
    background: var(--paper-dim);
  }
  
  .admin-table th {
    white-space: nowrap;
  }
  
  .admin-table tbody tr.expandable-row {
    transition: background 0.1s;
  }
  
  .admin-table tbody tr.expandable-row:hover {
    background: var(--paper-dim);
  }
  
  /* Status select in table */
  .statusSelect {
    border: 1px solid var(--line);
    border-radius: 6px;
    font-size: 0.75rem;
    padding: 5px 8px;
    background: #fff;
    cursor: pointer;
    font-family: var(--mono);
    transition: border-color 0.15s;
  }
  
  .statusSelect:hover {
    border-color: var(--ink);
  }
  
  .statusSelect:focus {
    outline: none;
    border-color: var(--amber-dark);
  }
  
  /* Quick action buttons — bigger touch targets */
  .quick-btn {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  
  /* Expandable detail content */
  .expandable-content {
    padding: 20px;
    background: var(--paper-dim);
  }
  
  .expandable-content .detail-row {
    padding: 8px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  }
  
  .expandable-content .detail-row:last-child {
    border-bottom: none;
  }
  
  .expandable-content .detail-row strong {
    text-align: right;
    max-width: 60%;
  }
  
  /* Contact links in detail view */
  .detail-contact-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    margin-top: 6px;
  }
  
  .detail-contact-link.call {
    background: var(--paper);
    border: 1px solid var(--line);
    color: var(--ink);
  }
  
  .detail-contact-link.whatsapp {
    background: #E4F3EA;
    color: var(--green);
  }
  
  .detail-contact-link.email {
    background: #E3EAF6;
    color: #2E5AA8;
  }
  
  /* ===========================================================
     ADMIN PANEL — data management tabs
     =========================================================== */
  
  .admin-panel {
    border-radius: 14px;
  }
  
  .admin-tab-buttons {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  
  .admin-tab-buttons::-webkit-scrollbar {
    display: none;
  }
  
  .admin-tab-btn {
    white-space: nowrap;
    flex-shrink: 0;
  }
  
  /* Data form inputs */
  .data-form input,
  .data-form select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 16px;
    font-family: var(--body);
    transition: border-color 0.15s;
  }
  
  .data-form input:focus,
  .data-form select:focus {
    outline: none;
    border-color: var(--ink);
  }
  
  .data-form input::placeholder {
    color: var(--slate-light);
  }
  
  .form-row > input,
  .form-row > select {
    flex: 1;
    min-width: 0;
  }
  
  /* Price row in data management */
  .price-row {
    align-items: center;
  }
  
  .price-row input {
    border: 1px solid var(--line);
    border-radius: 6px;
  }
  
  .price-row input:focus {
    outline: none;
    border-color: var(--ink);
  }
  
  /* Device tags */
  .device-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--paper-dim);
    border: 1px solid var(--line);
    color: var(--ink);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 500;
  }
  
  /* ===========================================================
     EMPTY STATES
     =========================================================== */
  
  .admin-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--slate-light);
  }
  
  .admin-empty-state svg {
    margin: 0 auto 12px;
    opacity: 0.4;
  }
  
  .admin-empty-state p {
    font-size: 0.9rem;
  }
  
  /* ===========================================================
     SECTION HEAD — admin section titles
     =========================================================== */
  
  .section-head {
    margin-bottom: 20px;
  }
  
  .section-head .eyebrow {
    font-family: var(--mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--slate-light);
  }
  
  .section-head h2 {
    font-family: var(--display);
    font-size: 1.3rem;
    margin-top: 4px;
  }
  
  /* ===========================================================
     MOBILE — â‰¤ 800px (tablet)
     =========================================================== */
  
  @media (max-width: 800px) {
    /* Stat cards: 2x2 grid */
    .stat-cards-row {
      grid-template-columns: repeat(2, 1fr);
      gap: 12px;
    }
  
    .stat-card {
      padding: 16px;
      gap: 12px;
    }
  
    .stat-card .stat-icon {
      width: 40px;
      height: 40px;
      border-radius: 8px;
    }
  
    .stat-card .stat-value {
      font-size: 1.25rem;
    }
  
    .stat-card .stat-label {
      font-size: 0.7rem;
    }
  }
  
  /* ===========================================================
     MOBILE — â‰¤ 640px (phones)
     =========================================================== */
  
  @media (max-width: 640px) {
    /* Login box */
    #loginBox {
      padding: 24px 20px;
      margin: 24px auto !important;
    }
  
    #loginBox h2 {
      font-size: 1.2rem;
    }
  
    /* Dashboard container */
    .container {
      padding-left: max(16px, env(safe-area-inset-left));
      padding-right: max(16px, env(safe-area-inset-right));
    }
  
    /* Stat cards: 2 columns, compact */
    .stat-cards-row {
      grid-template-columns: repeat(2, 1fr);
      gap: 10px;
      margin-bottom: 24px;
    }
  
    .stat-card {
      padding: 14px;
      gap: 10px;
      border-radius: 10px;
    }
  
    .stat-card .stat-icon {
      width: 36px;
      height: 36px;
      border-radius: 8px;
    }
  
    .stat-card .stat-icon .icon {
      width: 16px !important;
      height: 16px !important;
    }
  
    .stat-card .stat-value {
      font-size: 1.1rem;
      line-height: 1;
    }
  
    .stat-card .stat-label {
      font-size: 0.65rem;
    }
  
    /* Admin panel */
    .admin-panel {
      padding: 16px;
      border-radius: 10px;
    }
  
    .admin-panel-title {
      flex-direction: column;
      align-items: flex-start;
      gap: 4px;
      margin-bottom: 16px;
      padding-bottom: 10px;
    }
  
    .admin-panel-title h3 {
      font-size: 1.1rem;
    }
  
    /* Tab buttons: horizontal scroll */
    .admin-tab-buttons {
      display: flex;
      gap: 6px;
      margin-bottom: 16px;
      padding-bottom: 2px;
    }
  
    .admin-tab-btn {
      padding: 8px 12px;
      font-size: 0.82rem;
    }
  
    /* Data forms: stack everything */
    .data-form {
      gap: 12px;
    }
  
    .data-form input,
    .data-form select {
      font-size: 16px;
      padding: 12px 14px;
    }
  
    .form-row {
      flex-direction: column;
      gap: 12px;
    }
  
    .form-row > input,
    .form-row > select {
      width: 100%;
    }
  
    /* Price rows: single column on mobile */
    .price-row {
      grid-template-columns: 1fr !important;
      gap: 8px;
      padding: 14px;
      border: 1px solid var(--line);
      border-radius: 8px;
      margin-bottom: 8px;
    }
  
    .price-row input {
      width: 100%;
    }
  
    .delete-btn {
      width: 100%;
      text-align: center;
      padding: 8px;
    }
  
    /* Admin toolbar: stack */
    .admin-toolbar {
      flex-direction: column;
      gap: 10px;
    }
  
    .admin-search {
      width: 100%;
      min-width: 0;
      font-size: 16px;
      padding: 12px 14px;
    }
  
    .admin-toolbar .sort-select,
    .admin-toolbar #statusFilter {
      width: 100%;
      font-size: 16px;
      padding: 12px 14px;
    }
  
    .export-btn {
      width: 100%;
      justify-content: center;
      padding: 12px;
    }
  
    /* Admin table: horizontal scroll wrapper */
    .admin-table-wrapper {
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
      border: 1px solid var(--line);
      border-radius: 10px;
      scrollbar-width: none;
    }
  
    .admin-table-wrapper::-webkit-scrollbar {
      display: none;
    }
  
    .admin-table {
      min-width: 600px;
      font-size: 0.82rem;
    }
  
    .admin-table th,
    .admin-table td {
      padding: 10px 12px;
    }
  
    /* Quick action buttons: bigger */
    .quick-btn {
      min-height: 36px;
      padding: 6px 12px;
      font-size: 0.75rem;
    }
  
    .statusSelect {
      min-height: 36px;
      font-size: 0.75rem;
      padding: 6px 10px;
    }
  
    /* Expandable content */
    .expandable-content {
      padding: 14px;
    }
  
    .expandable-content .detail-row {
      flex-direction: column;
      gap: 2px;
      padding: 6px 0;
    }
  
    .expandable-content .detail-row span {
      font-size: 0.72rem;
    }
  
    .expandable-content .detail-row strong {
      text-align: left;
      max-width: 100%;
      font-size: 0.85rem;
    }
  
    /* Section heads */
    .section-head h2 {
      font-size: 1.1rem;
    }
  
    /* Device tags */
    .device-tag {
      font-size: 0.76rem;
      padding: 5px 10px;
    }
  
    /* Toast */
    .toast-container {
      left: 12px !important;
      right: 12px !important;
      bottom: 16px !important;
      transform: none !important;
      align-items: stretch !important;
    }
  
    .toast {
      font-size: 0.82rem;
      padding: 14px 18px;
      width: 100%;
      border-radius: 10px;
      text-align: center;
    }
  }
  
  /* ===========================================================
     TINY PHONES — â‰¤ 380px
     =========================================================== */
  
  @media (max-width: 380px) {
    .stat-cards-row {
      grid-template-columns: 1fr;
    }
  
    .stat-card {
      padding: 12px;
    }
  
    .stat-card .stat-icon {
      width: 32px;
      height: 32px;
    }
  
    .stat-card .stat-value {
      font-size: 1rem;
    }
  
    .admin-table {
      min-width: 500px;
    }
  
    #loginBox {
      padding: 20px 16px;
    }
  }
  
  /* ===========================================================
     REDUCED MOTION
     =========================================================== */
  
  @media (prefers-reduced-motion: reduce) {
    * {
      transition: none !important;
    }
  }
  

