/* ============================================
   NIET Lost & Found Portal — Design System
   ============================================ */

/* --- Fonts --- */
@import url("https://fonts.googleapis.com/css2?family=Merriweather:wght@400;700;900&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap");

/* --- CSS Variables (college-themed palette) --- */
:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-alt: #f3f6fb;
  --surface-muted: #eef4fb;
  --surface-strong: #e2e8f0;
  --border: rgba(7, 34, 77, 0.08);
  --border-light: rgba(7, 34, 77, 0.04);
  --primary: #07224d;
  --primary-rgb: 7, 34, 77;
  --secondary: #0b3d91;
  --secondary-hover: #083070;
  --accent: #b8860b;
  --accent-hover: #9b6d08;
  --success: #10b981;
  --danger: #ef4444;
  --text: #07224d;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-inverse: #ffffff;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-md:
    0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg:
    0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 20px;
  --radius-xl: 32px;
  --radius-full: 9999px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --max-width: 1280px;
  --header-height: 80px;
}

.hidden {
  display: none !important;
}

[data-theme="dark"] {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-alt: #334155;
  --surface-muted: #1e293b;
  --surface-strong: #475569;
  --border: rgba(255, 255, 255, 0.08);
  --border-light: rgba(255, 255, 255, 0.04);
  --primary: #f8fafc;
  --primary-rgb: 248, 250, 252;
  --text: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
  --shadow-md:
    0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
  --shadow-lg:
    0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
  --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
}

/* --- Reset --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  font-size: 16px;
}

body {
  background-color: var(--bg);
  background-image:
    url('portal-bg.svg'),
    radial-gradient(at 0% 0%, rgba(11, 61, 145, 0.06) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(184, 134, 11, 0.03) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.02) 0px, transparent 50%),
    radial-gradient(at 0% 100%, rgba(239, 68, 68, 0.02) 0px, transparent 50%);
  background-position: center top;
  background-size: cover;
  background-repeat: no-repeat;
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  transition:
    background-color var(--transition),
    color var(--transition);
  overflow-x: hidden;
}

::selection {
  background: rgba(59, 130, 246, 0.18);
  color: var(--text);
}

body::-webkit-scrollbar {
  width: 10px;
}

body::-webkit-scrollbar-track {
  background: transparent;
}

body::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.18);
  border-radius: 999px;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--secondary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--secondary-hover);
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: none;
  cursor: pointer;
}

/* --- Typography --- */
body,
input,
textarea,
select,
button {
  font-family: "Inter", system-ui, sans-serif;
}

/* Use Merriweather for prominent headings to add institutional feel */
h1, .adm-page-title, .adm-auth-title {
  font-family: "Merriweather", serif;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--primary);
  line-height: 1.1;
  font-weight: 800;
}

h1 {
  font-size: clamp(2rem, 8vw, 3.5rem);
}
h2 {
  font-size: clamp(1.5rem, 5vw, 2.5rem);
}
h3 {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
}
h4 {
  font-size: 1.15rem;
}

p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

@media (min-width: 768px) {
  p {
    font-size: 1rem;
  }
}

.text-muted {
  color: var(--text-muted);
}

.mt-4 {
  margin-top: 1rem;
}
.mt-8 {
  margin-top: 2rem;
}
.mb-4 {
  margin-bottom: 1rem;
}
.mb-8 {
  margin-bottom: 2rem;
}

/* ============================================
   HEADER / NAVIGATION
   ============================================ */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 60px;
  z-index: 1000;
  display: flex;
  align-items: center;
  transition: var(--transition);
  background: transparent;
}

@media (min-width: 768px) {
  .header {
    height: var(--header-height);
  }
}

.header--scrolled {
  background: rgba(var(--primary-rgb), 0.8);
  backdrop-filter: blur(12px);
  height: 60px;
  box-shadow: var(--shadow-lg);
  border-bottom: 1px solid var(--border);
}

@media (min-width: 768px) {
  .header--scrolled {
    height: 70px;
  }
}

[data-theme="light"] .header--scrolled {
  background: rgba(255, 255, 255, 0.8);
}

.header__inner {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

@media (min-width: 768px) {
  .header__inner {
    padding: 0 24px;
  }
}

.header__brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  z-index: 1001;
}

@media (min-width: 768px) {
  .header__brand {
    gap: 12px;
  }
}

.header__logo {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--secondary), var(--accent));
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: white;
  font-weight: 800;
  font-size: 0.9rem;
  box-shadow: var(--shadow-md);
}

@media (min-width: 768px) {
  .header__logo {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    font-size: 1.1rem;
  }
}

.header__logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: inherit;
}

.header__title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
  white-space: nowrap;
}

@media (min-width: 768px) {
  .header__title {
    font-size: 1.1rem;
  }
}

.header__subtitle {
  display: none;
}

@media (min-width: 768px) {
  .header__subtitle {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  background: var(--surface-alt);
  color: var(--text);
  display: grid;
  place-items: center;
  transition: var(--transition-bounce);
  border: 1px solid var(--border);
  position: relative;
}

@media (min-width: 768px) {
  .theme-toggle {
    width: 40px;
    height: 40px;
  }
}

.theme-toggle:hover {
  transform: scale(1.1);
  background: var(--surface-strong);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
  position: absolute;
  transition: var(--transition);
}

@media (min-width: 768px) {
  .theme-toggle svg {
    width: 20px;
    height: 20px;
  }
}

[data-theme="dark"] .sun,
[data-theme="light"] .moon {
  opacity: 0;
  transform: rotate(90deg) scale(0);
}

[data-theme="dark"] .moon,
[data-theme="light"] .sun {
  opacity: 1;
  transform: rotate(0) scale(1);
}

.header__nav {
  position: fixed;
  top: 0;
  right: -100%;
  width: 85%;
  max-width: 300px;
  height: 100vh;
  background: var(--surface);
  padding: 0;
  display: flex;
  flex-direction: column;
  transition: var(--transition-slow);
  box-shadow: var(--shadow-xl);
  z-index: 999;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.header__nav-header {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

@media (min-width: 768px) {
  .header__nav-header {
    display: none;
  }
}

.header__nav-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.header__nav-footer {
  margin-top: auto;
  padding: 24px 20px;
  border-top: 1px solid var(--border-light);
  text-align: center;
}

@media (min-width: 768px) {
  .header__nav-footer {
    display: none;
  }
}

.header__nav-footer p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.header__nav.active,
.header__nav.header__nav--open {
  right: 0;
}

@media (min-width: 768px) {
  .header__nav {
    position: static;
    width: auto;
    height: auto;
    background: transparent;
    padding: 0;
    flex-direction: row;
    gap: 8px;
    box-shadow: none;
    max-width: none;
    overflow-y: visible;
  }
}

.header__link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  margin: 0 12px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: var(--transition);
  text-align: left;
  min-height: 48px; /* Touch target > 44px */
}

.header__link .material-symbols-outlined {
  font-size: 22px;
  font-variation-settings: "FILL" 0, "wght" 500;
}

@media (min-width: 768px) {
  .header__link {
    padding: 8px 16px;
    margin: 0;
    font-size: 0.9rem;
    width: auto;
    border-radius: var(--radius-full);
    text-align: center;
    min-height: auto;
    gap: 6px;
  }

  .header__link .material-symbols-outlined {
    font-size: 18px;
  }
}

.header__link:hover {
  background: var(--surface-alt);
  color: var(--secondary);
}

.header__link--active {
  background: var(--secondary);
  color: white !important;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.header__link--active .material-symbols-outlined {
  font-variation-settings: "FILL" 1;
}

.header__link--admin {
  background: var(--surface-alt);
  color: var(--primary);
  border: 1px solid var(--border);
}

@media (min-width: 768px) {
  .header__link--admin {
    background: var(--surface-strong);
  }
}

.header__menu-btn {
  display: grid;
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  background: var(--surface-alt);
  color: var(--text);
  place-items: center;
  border: 1px solid var(--border);
  z-index: 1001;
  transition: var(--transition);
}

@media (min-width: 768px) {
  .header__menu-btn {
    display: none;
  }
}

.header__menu-btn:active {
  transform: scale(0.9);
}

.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.nav-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
  padding: 100px 16px 40px;
  text-align: center;
  position: relative;
}

@media (min-width: 768px) {
  .hero {
    padding: calc(var(--header-height) + 60px) 24px 80px;
  }
}

.hero__content {
  max-width: 100%;
  margin: 0 auto;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--secondary);
  margin-bottom: 12px;
}

@media (min-width: 768px) {
  .hero__badge {
    padding: 4px 12px;
    font-size: 0.75rem;
    margin-bottom: 20px;
  }
}

.hero__badge-dot {
  width: 6px;
  height: 6px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@media (min-width: 768px) {
  .hero__badge-dot {
    width: 8px;
    height: 8px;
  }
}

@keyframes pulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.hero h1 {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  line-height: 1.1;
}

@media (min-width: 768px) {
  .hero h1 {
    font-size: clamp(2.5rem, 8vw, 4rem);
    margin-bottom: 16px;
  }
}

.hero__highlight {
  background: linear-gradient(135deg, var(--secondary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 20px;
  padding: 0;
}

@media (min-width: 768px) {
  .hero p {
    font-size: 1.1rem;
    margin-bottom: 32px;
  }
}

.hero__search {
  max-width: 100%;
  margin: 0 auto;
  position: relative;
}

@media (min-width: 768px) {
  .hero__search {
    max-width: 600px;
  }
}

.hero__search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.hero__search-input {
  width: 100%;
  padding: 12px 16px 12px 42px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
  box-shadow: var(--shadow-md);
  transition: var(--transition-bounce);
}

@media (min-width: 768px) {
  .hero__search-input {
    padding: 14px 20px 14px 48px;
    font-size: 0.95rem;
    box-shadow: var(--shadow-lg);
  }
}

.hero__search-input:focus {
  outline: none;
  border-color: var(--secondary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

/* ============================================
   STATS BAR
   ============================================ */
.stats-bar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 32px;
}

@media (min-width: 480px) {
  .stats-bar {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .stats-bar {
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 60px;
  }
}

.stat-card {
  background: var(--surface);
  padding: 12px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition-bounce);
}

@media (min-width: 768px) {
  .stat-card {
    padding: 24px;
    gap: 16px;
  }
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: var(--secondary);
}

.stat-card__icon {
  width: 32px;
  height: 32px;
  background: var(--surface-alt);
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  font-size: 1rem;
}

@media (min-width: 768px) {
  .stat-card__icon {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
  }
}

.stat-card__value {
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1;
}

@media (min-width: 768px) {
  .stat-card__value {
    font-size: 1.8rem;
  }
}

.stat-card__label {
  font-size: 0.6rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

@media (min-width: 768px) {
  .stat-card__label {
    font-size: 0.85rem;
  }
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px 60px;
}

/* ============================================
   FILTERS & SEARCH
   ============================================ */
.filters {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 24px;
  padding: 16px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

@media (min-width: 480px) {
  .filters {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
}

@media (min-width: 768px) {
  .filters {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 20px;
    gap: 16px;
    margin-bottom: 40px;
    box-shadow: var(--shadow);
  }
}

.filters__label {
  grid-column: 1 / -1;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

@media (min-width: 768px) {
  .filters__label {
    grid-column: auto;
    font-size: 0.9rem;
    margin-bottom: 0;
  }
}

.filter-select,
.form-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text);
  font-size: 0.85rem;
  transition: var(--transition);
}

.filter-select:focus,
.form-input:focus {
  outline: none;
  border-color: var(--secondary);
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(11, 61, 145, 0.06);
}

@media (min-width: 768px) {
  .filter-select,
  .form-input {
    width: auto;
    padding: 10px 16px;
    font-size: 0.9rem;
  }
}

#search-input {
  grid-column: 1 / -1;
  max-width: 100%;
}

@media (min-width: 768px) {
  #search-input {
    grid-column: auto;
    min-width: 220px;
    max-width: 300px;
  }
}

.filters__clear {
  grid-column: 1 / -1;
  padding: 10px 16px;
  border-radius: var(--radius-full);
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
  font-weight: 600;
  font-size: 0.85rem;
  transition: var(--transition);
  text-align: center;
}

@media (min-width: 768px) {
  .filters__clear {
    grid-column: auto;
    padding: 10px 20px;
    font-size: 0.9rem;
    margin-left: auto;
  }
}

/* ============================================
   ITEMS GRID & CARDS
   ============================================ */
.items-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

@media (min-width: 768px) {
  .items-section__header {
    margin-bottom: 24px;
  }
}

.items-section__title {
  font-size: 1.25rem;
  font-weight: 800;
}

@media (min-width: 768px) {
  .items-section__title {
    font-size: 1.5rem;
  }
}

.items-section__count {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

@media (min-width: 768px) {
  .items-section__count {
    font-size: 0.9rem;
  }
}

.items-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 640px) {
  .items-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

@media (min-width: 1024px) {
  .items-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
  }
}

.item-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: var(--transition-bounce);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}

.item-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
  border-color: var(--secondary);
}

.item-card__img-wrap {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--surface-alt);
}

.item-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-slow);
}

.item-card:hover .item-card__img {
  transform: scale(1.1);
}

.item-card__img-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 3rem;
  color: var(--text-muted);
}

.item-card__status {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: white;
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-md);
}

.item-card__status--available {
  background: rgba(16, 185, 129, 0.9);
}
.item-card__status--claimed {
  background: rgba(245, 158, 11, 0.9);
}
.item-card__status--returned {
  background: rgba(59, 130, 246, 0.9);
}

.item-card__body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.item-card__category {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.item-card__title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 16px;
  line-height: 1.3;
  color: var(--text);
}

.item-card__meta {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}

.item-card__meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.item-card__meta-item svg {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

/* -- Buttons used across site and modals -- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius);
  font-weight: 700;
  text-decoration: none;
  border: 1px solid transparent;
  transition: var(--transition-bounce);
  min-height: 44px;
  color: var(--text);
  background: var(--surface);
}
.btn--primary {
  background: linear-gradient(90deg, var(--secondary), var(--accent));
  color: var(--text-inverse);
  box-shadow: 0 8px 24px rgba(11, 61, 145, 0.12);
  border-color: transparent;
}
.btn--primary:hover { transform: translateY(-2px); }
.btn--outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn--lg { padding: 14px 20px; font-size: 1rem; min-height: 48px; }
.btn--full { width: 100%; display: inline-flex; justify-content: center; }

/* Spinner for async actions */
.btn__spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: rgba(255,255,255,0.95);
  display: inline-block;
  vertical-align: middle;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Disabled button state */
.btn[disabled],
.adm-btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

/* Ensure primary button uses readable text on small screens */
.btn--primary { white-space: nowrap; }

/* -- Modal styles (shared) -- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 34, 77, 0.45);
  backdrop-filter: blur(6px);
  z-index: 1400;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 720px;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}
.modal__header { padding: 18px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal__title { margin: 0; font-size: 1.15rem; font-weight: 800; color: var(--primary); }
.modal__body { padding: 18px 20px; max-height: 66vh; overflow: auto; }
.modal__footer { padding: 16px 20px; border-top: 1px solid var(--border); display: flex; gap: 12px; justify-content: flex-end; }

/* -- Card and hero tweaks -- */
.item-card { position: relative; transition: transform 0.38s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.38s; }
.item-card:hover { transform: translateY(-6px); }
.hero { position: relative; }
.hero::after { content: ''; position: absolute; left: 50%; top: 0; transform: translateX(-50%); width: min(900px, 90%); height: 220px; background: linear-gradient(180deg, rgba(11,61,145,0.04), transparent); pointer-events: none; border-radius: 12px; }
@media (max-width: 640px) {
  .hero::after { height: 120px; width: min(600px, 92%); }
}

/* -- Footer -- */
.footer { padding: 36px 16px; margin-top: 48px; color: var(--text-secondary); }
.footer__inner { width: min(100%, var(--max-width)); margin: 0 auto; padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.footer__brand { font-weight: 900; color: var(--primary); }
.footer__text { font-size: 0.95rem; color: var(--text-muted); }
.footer__divider { width: 100%; height: 1px; background: var(--border); opacity: 0.6; margin: 6px 0; }
.footer__copy { font-size: 0.85rem; color: var(--text-muted); }

/* ============================================
   DESKTOP RESPONSIVENESS (MIN-WIDTH: 768px)
   ============================================ */
@media (min-width: 768px) {
  .header__inner {
    padding: 0 24px;
    width: min(100%, var(--max-width));
  }

  .header__brand {
    gap: 12px;
  }

  .header__logo {
    width: 42px;
    height: 42px;
    font-size: 1.2rem;
  }

  .header__title {
    font-size: 1.1rem;
  }

  .header__subtitle {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }

  .header__menu-btn {
    display: none;
  }

  .header__nav {
    position: static;
    width: auto;
    height: auto;
    background: transparent;
    padding: 0;
    flex-direction: row;
    gap: 8px;
    box-shadow: none;
    max-width: none;
  }

  .header__link {
    padding: 8px 16px;
    font-size: 0.9rem;
    width: auto;
    border-radius: var(--radius-full);
    text-align: center;
  }

  .hero {
    padding: calc(var(--header-height) + 60px) 24px 80px;
  }

  .hero h1 {
    font-size: clamp(2.5rem, 8vw, 4rem);
  }

  .hero p {
    font-size: 1.1rem;
    padding: 0;
  }

  .hero__search {
    max-width: 600px;
  }

  .stats-bar {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 60px;
  }

  .stat-card {
    padding: 24px;
    gap: 16px;
  }

  .stat-card__icon {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
  }

  .stat-card__value {
    font-size: 1.8rem;
  }

  .stat-card__label {
    font-size: 0.85rem;
  }

  .main {
    width: min(100%, var(--max-width));
    padding: 0 24px 80px;
  }

  .filters {
    flex-direction: row;
    align-items: center;
    padding: 20px;
    gap: 16px;
    margin-bottom: 40px;
  }

  .filters__clear {
    margin-left: auto;
    text-align: left;
  }

  .items-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
  }
}

/* ============================================
   REPORT PAGE
   ============================================ */
.report-page {
  padding-top: 80px;
  padding-bottom: 40px;
  min-height: 100vh;
}

@media (min-width: 768px) {
  .report-page {
    padding-top: calc(var(--header-height) + 40px);
    padding-bottom: 80px;
  }
}

.report-page__inner {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 16px;
}

@media (min-width: 768px) {
  .report-page__inner {
    padding: 0 24px;
  }
}

.report-page__header {
  text-align: center;
  margin-bottom: 32px;
}

@media (min-width: 768px) {
  .report-page__header {
    margin-bottom: 48px;
  }
}

.report-page__icon {
  width: 60px;
  height: 60px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  display: grid;
  place-items: center;
  margin: 0 auto 20px;
  color: var(--secondary);
  box-shadow: var(--shadow-sm);
  font-size: 1.5rem;
}

@media (min-width: 768px) {
  .report-page__icon {
    width: 80px;
    height: 80px;
    border-radius: 24px;
    margin-bottom: 24px;
    font-size: 2rem;
  }
}

.report-page__header h1 {
  font-size: 1.75rem;
  margin-bottom: 8px;
}

@media (min-width: 768px) {
  .report-page__header h1 {
    font-size: 2.5rem;
    margin-bottom: 12px;
  }
}

.report-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 20px;
  box-shadow: var(--shadow-lg);
}

@media (min-width: 768px) {
  .report-form {
    padding: 40px;
  }
}

.report-form__section {
  margin-bottom: 24px;
}

@media (min-width: 768px) {
  .report-form__section {
    margin-bottom: 32px;
  }
}

.report-form__section-title {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 16px;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

@media (min-width: 768px) {
  .report-form__section-title {
    font-size: 1.25rem;
    margin-bottom: 24px;
    gap: 12px;
  }
}

.report-form__section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.report-form__divider {
  height: 1px;
  background: var(--border);
  margin: 24px 0;
}

@media (min-width: 768px) {
  .report-form__divider {
    margin: 32px 0;
  }
}

.report-form__actions {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

@media (min-width: 768px) {
  .report-form__actions {
    margin-top: 40px;
  }
}

.admin-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 640px) {
  .admin-form-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
}

.form-group--full {
  grid-column: 1;
}

@media (min-width: 640px) {
  .form-group--full {
    grid-column: span 2;
  }
}

/* ============================================
   ITEM DETAIL PAGE
   ============================================ */
.item-detail {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 80px 16px 40px;
}

@media (min-width: 768px) {
  .item-detail {
    padding: 100px 24px 80px;
  }
}

.item-detail__back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--secondary);
  font-weight: 600;
  margin-bottom: 20px;
  font-size: 0.9rem;
}

@media (min-width: 768px) {
  .item-detail__back {
    margin-bottom: 28px;
    font-size: 1rem;
  }
}

.item-detail__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: start;
}

@media (min-width: 1024px) {
  .item-detail__grid {
    grid-template-columns: 1.25fr 1fr;
    gap: 36px;
  }
}

.item-detail__image-wrap {
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--surface-alt);
  aspect-ratio: 4 / 3;
  box-shadow: var(--shadow-sm);
}

@media (min-width: 768px) {
  .item-detail__image-wrap {
    border-radius: 32px;
    aspect-ratio: 5 / 4;
  }
}

.item-detail__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.item-detail__image-placeholder {
  min-height: 240px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--surface-alt), var(--bg));
  color: var(--text-muted);
}

@media (min-width: 768px) {
  .item-detail__image-placeholder {
    min-height: 360px;
  }
}

.item-detail__info {
  display: grid;
  gap: 20px;
}

@media (min-width: 768px) {
  .item-detail__info {
    gap: 24px;
  }
}

.item-detail__content {
  display: grid;
  gap: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

@media (min-width: 768px) {
  .item-detail__content {
    gap: 24px;
    border-radius: 30px;
    padding: 28px;
  }
}

.item-detail__aside {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

@media (min-width: 1024px) {
  .item-detail__aside {
    position: sticky;
    top: 100px;
    border-radius: 30px;
    padding: 28px;
  }
}

.item-detail__status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  color: white;
}

@media (min-width: 768px) {
  .item-detail__status-badge {
    padding: 10px 18px;
    font-size: 0.85rem;
  }
}

.item-detail__status-badge--available { background: var(--success); }
.item-detail__status-badge--claimed { background: var(--accent); }
.item-detail__status-badge--returned { background: var(--secondary); }

.item-detail__title {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.2;
}

@media (min-width: 768px) {
  .item-detail__title {
    font-size: 2.25rem;
    font-weight: 900;
  }
}

.item-detail__desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

@media (min-width: 768px) {
  .item-detail__desc {
    font-size: 1.1rem;
    line-height: 1.8;
  }
}

.item-detail__meta-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 480px) {
  .item-detail__meta-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

.item-detail__meta-item {
  display: grid;
  gap: 4px;
}

.item-detail__meta-label {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.item-detail__meta-value {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
}

@media (min-width: 768px) {
  .item-detail__meta-value {
    font-size: 1rem;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.95rem;
  transition: var(--transition-bounce);
}

@media (min-width: 768px) {
  .btn {
    padding: 14px 24px;
  }
}

.btn--primary {
  background: linear-gradient(135deg, var(--secondary), var(--accent));
  color: white;
  box-shadow: var(--shadow-md);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn--outline {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn--outline:hover {
  background: var(--surface-alt);
}

.btn--lg {
  padding: 14px 28px;
  font-size: 1.05rem;
}

@media (min-width: 768px) {
  .btn--lg {
    padding: 16px 32px;
  }
}

.btn--full {
  width: 100%;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  transform: translateY(20px);
  opacity: 0;
  transition: var(--transition);
}

@media (min-width: 768px) {
  .modal {
    border-radius: 32px;
    max-width: 560px;
  }
}

.modal-overlay.active .modal {
  transform: translateY(0);
  opacity: 1;
}

.modal__header,
.modal__footer {
  padding: 20px;
}

@media (min-width: 768px) {
  .modal__header,
  .modal__footer {
    padding: 24px 32px;
  }
}

.modal__body {
  padding: 0 20px 20px;
}

@media (min-width: 768px) {
  .modal__body {
    padding: 0 32px 32px;
  }
}

.modal__close {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-alt);
  color: var(--text-secondary);
  transition: var(--transition);
}

.modal__close:hover {
  background: var(--surface-strong);
  color: var(--primary);
}

.modal__title {
  font-size: 1.25rem;
  font-weight: 800;
}
  font-weight: 800;
}

.form-group {
  margin-bottom: 20px;
}

.form-group__label {
  display: block;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 10px;
}

.form-group__label span {
  color: var(--danger);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.95rem;
  transition:
    border-color var(--transition),
    box-shadow var(--transition);
}

.form-textarea {
  min-height: 140px;
  resize: vertical;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: rgba(71, 85, 105, 0.55);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 6px rgba(11, 61, 145, 0.07);
}

.file-upload {
  position: relative;
  border: 1px dashed rgba(15, 23, 42, 0.12);
  border-radius: 24px;
  padding: 28px;
  text-align: center;
  background: var(--surface);
  cursor: pointer;
  transition:
    border-color var(--transition),
    background var(--transition),
    transform var(--transition);
}

.file-upload:hover {
  border-color: rgba(11, 61, 145, 0.16);
  background: rgba(11, 61, 145, 0.03);
  transform: translateY(-1px);
}

.file-upload input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.file-upload__icon {
  margin-bottom: 16px;
  color: var(--secondary);
}

.file-upload__text {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
}

.file-upload__hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 8px;
}

.file-upload__preview img {
  width: 100%;
  border-radius: 18px;
  margin-top: 18px;
  box-shadow: var(--shadow-sm);
}

.loading-skeleton {
  display: grid;
  gap: 22px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  margin-top: 32px;
}

.skeleton-card {
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  min-height: 340px;
}

.skeleton-card__img {
  height: 220px;
  background: linear-gradient(
    90deg,
    rgba(226, 232, 240, 0.9),
    rgba(241, 245, 249, 1)
  );
}

.skeleton-card__body {
  padding: 24px;
  display: grid;
  gap: 14px;
}

.skeleton-line {
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(226, 232, 240, 1),
    rgba(241, 245, 249, 1)
  );
}

.skeleton-line--short {
  width: 40%;
}
.skeleton-line--medium {
  width: 70%;
}
.skeleton-line--full {
  width: 100%;
}

.hidden {
  display: none !important;
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.skeleton-card__img,
.skeleton-line {
  background: linear-gradient(
    90deg,
    var(--surface-alt) 25%,
    var(--border) 50%,
    var(--surface-alt) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite linear;
}

.empty-state {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 30px;
  padding: 48px 32px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  margin-top: 32px;
}

.empty-state__icon {
  width: 88px;
  height: 88px;
  margin: 0 auto 20px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  background: rgba(79, 70, 229, 0.08);
  color: var(--secondary);
}

.empty-state__title {
  font-size: 1.25rem;
  margin-bottom: 12px;
}

.empty-state__desc {
  color: var(--text-muted);
  max-width: 450px;
  margin: 0 auto;
}

.footer {
  padding: 36px 24px;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  margin-top: 60px;
}

.footer__inner {
  width: min(100%, var(--max-width));
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

.footer__brand {
  font-weight: 800;
}

.footer__text,
.footer__copy {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.footer__divider {
  flex: 1 1 100%;
  height: 1px;
  background: rgba(15, 23, 42, 0.06);
  margin: 12px 0;
}

@media (max-width: 900px) {
  .header__inner {
    flex-wrap: wrap;
    justify-content: center;
  }
  .header__nav {
    justify-content: center;
  }
  .hero {
    padding-top: 88px;
  }
  .hero__stats {
    margin-top: 32px;
  }
  .item-detail__grid {
    grid-template-columns: 1fr;
  }
  .item-detail__aside {
    position: static;
    top: auto;
  }
}

@media (max-width: 740px) {
  .main {
    padding: 0 18px 60px;
  }
  .filters {
    padding: 20px;
  }
  .filters__clear {
    margin-left: 0;
  }
}
