/* HOTEL OPS - Design System */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --primary: #1a365d;
  --primary-light: #2c5282;
  --primary-dark: #0f2744;
  --accent: #3182ce;
  --bg: #F6F8FB;
  --card: #ffffff;
  --text: #2d3748;
  --text-muted: #718096;
  --border: #e2e8f0;
  --success: #38a169;
  --success-bg: #f0fff4;
  --warning: #dd6b20;
  --warning-bg: #fffaf0;
  --danger: #e53e3e;
  --danger-bg: #fff5f5;
  --info: #3182ce;
  --info-bg: #ebf8ff;
  --sidebar-width: 260px;
  --navbar-height: 64px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 12px rgba(0,0,0,.04);
  --shadow-lg: 0 4px 20px rgba(0,0,0,.1);
  --transition: all .2s ease;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--primary); }

h1,h2,h3,h4,h5,h6 { font-weight: 600; color: var(--primary-dark); }

/* Layout */
.app-wrapper { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-width);
  background: var(--primary-dark);
  color: #fff;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transition: transform .3s ease;
  overflow-y: auto;
}

.sidebar-brand {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}

.sidebar-brand h1 {
  font-size: 1.25rem;
  color: #fff;
  letter-spacing: 1px;
  font-weight: 700;
}

.sidebar-brand p {
  font-size: .7rem;
  color: rgba(255,255,255,.6);
  margin-top: 4px;
}

.sidebar-nav { flex: 1; padding: 16px 12px; }

.nav-section {
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,.4);
  padding: 12px 12px 6px;
  font-weight: 600;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,.75);
  font-size: .875rem;
  font-weight: 500;
  transition: var(--transition);
  margin-bottom: 2px;
}

.nav-link i { font-size: 1.1rem; width: 20px; text-align: center; }

.nav-link:hover, .nav-link.active {
  background: rgba(255,255,255,.12);
  color: #fff;
}

.nav-link.active { background: rgba(255,255,255,.18); }

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.top-navbar {
  height: var(--navbar-height);
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 900;
}

.navbar-left { display: flex; align-items: center; gap: 16px; }

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text);
  cursor: pointer;
  padding: 4px;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  -webkit-tap-highlight-color: transparent;
}

.menu-toggle:active { background: var(--bg); }

.navbar-search {
  position: relative;
}

.navbar-search input {
  width: 280px;
  padding: 8px 12px 8px 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .875rem;
  background: var(--bg);
  transition: var(--transition);
}

.navbar-search input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(49,130,206,.15);
  background: #fff;
}

.navbar-search i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.navbar-right { display: flex; align-items: center; gap: 12px; }

.navbar-icon-btn {
  position: relative;
  background: none;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.navbar-icon-btn:hover { background: var(--bg); color: var(--text); }

.notification-badge {
  position: absolute;
  top: 4px; right: 4px;
  background: var(--danger);
  color: #fff;
  font-size: .6rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  border: none;
  background: none;
}

.user-menu:hover { background: var(--bg); }

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: .8rem;
}

.user-info { text-align: left; }
.user-info .name { font-weight: 600; font-size: .875rem; color: var(--text); }
.user-info .role { font-size: .75rem; color: var(--text-muted); }

.page-content { flex: 1; padding: 24px; }

.page-header { margin-bottom: 24px; }

.page-header h2 { font-size: 1.5rem; margin-bottom: 4px; }
.page-header p { color: var(--text-muted); font-size: .875rem; }

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .8rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }

/* Cards */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header h5 { font-size: .95rem; font-weight: 600; margin: 0; }
.card-body { padding: 20px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  line-height: 1.4;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-light); }

.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: #2b6cb0; }

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-outline:hover { background: var(--bg); border-color: var(--text-muted); }

.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }

.btn-sm { padding: 5px 10px; font-size: .8rem; }
.btn-lg { padding: 12px 24px; font-size: 1rem; }

.btn-icon {
  width: 32px; height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}
.btn-icon:hover { background: var(--bg); color: var(--text); }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
  line-height: 1.4;
}

