/* ================================================================
   MornLabs - 3D Model Download Site
   Theme: #2574B9 (Classic Blue)
   ================================================================ */

/* ========== CSS Variables ========== */
:root {
  --primary: #2574B9;
  --primary-dark: #1a5d93;
  --primary-light: #3a8ecc;
  --primary-bg: #e8f1fa;
  --dark: #1a2740;
  --text: #1a2740;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --border: #e5e7eb;
  --border-light: #f3f4f6;
  --bg-page: #f5f7fa;
  --bg-white: #ffffff;
  --bg-hover: #f9fafb;
  --success: #10b981;
  --success-bg: #ecfdf5;
  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --info: #3b82f6;
  --info-bg: #eff6ff;
  --purple: #8b5cf6;
  --purple-bg: #f5f3ff;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --transition: 0.2s ease;
  --transition-slow: 0.3s ease;
  --navbar-height: 56px;
  --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial,
    sans-serif;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-stack);
  color: var(--text);
  background: var(--bg-page);
  line-height: 1.6;
  min-height: 100vh;
}

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

a:hover {
  color: var(--primary-dark);
}

img {
  max-width: 100%;
  display: block;
}

ul,
ol {
  list-style: none;
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  outline: none;
}

/* ========== 1. Navbar ========== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--navbar-height);
  background: var(--bg-white);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  transition: box-shadow var(--transition);
}

.navbar.scrolled {
  box-shadow: var(--shadow-sm);
}

/* Logo */
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  color: var(--dark);
  text-decoration: none;
  flex-shrink: 0;
}

.nav-logo:hover {
  color: var(--dark);
}

.nav-logo svg,
.nav-logo .logo-icon {
  width: 28px;
  height: 28px;
  color: var(--primary);
}

/* Center Navigation */
.nav-center {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-item {
  position: relative;
}

.nav-item > a,
.nav-item > button {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  border: none;
  background: none;
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: all var(--transition);
  white-space: nowrap;
}

.nav-item > a:hover,
.nav-item > button:hover {
  color: var(--primary);
  background: var(--primary-bg);
}

.nav-item > a .chevron,
.nav-item > button .chevron {
  width: 14px;
  height: 14px;
  opacity: 0.5;
  transition: transform var(--transition);
}

.nav-item:hover > a .chevron,
.nav-item:hover > button .chevron {
  transform: rotate(180deg);
}

/* Right Actions */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Search Icon Button */
.nav-search-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
}

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

/* Login Button (icon style) */
.nav-login-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
}

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

/* Register Button */
.nav-register-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--bg-white);
  background: var(--primary);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.nav-register-btn:hover {
  background: var(--primary-dark);
  color: var(--bg-white);
}

/* ========== HTML Class Aliases ========== */
/* Navbar container flex */
.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

/* .nav-links = .nav-center */
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* .cat-dropdown wrapper = .nav-item */
.nav-links > .cat-dropdown {
  position: relative;
}

/* .cat-dropdown-trigger = .nav-item > button */
.cat-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  border: none;
  background: none;
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: all var(--transition);
  white-space: nowrap;
}

.cat-dropdown-trigger:hover {
  color: var(--primary);
  background: var(--primary-bg);
}

/* .nav-link-item = .nav-item > a */
.nav-link-item {
  display: flex;
  align-items: center;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: all var(--transition);
  white-space: nowrap;
}

.nav-link-item:hover {
  color: var(--primary);
  background: var(--primary-bg);
}

/* .nav-icon-btn = .nav-search-btn / .nav-login-btn */
.nav-icon-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
}

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

/* Dropdown menu panel */
.cat-dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  min-width: 180px;
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all var(--transition);
  z-index: 101;
}

.nav-links > .cat-dropdown:hover .cat-dropdown-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.cat-dropdown-menu a {
  display: block;
  padding: 6px 10px;
  font-size: 13px;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all var(--transition);
}

.cat-dropdown-menu a:hover {
  color: var(--primary);
  background: var(--primary-bg);
}

/* Hamburger (mobile) */
.nav-hamburger {
  display: none;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text);
}

/* ========== 3. Login Modal ========== */
.login-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-slow);
}

