/* Target Path: style.css */
/* 🌌 PRESTIGE DESIGN SYSTEM - BILLNOTE ENTERPRISE DASHBOARD */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Sarabun:wght@300;400;500;600;700&display=swap');

:root {
  /* HSL Dynamic Primary Color */
  --primary-h: 210;
  --primary-s: 70%;
  --primary-l: 56%;
  
  --primary: hsl(var(--primary-h), var(--primary-s), var(--primary-l));
  --primary-hover: hsl(var(--primary-h), var(--primary-s), 46%);
  --primary-light: hsl(var(--primary-h), var(--primary-s), 94%);
  --primary-glow: hsla(var(--primary-h), var(--primary-s), var(--primary-l), 0.25);
  
  --success: #10b981;
  --success-light: #ecfdf5;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  
  /* Light Mode Colors */
  --bg-app: #f4f7f9;
  --bg-card: #ffffff;
  --bg-sidebar: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --border-subtle: rgba(226, 232, 240, 0.8);
  
  /* Typography */
  --font-family: 'Outfit', 'Sarabun', system-ui, -apple-system, sans-serif;
  --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  
  /* Motion Tokens */
  --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --transition: all var(--duration-normal) var(--ease-smooth);
  
  /* Layered Shadows */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 15px -3px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
  --shadow-glow: 0 0 20px -4px var(--primary-glow);
}

/* 🌙 Dark Mode Tokens */
[data-theme="dark"] {
  --bg-app: #090d14;
  --bg-card: #131b28;
  --bg-sidebar: #131b28;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --border: #1e293b;
  --border-subtle: rgba(255, 255, 255, 0.06);
  --primary-light: hsl(var(--primary-h), var(--primary-s), 20%);
  --primary-glow: hsla(var(--primary-h), var(--primary-s), 60%, 0.3);
  --danger-light: #451a1a;
  --success-light: #064e3b;
  --warning-light: #451a03;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.55);
}

/* 🎨 Accent Theme Palettes */
:root[data-theme-color="mint"] { --primary-h: 155; --primary-s: 55%; --primary-l: 44%; }
:root[data-theme-color="lavender"] { --primary-h: 265; --primary-s: 65%; --primary-l: 62%; }

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-app);
  color: var(--text-main);
  transition: background-color 0.3s var(--ease-smooth), color 0.3s var(--ease-smooth);
  display: flex;
  height: 100vh;
  overflow: hidden;
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
}

button:focus:not(:focus-visible),
input:focus:not(:focus-visible),
select:focus:not(:focus-visible),
textarea:focus:not(:focus-visible) {
  outline: none !important;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ------------------ PC Layout: Sidebar ------------------ */
.sidebar {
  width: 260px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 24px;
  transition: 0.3s var(--ease-smooth);
  z-index: 50;
  flex-shrink: 0;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 36px;
  letter-spacing: -0.02em;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius-md);
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  background: transparent;
  text-align: left;
  font-size: 0.95rem;
  font-family: inherit;
}

.nav-item i {
  font-size: 1.25rem;
  width: 24px;
  text-align: center;
}

.nav-item:hover {
  background: var(--bg-app);
  color: var(--primary);
  transform: translateX(4px);
}

.nav-item.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 12px rgba(var(--primary-h), 50%, 50%, 0.25);
  transform: none;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ------------------ Main Content Layout ------------------ */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

header {
  height: 76px;
  padding: 0 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  z-index: 40;
  flex-shrink: 0;
}

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

.mobile-menu-btn {
  display: none;
  background: transparent;
  border: none;
  font-size: 1.3rem;
  color: var(--text-main);
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
}

.header-title {
  font-size: 1.25rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
  letter-spacing: -0.01em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-profile-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-app);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 20px;
  color: var(--text-main);
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.9rem;
}

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

.theme-picker {
  display: flex;
  gap: 6px;
  background: var(--bg-app);
  padding: 5px;
  border-radius: 20px;
  border: 1px solid var(--border);
}

.color-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: 0.2s var(--ease-spring);
}

.color-dot.blue { background: hsl(210, 70%, 60%); }
.color-dot.mint { background: hsl(155, 55%, 44%); }
.color-dot.lavender { background: hsl(265, 65%, 62%); }
.color-dot:hover, .color-dot.active { transform: scale(1.2); border-color: var(--text-main); }

