@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --primary: #2fe012;
  --primary-hover: #26c00d;
  --primary-light: #eaffe5;
  --primary-glow: rgba(47, 224, 18, 0.25);
  
  --bg-app: #f4f7f4;
  --bg-card: #ffffff;
  --bg-sidebar: #08150D;
  --bg-sidebar-hover: rgba(123, 230, 59, 0.12);
  --sidebar-border: rgba(255, 255, 255, 0.08);
  --sidebar-text-primary: #D7E2DA;
  --sidebar-text-muted: #93A29A;
  --sidebar-active-bg: #7BE63B;
  --sidebar-active-text: #08110A;
  --sidebar-active-glow: rgba(123, 230, 59, 0.28);
  
  --text-main: #101c12;
  --text-muted: #5c7060;
  --text-sub: #869988;
  --text-white: #ffffff;
  
  --border-light: #e2ede3;
  --border-dark: rgba(255, 255, 255, 0.08);
  
  --shadow-sm: 0 2px 8px rgba(16, 28, 18, 0.04);
  --shadow-md: 0 8px 24px rgba(16, 28, 18, 0.08);
  --shadow-lg: 0 16px 40px rgba(16, 28, 18, 0.12);
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  
  --font-main: 'Nunito', sans-serif;
  --font-body: 'Inter', sans-serif;
  
  /* Status Colors */
  --status-new-bg: #e0f2fe;
  --status-new-text: #0369a1;
  --status-new-border: #bae6fd;
  
  --status-confirmed-bg: #e0e7ff;
  --status-confirmed-text: #4338ca;
  --status-confirmed-border: #c7d2fe;
  
  --status-assigned-bg: #f3e8ff;
  --status-assigned-text: #7e22ce;
  --status-assigned-border: #e9d5ff;
  
  --status-ontheway-bg: #fef3c7;
  --status-ontheway-text: #b45309;
  --status-ontheway-border: #fde68a;
  
  --status-inrepair-bg: #ffedd5;
  --status-inrepair-text: #c2410c;
  --status-inrepair-border: #fed7aa;
  
  --status-completed-bg: #dcfce7;
  --status-completed-text: #15803d;
  --status-completed-border: #bbf7d0;
  
  --status-cancelled-bg: #fee2e2;
  --status-cancelled-text: #b91c1c;
  --status-cancelled-border: #fecaca;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-app);
  color: var(--text-main);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   AUTH SCREEN (LOGIN)
   ========================================================================== */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  background: radial-gradient(circle at 10% 20%, #152418 0%, #0a110b 90%);
}

.auth-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 2.8rem 2.4rem;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--primary), #86efac);
}

.auth-brand {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-brand img {
  height: 48px;
  margin: 0 auto 1rem;
  display: block;
}

.auth-brand h1 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-main);
}

.auth-brand p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 0.25rem;
}

.form-group {
  margin-bottom: 1.3rem;
}

.form-group label {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.45rem;
}

.input-shell {
  position: relative;
  display: flex;
  align-items: center;
}

.input-shell i {
  position: absolute;
  left: 1rem;
  color: var(--text-sub);
  font-size: 1rem;
}

.input-shell input,
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.85rem 1rem 0.85rem 2.8rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: #fbfdfb;
  color: var(--text-main);
  transition: all 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  background: #ffffff;
}

.btn-submit {
  width: 100%;
  padding: 0.95rem 1.5rem;
  background: var(--text-main);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-main);
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  transition: all 0.2s ease;
  margin-top: 1rem;
}

.btn-submit:hover {
  background: #1e3321;
  transform: translateY(-1px);
}

.auth-alert {
  display: none;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-bottom: 1.2rem;
  background: var(--status-cancelled-bg);
  color: var(--status-cancelled-text);
  border: 1px solid var(--status-cancelled-border);
  line-height: 1.45;
}

.auth-alert.visible,
.auth-alert.error {
  display: flex;
}

.auth-alert:empty {
  display: none !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
}

.auth-footer-note {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-sub);
  margin-top: 1.8rem;
}

/* ==========================================================================
   ADMIN APP LAYOUT (SIDEBAR + MAIN CONTENT)
   ========================================================================== */
.app-container {
  display: none;
  min-height: 100vh;
  background: var(--bg-app);
}

.app-container.active {
  display: flex;
}