.login-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.login-modal,
.login-modal-card {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: var(--bg-white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 32px;
  transform: scale(0.95) translateY(10px);
  transition: transform var(--transition-slow);
}

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

.login-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: var(--border-light);
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-muted);
  transition: all var(--transition);
}

.login-modal-close:hover {
  background: var(--border);
  color: var(--text);
}

.login-modal-header {
  text-align: center;
  margin-bottom: 24px;
}

.login-modal-header h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 4px;
}

.login-modal-header p {
  font-size: 13px;
  color: var(--text-muted);
}

.login-modal-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-modal-footer {
  margin-top: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

.login-modal-footer a {
  font-weight: 600;
}

/* Login Modal - alias styles for index.html classes */
.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  font-size: 13px;
  color: var(--text-muted);
}

.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-light);
}

.login-footer-text {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 16px;
}

.login-footer-text a {
  font-weight: 600;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

.form-link {
  font-size: 13px;
  color: var(--primary);
  text-decoration: none;
}

.form-link:hover {
  text-decoration: underline;
}

/* Social Login */
.social-login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 6px 0;
  font-size: 12px;
  color: var(--text-muted);
}

.social-login-divider::before,
.social-login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-light);
}

.social-login-btns {
  display: flex;
  gap: 10px;
}

.social-login-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-white);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.social-login-btn:hover {
  background: var(--bg-hover);
  border-color: var(--text-muted);
}

/* ========== 4. User Dropdown ========== */

/* Alias: .user-dropdown = .user-dropdown-wrap (used by index.html) */
.user-dropdown,
.user-dropdown-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-md);
  transition: background var(--transition);
}

.user-dropdown:hover,
.user-dropdown-wrap:hover {
  background: var(--border-light);
}

/* Alias: .user-dropdown-trigger = trigger button inside .user-dropdown */
.user-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.user-dropdown-trigger svg {
  transition: transform var(--transition);
}

.user-dropdown-trigger.open svg,
.user-dropdown.open .user-dropdown-trigger svg {
  transform: rotate(180deg);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}

.user-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

/* Alias: .user-dropdown-menu = .user-menu (used by index.html) */
.user-dropdown-menu,
.user-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 160px;
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(6px);
  transition: all var(--transition-slow);
  z-index: 110;
}

/* Show on hover for .user-dropdown-wrap */
.user-dropdown-wrap:hover > .user-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

/* Show on .active class for .user-dropdown (click-based) */
.user-dropdown .user-dropdown-menu.active,
.user-dropdown.open .user-dropdown-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.user-dropdown-menu a,
.user-menu a,
.user-dropdown-menu button,
.user-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-secondary);
  border: none;
  background: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
}

.user-menu a:hover,
.user-menu button:hover {
  background: var(--primary-bg);
  color: var(--primary);
  text-decoration: none;
}

.user-menu .menu-divider {
  height: 1px;
  background: var(--border-light);
  margin: 4px 0;
}

.user-menu .logout-item {
  color: var(--danger);
}

.user-menu .logout-item:hover {
  background: var(--danger-bg);
  color: var(--danger);
}

/* ========== 5. Banner / Hero ========== */
.hero {
  width: 100%;
  height: 400px;
  margin-top: var(--navbar-height);
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 24px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(255, 255, 255, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 30%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 640px;
}

.hero h1 {
  font-size: 36px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  margin-bottom: 12px;
}

.hero .hero-subtitle {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 24px;
}

.hero .hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
  background: #fff;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.hero .hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
  color: var(--primary-dark);
}

/* Hero Stats Row */
.hero-stats {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 40px;
  margin-top: 36px;
}

.hero-stat {
  text-align: center;
}

.hero-stat .stat-number {
  font-size: 28px;
  font-weight: 700;
  color: #fff;
}

.hero-stat .stat-label {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 2px;
}

/* Banner aliases (HTML uses .banner, CSS uses .hero) */
.banner {
  width: 100%;
  height: 400px;
  margin-top: var(--navbar-height);
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 24px;
  position: relative;
  overflow: hidden;
}

.banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(255, 255, 255, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 30%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
}

.banner h1 {
  font-size: 36px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  margin-bottom: 12px;
}

.banner-subtitle {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 24px;
}