.icon-btn {
  background: var(--bg-app);
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  font-size: 1.05rem;
  position: relative;
}

.icon-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
  transform: translateY(-2px);
}

.icon-btn.active {
  color: var(--primary);
  border-color: var(--primary);
}

.sound-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  background: var(--primary);
  color: white;
  font-size: 0.55rem;
  font-weight: bold;
  padding: 2px 4px;
  border-radius: 8px;
  display: none;
}

.icon-btn.active .sound-badge {
  display: block;
}

.divider-v {
  width: 1px;
  height: 24px;
  background: var(--border);
  margin: 0 4px;
}

/* ------------------ Tab Views ------------------ */
.tab-view {
  display: none;
  flex: 1;
  overflow-y: auto;
  padding: 32px;
}

.tab-view.active {
  display: block;
  animation: fadeIn 0.3s var(--ease-smooth);
}

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

/* ------------------ Dashboard UI ------------------ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
}

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.stat-info h4 {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 4px;
}

.stat-info h2 {
  font-size: 1.6rem;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.filter-section {
  background: var(--bg-card);
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.filter-row-1 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.date-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-app);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.date-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.date-input {
  border: none;
  background: transparent;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
}

.day-nav {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 2px 6px;
  border-radius: 6px;
  transition: 0.2s;
}

.day-nav:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.reset-date {
  font-size: 0.85rem;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-card);
  cursor: pointer;
  transition: 0.2s;
  font-weight: 500;
}

.reset-date:hover {
  border-color: var(--danger);
  color: var(--danger);
}

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

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

.search-box input {
  width: 100%;
  padding: 10px 16px 10px 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-app);
  color: var(--text-main);
  font-family: inherit;
  transition: 0.2s;
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.filter-row-2 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.branch-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-app);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: var(--transition);
}

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

.chip.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 4px 10px rgba(var(--primary-h), 50%, 50%, 0.3);
}

/* Status Filter Group */
.status-filter-group {
  display: flex;
  background: var(--bg-app);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px;
  gap: 4px;
}

.status-chip {
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text-muted);
  transition: 0.2s;
  font-family: inherit;
}

.status-chip.active-live {
  background: var(--success);
  color: white;
}

.status-chip.active-cancelled {
  background: var(--danger);
  color: white;
}

/* ------------------ Data Grid & Note Cards ------------------ */
.data-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  padding-bottom: 40px;
}

.note-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  animation: fadeIn 0.3s var(--ease-smooth);
  display: flex;
  flex-direction: column;
}

.note-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--primary);
  opacity: 0;
  transition: 0.3s;
}

.note-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
}

.note-card:hover::before {
  opacity: 1;
}

.note-card.is-cancelled {
  opacity: 0.65;
  border-color: var(--border);
  background: var(--bg-app);
}

.note-card.is-cancelled::before {
  background: var(--danger);
  opacity: 1;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.shop-name {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text-main);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
  margin-right: 10px;
}