/* SIDEBAR */
.sidebar {
  width: 260px;
  background: var(--bg-sidebar);
  color: var(--sidebar-text-primary);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 50;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-right: 1px solid var(--sidebar-border);
}

.sidebar-header {
  padding: 1.6rem 1.4rem;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-logo {
  height: 36px;
  width: auto;
}

.sidebar-badge {
  font-size: 0.72rem;
  font-weight: 800;
  background: rgba(123, 230, 59, 0.15);
  color: #7BE63B;
  border: 1px solid rgba(123, 230, 59, 0.3);
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sidebar-nav {
  padding: 1.5rem 0.9rem;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.sidebar-nav button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.85rem 1.1rem;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text-primary);
  font-family: var(--font-main);
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: left;
}

.sidebar-nav button i {
  font-size: 1.15rem;
  width: 22px;
  text-align: center;
  color: var(--sidebar-text-muted);
  transition: color 0.2s ease;
}

.sidebar-nav button:hover:not(.active) {
  color: #ffffff;
  background: var(--bg-sidebar-hover);
}

.sidebar-nav button:hover:not(.active) i {
  color: #7BE63B;
}

.sidebar-nav button.active {
  color: var(--sidebar-active-text);
  background: var(--sidebar-active-bg);
  font-weight: 800;
  box-shadow: 0 4px 14px var(--sidebar-active-glow);
}

.sidebar-nav button.active i {
  color: var(--sidebar-active-text);
}

.sidebar-count-badge {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.08);
  color: var(--sidebar-text-muted);
  font-size: 0.78rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-weight: 800;
}

.sidebar-nav button.active .sidebar-count-badge {
  background: rgba(8, 17, 10, 0.18);
  color: var(--sidebar-active-text);
}