.banner-stats {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 40px;
  margin-top: 36px;
}

.banner-stat {
  text-align: center;
}

.banner-stat strong {
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  display: block;
}

.banner-stat span {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 2px;
  display: block;
}

/* ========== 6. Model Card Grid ========== */
.model-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.model-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
}

.model-card:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: var(--shadow-lg);
}

/* Thumbnail */
.model-card-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 50%, #94a3b8 100%);
  overflow: hidden;
}

.model-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.model-card-thumb .thumb-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition);
}

.model-card:hover .thumb-overlay {
  opacity: 1;
}

.model-card-thumb .thumb-overlay .preview-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50px;
  cursor: pointer;
  transition: background var(--transition);
}

.model-card-thumb .thumb-overlay .preview-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Card Body */
.model-card-body {
  padding: 12px;
}

.model-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 8px;
}

.model-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.model-card-tag {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-bg);
  border-radius: 50px;
}

.model-card-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.model-card-actions .action-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}

.model-card-actions .action-btn:hover {
  background: var(--primary-bg);
  color: var(--primary);
}

.model-card-info {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-light);
  font-size: 12px;
  color: var(--text-muted);
}

.model-card-info span {
  display: flex;
  align-items: center;
  gap: 3px;
}

/* ========== 7. Category Filter Bar ========== */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.filter-bar::-webkit-scrollbar {
  display: none;
}

.filter-btn {
  display: inline-flex;
  align-items: center;
  padding: 7px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: 50px;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
}

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

.filter-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ========== 8. Load More Button ========== */
.load-more-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 32px auto;
  padding: 10px 36px;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  background: transparent;
  border: 2px solid var(--primary);
  border-radius: 50px;
  cursor: pointer;
  transition: all var(--transition);
}

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

/* ========== 9. Section Headers ========== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-header h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--dark);
}

.section-header .view-all {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--transition);
}

.section-header .view-all:hover {
  color: var(--primary);
}

.section-header .view-all .arrow {
  font-size: 14px;
  transition: transform var(--transition);
}

.section-header .view-all:hover .arrow {
  transform: translateX(2px);
}

/* ========== 10. Materials Section ========== */
.material-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.material-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 16px;
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
}

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

.material-card-swatch {
  width: 100%;
  height: 80px;
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  background: linear-gradient(135deg, #64748b, #475569);
}

.material-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.material-card-spec {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.material-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.material-card-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
}

.material-card-price .price-unit {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
}

.material-stock-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 50px;
}

.material-stock-badge.in-stock {
  background: var(--success-bg);
  color: var(--success);
}

.material-stock-badge.low-stock {
  background: var(--warning-bg);
  color: var(--warning);
}

.material-stock-badge.out-of-stock {
  background: var(--danger-bg);
  color: var(--danger);
}

/* ========== 11. Footer ========== */
.footer {
  background: #1a2740;
  color: rgba(255, 255, 255, 0.7);
  padding: 48px 24px 24px;
  margin-top: 48px;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 32px;
  margin-bottom: 32px;
}

.footer-brand .footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
}

.footer-brand .footer-desc {
  font-size: 13px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.5);
  max-width: 280px;
}

.footer-col h4 {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 16px;
}

.footer-col a {
  display: block;
  padding: 4px 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  transition: color var(--transition);
}

.footer-col a:hover {
  color: #fff;
  text-decoration: none;
}

.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
}

.footer-bottom p {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.icp-link {
  color: rgba(255, 255, 255, 0.4);
  text-decoration: none;
  transition: color var(--transition);
}

.icp-link:hover {
  color: rgba(255, 255, 255, 0.7);
}

.footer-social {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-social a {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.5);
  transition: all var(--transition);
}

.footer-social a:hover {
  background: var(--primary);
  color: #fff;
}

.footer-dmca {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}

/* ========== 12. Admin Panel Layout ========== */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
  width: 240px;
  min-height: 100vh;
  background: var(--dark);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 50;
  overflow-y: auto;
}

.admin-sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px;
  font-size: 18px;
  font-weight: 700;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-sidebar-logo svg {
  width: 24px;
  height: 24px;
  color: var(--primary-light);
}

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

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  margin: 2px 8px;
  border-radius: var(--radius-md);
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: all var(--transition);
}

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

