:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;
  --primary-border: #c7d2fe;
  --success: #10b981;
  --success-light: #d1fae5;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --info: #0284c7;
  --info-light: #e0f2fe;
  --bg-body: #f8fafc;
  --bg-sidebar: #0f172a;
  --bg-card: #ffffff;
  --border-color: #e2e8f0;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --sidebar-width: 260px;
  --header-height: 68px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-drawer: 4px 0 24px 0 rgba(0, 0, 0, 0.25);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

/* ------------------------------------------------------------- */
/* Sidebar Navigation */
/* ------------------------------------------------------------- */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  color: #f8fafc;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 1000;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: #ffffff;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.025em;
}

.brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary) 0%, #818cf8 100%);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.4);
}

.close-sidebar-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-light);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  line-height: 1;
  border-radius: var(--radius-sm);
}

.close-sidebar-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 0.75rem;
}

.nav-group-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-light);
  margin-bottom: 0.5rem;
  padding: 0 0.75rem;
  font-weight: 600;
}

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 1.5rem;
}

.nav-item a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  color: var(--text-light);
  text-decoration: none;
  font-size: 0.925rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  cursor: pointer;
}

.nav-item a:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.nav-item.active a {
  color: #ffffff;
  background: var(--primary);
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.35);
}

.nav-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.nav-badge {
  margin-left: auto;
  font-size: 0.72rem;
  padding: 0.15rem 0.5rem;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  color: #ffffff;
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #334155;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
  color: #f8fafc;
}

.user-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.user-name {
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.user-role {
  font-size: 0.75rem;
  color: var(--text-light);
}

/* ------------------------------------------------------------- */
/* Drawer Backdrop (for mobile) */
/* ------------------------------------------------------------- */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.drawer-backdrop.is-active,
.drawer-backdrop.visible,
.drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

/* ------------------------------------------------------------- */
/* Main Wrapper */
/* ------------------------------------------------------------- */
.main-wrapper {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-width: 0;
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ------------------------------------------------------------- */
/* Top Header */
/* ------------------------------------------------------------- */
.topbar {
  height: var(--header-height);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

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

/* Hamburger Menu Button */
.hamburger-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  width: 44px;
  height: 44px;
  cursor: pointer;
  padding: 10px 8px;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
  transition: var(--transition);
  touch-action: manipulation;
}

.hamburger-btn:hover {
  background-color: var(--bg-body);
  border-color: var(--text-light);
}

.hamburger-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.hamburger-line {
  width: 22px;
  height: 2.5px;
  background-color: var(--text-main);
  border-radius: 4px;
  transition: transform 0.3s ease, opacity 0.2s ease, width 0.3s ease;
  transform-origin: center;
}

.hamburger-btn.is-active .hamburger-line:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}

.hamburger-btn.is-active .hamburger-line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.hamburger-btn.is-active .hamburger-line:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

.page-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

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

.status-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-body);
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  border: 1px solid var(--border-color);
}

.status-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* ------------------------------------------------------------- */
/* Views Switching & Page Content */
/* ------------------------------------------------------------- */
.content {
  padding: 1.5rem;
  position: relative;
}

.view-panel {
  display: none;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
}

.view-panel.is-active {
  display: flex;
  animation: viewFadeIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Stats Cards Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

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

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

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.stat-icon.blue { background: #e0e7ff; color: #4338ca; }
.stat-icon.green { background: #dcfce7; color: #15803d; }
.stat-icon.amber { background: #fef3c7; color: #b45309; }
.stat-icon.purple { background: #f3e8ff; color: #7e22ce; }

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

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

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.03em;
  margin-top: 0.15rem;
}

/* Quick Actions Grid */
.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.quick-action-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  color: var(--text-main);
}

.quick-action-card:hover {
  border-color: var(--primary);
  background-color: var(--primary-light);
  transform: translateY(-2px);
}

.quick-action-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.quick-action-info strong {
  display: block;
  font-size: 0.9rem;
}

.quick-action-info span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Actions & Filter Section */
.actions-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--bg-card);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.filter-pills {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 2px;
}

.filter-pill {
  padding: 0.4rem 0.85rem;
  font-size: 0.825rem;
  font-weight: 500;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  background: var(--bg-body);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.filter-pill.active,
.filter-pill:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-body);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.85rem;
  min-width: 260px;
  flex: 1;
  max-width: 400px;
}

.search-box input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.9rem;
  width: 100%;
  color: var(--text-main);
}

.search-box input::placeholder {
  color: var(--text-light);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  touch-action: manipulation;
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.25);
}

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

.btn-secondary {
  background-color: var(--bg-body);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background-color: #e2e8f0;
}

/* Dropdown / Pulldown Menus */
.dropdown {
  position: relative;
  display: inline-flex;
}

.dropdown-toggle {
  user-select: none;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  min-width: 175px;
  z-index: 150;
  display: none;
  flex-direction: column;
  padding: 0.4rem 0;
  animation: tabFadeIn 0.15s ease-out;
}

.dropdown.open .dropdown-menu {
  display: flex;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-main);
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
}

.dropdown-item:hover {
  background-color: #f1f5f9;
  color: var(--primary);
}

.dropdown-item span {
  font-size: 1rem;
}

/* Data Table Card */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

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

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

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

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

th {
  background: #f8fafc;
  color: var(--text-muted);
  font-weight: 600;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background-color: #f8fafc;
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
  text-transform: uppercase;
}

.badge-info { background: var(--info-light); color: var(--info); }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-danger { background: var(--danger-light); color: var(--danger); }

.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  color: var(--text-light);
}

/* Table Action Buttons & Price Stack */
.actions-cell {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
}