.sidebar-footer {
  padding: 1.2rem;
  border-top: 1px solid var(--sidebar-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  overflow: hidden;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #122417;
  color: #7BE63B;
  border: 1.5px solid rgba(123, 230, 59, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.user-meta {
  overflow: hidden;
}

.user-email {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--sidebar-text-primary);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.user-role {
  font-size: 0.74rem;
  color: var(--sidebar-text-muted);
  font-weight: 600;
}

.btn-logout {
  background: none;
  border: none;
  color: var(--sidebar-text-muted);
  font-size: 1.15rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.btn-logout:hover {
  color: #f87171;
  background: rgba(239, 68, 68, 0.12);
}

/* MAIN WRAPPER */
.main-wrapper {
  margin-left: 260px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* TOPBAR */
.topbar {
  height: 74px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 40;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.btn-menu-mobile {
  display: none;
  background: none;
  border: none;
  font-size: 1.4rem;
  color: var(--text-main);
  cursor: pointer;
}

.page-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-main);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.btn-refresh {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #f0f6f0;
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  padding: 0.55rem 0.95rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-refresh:hover {
  background: var(--primary-light);
  color: var(--primary-hover);
  border-color: var(--primary);
}

.btn-refresh i.spin {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* CONTENT VIEWPORT */
.content-viewport {
  padding: 2rem;
  flex: 1;
}

.view-panel {
  display: none;
}

.view-panel.active {
  display: block;
}

/* ==========================================================================
   METRIC STATS CARDS
   ========================================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 1.4rem 1.3rem;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 1.1rem;
  transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

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

.stat-icon.new { background: var(--status-new-bg); color: var(--status-new-text); }
.stat-icon.confirmed { background: var(--status-confirmed-bg); color: var(--status-confirmed-text); }
.stat-icon.in-progress { background: var(--status-inrepair-bg); color: var(--status-inrepair-text); }
.stat-icon.completed { background: var(--status-completed-bg); color: var(--status-completed-text); }
.stat-icon.today { background: var(--primary-light); color: var(--primary-hover); }
.stat-icon.customers { background: #f1f5f9; color: #475569; }

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
}

.stat-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* ==========================================================================
   DATA TABLES & CARDS
   ========================================================================== */
.table-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 2rem;
}

.table-header {
  padding: 1.3rem 1.6rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.table-header h2 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-main);
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  min-width: 240px;
}

.search-box i {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-sub);
  font-size: 0.9rem;
}

.search-box input {
  width: 100%;
  padding: 0.55rem 0.85rem 0.55rem 2.4rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: #fbfdfb;
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary);
}

.filter-select {
  padding: 0.55rem 0.85rem;
  font-family: var(--font-main);
  font-size: 0.88rem;
  font-weight: 700;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: #fbfdfb;
  color: var(--text-main);
  cursor: pointer;
}

.filter-select:focus {
  outline: none;
  border-color: var(--primary);
}

/* DATA TABLE */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-family: var(--font-body);
  font-size: 0.92rem;
}

thead {
  background: #f7faf7;
  border-bottom: 1.5px solid var(--border-light);
}

th {
  padding: 0.95rem 1.2rem;
  font-family: var(--font-main);
  font-weight: 800;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

td {
  padding: 1.05rem 1.2rem;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-main);
  vertical-align: middle;
}

tbody tr {
  transition: background 0.15s ease;
}

tbody tr:hover {
  background: #f9fcf9;
}

/* TABLE ITEMS & BADGES */
.order-num-tag {
  font-family: var(--font-main);
  font-weight: 800;
  color: var(--text-main);
  background: #ecf7ed;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.88rem;
  letter-spacing: 0.03em;
  display: inline-block;
}

.customer-cell {
  display: flex;
  flex-direction: column;
}

.customer-name {
  font-weight: 700;
  color: var(--text-main);
}

.customer-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.price-text {
  font-weight: 700;
  color: #1b4d24;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  font-family: var(--font-main);
  white-space: nowrap;
  border: 1px solid transparent;
}

.badge-new { background: var(--status-new-bg); color: var(--status-new-text); border-color: var(--status-new-border); }
.badge-confirmed { background: var(--status-confirmed-bg); color: var(--status-confirmed-text); border-color: var(--status-confirmed-border); }
.badge-technician-assigned { background: var(--status-assigned-bg); color: var(--status-assigned-text); border-color: var(--status-assigned-border); }
.badge-on-the-way { background: var(--status-ontheway-bg); color: var(--status-ontheway-text); border-color: var(--status-ontheway-border); }
.badge-in-repair { background: var(--status-inrepair-bg); color: var(--status-inrepair-text); border-color: var(--status-inrepair-border); }
.badge-completed { background: var(--status-completed-bg); color: var(--status-completed-text); border-color: var(--status-completed-border); }
.badge-cancelled { background: var(--status-cancelled-bg); color: var(--status-cancelled-text); border-color: var(--status-cancelled-border); }

.btn-action-view {
  background: var(--primary-light);
  color: var(--primary-hover);
  border: 1px solid rgba(47, 224, 18, 0.4);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-main);
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-action-view:hover {
  background: var(--primary);
  color: #0b140c;
}

/* EMPTY / LOADING STATES */
.table-empty, .table-loading {
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
}

.table-empty i, .table-loading i {
  font-size: 2.5rem;
  color: var(--text-sub);
  margin-bottom: 0.8rem;
  display: block;
}

/* PAGINATION */
.table-pagination {
  padding: 1rem 1.6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-light);
  font-size: 0.88rem;
  color: var(--text-muted);
}

.pagination-buttons {
  display: flex;
  gap: 0.4rem;
}

.btn-page {
  padding: 0.4rem 0.8rem;
  background: #ffffff;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-page:hover:not(:disabled) {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary-hover);
}

.btn-page:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ==========================================================================
   MODAL / SIDE DRAWER (ORDER DETAILS & CUSTOMER HISTORY)
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 17, 11, 0.6);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-backdrop.active,
.modal-backdrop.open {
  display: flex;
}

.modal-window {
  background: #ffffff;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 780px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-window form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  margin: 0;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  padding: 1.2rem 1.8rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fbfdfb;
  flex-shrink: 0;
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.modal-header h3 {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-main);
}