.admin-nav-item.active {
  background: rgba(37, 116, 185, 0.25);
  color: var(--primary-light);
}

.admin-nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.7;
}

.admin-nav-item.active svg {
  opacity: 1;
}

.admin-nav-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 8px 16px;
}

/* Main Content */
.admin-main {
  flex: 1;
  margin-left: 240px;
  background: var(--bg-page);
  min-height: 100vh;
}

/* ========== 13. Admin Components ========== */

/* Admin Header */
.admin-header {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 40;
}

.admin-header-left h1 {
  font-size: 20px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 4px;
}

.admin-header-left .breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
}

.admin-header-left .breadcrumb a {
  color: var(--text-muted);
}

.admin-header-left .breadcrumb a:hover {
  color: var(--primary);
}

.admin-header-left .breadcrumb .sep {
  color: var(--border);
}

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

/* Admin Stats Cards */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 24px 28px;
}

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

.admin-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.admin-stat-icon.blue {
  background: var(--info-bg);
  color: var(--info);
}

.admin-stat-icon.green {
  background: var(--success-bg);
  color: var(--success);
}

.admin-stat-icon.orange {
  background: var(--warning-bg);
  color: var(--warning);
}

.admin-stat-icon.purple {
  background: var(--purple-bg);
  color: var(--purple);
}

.admin-stat-info .stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--dark);
}

.admin-stat-info .stat-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.admin-stat-info .stat-trend {
  font-size: 12px;
  font-weight: 600;
  margin-top: 2px;
}

.stat-trend.up {
  color: var(--success);
}

.stat-trend.down {
  color: var(--danger);
}

/* Admin Table */
.admin-table-wrap {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

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

.admin-table-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--dark);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.admin-table th {
  text-align: left;
  padding: 10px 16px;
  background: var(--bg-hover);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}

.admin-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text);
}

.admin-table tr:hover td {
  background: var(--bg-hover);
}

.admin-table .table-thumb {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.admin-table .actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.admin-table .action-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--primary);
  cursor: pointer;
}

.admin-table .action-link:hover {
  text-decoration: underline;
}

.admin-table .action-link.danger {
  color: var(--danger);
}

/* Admin Pagination */
.admin-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-top: 1px solid var(--border-light);
  font-size: 13px;
  color: var(--text-secondary);
}

.admin-pagination-btns {
  display: flex;
  gap: 4px;
}

.page-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-white);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition);
}

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

.page-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.page-btn.disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* Admin Form */
.admin-form {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 24px;
}

.admin-form-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}

.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

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

.form-group {
  margin-bottom: 16px;
}

.form-group > label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.form-group > input,
.form-input {
  width: 100%;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0 12px;
  font-size: 14px;
  color: var(--text);
  background: var(--bg-white);
  transition: all var(--transition);
}

.form-group > input:focus,
.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 116, 185, 0.12);
}

.form-group > input::placeholder,
.form-input::placeholder {
  color: var(--text-muted);
}

.form-select {
  width: 100%;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0 12px;
  font-size: 14px;
  color: var(--text);
  background: var(--bg-white);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236b7280' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 116, 185, 0.12);
}

.form-textarea {
  width: 100%;
  min-height: 100px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 14px;
  color: var(--text);
  background: var(--bg-white);
  resize: vertical;
  font-family: inherit;
}

.form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 116, 185, 0.12);
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
  margin-top: 20px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 20px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover {
  text-decoration: none;
}

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

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

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

.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--text-muted);
}

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

.btn-danger:hover {
  background: #dc2626;
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

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

.btn-sm {
  padding: 5px 12px;
  font-size: 13px;
}

.btn-block {
  width: 100%;
}

.btn svg {
  flex-shrink: 0;
}

/* Upload Area */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg-hover);
}

.upload-area:hover,
.upload-area.dragover {
  border-color: var(--primary);
  background: var(--primary-bg);
}

.upload-area .upload-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  color: var(--text-muted);
}

.upload-area.dragover .upload-icon {
  color: var(--primary);
}

.upload-area .upload-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.upload-area .upload-hint {
  font-size: 12px;
  color: var(--text-muted);
}

