
/* ============================================
   CARDVERIFY
   COMPLETE APPLICATION STYLESHEET
   PHP + MYSQL + VANILLA JAVASCRIPT

   Colors: Green, Cream, Black
============================================ */


/* ============================================
   1. DESIGN VARIABLES
============================================ */

:root {
  /* Primary colors */
  --green-950: #092c22;
  --green-900: #103e2f;
  --green-800: #18533f;
  --green-700: #21694f;
  --green-600: #2a805d;
  --green-500: #369b70;
  --green-100: #e5f1e9;
  --green-50: #f2f8f3;

  /* Cream */
  --cream-50: #fffef9;
  --cream-100: #faf7ed;
  --cream-200: #f1ead9;
  --cream-300: #e6dcc5;

  /* Neutral */
  --black: #171b18;
  --gray-900: #29312b;
  --gray-700: #59665d;
  --gray-500: #87938a;
  --gray-300: #d7dfd8;
  --gray-100: #f3f5f2;
  --white: #ffffff;

  /* Semantic */
  --success: #187346;
  --success-bg: #e8f6ed;

  --danger: #b42332;
  --danger-bg: #fff0f1;

  --warning: #946200;
  --warning-bg: #fff4d9;

  --info: #24609b;
  --info-bg: #eaf3ff;

  /* Application */
  --primary: var(--green-900);
  --primary-hover: var(--green-700);
  --text: var(--black);
  --text-muted: #66716a;
  --surface: var(--white);
  --surface-soft: var(--cream-100);
  --background: var(--cream-100);
  --border: #e5e8df;

  /* Radius */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 999px;

  /* Shadows */
  --shadow-sm:
    0 2px 8px rgba(15, 45, 31, 0.04);

  --shadow-md:
    0 8px 30px rgba(15, 45, 31, 0.07);

  --shadow-lg:
    0 20px 70px rgba(15, 45, 31, 0.09);

  /* Layout */
  --sidebar-width: 260px;
  --topbar-height: 76px;

  /* Motion */
  --transition: 180ms ease;
}


/* ============================================
   2. GLOBAL RESET
============================================ */

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

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: var(--background);
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Arial,
    sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body,
button,
input,
select,
textarea {
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Arial,
    sans-serif;
}

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

button {
  cursor: pointer;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg,
video {
  max-width: 100%;
}

img {
  display: block;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin-top: 0;
  color: var(--green-950);
  line-height: 1.25;
}

p {
  margin-top: 0;
}

input,
textarea,
select {
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid var(--green-500);
  outline-offset: 3px;
}

::selection {
  color: white;
  background: var(--green-700);
}


/* ============================================
   3. COMMON UTILITIES
============================================ */

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

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

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

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

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

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

.w-full {
  width: 100%;
}

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

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

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

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

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

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

.flex {
  display: flex;
}

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

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

.gap-1 {
  gap: 8px;
}

.gap-2 {
  gap: 16px;
}

.gap-3 {
  gap: 24px;
}


/* ============================================
   4. COMMON BUTTONS
============================================ */

.btn {
  min-height: 46px;
  padding: 11px 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: white;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background var(--transition),
    color var(--transition),
    border-color var(--transition),
    box-shadow var(--transition),
    transform var(--transition);
}

.btn:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 7px 18px rgba(16, 62, 47, 0.14);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
}

.btn-secondary {
  border-color: var(--cream-300);
  background: var(--cream-100);
  color: var(--green-900);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--green-100);
  border-color: var(--green-600);
  box-shadow: none;
}

.btn-outline {
  border-color: var(--border);
  background: transparent;
  color: var(--green-900);
}

.btn-outline:hover:not(:disabled) {
  background: var(--green-50);
  border-color: var(--green-600);
  box-shadow: none;
}

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

.btn-danger:hover:not(:disabled) {
  background: #921c2b;
}

.btn-success {
  background: var(--success);
}

.btn-success:hover:not(:disabled) {
  background: #125a37;
}

.btn-sm {
  min-height: 36px;
  padding: 7px 13px;
  border-radius: 8px;
  font-size: 12px;
}