.btn-close-modal {
  background: none;
  border: none;
  font-size: 1.3rem;
  color: var(--text-sub);
  cursor: pointer;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-close-modal:hover {
  background: #f0f4f0;
  color: var(--text-main);
}

.modal-body {
  padding: 1.6rem 1.8rem;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 1.3rem;
}

.modal-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.detail-section {
  background: #f8faf8;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.2rem 1.4rem;
}

.detail-section h4 {
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 0.55rem 0;
  border-bottom: 1px dashed var(--border-light);
  font-size: 0.92rem;
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  color: var(--text-muted);
  font-weight: 600;
}

.detail-value {
  font-weight: 700;
  color: var(--text-main);
  text-align: right;
  max-width: 60%;
  word-break: break-word;
}

.admin-edit-card {
  background: #ecf9ee;
  border: 1.5px solid #bcebc2;
  border-radius: var(--radius-md);
  padding: 1.4rem;
}

.admin-edit-card h4 {
  color: #1b4d24;
  font-size: 0.95rem;
  font-weight: 800;
  margin-bottom: 1rem;
}

.modal-footer {
  padding: 1.1rem 1.8rem;
  border-top: 1px solid var(--border-light);
  background: #fbfdfb;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.8rem;
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  z-index: 10;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.03);
}

.btn-secondary {
  padding: 0.75rem 1.3rem;
  background: #ffffff;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: #f0f4f0;
  color: var(--text-main);
}

.btn-modal-save {
  padding: 0.75rem 1.6rem;
  background: var(--primary);
  color: #061108;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-main);
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(47, 224, 18, 0.25);
}

.btn-modal-save:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(47, 224, 18, 0.4);
}

.btn-modal-save:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  padding: 0.75rem 1.5rem;
  background: var(--text-main);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-main);
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s;
}

.btn-primary:hover {
  background: #1e3321;
}