.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-secondary { background: #edf2f7; color: var(--text-muted); }
.badge-primary { background: rgba(26,54,93,.1); color: var(--primary); }

/* Priority badges */
.priority-kritik { background: #fed7d7; color: #c53030; }
.priority-acil { background: #feebc8; color: #c05621; }
.priority-yuksek { background: #fefcbf; color: #975a16; }
.priority-normal { background: #e2e8f0; color: #4a5568; }
.priority-dusuk { background: #edf2f7; color: #718096; }

/* Status badges */
.status-yeni, .status-bekliyor { background: #ebf8ff; color: #2b6cb0; }
.status-atandi { background: #faf5ff; color: #805ad5; }
.status-isleme-alindi { background: #fffaf0; color: #c05621; }
.status-beklemede { background: #fefcbf; color: #975a16; }
.status-tamamlandi { background: var(--success-bg); color: var(--success); }
.status-iptal { background: #edf2f7; color: #718096; }
.status-tekrar-acildi { background: var(--danger-bg); color: var(--danger); }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.form-control, .form-select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-family: inherit;
  background: #fff;
  transition: var(--transition);
}

.form-control:focus, .form-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(49,130,206,.15);
}

textarea.form-control { min-height: 100px; resize: vertical; }

.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.form-check input { width: 16px; height: 16px; accent-color: var(--primary); }

/* Tables */
.table-wrapper { overflow-x: auto; }

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: .875rem;
  vertical-align: middle;
}

.data-table tbody tr { transition: var(--transition); }
.data-table tbody tr:hover { background: rgba(246,248,251,.8); }

/* Grid */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.show { display: flex; }

.modal {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn .2s ease;
}

.modal-lg { max-width: 720px; }

@keyframes modalIn {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h5 { font-size: 1.1rem; margin: 0; }

.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Toast */
.toast-container {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--card);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
  animation: toastIn .3s ease;
  border-left: 4px solid var(--accent);
}

.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }

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

/* Empty state */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

.empty-state i { font-size: 3rem; margin-bottom: 16px; opacity: .4; }
.empty-state h5 { margin-bottom: 8px; color: var(--text); }

/* Loading */
.loading-spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin: 40px auto;
}

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

/* SLA violation */
.sla-violation {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--danger);
  font-size: .75rem;
  font-weight: 600;
}

/* Avatar group */
.avatar-sm {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
  font-weight: 600;
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: center;
  padding: 16px 0;
}

.pagination button {
  min-width: 36px; height: 36px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: .875rem;
  transition: var(--transition);
}

.pagination button:hover, .pagination button.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.pagination button:disabled { opacity: .4; cursor: not-allowed; }

/* Filter bar */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
  padding: 16px;
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.filter-bar .form-control, .filter-bar .form-select {
  width: auto;
  min-width: 140px;
}

/* Dropdown */
.dropdown { position: relative; display: inline-block; }

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  min-width: 180px;
  z-index: 1100;
  display: none;
  padding: 6px 0;
}

.dropdown-menu.show { display: block; }

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: .875rem;
  color: var(--text);
  cursor: pointer;
  transition: var(--transition);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.dropdown-item:hover { background: var(--bg); }

/* Tabs */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.tab-btn {
  padding: 10px 20px;
  border: none;
  background: none;
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
  font-family: inherit;
}

.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }

/* Login page */
.login-page {
  min-height: 100vh;
  display: flex;
}

.login-left {
  flex: 1;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.login-left::before {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: rgba(255,255,255,.05);
  top: -100px; right: -100px;
}

.login-left h1 {
  font-size: 2.5rem;
  color: #fff;
  letter-spacing: 2px;
  margin-bottom: 12px;
}

.login-left p { font-size: 1.1rem; opacity: .85; max-width: 400px; }

.login-features {
  margin-top: 48px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-feature {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: .9rem;
  opacity: .9;
}

.login-feature i { font-size: 1.2rem; opacity: .7; }

.login-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: var(--bg);
}

.login-form-container {
  width: 100%;
  max-width: 420px;
}

.login-form-container h2 {
  font-size: 1.75rem;
  margin-bottom: 8px;
}

.login-form-container > p {
  color: var(--text-muted);
  margin-bottom: 32px;
}

.demo-users {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.demo-users h6 {
  font-size: .8rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.demo-user-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.demo-user-btns .btn { justify-content: center; font-size: .8rem; padding: 10px; }

/* Overlay for mobile sidebar */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 999;
}

.sidebar-overlay.show { display: block; }

/* Utility */
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-center { text-align: center; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.w-100 { width: 100%; }
.flex-1 { flex: 1; }

/* =====================================================
   MOBILE RESPONSIVE — always in style.css (guaranteed)
   ===================================================== */
@media screen and (max-width: 992px) {
  :root { --sidebar-width: 0px; --navbar-height: 56px; }

  html { -webkit-text-size-adjust: 100%; }
  body { overflow-x: hidden; max-width: 100vw; }

  .app-wrapper,
  .main-content,
  .page-content,
  .card,
  .card-body,
  .wo-toolbar {
    min-width: 0;
    max-width: 100%;
  }

  .main-content { overflow-x: visible; }

  .app-wrapper { display: block !important; width: 100% !important; }

  /* Sidebar: off-screen until hamburger opens it */
  #sidebar.sidebar,
  aside.sidebar {
    position: fixed !important;
    left: -290px !important;
    top: 0 !important;
    width: 280px !important;
    max-width: 85vw !important;
    height: 100vh !important;
    transform: none !important;
    transition: left 0.28s ease !important;
    z-index: 1001 !important;
  }

  #sidebar.sidebar.open,
  aside.sidebar.open {
    left: 0 !important;
    box-shadow: 4px 0 30px rgba(0,0,0,.35) !important;
  }

  .main-content {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    min-height: 100vh;
  }

  .menu-toggle { display: flex !important; }

  .top-navbar { padding: 0 10px; height: 56px; }

  .navbar-search { display: none !important; }

  .user-info { display: none !important; }

  .page-content {
    padding: 12px !important;
    padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .mobile-bottom-nav {
    display: flex !important;
    align-items: center;
    position: fixed !important;
    bottom: 0; left: 0; right: 0;
    height: 64px;
    z-index: 1100;
    background: var(--card);
    border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom, 0);
    box-shadow: 0 -4px 20px rgba(0,0,0,.08);
  }

  /* Responsive tables → stacked cards (CSS only, needs data-label on td) */
  .table-wrapper { overflow: visible !important; }

  .data-table { border-collapse: separate; border-spacing: 0 10px; }

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

  .data-table tbody { display: block; width: 100%; }

  .data-table tbody tr {
    display: block;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
    margin-bottom: 10px;
    box-shadow: var(--shadow);
  }

  .data-table tbody tr:active { opacity: 0.85; }

  .data-table td {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 7px 0 !important;
    border: none !important;
    border-bottom: 1px solid var(--border) !important;
    font-size: 0.85rem !important;
    text-align: right;
    width: 100% !important;
  }

  .data-table td:last-child { border-bottom: none !important; }

  .data-table td::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    text-align: left;
    flex-shrink: 0;
    max-width: 45%;
  }

  .data-table td:first-child {
    font-weight: 700;
    color: var(--primary);
    border-bottom: 1px solid var(--border) !important;
    padding-bottom: 10px !important;
    margin-bottom: 4px;
  }

  .kpi-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }

  .kpi-grid-scroll,
  .kpi-grid.kpi-grid-5 {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    grid-template-columns: unset !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 10px !important;
  }

  .kpi-grid-scroll .kpi-card,
  .kpi-grid.kpi-grid-5 .kpi-card {
    min-width: 130px;
    flex: 0 0 130px;
  }

  .filter-chips-scroll,
  .chips-scroll-outer {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box;
  }

  .chips-scroll-outer {
    overflow: hidden !important;
    position: relative;
  }

  .filter-chips-scroll {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-x !important;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    padding-bottom: 8px !important;
    margin-bottom: 4px;
    scrollbar-width: none;
  }

  .filter-chips-scroll::-webkit-scrollbar { display: none; }

  .filter-chips-scroll .btn,
  .filter-chips-scroll .filter-chip,
  .filter-chips-scroll .subunit-filter,
  .filter-chips-scroll .tab-btn,
  .filter-chips-scroll .badge {
    flex: 0 0 auto !important;
    flex-shrink: 0 !important;
    scroll-snap-align: start;
    white-space: nowrap;
  }

  /* Any horizontal button row on mobile */
  .d-flex.gap-2.mb-4:not(.grid):not(.page-header),
  .d-flex.gap-2.flex-wrap:has(.subunit-filter),
  .d-flex.gap-2:has(.subunit-filter) {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-x !important;
    max-width: 100%;
    padding-bottom: 6px;
    scrollbar-width: none;
  }

  .d-flex.gap-2:has(.subunit-filter)::-webkit-scrollbar { display: none; }

  .wo-toolbar {
    flex-direction: column !important;
    align-items: stretch !important;
    overflow: visible !important;
    gap: 10px !important;
  }

  .wo-toolbar .view-toggle { width: 100%; align-self: stretch; }

  .tabs {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-x !important;
    scrollbar-width: none;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .chips-scroll-outer > .tabs {
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
  }

  .tabs::-webkit-scrollbar { display: none; }

  .tabs .tab-btn { flex-shrink: 0; white-space: nowrap; }

  .filter-bar { flex-direction: column; align-items: stretch !important; }
  .filter-bar .form-control, .filter-bar .form-select { width: 100% !important; min-width: unset !important; }

  .grid-2, .grid-3, .grid-4,
  .dashboard-grid, .dashboard-grid-3,
  .detail-grid, .dept-grid, .asset-grid,
  .wo-card-grid { grid-template-columns: 1fr !important; }

  .page-header { flex-direction: column; align-items: flex-start !important; gap: 10px; }
  .page-header h2 { font-size: 1.2rem; }

  .welcome-banner { flex-direction: column; text-align: center; padding: 18px 14px; }

  .recent-tasks-table, .wo-table-desktop { display: none !important; }

  .kanban-board { flex-direction: column; }
  .kanban-column { min-width: 100% !important; max-width: 100% !important; }

  .room-grid { grid-template-columns: repeat(3, 1fr) !important; gap: 8px; }

  .chart-container { height: 220px; }

  .card-header { flex-wrap: wrap; gap: 8px; }
}

@media screen and (max-width: 480px) {
  .kpi-grid:not(.kpi-grid-scroll):not(.kpi-grid-5) { grid-template-columns: 1fr !important; }
  .room-grid { grid-template-columns: repeat(2, 1fr) !important; }
}