.btn-lg {
  min-height: 54px;
  padding: 14px 26px;
  font-size: 14px;
}

.btn-block {
  width: 100%;
}

.btn-icon {
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
}


/* ============================================
   5. COMMON FORM ELEMENTS
============================================ */

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

.form-label,
.form-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--gray-900);
  font-size: 13px;
  font-weight: 700;
}

.form-control,
.form-select,
.form-textarea,
.form-group input:not([type="checkbox"]):not([type="radio"]),
.form-group select,
.form-group textarea {
  width: 100%;
  min-height: 48px;
  padding: 11px 15px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  background: var(--cream-50);
  color: var(--text);
  font-size: 14px;
  transition:
    border-color var(--transition),
    background var(--transition),
    box-shadow var(--transition);
}

.form-textarea,
.form-group textarea {
  min-height: 140px;
  resize: vertical;
}

.form-control::placeholder,
.form-textarea::placeholder,
.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #9aa39b;
}

.form-control:focus,
.form-select:focus,
.form-textarea:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--green-600);
  background: white;
  box-shadow: 0 0 0 4px rgba(42, 128, 93, 0.1);
}

.form-help {
  display: block;
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 12px;
}

.form-error {
  display: block;
  margin-top: 6px;
  color: var(--danger);
  font-size: 12px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}


/* ============================================
   6. COMMON CARDS
============================================ */

.card {
  position: relative;
  width: 100%;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 22px;
}

.card-title {
  margin: 0 0 5px;
  color: var(--green-950);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.card-description {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
}


/* ============================================
   7. PUBLIC VERIFICATION PAGE
============================================ */

body:has(.public-shell) {
  background:
    radial-gradient(
      circle at 10% 10%,
      rgba(42, 128, 93, 0.075),
      transparent 38%
    ),
    radial-gradient(
      circle at 90% 88%,
      rgba(230, 220, 197, 0.6),
      transparent 40%
    ),
    var(--cream-100);
}

.public-shell {
  width: min(100% - 36px, 660px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 52px 0 28px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 12px;
  color: var(--green-950);
  font-size: 15px;
  font-weight: 850;
  letter-spacing: 0.11em;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: white;
  background: var(--green-900);
  font-size: 23px;
  font-weight: 750;
  box-shadow:
    0 7px 18px rgba(16, 62, 47, 0.18);
}


/* ============================================
   8. PUBLIC HERO
============================================ */

.hero {
  overflow: hidden;
  padding: 36px;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}

.hero::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 170px;
  height: 170px;
  border-radius: 0 0 0 100%;
  background: linear-gradient(
    135deg,
    rgba(229, 241, 233, 0.7),
    rgba(241, 234, 217, 0.35)
  );
  pointer-events: none;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--green-700);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.hero .eyebrow {
  margin-bottom: 22px;
}

.hero .eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green-600);
}

.hero h1 {
  position: relative;
  margin: 0 0 14px;
  color: var(--green-950);
  font-size: clamp(32px, 5.5vw, 48px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.055em;
}

.hero > p {
  position: relative;
  max-width: 460px;
  margin: 0 0 30px;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.8;
}


/* ============================================
   9. CARD VERIFICATION FORM
============================================ */

.lookup-form {
  position: relative;
  margin-bottom: 14px;
}

.lookup-form label {
  display: block;
  margin-bottom: 10px;
  color: var(--black);
  font-size: 13px;
  font-weight: 750;
}

.input-row {
  display: flex;
  align-items: stretch;
  gap: 10px;
}

.input-row input {
  flex: 1;
  width: 100%;
  min-width: 0;
  height: 54px;
  padding: 0 17px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  background: var(--cream-50);
  color: var(--black);
  font-size: 14px;
  font-weight: 550;
  transition:
    border-color var(--transition),
    background var(--transition),
    box-shadow var(--transition);
}

.input-row input::placeholder {
  color: #9aa39b;
  font-weight: 400;
}

.input-row input:hover {
  border-color: var(--cream-300);
}

.input-row input:focus {
  border-color: var(--green-600);
  background: white;
  box-shadow:
    0 0 0 4px rgba(42, 128, 93, 0.1);
}

.input-row .btn {
  min-height: 54px;
}


/* ============================================
   10. QR SCANNER
============================================ */

#scan-btn {
  width: 100%;
}

#scan-feedback {
  margin-top: 12px;
  text-align: center;
  font-size: 12px;
  line-height: 1.6;
}

#scan-feedback:empty {
  display: none;
}

#camera {
  display: block;
  width: 100%;
  max-height: 340px;
  margin-top: 18px;
  border: 2px solid var(--green-700);
  border-radius: var(--radius-md);
  background: var(--black);
  object-fit: cover;
  aspect-ratio: 4 / 3;
}

#stop-btn {
  width: 100%;
  margin-top: 12px;
}


/* ============================================
   11. VERIFICATION RESULT
============================================ */

.result {
  padding: 30px;
  border-radius: var(--radius-xl);
  animation: result-appear 300ms ease-out;
}

.result h2 {
  margin: 18px 0 8px;
  color: var(--green-950);
  font-size: clamp(22px, 4vw, 29px);
  font-weight: 800;
  letter-spacing: -0.035em;
  overflow-wrap: anywhere;
}

.result > p {
  margin: 0;
  font-size: 14px;
  line-height: 1.7;
}

.success,
.error {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 800;
}

.success {
  background: var(--success-bg);
  color: var(--success);
}

.error {
  margin-bottom: 16px;
  background: var(--danger-bg);
  color: var(--danger);
}


/* ============================================
   12. ASSIGNED CARD MESSAGE
============================================ */

.message {
  margin-top: 26px;
  padding: 24px;
  border: 1px solid var(--cream-300);
  border-radius: var(--radius-md);
  background: linear-gradient(
    145deg,
    var(--cream-100),
    var(--cream-50)
  );
}

.message h3 {
  margin: 0 0 12px;
  color: var(--green-900);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.025em;
  overflow-wrap: anywhere;
}

.message p {
  margin: 0;
  color: var(--black);
  font-size: 14px;
  line-height: 1.9;
  overflow-wrap: anywhere;
}


/* ============================================
   13. PUBLIC FOOTER
============================================ */

.public-shell > footer {
  margin-top: auto;
  padding: 10px 0 0;
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
}


/* ============================================
   14. ADMIN LOGIN
============================================ */

.auth-shell,
.login-shell {
  width: 100%;
  min-height: 100vh;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(
      circle at top left,
      rgba(42, 128, 93, 0.12),
      transparent 40%
    ),
    var(--cream-100);
}

.auth-card,
.login-card {
  width: min(100%, 440px);
  padding: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: white;
  box-shadow: var(--shadow-lg);
}

.auth-brand,
.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 35px;
  color: var(--green-900);
  font-size: 17px;
  font-weight: 850;
}

.auth-card h1,
.login-card h1 {
  margin: 0 0 10px;
  color: var(--green-950);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.auth-subtitle,
.login-subtitle {
  margin-bottom: 28px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.7;
}

.auth-card .btn,
.login-card .btn {
  width: 100%;
}

.auth-footer,
.login-footer {
  margin-top: 26px;
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
}


/* ============================================
   15. ADMIN APPLICATION LAYOUT
============================================ */

.admin-layout,
.admin-shell {
  display: flex;
  width: 100%;
  min-height: 100vh;
  background: #f7f8f4;
}

.admin-main,
.admin-content-wrapper {
  flex: 1;
  min-width: 0;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
}

.admin-content,
.page-content {
  width: 100%;
  max-width: 1500px;
  margin: 0 auto;
  padding: 32px;
}


/* ============================================
   16. ADMIN SIDEBAR
============================================ */

.admin-sidebar,
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  width: var(--sidebar-width);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  background: var(--green-950);
  color: white;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px 28px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  color: white;
  font-size: 17px;
  font-weight: 850;
  letter-spacing: -0.025em;
}

.sidebar-brand .brand-mark {
  background: var(--green-600);
  box-shadow: none;
}

.sidebar-section-title {
  padding: 26px 14px 10px;
  color: #93ab9d;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.sidebar-nav,
.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 18px;
}

.sidebar-link,
.admin-nav a {
  min-height: 46px;
  padding: 11px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: var(--radius-sm);
  color: #c8d7cc;
  font-size: 13px;
  font-weight: 600;
  transition:
    color var(--transition),
    background var(--transition);
}

.sidebar-link:hover,
.admin-nav a:hover {
  background: rgba(255,255,255,0.075);
  color: white;
}

.sidebar-link.active,
.admin-nav a.active,
.sidebar-link[aria-current="page"],
.admin-nav a[aria-current="page"] {
  background: var(--green-700);
  color: white;
  font-weight: 750;
}

.sidebar-link svg,
.admin-nav a svg {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
}

.sidebar-bottom {
  margin-top: auto;
  padding-top: 22px;
}

.sidebar-footer {
  padding: 18px 12px 0;
  color: #94aa9d;
  font-size: 11px;
  line-height: 1.7;
}


/* ============================================
   17. ADMIN TOPBAR
============================================ */

.admin-topbar,
.topbar {
  min-height: var(--topbar-height);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--border);
  background: white;
}

.topbar-title {
  color: var(--green-950);
  font-size: 17px;
  font-weight: 800;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.admin-avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--green-100);
  color: var(--green-900);
  font-size: 14px;
  font-weight: 800;
}

.admin-name {
  color: var(--gray-900);
  font-size: 13px;
  font-weight: 700;
}


/* ============================================
   18. PAGE HEADERS
============================================ */

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 28px;
}

.page-heading h1,
.page-header h1 {
  margin: 0 0 7px;
  color: var(--green-950);
  font-size: clamp(23px, 3vw, 30px);
  font-weight: 850;
  letter-spacing: -0.04em;
}

.page-heading p,
.page-header p {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}


/* ============================================
   19. DASHBOARD STATISTICS
============================================ */

.stats-grid,
.dashboard-grid {
  display: grid;
  grid-template-columns:
    repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 26px;
}

.stat-card {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: white;
  box-shadow: var(--shadow-sm);
}

.stat-label {
  display: block;
  margin-bottom: 14px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 650;
}

.stat-value {
  display: block;
  color: var(--green-950);
  font-size: 32px;
  font-weight: 850;
  letter-spacing: -0.055em;
  line-height: 1.2;
}

.stat-meta {
  display: block;
  margin-top: 10px;
  color: var(--text-muted);
  font-size: 11px;
}

.stat-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  border-radius: 12px;
  background: var(--green-100);
  color: var(--green-800);
}


/* ============================================
   20. ADMIN TABLES
============================================ */

.table-card {
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: white;
  box-shadow: var(--shadow-sm);
}

.table-header {
  padding: 22px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  border-bottom: 1px solid var(--border);
}

.table-title {
  margin: 0;
  color: var(--green-950);
  font-size: 16px;
  font-weight: 800;
}

.table-responsive,
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table,
.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

thead {
  background: #f7f9f5;
}

th {
  padding: 15px 20px;
  color: var(--gray-700);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.045em;
  text-transform: uppercase;
  white-space: nowrap;
}

td {
  padding: 17px 20px;
  color: var(--gray-900);
  font-size: 13px;
  vertical-align: middle;
  border-top: 1px solid var(--border);
}

tbody tr {
  transition: background var(--transition);
}

tbody tr:hover {
  background: var(--green-50);
}

td strong {
  color: var(--green-950);
  font-weight: 750;
}

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

.table-actions form {
  margin: 0;
}

.table-empty,
.empty-state {
  padding: 50px 25px;
  text-align: center;
}

.empty-state h3 {
  margin: 0 0 8px;
  font-size: 17px;
}

.empty-state p {
  margin: 0 0 20px;
  color: var(--text-muted);
  font-size: 13px;
}


/* ============================================
   21. STATUS BADGES
============================================ */

.badge,
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: var(--radius-full);
  background: var(--gray-100);
  color: var(--gray-700);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.badge-active,
.status-active,
.badge-success {
  background: var(--success-bg);
  color: var(--success);
}

.badge-inactive,
.status-inactive {
  background: var(--gray-100);
  color: var(--gray-700);
}

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

.badge-danger {
  background: var(--danger-bg);
  color: var(--danger);
}


/* ============================================
   22. SEARCH AND FILTERS
============================================ */

.toolbar,
.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

.search-box {
  flex: 1;
  min-width: 200px;
  max-width: 380px;
}

.search-box input {
  width: 100%;
  min-height: 44px;
  padding: 10px 15px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: white;
  color: var(--text);
  outline: none;
}

.search-box input:focus {
  border-color: var(--green-600);
  box-shadow:
    0 0 0 4px rgba(42, 128, 93, 0.1);
}

.filter-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}


/* ============================================
   23. ADD AND EDIT FORM PAGES
============================================ */

.form-card {
  width: 100%;
  max-width: 760px;
  padding: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: white;
  box-shadow: var(--shadow-sm);
}

.form-card h2 {
  margin: 0 0 7px;
  color: var(--green-950);
  font-size: 20px;
  font-weight: 800;
}

.form-card > p {
  margin-bottom: 26px;
  color: var(--text-muted);
  font-size: 13px;
}

.form-section {
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.form-section:last-of-type {
  border-bottom: none;
}

.form-section-title {
  margin: 0 0 18px;
  color: var(--green-950);
  font-size: 15px;
  font-weight: 800;
}


/* ============================================
   24. ALERTS
============================================ */

.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 20px;
  padding: 15px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.7;
}

.alert-success {
  border-color: #cce8d5;
  background: var(--success-bg);
  color: var(--success);
}

.alert-danger,
.alert-error {
  border-color: #f0d0d4;
  background: var(--danger-bg);
  color: var(--danger);
}

.alert-warning {
  border-color: #f2dfac;
  background: var(--warning-bg);
  color: var(--warning);
}

.alert-info {
  border-color: #d5e6fa;
  background: var(--info-bg);
  color: var(--info);
}


/* ============================================
   25. DELETE CONFIRMATION
============================================ */

.delete-confirmation {
  width: 100%;
  max-width: 520px;
  margin: 30px auto;
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: white;
  text-align: center;
  box-shadow: var(--shadow-md);
}

.delete-confirmation h2 {
  margin: 0 0 12px;
  font-size: 23px;
}

.delete-confirmation p {
  margin-bottom: 25px;
  color: var(--text-muted);
  font-size: 14px;
}

.delete-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}


/* ============================================
   26. PAGINATION
============================================ */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 24px;
}

.pagination a,
.pagination span {
  min-width: 37px;
  height: 37px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  color: var(--gray-700);
  font-size: 12px;
  font-weight: 700;
}

.pagination a:hover {
  border-color: var(--green-600);
  color: var(--green-900);
}

.pagination .active,
.pagination [aria-current="page"] {
  border-color: var(--green-900);
  background: var(--green-900);
  color: white;
}


/* ============================================
   27. ADMIN FOOTER
============================================ */

.admin-footer {
  margin-top: auto;
  padding: 22px 32px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
}


/* ============================================
   28. ANIMATIONS
============================================ */

@keyframes result-appear {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}


/* ============================================
   29. LARGE TABLET
============================================ */

@media (max-width: 1100px) {
  :root {
    --sidebar-width: 230px;
  }

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

  .admin-content,
  .page-content {
    padding: 26px;
  }
}


/* ============================================
   30. TABLET
============================================ */