/* Image Grid */
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}

.image-grid-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--border-light);
}

.image-grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-grid-item .image-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--transition);
}

.image-grid-item:hover .image-remove {
  opacity: 1;
}

/* ========== 14. Profile / Personal Center ========== */
.profile-layout {
  display: flex;
  min-height: 100vh;
  padding-top: var(--navbar-height);
}

.profile-sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--bg-white);
  border-right: 1px solid var(--border);
  padding: 24px 0;
}

.profile-avatar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 20px 20px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 8px;
}

.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 10px;
}

.profile-user-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 2px;
}

.profile-user-role {
  font-size: 12px;
  color: var(--text-muted);
}

.profile-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  font-size: 14px;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.profile-menu a:hover {
  background: var(--primary-bg);
  color: var(--primary);
  text-decoration: none;
}

.profile-menu a.active {
  color: var(--primary);
  background: var(--primary-bg);
  font-weight: 600;
  border-right: 3px solid var(--primary);
}

.profile-menu a svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.6;
}

.profile-menu a.active svg,
.profile-menu a:hover svg {
  opacity: 1;
}

.profile-content {
  flex: 1;
  padding: 24px 28px;
  max-width: 960px;
}

.profile-section-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 20px;
}

/* ========== 15. Toast Notifications ========== */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  color: var(--text);
  min-width: 280px;
  max-width: 400px;
  pointer-events: auto;
  animation: toast-slide-in 0.3s ease forwards;
}

.toast.toast-exit {
  animation: toast-slide-out 0.3s ease forwards;
}

.toast-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.toast.success .toast-icon {
  color: var(--success);
}

.toast.error .toast-icon {
  color: var(--danger);
}

.toast.warning .toast-icon {
  color: var(--warning);
}

.toast.info .toast-icon {
  color: var(--info);
}

.toast-close {
  margin-left: auto;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: color var(--transition);
}

.toast-close:hover {
  color: var(--text);
}

@keyframes toast-slide-in {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes toast-slide-out {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* ========== 16. Badges ========== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 600;
}

.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);
}

/* ========== 17. Cards (Generic) ========== */
.card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

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

.card-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--dark);
}

.card-body {
  padding: 20px;
}

/* ========== 18. Page Container ========== */
.page-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px;
}

.page-section {
  margin-bottom: 40px;
}

.page-section:last-child {
  margin-bottom: 0;
}

/* ========== 19. Auth Pages ========== */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-page);
  padding: 40px 16px;
}

.auth-container {
  width: 100%;
  max-width: 440px;
}

.auth-card {
  background: var(--bg-white);
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: var(--shadow-md);
}

.auth-header {
  text-align: center;
  margin-bottom: 28px;
}

.auth-header .logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 16px;
  font-size: 20px;
  font-weight: 700;
  color: var(--dark);
}

.auth-header h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 4px;
}

.auth-header p {
  font-size: 14px;
  color: var(--text-muted);
}

.auth-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-muted);
}

.auth-back {
  position: fixed;
  top: 16px;
  left: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: none;
  z-index: 10;
}

.auth-back:hover {
  color: var(--primary);
}

/* ========== 20. Form Helpers ========== */
.form-row {
  display: flex;
  gap: 12px;
}

.form-row .form-group {
  flex: 1;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text);
}

.form-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

.form-check-link {
  margin-left: auto;
  font-size: 13px;
}

.form-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  font-size: 13px;
  color: var(--text-muted);
}

.form-divider::before,
.form-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-light);
}

/* ========== 21. Responsive ========== */

