*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --primary: #facc15;
  --primary-dark: #eab308;
  --bg-primary: #020204;
  --bg-secondary: #020617;
  --bg-tertiary: #0f172a;
  --border: rgba(55, 65, 81, 0.8);
  --text-primary: #f9fafb;
  --text-secondary: #e5e7eb;
  --text-muted: #9ca3af;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 18px 40px rgba(0, 0, 0, 0.75);
  --shadow-glow: 0 12px 30px rgba(250, 204, 21, 0.45);
  --radius: 0.75rem;
  --radius-lg: 1rem;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

body.dark-body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ==================== Navigation ==================== */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.98);
  border-bottom: 1px solid rgba(250, 204, 21, 0.18);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo {
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.85rem;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo img {
  height: 28px;
  width: auto;
  border-radius: 999px;
}

.mobile-menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  width: 44px;
  height: 44px;
  padding: 0;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: var(--transition);
}

.mobile-menu-toggle:hover {
  background: rgba(250, 204, 21, 0.1);
  border-color: var(--primary);
}

.mobile-menu-toggle svg {
  width: 24px;
  height: 24px;
}

.nav-center {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.nav-link {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: var(--transition);
  white-space: nowrap;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-link:hover {
  background: rgba(250, 204, 21, 0.16);
  color: #fefce8;
  transform: translateY(-1px);
}

.nav-link.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #050509;
  font-weight: 500;
  box-shadow: var(--shadow-glow);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.nav-user {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.nav-icon-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(15, 23, 42, 0.9);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
  padding: 0;
}

.nav-icon-btn:hover {
  background: rgba(250, 204, 21, 0.18);
  transform: translateY(-1px);
  border-color: var(--primary);
}

.nav-icon-btn.active {
  background: rgba(250, 204, 21, 0.16);
  color: #fefce8;
  border-color: rgba(250, 204, 21, 0.7);
}

/* Mobile Navigation */
.mobile-nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  z-index: 99;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-nav-overlay.open {
  display: block;
  opacity: 1;
}

.mobile-nav-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  max-width: 85vw;
  height: 100vh;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  padding: 1rem;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 100;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.mobile-nav-menu.open {
  transform: translateX(0);
}

.mobile-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.mobile-nav-close {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  width: 44px;
  height: 44px;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: var(--transition);
}

.mobile-nav-close:hover {
  background: rgba(250, 204, 21, 0.1);
  border-color: var(--primary);
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mobile-nav-link {
  padding: 0.875rem 1rem;
  border-radius: var(--radius);
  color: var(--text-secondary);
  transition: var(--transition);
  font-size: 0.95rem;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.mobile-nav-link:hover {
  background: rgba(250, 204, 21, 0.1);
  color: #fefce8;
}

.mobile-nav-link.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #050509;
  font-weight: 500;
}

.mobile-nav-user {
  margin-top: auto;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ==================== Main Container ==================== */
.main-container {
  max-width: 1200px;
  margin: 1.5rem auto 3rem;
  padding: 0 1rem;
}

.page-title {
  font-size: clamp(1.25rem, 4vw, 1.75rem);
  font-weight: 600;
  margin: 0 0 1.25rem;
  line-height: 1.2;
}

.section-title {
  font-size: clamp(0.95rem, 2.5vw, 1.1rem);
  font-weight: 500;
  margin: 0 0 0.75rem;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.page-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ==================== Cards ==================== */
.card {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  border-color: rgba(250, 204, 21, 0.3);
}

.card-title {
  margin: 0 0 1rem;
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  font-weight: 600;
}

/* ==================== Grid ==================== */
.grid {
  display: grid;
  gap: 1rem;
}

.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* ==================== Buttons ==================== */
.btn {
  border-radius: 999px;
  padding: 0.625rem 1.25rem;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: var(--transition);
  font-weight: 500;
  min-height: 44px;
  white-space: nowrap;
}

.btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.btn:active {
  transform: scale(0.98);
}

.primary-btn {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #050509;
  box-shadow: var(--shadow-glow);
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(250, 204, 21, 0.6);
}

.secondary-btn {
  background: rgba(15, 23, 42, 0.8);
  color: var(--text-secondary);
  border: 1px solid rgba(148, 163, 184, 0.4);
}

.secondary-btn:hover {
  background: rgba(250, 204, 21, 0.08);
  border-color: rgba(250, 204, 21, 0.4);
}

.full-width {
  width: 100%;
}

/* ==================== Stats ==================== */
.stat-card {
  padding: 1.25rem 1.5rem;
  text-align: center;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 600;
  color: var(--primary);
}

.owner-card {
  padding: 1.25rem 1.5rem;
}

.owner-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.owner-stat {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(55, 65, 81, 0.5);
}

.owner-stat:last-child {
  border-bottom: none;
}

.owner-stat .label {
  color: var(--text-muted);
}

.owner-stat .value {
  font-weight: 600;
  color: var(--text-primary);
}

.owner-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0.1rem 0.25rem 0.1rem 0;
  white-space: nowrap;
  flex-shrink: 0;
}

.owner-josh {
  background: rgba(250, 204, 21, 0.12);
  color: var(--primary);
  border: 1px solid rgba(250, 204, 21, 0.6);
}

.owner-ethan {
  background: rgba(52, 211, 153, 0.1);
  color: #6ee7b7;
  border: 1px solid rgba(52, 211, 153, 0.6);
}

.owner-gavin {
  background: rgba(251, 113, 133, 0.1);
  color: #fecaca;
  border: 1px solid rgba(251, 113, 133, 0.6);
}

.owner-consignment {
  background: rgba(250, 204, 21, 0.18);
  color: #fef3c7;
  border: 1px solid rgba(250, 204, 21, 0.7);
}

/* ==================== Forms ==================== */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.auth-card {
  max-width: 400px;
  width: 100%;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.grid-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.grid-form .form-group {
  min-width: 0;
}

.grid-form .full-width {
  grid-column: 1 / -1;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.form-group label {
  color: var(--text-muted);
  font-weight: 500;
}

input,
select,
textarea {
  background: rgba(15, 23, 42, 0.9);
  border-radius: var(--radius);
  border: 1px solid rgba(148, 163, 184, 0.5);
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  transition: var(--transition);
  min-height: 44px;
  width: 100%;
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  margin: 0 0.5rem 0 0;
  cursor: pointer;
  accent-color: var(--primary);
  flex-shrink: 0;
}

input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

textarea {
  min-height: 100px;
  resize: vertical;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-color: var(--primary);
  background: rgba(15, 23, 42, 1);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

.readonly-field {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  border: 1px dashed rgba(148, 163, 184, 0.6);
  background: rgba(15, 23, 42, 0.9);
  font-size: 0.95rem;
  color: var(--text-muted);
}

.form-actions {
  margin-top: 0.5rem;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ==================== Tables ==================== */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius);
}

.table-wrapper.small {
  max-height: 400px;
  overflow-y: auto;
}

.table-tabs {
  display: inline-flex;
  gap: 0.5rem;
  padding: 0.25rem;
  margin-bottom: 1rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--border);
  flex-wrap: wrap;
}

.table-tab {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.table-tab:hover {
  background: rgba(250, 204, 21, 0.12);
  color: #fefce8;
}

.table-tab.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #050509;
  font-weight: 500;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  table-layout: fixed;
}

.table th:nth-child(1),
.table td:nth-child(1) {
  width: 9%;
  min-width: 90px;
  max-width: 110px;
}

.table th:nth-child(2),
.table td:nth-child(2) {
  width: 18%;
  min-width: 140px;
}

.table th:nth-child(3),
.table td:nth-child(3),
.table th:nth-child(4),
.table td:nth-child(4) {
  width: 7%;
  min-width: 70px;
}

.table th:nth-child(5),
.table td:nth-child(5) {
  width: 12%;
  min-width: 120px;
}

.table th:nth-child(6),
.table td:nth-child(6) {
  width: 7%;
  min-width: 70px;
}

.table th:nth-child(7),
.table td:nth-child(7),
.table th:nth-child(8),
.table td:nth-child(8),
.table th:nth-child(9),
.table td:nth-child(9) {
  width: 7%;
  min-width: 80px;
}

.table th:nth-child(10),
.table td:nth-child(10) {
  width: 4%;
  min-width: 45px;
}

.table th:nth-child(11),
.table td:nth-child(11) {
  width: 5%;
  min-width: 60px;
}

.table th,
.table td {
  padding: 0.625rem 0.4rem;
  text-align: left;
  border-bottom: 1px solid rgba(31, 41, 55, 0.9);
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table td {
  white-space: normal;
  word-wrap: break-word;
}

.table td:nth-child(2) {
  white-space: normal;
  max-width: 0;
}

.table td:nth-child(5) {
  white-space: normal;
  line-height: 1.8;
}

.table th {
  position: sticky;
  top: 0;
  background: var(--bg-secondary);
  z-index: 1;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.75rem 0.4rem;
}

.table tr {
  transition: var(--transition);
  position: relative;
}

.table tbody tr:hover {
  background: rgba(17, 24, 39, 0.95);
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.table-action {
  font-size: 0.8rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: rgba(15, 23, 42, 0.95);
  color: var(--text-secondary);
  margin-right: 0.5rem;
  cursor: pointer;
  transition: var(--transition);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.table-action:hover {
  background: rgba(250, 204, 21, 0.14);
  transform: translateY(-1px);
}

.table-action.danger {
  border-color: rgba(248, 113, 113, 0.7);
  color: #fecaca;
}

.table th:last-child {
  text-align: left;
  padding-left: 0.75rem;
}

.table td:last-child {
  text-align: center;
  white-space: nowrap;
  width: auto;
  min-width: 60px;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.table td:last-child .table-icon-btn {
  margin-right: 0;
  margin-bottom: 0.25rem;
  margin-left: 0;
  display: block;
}

.table td:last-child .table-icon-btn:last-child {
  margin-bottom: 0;
}

.table td:last-child .inline-form {
  display: block;
  margin: 0 0 0.25rem 0;
}

.table td:last-child .inline-form:last-child {
  margin-bottom: 0;
}

.table-icon-btn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: rgba(15, 23, 42, 0.95);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  margin: 0 auto;
  cursor: pointer;
  transition: var(--transition);
  padding: 0;
  vertical-align: middle;
}

.table-icon-btn:hover {
  background: rgba(250, 204, 21, 0.14);
  transform: translateY(-1px);
  border-color: var(--primary);
}

.table-icon-btn.danger {
  border-color: rgba(248, 113, 113, 0.7);
  color: #fecaca;
}

.table-icon-btn.danger:hover {
  background: rgba(248, 113, 113, 0.2);
}

/* Mobile Card View for Tables */
.mobile-card-view {
  display: none;
}

.mobile-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

/* Low stock styling removed - no visual highlight */

.mobile-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.mobile-card-title {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-primary);
  margin: 0;
}

.mobile-card-actions {
  display: flex;
  gap: 0.5rem;
}

.mobile-card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(55, 65, 81, 0.5);
}

.mobile-card-row:last-child {
  border-bottom: none;
}

.mobile-card-label {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
}

.mobile-card-value {
  color: var(--text-primary);
  font-weight: 500;
  text-align: right;
  flex: 1;
  margin-left: 1rem;
}

/* ==================== Utilities ==================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.inline-form {
  display: inline;
}

.empty-cell {
  text-align: center;
  padding: 2rem 0.5rem;
  color: var(--text-muted);
  font-style: italic;
}

.consignment-fee {
  color: var(--primary);
  font-weight: 600;
}

/* Low stock styling removed - no visual highlight */

/* ==================== Flash Messages ==================== */
.flash-container {
  margin-bottom: 1.5rem;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.flash {
  padding: 0.875rem 1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: slideDown 0.3s ease;
}

.flash-success {
  background: rgba(22, 163, 74, 0.16);
  border-color: rgba(22, 163, 74, 0.5);
  color: #86efac;
}

.flash-error {
  background: rgba(220, 38, 38, 0.18);
  border-color: rgba(220, 38, 38, 0.6);
  color: #fca5a5;
}

.flash-info {
  background: rgba(59, 130, 246, 0.18);
  border-color: rgba(59, 130, 246, 0.6);
  color: #93c5fd;
}

/* ==================== Modal ==================== */
.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal.open {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-content {
  position: relative;
  z-index: 1001;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  border: 1px solid var(--border);
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-lg);
  overflow-y: auto;
}

.modal-content img {
  max-width: 85vw;
  max-height: 75vh;
  border-radius: var(--radius);
  background: #fff;
  padding: 0.5rem;
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.9);
  color: var(--text-secondary);
  border-radius: 999px;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
  transition: var(--transition);
  padding: 0;
}

.modal-close:hover {
  background: rgba(250, 204, 21, 0.1);
  border-color: var(--primary);
  color: var(--primary);
}

.modal-actions {
  margin-top: 0.5rem;
  display: flex;
  gap: 0.75rem;
}

.thumb-image {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 0.5rem;
  object-fit: cover;
  margin-right: 0.5rem;
  vertical-align: middle;
  cursor: pointer;
  transition: var(--transition);
  border: 2px solid var(--border);
}

.thumb-image:hover {
  transform: scale(1.1);
  border-color: var(--primary);
}

.qr-thumb {
  height: 60px;
  min-height: 60px;
  background: #fff;
  padding: 4px;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: var(--transition);
  border: 2px solid var(--border);
}

.qr-thumb:hover {
  transform: scale(1.05);
  border-color: var(--primary);
}

/* ==================== Responsive Design ==================== */
@media (max-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  
  .main-container {
    max-width: 100%;
    padding: 0 1rem;
  }
}

@media (max-width: 768px) {
  .top-nav {
    padding: 0.75rem 1rem;
    flex-wrap: wrap;
  }

  .mobile-menu-toggle {
    display: flex;
  }

  .nav-center {
    display: none;
  }

  .nav-right {
    margin-left: auto;
  }

  .nav-user {
    display: none;
  }

  .main-container {
    margin: 1rem auto 2rem;
    padding: 0 0.75rem;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .page-actions {
    width: 100%;
  }

  .page-actions .btn {
    flex: 1;
    min-width: 0;
  }

  .card {
    padding: 1rem 1.25rem;
  }

  .grid-4,
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .grid-form {
    grid-template-columns: 1fr;
  }

  .table-wrapper {
    margin: 0 -0.75rem;
    border-radius: 0;
  }

  .table {
    display: none;
  }

  .mobile-card-view {
    display: block;
  }

  .stat-card {
    padding: 1rem 1.25rem;
  }

  .stat-value {
    font-size: 1.5rem;
  }

  .btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
  }

  input,
  select,
  textarea {
    padding: 0.875rem 1rem;
    font-size: 1rem;
  }

  .table-tabs {
    width: 100%;
    justify-content: center;
  }

  .table-tab {
    flex: 1;
    min-width: 0;
  }
}

@media (max-width: 480px) {
  .main-container {
    padding: 0 0.5rem;
  }

  .card {
    padding: 1rem;
    border-radius: var(--radius);
  }

  .page-title {
    font-size: 1.25rem;
  }

  .section-title {
    font-size: 1rem;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

  .page-actions {
    flex-direction: column;
  }

  .page-actions .btn {
    width: 100%;
  }

  .mobile-nav-menu {
    width: 100%;
    max-width: 100%;
  }
}

/* ==================== Animations ==================== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card {
  animation: fadeIn 0.3s ease;
}

/* ==================== Scrollbar Styling ==================== */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.5);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(250, 204, 21, 0.5);
}

/* ==================== Print Styles ==================== */
@media print {
  .top-nav,
  .page-actions,
  .btn,
  .table-icon-btn {
    display: none !important;
  }

  .main-container {
    max-width: 100%;
    margin: 0;
    padding: 0;
  }

  .card {
    box-shadow: none;
    border: 1px solid #ccc;
  }
}
