/* assets/css/style.css */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@500;700&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,300&display=swap');

:root {
  --bg:          #FAF8F6;
  --bg-card:     #FFFFFF;
  --text:        #7A6B5A;
  --text-dark:   #3D3228;
  --text-light:  #A89484;
  --primary:     #955D4A;
  --primary-h:   #7C4F3F;
  --accent:      #B28C7B;
  --accent-light:#E8D9D1;
  --border:      #E2D5CC;
  --success:     #6B8F71;
  --warning:     #C8963E;
  --danger:      #B05252;
  --shadow-sm:   0 1px 3px rgba(149,93,74,0.08);
  --shadow:      0 4px 16px rgba(149,93,74,0.12);
  --shadow-lg:   0 8px 32px rgba(149,93,74,0.16);
  --radius:      14px;
  --radius-sm:   8px;
  --font-heading:'Playfair Display', serif;
  --font-body:   'DM Sans', sans-serif;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

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

/* ── Typography ─────────────────────────────────────────── */
h1,h2,h3,h4 { font-family: var(--font-heading); color: var(--text-dark); line-height: 1.25; }
h1 { font-size: clamp(1.6rem, 5vw, 2.2rem); }
h2 { font-size: clamp(1.2rem, 4vw, 1.6rem); }
h3 { font-size: 1.15rem; }
p  { font-size: 0.95rem; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; border-radius: var(--radius-sm); border: none;
  font-family: var(--font-body); font-size: 0.95rem; font-weight: 500;
  cursor: pointer; transition: all 0.2s ease; text-decoration: none;
  white-space: nowrap;
}
.btn-primary   { background: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(149,93,74,0.3); }
.btn-primary:hover { background: var(--primary-h); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(149,93,74,0.4); }
.btn-outline   { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover { background: var(--accent-light); }
.btn-ghost     { background: transparent; color: var(--text); }
.btn-ghost:hover { background: var(--accent-light); }
.btn-danger    { background: var(--danger); color: #fff; }
.btn-success   { background: var(--success); color: #fff; }
.btn-sm        { padding: 8px 16px; font-size: 0.85rem; }
.btn-full      { width: 100%; }
.btn:disabled  { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ── Form elements ──────────────────────────────────────── */
.form-group { margin-bottom: 1.2rem; }
label { display: block; font-size: 0.85rem; font-weight: 500; color: var(--text-dark); margin-bottom: 6px; }
input, select, textarea {
  width: 100%; padding: 12px 16px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); background: var(--bg-card);
  font-family: var(--font-body); font-size: 0.95rem; color: var(--text-dark);
  transition: border-color 0.2s, box-shadow 0.2s; outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(178,140,123,0.15);
}
input::placeholder { color: var(--text-light); }
textarea { resize: vertical; min-height: 100px; }
.input-error { border-color: var(--danger) !important; }
.error-msg  { font-size: 0.8rem; color: var(--danger); margin-top: 4px; }
.hint-msg   { font-size: 0.8rem; color: var(--text-light); margin-top: 4px; }

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--bg-card); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.card-header { margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.card-title  { font-family: var(--font-heading); font-size: 1.1rem; color: var(--text-dark); }

/* ── Stat Cards ──────────────────────────────────────────── */
.stat-card {
  background: var(--bg-card); border-radius: var(--radius);
  padding: 20px; border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 8px;
}
.stat-icon   { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; }
.stat-num    { font-size: 2rem; font-weight: 700; color: var(--text-dark); line-height: 1; }
.stat-label  { font-size: 0.8rem; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.5px; }
.stat-pending   .stat-icon { background: rgba(200,150,62,0.15); color: var(--warning); }
.stat-completed .stat-icon { background: rgba(107,143,113,0.15); color: var(--success); }
.stat-rejected  .stat-icon { background: rgba(176,82,82,0.15); color: var(--danger); }
.stat-total     .stat-icon { background: rgba(149,93,74,0.15); color: var(--primary); }

/* ── Tables ──────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
thead tr { background: var(--accent-light); }
th { padding: 12px 16px; text-align: left; font-weight: 600; color: var(--text-dark); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.4px; white-space: nowrap; }
td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(178,140,123,0.04); }

/* ── Badges ──────────────────────────────────────────────── */
.badge {
  display: inline-block; padding: 4px 10px; border-radius: 20px;
  font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px;
}
.badge-pending   { background: rgba(200,150,62,0.15); color: var(--warning); }
.badge-completed { background: rgba(107,143,113,0.15); color: var(--success); }
.badge-rejected  { background: rgba(176,82,82,0.15); color: var(--danger); }

/* ── Mobile Nav ──────────────────────────────────────────── */
.mobile-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  background: var(--bg-card); border-top: 1px solid var(--border);
  display: flex; box-shadow: 0 -4px 16px rgba(149,93,74,0.1);
}
.nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  padding: 10px 4px 8px; gap: 4px; text-decoration: none;
  color: var(--text-light); font-size: 0.7rem; font-weight: 500;
  transition: color 0.2s; border: none; background: none; cursor: pointer;
}
.nav-item.active, .nav-item:hover { color: var(--primary); }
.nav-item svg { width: 22px; height: 22px; }
.nav-item span { font-size: 0.65rem; }

/* ── Page Header ─────────────────────────────────────────── */
.page-header {
  background: var(--bg-card); border-bottom: 1px solid var(--border);
  padding: 16px 20px; display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 90; box-shadow: var(--shadow-sm);
}
.page-header .logo { display: flex; align-items: center; gap: 10px; }
.logo-icon { width: 36px; height: 36px; }
.logo-text { font-family: var(--font-heading); font-size: 1.1rem; color: var(--primary); }

/* ── Page Content ─────────────────────────────────────────── */
.page-content { padding: 20px; padding-bottom: 80px; max-width: 600px; margin: 0 auto; }

/* ── Location Buttons ─────────────────────────────────────── */
.location-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.location-btn {
  padding: 20px 12px; border: 2px solid var(--border); border-radius: var(--radius);
  background: var(--bg-card); cursor: pointer; text-align: center;
  transition: all 0.2s; font-family: var(--font-body);
}
.location-btn:hover, .location-btn.selected {
  border-color: var(--primary); background: rgba(149,93,74,0.06); color: var(--primary);
}
.location-btn svg { display: block; margin: 0 auto 8px; }

/* ── Item Entry Form ──────────────────────────────────────── */
.item-block { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; position: relative; }
.item-block-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.size-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: start; background: var(--bg); border-radius: var(--radius-sm); padding: 12px; margin-bottom: 10px; }
.color-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.color-tag  { display: inline-flex; align-items: center; gap: 4px; background: var(--accent-light); color: var(--primary); padding: 4px 10px; border-radius: 20px; font-size: 0.8rem; }
.color-tag button { background: none; border: none; cursor: pointer; color: var(--danger); font-size: 1rem; line-height: 1; padding: 0; }
.image-upload-area {
  border: 2px dashed var(--border); border-radius: var(--radius-sm);
  padding: 20px; text-align: center; cursor: pointer; transition: border-color 0.2s;
}
.image-upload-area:hover { border-color: var(--accent); }
.image-previews { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.image-preview { width: 72px; height: 72px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--border); }

/* ── Alert ───────────────────────────────────────────────── */
.alert { padding: 14px 18px; border-radius: var(--radius-sm); font-size: 0.9rem; margin-bottom: 16px; }
.alert-success { background: rgba(107,143,113,0.12); color: #3d6b43; border: 1px solid rgba(107,143,113,0.3); }
.alert-error   { background: rgba(176,82,82,0.12); color: #803333; border: 1px solid rgba(176,82,82,0.3); }
.alert-info    { background: rgba(178,140,123,0.12); color: var(--primary); border: 1px solid rgba(178,140,123,0.3); }

/* ── Modal ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(61,50,40,0.5); z-index: 200;
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.25s;
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal {
  background: var(--bg-card); border-radius: var(--radius) var(--radius) 0 0;
  width: 100%; max-width: 600px; padding: 24px; max-height: 90vh; overflow-y: auto;
  transform: translateY(20px); transition: transform 0.25s;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-title { font-family: var(--font-heading); font-size: 1.2rem; color: var(--text-dark); margin-bottom: 20px; }

/* ── Admin Layout ─────────────────────────────────────────── */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 240px; background: var(--text-dark); color: #fff; flex-shrink: 0;
  display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; z-index: 100;
}
.admin-sidebar .logo-area { padding: 24px 20px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.admin-nav a {
  display: flex; align-items: center; gap: 10px; padding: 14px 20px;
  color: rgba(255,255,255,0.7); text-decoration: none; font-size: 0.9rem;
  transition: all 0.2s; border-left: 3px solid transparent;
}
.admin-nav a:hover, .admin-nav a.active { color: #fff; background: rgba(255,255,255,0.08); border-left-color: var(--accent); }
.admin-nav a svg { width: 18px; height: 18px; }
.admin-main { margin-left: 240px; flex: 1; display: flex; flex-direction: column; }
.admin-topbar { background: var(--bg-card); border-bottom: 1px solid var(--border); padding: 16px 28px; display: flex; align-items: center; justify-content: space-between; }
.admin-content { padding: 28px; flex: 1; }

/* ── Filters Bar ─────────────────────────────────────────── */
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.filter-bar input, .filter-bar select { flex: 1; min-width: 140px; }
.filter-bar .btn { flex-shrink: 0; }

/* ── Checkbox ─────────────────────────────────────────────── */
input[type="checkbox"] { width: auto; accent-color: var(--primary); cursor: pointer; }

/* ── Upload Animations ─────────────────────────────────────── */
.spinner { width: 20px; height: 20px; border: 2px solid rgba(255,255,255,0.3); border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Toast ───────────────────────────────────────────────── */
#toast-container { position: fixed; top: 20px; right: 16px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--text-dark); color: #fff; padding: 12px 20px; border-radius: var(--radius-sm);
  font-size: 0.88rem; box-shadow: var(--shadow); animation: slideIn 0.3s ease;
  max-width: 320px;
}
.toast.success { background: var(--success); }
.toast.error   { background: var(--danger); }
@keyframes slideIn { from { opacity:0; transform: translateX(20px); } to { opacity:1; transform: translateX(0); } }

/* ── Login Page ──────────────────────────────────────────── */
.login-page {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 24px;
  background: linear-gradient(160deg, #FAF8F6 0%, #F0E8E2 100%);
}
.login-card { width: 100%; max-width: 400px; }
.login-logo  { text-align: center; margin-bottom: 32px; }
.logo-star   { width: 64px; height: 64px; margin: 0 auto 12px; }

/* ── Responsive Admin Sidebar ─────────────────────────────── */
@media (max-width: 768px) {
  .admin-sidebar { transform: translateX(-100%); transition: transform 0.3s; }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
  .admin-content { padding: 16px; }
  .filter-bar { flex-direction: column; }
}

/* ── Request Detail Modal ─────────────────────────────────── */
.detail-section { margin-bottom: 16px; }
.detail-label  { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-light); font-weight: 600; margin-bottom: 6px; }
.detail-value  { font-size: 0.95rem; color: var(--text-dark); }
.img-thumb-grid { display: flex; gap: 8px; flex-wrap: wrap; }
.img-thumb      { width: 80px; height: 80px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--border); cursor: pointer; }
.barcode-display { font-family: 'Courier New', monospace; font-size: 1.1rem; background: var(--bg); padding: 8px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); letter-spacing: 2px; display: inline-block; }

/* ── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }
