/* ── Reset & Base ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --primary: #FF6B35;
  --primary-dark: #c2410c;
  --bg: #f8f9fa;
  --sidebar-bg: #1a1a2e;
  --sidebar-text: rgba(255,255,255,0.7);
  --sidebar-active: #FF6B35;
  --card-bg: #ffffff;
  --text: #1a1a2e;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --success: #10b981;
  --danger: #ef4444;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.05);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.1), 0 12px 40px rgba(0,0,0,0.08);
}
html { font-size: 16px; }
body { font-family: 'Plus Jakarta Sans', system-ui, sans-serif; color: var(--text); background: var(--bg); line-height: 1.6; }
a { text-decoration: none; color: inherit; }
button { font-family: inherit; }

/* ── Login Page ── */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #1a1a2e 100%);
  padding: 24px;
}
.login-card {
  background: var(--card-bg); border-radius: 20px; padding: 48px 40px;
  width: 100%; max-width: 400px; box-shadow: var(--shadow-lg);
}
.login-header { text-align: center; margin-bottom: 36px; }
.login-logo { height: 48px; width: auto; margin-bottom: 20px; }
.login-header h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: 6px; color: var(--text); }
.login-header p { font-size: 0.88rem; color: var(--text-muted); }
.login-form { display: flex; flex-direction: column; gap: 18px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 0.82rem; font-weight: 600; color: var(--text); letter-spacing: 0.01em; }
.form-group input {
  border: 1.5px solid var(--border); border-radius: 10px; padding: 12px 14px;
  font-size: 0.95rem; font-family: inherit; color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s; background: var(--bg);
}
.form-group input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(255,107,53,0.12); }
.form-group input::placeholder { color: #aaa; }
.form-error { font-size: 0.82rem; color: var(--danger); display: none; min-height: 20px; }
.form-error.visible { display: block; }
.btn-login {
  background: var(--primary); color: #fff; border: none; border-radius: 10px;
  padding: 14px; font-size: 0.95rem; font-weight: 600; cursor: pointer;
  transition: background 0.2s, transform 0.15s; margin-top: 4px;
}
.btn-login:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-login:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

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

/* ── Sidebar ── */
.sidebar {
  width: 240px; background: var(--sidebar-bg); color: #fff;
  display: flex; flex-direction: column; position: fixed; top: 0; left: 0;
  bottom: 0; z-index: 50; flex-shrink: 0;
}
.sidebar-header {
  display: flex; align-items: center; gap: 10px; padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-logo { height: 32px; width: auto; }
.sidebar-header span { font-weight: 700; font-size: 0.95rem; color: rgba(255,255,255,0.95); }
.sidebar-nav { padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px;
  border-radius: 10px; font-size: 0.88rem; font-weight: 500; color: var(--sidebar-text);
  transition: background 0.2s, color 0.2s; background: none; border: none; cursor: pointer;
  text-align: left; width: 100%;
}
.nav-item svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-item.active { background: rgba(255,107,53,0.15); color: var(--primary); }
.nav-logout { color: rgba(255,255,255,0.4); margin-top: auto; }
.nav-logout:hover { color: #ff6b6b; }

/* ── Main Content ── */
.main-content { margin-left: 240px; flex: 1; padding: 32px 40px; min-height: 100vh; }
.content-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; gap: 16px; flex-wrap: wrap; }
.content-header h1 { font-size: 1.5rem; font-weight: 700; color: var(--text); }
.request-count { background: var(--primary); color: #fff; font-size: 0.78rem; font-weight: 600; padding: 4px 12px; border-radius: 50px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 0.88rem; font-weight: 500; color: var(--text-muted); transition: color 0.2s; }
.back-link:hover { color: var(--primary); }
.back-link svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ── Loading ── */
.loading { color: var(--text-muted); font-size: 0.92rem; padding: 20px 0; }

/* ── Requests List ── */
.requests-list { display: flex; flex-direction: column; gap: 12px; }
.request-card {
  background: var(--card-bg); border-radius: 14px; padding: 20px 24px;
  box-shadow: var(--shadow); display: flex; align-items: center; justify-content: space-between;
  gap: 16px; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s;
  border: 1px solid transparent;
}
.request-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--primary); }
.request-info { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.request-name { font-weight: 600; font-size: 0.98rem; color: var(--text); }
.request-meta { display: flex; align-items: center; gap: 12px; }
.request-id { font-size: 0.78rem; color: var(--text-muted); font-family: monospace; }
.request-date { font-size: 0.82rem; color: var(--text-muted); }
.request-arrow { color: var(--text-muted); flex-shrink: 0; }
.request-arrow svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state svg { width: 64px; height: 64px; stroke: var(--border); fill: none; stroke-width: 1.5; margin: 0 auto 16px; display: block; }
.empty-state p { font-size: 0.98rem; }

/* ── Detail View ── */
.detail-content { display: flex; flex-direction: column; gap: 24px; }
.detail-card {
  background: var(--card-bg); border-radius: 16px; padding: 28px; box-shadow: var(--shadow);
}
.detail-card h2 { font-size: 1.05rem; font-weight: 700; margin-bottom: 20px; color: var(--text); padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 32px; }
.detail-item { display: flex; flex-direction: column; gap: 4px; }
.detail-label { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }
.detail-value { font-size: 0.95rem; font-weight: 500; color: var(--text); word-break: break-all; }
.detail-value.mono { font-family: monospace; font-size: 0.88rem; }
.detail-description { grid-column: 1 / -1; }
.detail-description .detail-value { white-space: pre-wrap; background: var(--bg); padding: 12px 14px; border-radius: 8px; border: 1px solid var(--border); }
.prescription-image-card { grid-column: 1 / -1; }
.prescription-image-card img { max-width: 100%; max-height: 500px; border-radius: 10px; border: 1px solid var(--border); display: block; }
.no-image { color: var(--text-muted); font-size: 0.88rem; font-style: italic; }

/* ── Toast ── */
.toast {
  position: fixed; bottom: 24px; right: 24px; padding: 14px 20px;
  border-radius: 12px; font-size: 0.88rem; font-weight: 500;
  box-shadow: var(--shadow-lg); transform: translateY(100px); opacity: 0;
  transition: transform 0.3s, opacity 0.3s; z-index: 1000; pointer-events: none;
  max-width: 360px;
}
.toast.success { background: #10b981; color: #fff; }
.toast.error { background: var(--danger); color: #fff; }
.toast.show { transform: translateY(0); opacity: 1; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .sidebar { width: 60px; }
  .sidebar-header span, .nav-item span, .nav-logout { display: none; }
  .sidebar-header { padding: 16px 12px; justify-content: center; }
  .nav-item { justify-content: center; padding: 12px; }
  .main-content { margin-left: 60px; padding: 20px; }
  .detail-grid { grid-template-columns: 1fr; }
}

/* ── Spinner ── */
.spinner {
  display: inline-block; width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.3); border-top-color: #fff;
  border-radius: 50%; animation: spin 0.7s linear infinite; vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }