/* ==========================================================================
  EZ GADGETS - LIGHT/DARK THEMEABLE UI
   ========================================================================== */

/* LIGHT MODE (Default) */
:root {
  --bg: #f4f4f5;
  --surface: #ffffff;
  --surface2: #fafafa;
  --border: #e4e4e7;
  --text: #09090b;
  --text2: #52525b;
  --text3: #a1a1aa;
  --accent: #2563eb; /* Modern Blue */
  --accent-hover: #1d4ed8;
  --accent2: #0d9488; /* Teal */
  --accent3: #e11d48; /* Rose/Red */
  --shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.08);
  --focus-ring: 0 0 0 3px rgba(37, 99, 235, 0.15);
  --radius: 12px;
}

/* DARK MODE OVERRIDES */
[data-theme="dark"] {
  --bg: #09090b;
  --surface: #18181b;
  --surface2: #27272a;
  --border: #3f3f46;
  --text: #fafafa;
  --text2: #a1a1aa;
  --text3: #71717a;
  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.5);
  --focus-ring: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter Tight", sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
}

/* ==========================================================================
  CENTERED HEADER WITH LARGE LOGO & TEXT
   ========================================================================== */

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 90px;
  padding: 0 40px;
}

.header-left-spacer,
.header-controls {
  width: 180px;
  flex-shrink: 0;
}

.logo-area {
  display: flex;
  align-items: center; /* Image on Left, Text on Right */
  gap: 18px;
  flex-shrink: 0;
  margin: 0 auto;
}

.logo-text h1 {
  font-size: 22px !important;
  font-weight: 800;
  white-space: nowrap; /* No shrinking */
}

.logo-area img {
  height: 48px !important; /* Forces large logo size */
  width: auto;
  border-radius: 8px;
  flex-shrink: 0;
}

.logo-text {
  flex-shrink: 0;
}

.logo-text p {
  font-size: 11px !important;
  color: var(--text3);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 4px;
}

/* RIGHT: Controls */
.header-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  width: 180px; /* Must match .header-left-spacer exactly */
  flex-shrink: 0;
}

/* Fix for the "Update" button issue from the last image */
.records-table .btn {
  white-space: nowrap !important;
  min-width: 110px;
}

@media (max-width: 900px) {
  .header-left-spacer {
    display: none;
  }
  .header-controls {
    width: auto;
  }
  .logo-area {
    margin: 0;
  }
  header {
    justify-content: space-between;
    padding: 0 20px;
  }
}

.theme-toggle {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s ease;
}
.theme-toggle:hover {
  background: var(--border);
}

nav {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 24px 20px 0;
}

.tab {
  padding: 10px 24px;
  border-radius: var(--radius) var(--radius) 0 0;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text2);
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}
.tab:hover {
  color: var(--text);
}
.tab.active {
  color: var(--accent);
  font-weight: 600;
  border-bottom: 2px solid var(--accent);
}

/* LAYOUT & PANELS */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 20px 80px;
  width: 100%;
}

.panel {
  display: none;
  width: 100%;
  max-width: 600px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow);
  animation: slideUp 0.3s ease;
  transition: background-color 0.3s ease;
}
.panel.active {
  display: block;
}
.panel.admin-panel {
  max-width: 900px;
} /* Wider for admin tables */

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

.section-header {
  text-align: center;
  margin-bottom: 32px;
}
.section-header h2 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.section-header p {
  font-size: 14px;
  color: var(--text2);
  margin-top: 4px;
}
.divider {
  height: 1px;
  background: var(--border);
  margin: 32px 0;
}

/* FORMS & INPUTS */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.form-group.full {
  grid-column: 1 / -1;
}

label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
}
input,
select,
textarea {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  outline: none;
  transition: all 0.2s ease;
  width: 100%;
}
input::placeholder,
textarea::placeholder {
  color: var(--text3);
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
  background: var(--surface);
}
textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.5;
}
select option {
  background: var(--surface2);
}

/* BUTTONS */
.btn {
  padding: 12px 24px;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn:active {
  transform: scale(0.98);
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-hover);
}
.btn-secondary {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: var(--border);
}
.btn-teal {
  background: rgba(13, 148, 136, 0.1);
  color: var(--accent2);
  border: 1px solid rgba(13, 148, 136, 0.2);
}
.btn-group {
  display: flex;
  gap: 16px;
  margin-top: 32px;
}
.btn-group .btn {
  flex: 1;
}

/* COMPONENTS */
.code-display {
  background: var(--surface2);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  display: none;
  margin-top: 24px;
}
.code-display.show {
  display: block;
  animation: slideUp 0.3s ease;
}
.code-display .label {
  font-size: 13px;
  color: var(--text2);
  font-weight: 500;
  margin-bottom: 8px;
}
.code-display .code {
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 2px;
}

.badge {
  padding: 6px 12px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  display: inline-block;
}
.badge-received {
  background: rgba(56, 189, 248, 0.15);
  color: #0284c7;
}
.badge-inhouse {
  background: rgba(37, 99, 235, 0.15);
  color: var(--accent);
}
.badge-sent {
  background: rgba(249, 115, 22, 0.15);
  color: #ea580c;
}
.badge-fixed {
  background: rgba(34, 197, 94, 0.15);
  color: #16a34a;
}
.badge-delivered {
  background: rgba(20, 184, 166, 0.15);
  color: #0d9488;
}
[data-theme="dark"] .badge-received {
  color: #38bdf8;
}
[data-theme="dark"] .badge-fixed {
  color: #4ade80;
}
[data-theme="dark"] .badge-sent {
  color: #fb923c;
}

/* ADMIN TABLES & STATS */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.stat-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
}
.stat-card .sv {
  font-size: 36px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  margin-bottom: 8px;
}
.stat-card .sl {
  font-size: 13px;
  color: var(--text2);
  font-weight: 500;
}

.records-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
}
.records-table th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--text3);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.records-table td {
  padding: 16px;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  white-space: normal !important; /* Forces text to wrap to next line */
  word-break: break-word; /* Breaks long strings of text */
  max-width: 300px;
}
.records-table tr:hover td {
  background: var(--surface2);
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text3);
}

/* MODALS & TOASTS */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.show {
  display: flex;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
  animation: slideUp 0.3s ease;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}
.close-btn {
  background: var(--surface2);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text2);
}
.close-btn:hover {
  background: var(--border);
  color: var(--text);
}
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}
.detail-item .dl {
  font-size: 12px;
  color: var(--text3);
  margin-bottom: 6px;
  font-weight: 600;
}
.detail-item .dv {
  font-size: 15px;
  color: var(--text);
  line-height: 1.5;
  white-space: normal !important; /* Forces text to wrap to next line */
  word-break: break-word; /* Breaks long strings of text */
  max-width: 300px;
}

.toast {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 999;
  padding: 14px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow);
  transform: translateY(80px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.toast.show {
  transform: translateY(0);
  opacity: 1;
}
.toast.success {
  border-color: #10b981;
  color: #10b981;
}
.toast.error {
  border-color: #ef4444;
  color: #ef4444;
}

/* SPINNER */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(37, 99, 235, 0.3);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* MOBILE RESPONSIVENESS */
.bottom-nav {
  display: none;
}
@media (max-width: 640px) {
  nav:not(.bottom-nav) {
    display: none;
  }
  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    z-index: 150;
  }
  .bottom-nav-inner {
    display: flex;
    justify-content: space-around;
    width: 100%;
    height: 60px;
  }
  .bnav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: none;
    border: none;
    color: var(--text3);
  }
  .bnav-item.active {
    color: var(--accent);
  }
  .bnav-item .bnav-label {
    font-size: 11px;
    font-weight: 500;
  }

  header {
    padding: 0 20px;
    height: 60px;
  }
  main {
    padding: 16px 16px 80px;
  }
  .panel {
    padding: 24px 20px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .btn {
    width: 100%;
  }
  .detail-grid {
    grid-template-columns: 1fr;
  }
  .modal {
    border-radius: 20px 20px 0 0;
    padding: 32px 20px;
    max-height: 85vh;
    align-self: flex-end;
  }
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }
}

/* Add the missing Replaced badge color */
.badge-replaced {
  background: rgba(20, 184, 166, 0.15) !important;
  color: #0d9488 !important;
}

/* Ensure the dot for replaced status shows up */
.badge-replaced::before {
  background: #0d9488 !important;
}

/* ==========================================================================
  WE REPAIR BD TABLE SQUEEZING
   ========================================================================== */

/* 1. Prevent buttons from breaking/shrinking */
.records-table .btn {
  white-space: nowrap !important; /* Prevents "Update" */
  min-width: 100px; /* Ensures a consistent button size */
  padding: 8px 16px; /* Comfortable padding */
}

/* 2. Prevent badges from shrinking */
.records-table .badge {
  white-space: nowrap !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 90px; /* Keeps "Cannot Fix" on one line */
}

/* 3. Give specific columns priority */
/* The last column (Action button) should only be as wide as the button */
.records-table td:last-child {
  width: 120px;
  text-align: right;
}

/* The second to last column (Status) should have enough space for badges */
.records-table td:nth-last-child(2) {
  width: 110px;
  text-align: center;
}

/* 4. Let the Issue Description take up all the remaining space */
.records-table td:nth-child(3) {
  width: auto;
  min-width: 200px;
}

/* ==========================================================================
  CUSTOMER DETAILS & CLICK-TO-COPY
   ========================================================================== */
.eye-btn {
  background: transparent;
  border: none;
  color: var(--text2);
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  transition: 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.eye-btn:hover {
  color: var(--accent);
  background: rgba(59, 130, 246, 0.1);
}

.copy-block {
  background: var(--surface2, #1e1e1e);
  padding: 12px 15px;
  border-radius: 8px;
  margin-bottom: 10px;
  cursor: pointer;
  border: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: 0.2s;
}

.copy-block:hover {
  border-color: var(--accent);
  background: rgba(59, 130, 246, 0.05);
}

.copy-label {
  font-size: 11px;
  color: var(--text3);
  display: block;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.copy-value {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  word-break: break-word;
}

/* ==========================================================================
  ENHANCED LOGOUT BUTTONS & NAV-STYLE UNDERLINE
   ========================================================================== */

/* Larger, more prominent logout button */
.btn-logout {
  padding: 10px 22px !important; /* Bigger footprint */
  font-size: 13px !important;
  font-weight: 700 !important;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  position: relative;
  background: var(--surface2) !important;
  border: 1px solid var(--border) !important;
  color: var(--text) !important;
  text-decoration: none;
  overflow: hidden;
  transition: all 0.3s ease;
}

/* The Underline Effect (Hidden by default) */
.btn-logout::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--accent); /* Matches your blue theme */
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

/* Hover State: Slide out the underline and darken background */
.btn-logout:hover {
  background: var(--border) !important;
  color: var(--accent) !important;
}

.btn-logout:hover::after {
  width: 100%; /* Expands the underline like the nav tabs */
}

/* Ensure header controls can fit the bigger buttons */
.header-controls {
  width: 220px !important; /* Widened to prevent squeezing */
  gap: 16px !important;
}

.header-left-spacer {
  width: 220px !important; /* Balanced for centering */
}
/* ==========================================================================
  DESKTOP TABS (Modern Pill Style)
   ========================================================================== */
.tabs {
  display: flex;
  justify-content: center;
  width: 100%;
  max-width: 500px; /* Keeps them from stretching across the whole monitor */
  margin: 30px auto;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 30px;
  padding: 6px;
  box-sizing: border-box;
}

.tab-btn {
  flex: 1;
  font-size: 16px;
  font-weight: 600;
  padding: 12px 20px;
  background: transparent;
  border: none;
  color: var(--text);
  border-radius: 25px;
  cursor: pointer; /* Gives the mouse a pointer hand on PC */
  transition: 0.3s ease;
  text-align: center;
}

/* Add a nice hover effect for PC users with a mouse */
.tab-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* General Icon Button Styling (Put this above your media query) */
.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: 0.2s;
}
.icon-btn:hover {
  background: var(--border);
}

/* ==========================================================================
  MOBILE RESPONSIVENESS FIX (CORRECTED)
   ========================================================================== */
/* Prevent the entire page from sliding left/right */
html,
body {
  overflow-x: hidden;
  width: 100%;
}
/* 1. Fix the RMA Code Color and Prevent Breaking */
td:first-child,
.rma-code,
.col-rma {
  color: #3b82f6 !important; /* Your Admin Blue */
  font-weight: 700 !important;
  white-space: nowrap !important; /* Forces the ID to stay on one line */
  font-family: "Inter Tight", sans-serif !important;
  letter-spacing: 0.5px !important;
}

/* 2. Adjust Column Widths so there is space for the code */
table {
  table-layout: auto !important;
  width: 100% !important;
  border-collapse: collapse !important;
}

/* Give the first column a bit more room to breathe */
th:first-child,
td:first-child {
  min-width: 180px !important;
  padding-right: 20px !important;
}

/* 3. Match the Admin Typography for the rest of the row */
td {
  font-size: 14px !important;
  color: var(--text) !important;
  padding: 16px 12px !important; /* Spacious Admin padding */
  vertical-align: middle !important;
}

/* Ensure the Device Name is Bold like Admin */
td:nth-child(2),
.device-name {
  font-weight: 600 !important;
  color: var(--text) !important;
}

/* ==========================================================================
  MOBILE RESPONSIVENESS FIX (FINAL CONSOLIDATED VERSION)
   ========================================================================== */
@media screen and (max-width: 768px) {
  /* 1. LAYOUT REORDERING & GLOBAL */
  body {
    display: flex !important;
    flex-direction: column !important;
    overflow-x: hidden;
    width: 100%;
  }

  header {
    order: 1 !important;
  }
  #panel-search {
    order: 2 !important;
    display: block !important;
  } /* Pins search bar under navbar */
  .tabs {
    order: 3 !important;
  }
  main {
    order: 4 !important;
  }

  /* 2. HEADER & LOGO AREA */
  header {
    display: flex !important;
    flex-wrap: nowrap !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 12px 15px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .header-left-spacer {
    display: none !important;
  }

  .logo-area {
    display: flex !important;
    align-items: center !important;
    width: calc(100% - 95px) !important;
    max-width: none !important;
    flex-shrink: 1 !important;
  }

  .logo-area img {
    max-height: 40px !important;
    margin-right: -8px !important;
    width: auto !important;
    flex-shrink: 0 !important;
  }

  .logo-text h1 {
    font-size: 1.05rem !important;
    margin: 0 0 2px 0 !important;
    white-space: normal !important;
    line-height: 1.1 !important;
  }

  .logo-text p {
    font-size: 0.65rem !important;
    margin: 0 !important;
    white-space: normal !important;
    line-height: 1.2 !important;
  }

  .header-controls {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    justify-content: flex-end !important;
    flex-shrink: 0 !important;
  }

  .header-controls a.icon-btn,
  .header-controls button.theme-toggle {
    width: 38px !important;
    height: 38px !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    border-radius: 8px !important;
    border: 1px solid var(--border) !important;
  }

  /* 3. PINNED SEARCH BAR & PANEL */
  #panel-search {
    width: 92% !important;
    margin: 10px auto !important;
    padding: 12px !important;
    background: var(--bg-color) !important;
    border: 1px solid var(--border) !important;
    border-radius: 12px !important;
    box-sizing: border-box !important;
  }

  #panel-search .section-header {
    display: none !important;
  }

  #adminSearchQuery {
    width: 100% !important;
    padding: 12px !important;
    font-size: 16px !important; /* Prevents iOS auto-zoom */
    border-radius: 8px !important;
    box-sizing: border-box !important;
  }

  /* 4. MODERN PILL TABS - RE-FIXED */
  .tabs {
    display: flex !important;
    justify-content: space-between !important;
    width: 90% !important;
    max-width: 400px !important;
    margin: 15px auto !important; /* Centers it with space around it */
    background: rgba(
      255,
      255,
      255,
      0.05
    ) !important; /* Slight background tint */
    border: 1px solid var(--border) !important;
    border-radius: 50px !important; /* Makes the container a pill */
    padding: 5px !important;
    box-sizing: border-box !important;
    order: 2 !important; /* Ensures it stays under header */
  }

  .tab-btn {
    flex: 1 !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    padding: 10px !important;
    border-radius: 40px !important; /* Makes the active button a pill */
    border: none !important;
    background: transparent !important;
    color: var(--text) !important;
    transition: 0.3s ease !important;
    cursor: pointer !important;
  }

  .tab-btn.active {
    background: var(--accent) !important;
    color: white !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2) !important;
  }

  nav {
    display: none !important;
  }

  /* 5. FORM & CONTENT COMPACTING */
  .form-container,
  .panel {
    width: 92% !important;
    margin: 0 auto 20px auto !important;
    padding: 15px !important;
    box-sizing: border-box !important;
  }

  .form-row,
  .input-group {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    margin-bottom: 12px !important;
  }

  input,
  select,
  textarea {
    font-size: 14px !important;
    padding: 10px !important;
  }

  textarea {
    height: 60px !important;
    min-height: 60px !important;
  }

  /* 6. TABLE-TO-CARD "NUKE" FIX */
  .table-container,
  table,
  tbody,
  tr,
  td {
    display: block !important;
    width: 100% !important;
  }

  thead,
  .table-header {
    display: none !important;
  }

  tbody tr,
  .rma-row,
  .ticket-row,
  .repair-row {
    display: flex !important;
    flex-direction: column !important;
    background: var(--bg-color) !important;
    border: 1px solid var(--border) !important;
    border-radius: 12px !important;
    padding: 15px !important;
    margin-bottom: 15px !important;
    gap: 8px !important;
    box-sizing: border-box !important;
  }

  tbody td,
  .col,
  div[class^="col-"] {
    border: none !important;
    padding: 0 !important;
    width: 100% !important;
    text-align: left !important;
    white-space: normal !important;
  }

  /* Card Header styling for first column */
  tbody td:first-child,
  .rma-code {
    font-size: 1.1rem !important;
    font-weight: bold !important;
    color: var(--accent) !important;
    border-bottom: 1px solid var(--border) !important;
    padding-bottom: 8px !important;
    margin-bottom: 5px !important;
  }

  .status-badge {
    width: fit-content !important;
  }

  .btn-manage,
  .manage-btn,
  tbody td:last-child button {
    width: 100% !important;
    padding: 12px !important;
    margin-top: 5px !important;
  }

  /* 7. MODAL FIXES */
  .modal,
  #manageModal {
    width: 94% !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    padding: 15px !important;
    margin: 4vh auto !important;
  }

  .modal-actions,
  .modal-buttons {
    display: flex !important;
    flex-direction: row !important;
    gap: 10px !important;
  }

  .modal-actions button {
    flex: 1 !important;
    padding: 10px !important;
  }
}