/* Tablet (< 1024px) */
@media (max-width: 1024px) {
  .model-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .material-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .admin-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Small Tablet (< 768px) */
@media (max-width: 768px) {
  .nav-center,
  .nav-links {
    display: none;
  }

  .nav-register-btn {
    display: none;
  }

  .nav-hamburger {
    display: flex;
  }

  /* Mobile Nav (when hamburger is clicked) */
  .nav-center.mobile-open,
  .nav-links.mobile-open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--navbar-height);
    left: 0;
    right: 0;
    background: var(--bg-white);
    padding: 8px;
    box-shadow: var(--shadow-md);
    border-bottom: 1px solid var(--border);
  }

  .nav-center.mobile-open .nav-item > a,
  .nav-center.mobile-open .nav-item > button,
  .nav-links.mobile-open .cat-dropdown-trigger,
  .nav-links.mobile-open .nav-link-item {
    padding: 10px 14px;
  }

  .nav-center.mobile-open .cat-dropdown,
  .nav-links.mobile-open .cat-dropdown-menu {
    position: static;
    transform: none;
    box-shadow: none;
    min-width: 100%;
    border-radius: 0;
    padding: 8px 16px;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    display: none;
    background: var(--bg-hover);
    left: auto;
  }

  .nav-center.mobile-open .nav-item.open > .cat-dropdown,
  .nav-links.mobile-open .cat-dropdown.open > .cat-dropdown-menu {
    display: block;
  }

  .hero,
  .banner {
    height: 320px;
    padding: 32px 16px;
  }

  .hero h1,
  .banner h1 {
    font-size: 26px;
  }

  .hero .hero-subtitle,
  .banner-subtitle {
    font-size: 14px;
  }

  .hero-stats,
  .banner-stats {
    gap: 24px;
  }

  .hero-stat .stat-number,
  .banner-stat strong {
    font-size: 22px;
  }

  .model-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .material-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .page-container {
    padding: 20px 16px;
  }

  .section-header h2 {
    font-size: 18px;
  }

  /* Admin */
  .admin-sidebar {
    transform: translateX(-100%);
    transition: transform var(--transition-slow);
    z-index: 60;
  }

  .admin-sidebar.mobile-open {
    transform: translateX(0);
  }

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

  .admin-stats {
    grid-template-columns: 1fr 1fr;
    padding: 16px;
  }

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

  .admin-header {
    padding: 12px 16px;
  }

  /* Profile */
  .profile-layout {
    flex-direction: column;
  }

  .profile-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
  }

  .profile-avatar-wrap {
    flex-direction: row;
    gap: 12px;
    padding: 0 16px 12px;
  }

  .profile-avatar {
    width: 48px;
    height: 48px;
    font-size: 18px;
    margin-bottom: 0;
  }

  .profile-content {
    padding: 16px;
  }

  /* Footer */
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
}

/* Mobile (< 480px) */
@media (max-width: 480px) {
  .hero,
  .banner {
    height: 280px;
  }

  .hero h1,
  .banner h1 {
    font-size: 22px;
  }

  .hero-stats,
  .banner-stats {
    flex-wrap: wrap;
    gap: 16px;
  }

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

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

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

  .login-modal {
    margin: 16px;
    padding: 24px;
  }

  .auth-card {
    padding: 24px;
    border-radius: var(--radius-lg);
  }

  .toast {
    min-width: unset;
    max-width: calc(100vw - 40px);
  }

  .filter-bar {
    gap: 6px;
  }

  .filter-btn {
    padding: 6px 14px;
    font-size: 12px;
  }
}

/* ========== 22. Utility ========== */
.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.text-primary {
  color: var(--primary);
}

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

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

.text-muted {
  color: var(--text-muted);
}

.fw-600 {
  font-weight: 600;
}

.fw-700 {
  font-weight: 700;
}

.mt-8 {
  margin-top: 8px;
}

.mt-16 {
  margin-top: 16px;
}

.mt-24 {
  margin-top: 24px;
}

.mb-8 {
  margin-bottom: 8px;
}

.mb-16 {
  margin-bottom: 16px;
}

.mb-24 {
  margin-bottom: 24px;
}

.gap-8 {
  gap: 8px;
}

.gap-16 {
  gap: 16px;
}

.flex {
  display: flex;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hidden {
  display: none !important;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Mobile sidebar overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 55;
}

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

/* ========== 23. Animations ========== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

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

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

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

.animate-fade-in {
  animation: fadeIn 0.3s ease;
}

.animate-slide-down {
  animation: slideDown 0.3s ease;
}

.animate-scale-in {
  animation: scaleIn 0.3s ease;
}

/* Skeleton loading */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--border-light) 25%,
    var(--bg-hover) 50%,
    var(--border-light) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Selection */
::selection {
  background: rgba(37, 116, 185, 0.2);
  color: var(--dark);
}