/* CUSTOMER HISTORY LIST IN MODAL */
.history-timeline {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.history-item {
  background: #ffffff;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 1rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  transition: border-color 0.2s;
}

.history-item:hover {
  border-color: var(--primary);
}

.history-item-left {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.history-item-top {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.history-order-num {
  font-weight: 800;
  color: var(--text-main);
}

.history-device-repair {
  font-size: 0.92rem;
  color: var(--text-muted);
}

.history-date {
  font-size: 0.8rem;
  color: var(--text-sub);
}

/* TOAST NOTIFICATION */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.toast {
  background: #111c13;
  color: #ffffff;
  padding: 0.85rem 1.3rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--primary);
  animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.error {
  border-left-color: #ef4444;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   SERVICES & PRICING SUB-NAV & CONTROLS
   ========================================================================== */
.sub-nav-tabs {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.2rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.sub-nav-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.1rem;
  background: #ffffff;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: var(--font-main);
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.sub-nav-btn:hover {
  border-color: var(--primary);
  color: var(--text-main);
}

.sub-nav-btn.active {
  background: var(--text-main);
  border-color: var(--text-main);
  color: #ffffff;
}

.sub-nav-btn.active i {
  color: var(--primary);
}

.sub-view-panel {
  display: none;
}

.sub-view-panel.active {
  display: block;
}

.btn-primary-action {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  background: var(--text-main);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-main);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.btn-primary-action:hover {
  background: #1e3321;
  transform: translateY(-1px);
}

.btn-action-edit {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  font-family: var(--font-main);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-action-edit:hover {
  background: #dcfce7;
}

.btn-action-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  background: #f8fafc;
  color: #475569;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-family: var(--font-main);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-action-toggle:hover {
  background: #f1f5f9;
}

.btn-action-delete {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  border-radius: 6px;
  font-family: var(--font-main);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-action-delete:hover {
  background: #fee2e2;
}

.badge-active {
  background: #dcfce7;
  color: #15803d;
  border-color: #bbf7d0;
}

.badge-inactive {
  background: #f1f5f9;
  color: #64748b;
  border-color: #cbd5e1;
}

.checkbox-group {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

.checkbox-label {
  display: flex !important;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-main);
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* ==========================================================================
   GROUPED MODEL PRICING ACCORDIONS
   ========================================================================== */
.model-pricing-card {
  background: #ffffff;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.model-pricing-card:hover {
  border-color: #cbd5e1;
}

.model-pricing-card.open {
  border-color: #bbf7d0;
  box-shadow: 0 4px 16px rgba(16, 28, 18, 0.06);
}

.model-pricing-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.4rem;
  background: #ffffff;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease;
}

.model-pricing-header:hover {
  background: #f8faf8;
}

.model-pricing-card.open .model-pricing-header {
  background: #f4fbf5;
  border-bottom: 1px solid var(--border-light);
}

.model-title-area {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.model-device-icon {
  height: 28px;
  width: auto;
  flex-shrink: 0;
}

.model-title-text {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
}

.model-category-tag {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  background: rgba(47, 224, 18, 0.14);
  color: #15803d;
  letter-spacing: 0.02em;
}

.model-count-tag {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
}

.model-header-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.btn-add-service-small {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  background: #ffffff;
  color: var(--text-main);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  font-family: var(--font-main);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-add-service-small:hover {
  border-color: var(--primary);
  background: #f0fdf4;
  color: #15803d;
}

.model-accordion-chevron {
  font-size: 0.95rem;
  color: var(--text-sub);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, color 0.2s ease;
}

.model-pricing-card.open .model-accordion-chevron {
  transform: rotate(180deg);
  color: var(--primary);
}

.model-pricing-body {
  display: none;
  background: #ffffff;
}

.model-pricing-card.open .model-pricing-body {
  display: block;
}

.inline-input-price,
.inline-input-warranty,
.inline-select-status {
  padding: 0.45rem 0.65rem;
  border: 1.5px solid var(--primary);
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  background: #ffffff;
  color: var(--text-main);
}

.inline-input-price {
  max-width: 140px;
  font-weight: 700;
}

.inline-input-warranty {
  max-width: 200px;
  font-weight: 500;
}

.inline-select-status {
  font-weight: 700;
}

.empty-model-services {
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* ==========================================================================
   TOPBAR ACTION BUTTONS & NOTIFICATION TOGGLES
   ========================================================================== */
.btn-topbar-action {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: #ffffff;
  border: 1px solid var(--border-light);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-topbar-action:hover {
  background: var(--bg-app);
  border-color: var(--primary);
  color: var(--primary-hover);
}

.push-status-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
  border: 1.5px solid #ffffff;
  transition: background 0.2s ease;
}

.push-status-dot.active {
  background: var(--primary);
  box-shadow: 0 0 6px rgba(47, 224, 18, 0.6);
}

/* ==========================================================================
   IN-APP REALTIME NEW ORDER BANNER
   ========================================================================== */
.new-order-banner {
  position: sticky;
  top: 0;
  z-index: 950;
  padding: 0.75rem 1.25rem;
  background: #08150D;
  border-bottom: 2px solid var(--primary);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  animation: bannerSlideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes bannerSlideDown {
  from {
    opacity: 0;
    transform: translateY(-100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.banner-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.banner-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(47, 224, 18, 0.18);
  border: 1px solid rgba(47, 224, 18, 0.35);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.08); opacity: 0.85; }
}

.banner-text {
  flex: 1;
  min-width: 0;
}

.banner-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 2px;
}

.banner-subtitle {
  font-size: 0.82rem;
  color: #93A29A;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.banner-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.btn-banner-view {
  padding: 0.45rem 1rem;
  background: var(--primary);
  color: #08110A;
  border: none;
  border-radius: 8px;
  font-family: var(--font-main);
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-banner-view:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-banner-close {
  background: none;
  border: none;
  color: #93A29A;
  font-size: 1rem;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
}

.btn-banner-close:hover {
  color: #ffffff;
}

/* ==========================================================================
   MOBILE BOTTOM NAVIGATION & DRAWER
   ========================================================================== */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.sidebar-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.btn-sidebar-close {
  display: none;
  background: none;
  border: none;
  color: var(--sidebar-text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  margin-left: auto;
}

.btn-sidebar-close:hover {
  color: #ffffff;
}

.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 62px;
  background: rgba(8, 21, 13, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 990;
  padding: 0 0.5rem;
  padding-bottom: env(safe-area-inset-bottom);
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--sidebar-text-muted);
  font-family: var(--font-main);
  font-size: 0.72rem;
  font-weight: 700;
  gap: 3px;
  cursor: pointer;
  padding: 6px 0;
  transition: color 0.15s ease;
}

.bottom-nav-item i {
  font-size: 1.15rem;
}

.bottom-nav-item.active {
  color: var(--primary);
}

.bnav-icon-wrap {
  position: relative;
}

.bnav-badge {
  position: absolute;
  top: -4px;
  right: -8px;
  background: var(--primary);
  color: #08110A;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 999px;
  line-height: 1.2;
}

/* ==========================================================================
   MOBILE CARDS FOR ORDERS & CUSTOMERS
   ========================================================================== */
.mobile-cards-list {
  display: none;
  flex-direction: column;
  gap: 0.85rem;
}

.mobile-order-card,
.mobile-customer-card {
  background: #ffffff;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  transition: all 0.15s ease;
}

.mobile-order-card:active,
.mobile-customer-card:active {
  background: #fcfdfc;
  transform: scale(0.99);
}

.m-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.m-order-num {
  font-family: monospace;
  font-size: 0.92rem;
  font-weight: 800;
  color: #15803d;
  background: #f0fdf4;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  border: 1px solid #bbf7d0;
}

.m-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.m-customer-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
}

.m-meta-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.m-meta-row i {
  color: var(--text-sub);
  width: 14px;
  text-align: center;
}

.m-phone-link {
  color: var(--primary-hover);
  text-decoration: none;
  font-weight: 700;
}

.m-service-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #f8faf8;
  border: 1px solid var(--border-light);
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 0.2rem;
}

.m-price-tag {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--text-main);
  margin-left: auto;
}

.m-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border-light);
  gap: 0.6rem;
}

.btn-card-action {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  background: #f4fbf5;
  border: 1.5px solid rgba(47, 224, 18, 0.4);
  border-radius: 10px;
  color: #15803d;
  font-family: var(--font-main);
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-card-action:hover {
  background: var(--primary);
  color: #08110A;
}

/* Mobile Service Item in Model Pricing Accordion */
.mobile-service-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--border-light);
  gap: 0.75rem;
  flex-wrap: wrap;
}

.mobile-service-item:last-child {
  border-bottom: none;
}

.ms-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.ms-name {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
}

.ms-meta {
  font-size: 0.8rem;
  color: var(--text-sub);
}

.ms-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.ms-price {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS
   ========================================================================== */
@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 290px;
    z-index: 1000;
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .btn-sidebar-close {
    display: block;
  }

  .main-wrapper {
    margin-left: 0;
  }

  .btn-menu-mobile {
    display: flex;
  }

  .mobile-bottom-nav {
    display: flex;
  }

  .content-viewport {
    padding: 1.25rem 1rem calc(76px + env(safe-area-inset-bottom));
  }

  .modal-grid-2 {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .stat-card {
    padding: 1rem 0.9rem;
    gap: 0.75rem;
  }

  .stat-icon {
    width: 42px;
    height: 42px;
    font-size: 1.1rem;
    border-radius: 12px;
  }

  .stat-value {
    font-size: 1.45rem;
  }

  .stat-label {
    font-size: 0.78rem;
  }

  .table-responsive {
    display: none;
  }

  .mobile-cards-list {
    display: flex;
  }

  .mobile-review-card {
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 1.1rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
  }

  .mobile-review-card .mrc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .mobile-review-card .mrc-name {
    font-weight: 800;
    font-size: 1rem;
    color: var(--text-main);
  }

  .mobile-review-card .mrc-stars {
    color: #f59e0b;
    font-size: 0.95rem;
    letter-spacing: 0.05em;
  }

  .mobile-review-card .mrc-text {
    font-size: 0.92rem;
    line-height: 1.55;
    color: var(--text-body);
    margin: 0;
  }

  .mobile-review-card .mrc-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-light);
    padding-top: 0.65rem;
    margin-top: 0.25rem;
  }

  .mobile-phone-card {
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 1.1rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
  }

  .mobile-phone-card .mpc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .mobile-phone-card .mpc-phone {
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--text-main);
  }

  .mobile-phone-card .mpc-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-light);
    padding-top: 0.65rem;
    margin-top: 0.25rem;
  }

  .table-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .table-actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .search-box,
  .filter-select {
    width: 100% !important;
    min-width: 100% !important;
  }

  .sub-nav-tabs {
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 0.4rem;
    -webkit-overflow-scrolling: touch;
  }

  .sub-nav-btn {
    flex-shrink: 0;
  }
}

@media (max-width: 480px) {
  .topbar {
    padding: 0.75rem 1rem;
    height: 64px;
  }

  .page-title {
    font-size: 1.15rem;
  }

  .btn-refresh span {
    display: none;
  }

  .btn-refresh {
    padding: 0.5rem;
    width: 38px;
    height: 38px;
    justify-content: center;
  }

  .modal-content {
    width: 100%;
    margin: 0;
    max-height: 94vh;
    border-radius: 20px 20px 0 0;
  }

  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
  }
}