@media (max-width: 768px) {
  :root {
    --sidebar-width: 0px;
    --topbar-height: 65px;
  }

  .public-shell {
    padding-top: 32px;
    gap: 22px;
  }

  .hero {
    padding: 28px;
    border-radius: 24px;
  }

  .hero h1 {
    font-size: clamp(30px, 7vw, 40px);
  }

  .admin-sidebar,
  .sidebar {
    position: static;
    width: 100%;
    padding: 12px;
    overflow: visible;
  }

  .admin-layout,
  .admin-shell {
    flex-direction: column;
  }

  .admin-main,
  .admin-content-wrapper {
    width: 100%;
    margin-left: 0;
  }

  .sidebar-brand {
    padding: 10px 12px 14px;
  }

  .sidebar-nav,
  .admin-nav {
    flex-direction: row;
    flex-wrap: wrap;
    margin-top: 8px;
  }

  .sidebar-link,
  .admin-nav a {
    min-height: 40px;
    padding: 9px 12px;
    font-size: 12px;
  }

  .sidebar-section-title,
  .sidebar-bottom,
  .sidebar-footer {
    display: none;
  }

  .admin-content,
  .page-content {
    padding: 22px;
  }

  .admin-topbar,
  .topbar {
    padding: 0 22px;
  }

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

  .card {
    padding: 24px;
  }

  .table-card {
    padding: 0;
  }
}


/* ============================================
   31. MOBILE
============================================ */

@media (max-width: 480px) {
  .public-shell {
    width: calc(100% - 28px);
    padding-top: 22px;
    gap: 18px;
  }

  .brand {
    gap: 9px;
    font-size: 13px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    font-size: 20px;
  }

  .hero {
    padding: 24px 20px;
    border-radius: 20px;
  }

  .hero .eyebrow {
    margin-bottom: 19px;
    font-size: 10px;
  }

  .hero h1 {
    font-size: 34px;
  }

  .hero > p {
    margin-bottom: 25px;
    font-size: 13px;
    line-height: 1.8;
  }

  .input-row {
    flex-direction: column;
    gap: 10px;
  }

  .input-row input {
    flex: none;
    height: 52px;
    font-size: 16px;
  }

  .input-row .btn {
    width: 100%;
  }

  .btn {
    min-height: 44px;
    font-size: 12px;
  }

  .btn-lg {
    min-height: 52px;
  }

  .result {
    padding: 24px 20px;
    border-radius: 20px;
  }

  .result h2 {
    font-size: 25px;
  }

  .message {
    padding: 20px;
  }

  .message h3 {
    font-size: 17px;
  }

  .message p {
    font-size: 13px;
  }

  #camera {
    max-height: 300px;
  }

  .auth-shell,
  .login-shell {
    padding: 15px;
  }

  .auth-card,
  .login-card {
    padding: 28px 22px;
    border-radius: 20px;
  }

  .auth-card h1,
  .login-card h1 {
    font-size: 25px;
  }

  .admin-content,
  .page-content {
    padding: 18px 14px;
  }

  .admin-topbar,
  .topbar {
    padding: 0 14px;
  }

  .topbar-title {
    font-size: 15px;
  }

  .admin-name {
    display: none;
  }

  .page-header {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .page-header h1 {
    font-size: 24px;
  }

  .page-actions {
    width: 100%;
  }

  .page-actions .btn {
    flex: 1;
  }

  .stats-grid,
  .dashboard-grid {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .stat-card {
    padding: 17px 14px;
    border-radius: 14px;
  }

  .stat-label {
    margin-bottom: 10px;
    font-size: 11px;
  }

  .stat-value {
    font-size: 26px;
  }

  .stat-meta {
    font-size: 10px;
  }

  .card {
    padding: 20px;
    border-radius: 16px;
  }

  .table-card {
    padding: 0;
  }

  .table-header {
    padding: 18px;
  }

  th {
    padding: 12px 14px;
    font-size: 10px;
  }

  td {
    padding: 14px;
    font-size: 12px;
  }

  .table-actions {
    gap: 5px;
  }

  .form-card {
    padding: 22px 18px;
    border-radius: 16px;
  }

  .form-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .form-actions .btn {
    width: 100%;
  }

  .toolbar,
  .table-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .search-box {
    max-width: none;
  }

  .admin-footer {
    padding: 18px 14px;
  }
}


/* ============================================
   32. EXTRA SMALL SCREENS
============================================ */

@media (max-width: 360px) {
  .hero h1 {
    font-size: 29px;
  }

  .hero {
    padding: 22px 16px;
  }

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

  .brand {
    font-size: 12px;
  }

  .sidebar-link,
  .admin-nav a {
    font-size: 11px;
  }
}


/* ============================================
   33. REDUCED MOTION
============================================ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