.room-badge {
  font-size: 0.75rem;
  padding: 4px 10px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

.room-badge.cancelled {
  background: var(--danger-light);
  color: var(--danger);
}

.card-body {
  flex: 1;
}

.card-body p {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: pre-wrap;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px dashed var(--border);
  padding-top: 14px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.card-footer-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.comment-badge {
  background: var(--primary-light);
  color: var(--primary);
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.comment-img-badge {
  background: var(--bg-app);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 3rem;
  opacity: 0.4;
  margin-bottom: 12px;
}

/* ------------------ Forms ------------------ */
.form-layout {
  background: var(--bg-card);
  padding: 32px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  max-width: 800px;
  margin: 0 auto;
  box-shadow: var(--shadow-sm);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group.full {
  grid-column: 1 / -1;
}

.form-group label {
  font-weight: 500;
  font-size: 0.95rem;
}

.req {
  color: var(--danger);
  font-size: 0.8rem;
  font-weight: normal;
  margin-left: 4px;
}

.form-control {
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-app);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.95rem;
  transition: 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px var(--primary-light);
}

textarea.form-control {
  resize: none;
  min-height: 140px;
  line-height: 1.6;
}

.upload-box {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
  color: var(--text-muted);
  cursor: pointer;
  background: var(--bg-app);
  transition: 0.3s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
}

.upload-box i {
  font-size: 2.2rem;
  color: var(--primary);
  opacity: 0.7;
}

.upload-box:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.upload-box:hover i {
  opacity: 1;
  transform: scale(1.08);
}

.upload-indicator {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--success);
  color: white;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: bold;
  display: none;
}

.upload-box.has-file .upload-indicator {
  display: block;
}

.upload-box.drag-over {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: scale(1.01);
  box-shadow: 0 0 0 4px var(--primary-light);
}

.thumbnail-preview-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.thumb-item {
  width: 70px;
  height: 70px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  object-fit: cover;
  position: relative;
}

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 12px rgba(var(--primary-h), 50%, 50%, 0.25);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(var(--primary-h), 50%, 50%, 0.35);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover:not(:disabled) {
  opacity: 0.9;
  transform: translateY(-2px);
}

.btn:disabled {
  background: var(--text-muted) !important;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
  opacity: 0.65;
}

/* ------------------ Detail Modal ------------------ */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  transition: opacity 0.3s var(--ease-smooth);
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
}

.modal-content {
  background: var(--bg-app);
  width: 95%;
  max-width: 1050px;
  height: 88vh;
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(20px);
  transition: 0.3s var(--ease-smooth);
  box-shadow: var(--shadow-lg);
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

.modal-header {
  padding: 20px 32px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.modal-body {
  padding: 28px 32px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  gap: 28px;
}

.modal-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.main-image-viewer {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 380px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
}

.main-image-viewer img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: 0.3s;
}

.main-image-viewer:hover img {
  transform: scale(1.02);
}

.image-gallery-nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.image-thumb-btn {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
  background: var(--bg-card);
}

.image-thumb-btn.active {
  border-color: var(--primary);
}

.image-thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-right {
  flex: 1.2;
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-height: 100%;
  overflow-y: auto;
  padding-right: 8px;
}

.modal-right::-webkit-scrollbar {
  width: 6px;
}

.modal-right::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 10px;
}

.comment-history {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.reply-bubble {
  background: var(--bg-card);
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  text-align: left;
  position: relative;
}

.reply-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.reply-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.reply-text {
  font-size: 0.95rem;
  line-height: 1.6;
  white-space: pre-wrap;
}

.reply-images {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.reply-images img {
  width: 90px;
  height: 120px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: 0.2s;
}

.reply-images img:hover {
  transform: scale(1.04);
}

.modal-footer {
  padding: 18px 32px;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  display: flex;
  gap: 14px;
  align-items: center;
  flex-shrink: 0;
}

.modal-footer .form-control {
  flex: 1;
  border-radius: 20px;
  padding: 12px 20px;
}

.btn-attach {
  background: var(--bg-app);
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  font-size: 1.15rem;
  position: relative;
  flex-shrink: 0;
}

.btn-attach:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary-light);
  transform: translateY(-2px);
}

.btn-attach.has-file {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

.btn-attach .attach-indicator {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--danger);
  color: white;
  font-size: 0.65rem;
  font-weight: bold;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-card);
}

.btn-attach.has-file .attach-indicator {
  display: flex;
}

/* ------------------ Settings Tab (Admin Permissions & Rooms) ------------------ */
.settings-subtabs {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.subtab-btn {
  padding: 8px 18px;
  border-radius: var(--radius-md);
  border: none;
  background: var(--bg-app);
  color: var(--text-muted);
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
}

.subtab-btn.active {
  background: var(--primary);
  color: white;
}

.table-responsive {
  overflow-x: auto;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

table.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

table.admin-table th, table.admin-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

table.admin-table th {
  background: var(--bg-app);
  color: var(--text-muted);
  font-weight: 600;
}

.toggle-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* ------------------ Image Lightbox Zoom Modal ------------------ */
.lightbox-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  cursor: zoom-out;
}

.lightbox-modal.active {
  display: flex;
}

.lightbox-modal img {
  max-width: 92%;
  max-height: 92vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  animation: zoomIn 0.25s var(--ease-spring);
}

@keyframes zoomIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ------------------ Responsive Mobile Support ------------------ */
@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    bottom: 0;
    width: 260px;
    box-shadow: var(--shadow-lg);
    transition: left 0.3s var(--ease-smooth);
  }

  .sidebar.mobile-open {
    left: 0;
  }

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

  header {
    padding: 0 16px;
  }

  .tab-view {
    padding: 16px;
  }

  .search-box {
    width: 100%;
  }

  .modal-body {
    flex-direction: column;
  }

  .modal-content {
    height: 95vh;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }
}