.btn-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  transition: var(--transition);
  color: var(--text-muted);
}

.btn-icon:hover {
  background: #f1f5f9;
}

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

.btn-icon.delete:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: var(--danger-light);
}

.price-stack {
  display: flex;
  flex-direction: column;
}

td[style*="text-align: right"] .price-stack,
.price-stack.text-right {
  align-items: flex-end;
  text-align: right;
}

.price-stack .sale-price {
  font-weight: 700;
  color: var(--text-main);
  font-size: 0.95rem;
}

.price-stack .cost-price {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Form Styles */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  padding: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
  width: 100%;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--text-main);
  background: var(--bg-card);
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.is-active,
.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  margin: auto;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 500px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transform: translateY(12px) scale(0.98);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.modal-card.modal-lg {
  max-width: 860px;
  max-height: calc(100vh - 3rem);
  height: auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.modal-card.modal-lg form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  width: 100%;
}

.modal-overlay.is-active .modal-card,
.modal-overlay.active .modal-card {
  transform: translateY(0) scale(1);
}

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

.modal-header-info {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.modal-badge-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  background: #e0e7ff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.modal-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 1.4rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  border-radius: var(--radius-sm);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s, color 0.2s;
  flex-shrink: 0;
  margin-left: 0.5rem;
}

.modal-close:hover {
  background: #f1f5f9;
  color: var(--danger);
}

/* Modal Tabs Navigation */
.modal-tabs {
  display: flex;
  gap: 0.35rem;
  padding: 0.6rem 1.5rem 0;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
  scrollbar-width: thin;
  flex-shrink: 0;
}

.modal-tabs::-webkit-scrollbar {
  height: 4px;
}

.modal-tabs::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

.modal-tab-btn {
  background: none;
  border: none;
  padding: 0.65rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 2px solid transparent;
  border-radius: 6px 6px 0 0;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.modal-tab-btn:hover {
  color: var(--primary);
  background: rgba(79, 70, 229, 0.05);
}

.modal-tab-btn.active {
  color: var(--primary);
  border-bottom: 2px solid var(--primary);
  background: var(--bg-card);
  font-weight: 700;
}

.modal-tab-btn .tab-icon {
  font-size: 1rem;
}

/* Modal Content & Tab Panes */
.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
}

.modal-tab-pane {
  display: none;
  width: 100%;
  min-height: 0;
}

.modal-tab-pane.active {
  display: block;
  animation: tabFadeIn 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Modal Form Grids */
.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.15rem 1.25rem;
  width: 100%;
}

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

.input-with-button {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
  min-width: 0;
  width: 100%;
}

.input-with-button input {
  flex: 1 1 0%;
  min-width: 0;
}

.btn-sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.8rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.required-star {
  color: var(--danger);
  font-weight: 700;
  margin-left: 2px;
}

.input-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
  line-height: 1.3;
}

.pulse-highlight {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.25) !important;
  transition: all 0.3s ease;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-shrink: 0;
}

.modal-footer-left {
  display: flex;
  align-items: center;
}

.modal-footer-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ------------------------------------------------------------- */
/* Responsive Breakpoints - Mobile View (< 768px) */
/* ------------------------------------------------------------- */
@media (max-width: 768px) {
  .hamburger-btn {
    display: flex;
  }

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

  .sidebar {
    transform: translateX(-100%);
    box-shadow: var(--shadow-drawer);
    width: 280px;
  }

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

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

  .topbar {
    padding: 0 1rem;
  }

  .content {
    padding: 1rem;
  }

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

  .quick-actions-grid {
    grid-template-columns: 1fr;
  }

  .actions-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .search-box {
    max-width: 100%;
  }

  .btn {
    justify-content: center;
    width: 100%;
  }

  .settings-grid {
    grid-template-columns: 1fr;
    padding: 1rem;
  }

  .modal-card.modal-lg {
    max-height: 94vh;
    margin: 0.5rem;
  }

  .form-grid-2 {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.85rem;
  }

  .modal-tabs {
    padding: 0.5rem 0.75rem 0;
  }

  .modal-tab-btn {
    padding: 0.5rem 0.65rem;
    font-size: 0.78rem;
  }

  .modal-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .modal-footer-left {
    text-align: center;
    justify-content: center;
  }

  .modal-footer-right {
    display: flex;
    flex-direction: column-reverse;
    width: 100%;
    gap: 0.5rem;
  }

  .modal-footer-right .btn {
    width: 100%;
  }
}

/* Alert & Validation Utilities */
.alert {
  padding: 0.85rem 1.15rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 0.88rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: fadeIn 0.2s ease-in-out;
}

.alert-danger {
  background-color: var(--danger-light);
  color: #991b1b;
  border: 1px solid #fca5a5;
}

.alert-success {
  background-color: var(--success-light);
  color: #065f46;
  border: 1px solid #6ee7b7;
}

.text-danger {
  color: var(--danger) !important;
}

.text-success {
  color: var(--success) !important;
}

.btn-sm {
  padding: 0.4rem 0.65rem;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

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

/* Product Images & Gallery Styles */
.image-card {
  position: relative;
  border: 1.5px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-card);
  transition: all 0.2s ease;
}

.image-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.image-card.is-onyuz {
  border-color: var(--success);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
}

.image-card img {
  transition: transform 0.25s ease;
}

.image-card:hover img {
  transform: scale(1.05);
}

.product-row-thumb {
  width: 38px;
  height: 38px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  flex-shrink: 0;
  background: var(--bg-body);
}

.product-row-thumb-placeholder {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  background: var(--bg-body);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  border: 1px dashed var(--border-color);
  flex-shrink: 0;
  user-select: none;
}


