/* ============================================================
   style.css — Computer Force User Account Management
   Developer : Leigh Hawking
   ============================================================ */

/* ─── RESET ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:       #f59e0b;
  --primary-dark:  #d97706;
  --primary-light: #fef3c7;
  --primary-glow:  rgba(245,158,11,.2);
  --bg:            #f0f4f8;
  --bg2:           #ffffff;
  --bg3:           #f8fafc;
  --border:        #e2e8f0;
  --text:          #0f172a;
  --text2:         #334155;
  --muted:         #64748b;
  --success:       #16a34a;
  --success-bg:    #f0fdf4;
  --success-bdr:   #bbf7d0;
  --error:         #dc2626;
  --error-bg:      #fef2f2;
  --error-bdr:     #fecaca;
  --radius:        16px;
  --radius-sm:     10px;
  --shadow-sm:     0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow:        0 4px 16px rgba(0,0,0,.08), 0 1px 4px rgba(0,0,0,.04);
  --shadow-lg:     0 20px 40px rgba(0,0,0,.12);
  --trans:         all .22s cubic-bezier(.4,0,.2,1);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ─── HEADER ─── */
header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(16px,4vw,48px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.logo-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-wrap img { height: 42px; width: auto; }

.header-badge {
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: .72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: .05em;
  text-transform: uppercase;
}

/* ─── HERO ─── */
.hero {
  background: linear-gradient(135deg, #fffbeb 0%, #fff7ed 50%, #fef9ee 100%);
  border-bottom: 1px solid #fde68a;
  padding: clamp(36px,5vw,64px) clamp(16px,4vw,48px);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(245,158,11,.13) 0%, transparent 70%);
  border-radius: 50%;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -60px; left: -60px;
  width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(245,158,11,.09) 0%, transparent 70%);
  border-radius: 50%;
}

.hero-logo {
  height: 80px;
  width: auto;
  margin-bottom: 18px;
  border-radius: 10px;
  position: relative;
  filter: drop-shadow(0 1px 2px rgba(245,158,11,.25));
}

.hero h1 {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 800;
  color: var(--text);
  margin-bottom: 12px;
  position: relative;
}

.hero h1 span {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 500px;
  margin: 0 auto;
  line-height: 1.7;
  position: relative;
}

/* ─── MAIN ─── */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(28px,4vw,52px) clamp(16px,3vw,48px);
}

/* ─── QUICK-ACTION CARDS ─── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}

@media (max-width: 860px) { .stats-row { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 480px) { .stats-row { grid-template-columns: 1fr; } }

.stat-card {
  background: #fff;
  border: 1.5px solid var(--border);
  border-left: 4px solid transparent;
  border-radius: 14px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: var(--trans);
  text-align: left;
  box-shadow: var(--shadow-sm);
}

.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }

.stat-card.c-create { border-left-color: #22c55e; }
.stat-card.c-view   { border-left-color: #3b82f6; }
.stat-card.c-edit   { border-left-color: #f59e0b; }
.stat-card.c-delete { border-left-color: #ef4444; }

.stat-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
  transition: var(--trans);
}

.c-create .stat-icon { background: #f0fdf4; color: #16a34a; }
.c-view   .stat-icon { background: #eff6ff; color: #2563eb; }
.c-edit   .stat-icon { background: #fffbeb; color: #d97706; }
.c-delete .stat-icon { background: #fef2f2; color: #dc2626; }

.stat-title { font-weight: 700; font-size: .9rem; color: var(--text); transition: var(--trans); }
.stat-desc  { font-size: .75rem; color: var(--muted); margin-top: 2px; transition: var(--trans); }

/* ── Active stat-card states ── */
.stat-card.active {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.stat-card.c-create.active {
  background: #16a34a;
  border-color: #16a34a;
  border-left-color: #14532d;
}
.stat-card.c-create.active .stat-icon { background: rgba(255,255,255,.2); color: #fff; }
.stat-card.c-create.active .stat-title { color: #fff; }
.stat-card.c-create.active .stat-desc  { color: rgba(255,255,255,.75); }

.stat-card.c-view.active {
  background: #2563eb;
  border-color: #2563eb;
  border-left-color: #1e3a8a;
}
.stat-card.c-view.active .stat-icon { background: rgba(255,255,255,.2); color: #fff; }
.stat-card.c-view.active .stat-title { color: #fff; }
.stat-card.c-view.active .stat-desc  { color: rgba(255,255,255,.75); }

.stat-card.c-edit.active {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  border-color: var(--primary-dark);
  border-left-color: #92400e;
}
.stat-card.c-edit.active .stat-icon { background: rgba(255,255,255,.2); color: #fff; }
.stat-card.c-edit.active .stat-title { color: #fff; }
.stat-card.c-edit.active .stat-desc  { color: rgba(255,255,255,.75); }

.stat-card.c-delete.active {
  background: #dc2626;
  border-color: #dc2626;
  border-left-color: #7f1d1d;
}
.stat-card.c-delete.active .stat-icon { background: rgba(255,255,255,.2); color: #fff; }
.stat-card.c-delete.active .stat-title { color: #fff; }
.stat-card.c-delete.active .stat-desc  { color: rgba(255,255,255,.75); }

/* ─── TAB BAR ─── */
.tab-bar {
  display: flex;
  gap: 5px;
  margin-bottom: 24px;
  background: #fff;
  padding: 6px;
  border-radius: 50px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  width: fit-content;
  flex-wrap: wrap;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 9px 22px;
  border-radius: 50px;
  cursor: pointer;
  font-size: .875rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  transition: var(--trans);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.tab-btn:hover { color: var(--text); background: var(--bg3); }

.tab-btn.active {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #fff;
  box-shadow: 0 4px 12px var(--primary-glow);
}

/* ─── PANELS ─── */
.panel { display: none; animation: fadeUp .3s ease; }
.panel.active { display: block; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── CARD ─── */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(24px,4vw,40px);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.card-bar {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-dark), var(--primary), #fbbf24);
}

.card-bar.danger {
  background: linear-gradient(90deg, #b91c1c, #dc2626, #f87171);
}

.card-header { margin-bottom: 26px; }

.card-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 5px;
}

.title-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.title-icon.amber { background: var(--primary-light); color: var(--primary-dark); }
.title-icon.blue  { background: #eff6ff; color: #2563eb; }
.title-icon.red   { background: #fef2f2; color: #dc2626; }

.card-subtitle { color: var(--muted); font-size: .875rem; }

/* ─── FORM ─── */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 18px;
}

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }

label {
  font-size: .77rem;
  font-weight: 700;
  color: var(--text2);
  letter-spacing: .05em;
  text-transform: uppercase;
}

label .req { color: var(--primary-dark); margin-left: 3px; }

.input-wrap { position: relative; }

.input-wrap .fi {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  font-size: .85rem;
  color: var(--muted);
  pointer-events: none;
  width: 16px;
  text-align: center;
}

input, select {
  width: 100%;
  background: var(--bg3);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 11px 14px 11px 38px;
  font-size: .92rem;
  font-family: 'Inter', sans-serif;
  transition: var(--trans);
  outline: none;
}

input:focus, select:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px var(--primary-glow);
}

input::placeholder { color: #94a3b8; }
select option { background: #fff; color: var(--text); }

/* ─── BUTTONS ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 26px;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  font-size: .88rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  transition: var(--trans);
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #fff;
  box-shadow: 0 4px 14px var(--primary-glow);
}
.btn-primary:hover  { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(245,158,11,.4); }
.btn-primary:active { transform: translateY(0); }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text2);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary-dark); background: var(--primary-light); }

.btn-info {
  background: #eff6ff;
  border: 1.5px solid #bfdbfe;
  color: #1d4ed8;
}
.btn-info:hover { background: #dbeafe; transform: translateY(-1px); }

.btn-danger {
  background: var(--error-bg);
  border: 1.5px solid var(--error-bdr);
  color: var(--error);
}
.btn-danger:hover { background: #fee2e2; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(220,38,38,.15); }

.btn-sm { padding: 9px 18px; font-size: .82rem; border-radius: 50px; }

.btn-row { display: flex; gap: 10px; margin-top: 26px; flex-wrap: wrap; align-items: center; }

/* ─── DIVIDER ─── */
.divider { height: 1px; background: var(--border); margin: 22px 0; }

/* ─── SEARCH ROW ─── */
.search-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg3);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 6px 6px 14px;
  margin-bottom: 20px;
  transition: var(--trans);
}

.search-row:focus-within {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.search-row .sr-icon {
  color: var(--muted);
  font-size: .9rem;
  flex-shrink: 0;
}

.search-row input {
  flex: 1;
  background: transparent;
  border: none;
  padding: 7px 0;
  box-shadow: none !important;
  font-size: .92rem;
}

.search-row input:focus { box-shadow: none; border: none; }

/* ─── RESULT BOX ─── */
.result-box {
  display: none;
  background: linear-gradient(135deg, #fffbeb 0%, #fffaeb 100%);
  border: 1.5px solid #fde68a;
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 20px;
  animation: fadeUp .3s ease;
}
.result-box.show { display: block; }

.result-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #fde68a;
}

.avatar {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem; font-weight: 800; color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 12px var(--primary-glow);
  letter-spacing: .02em;
}

.result-name  { font-family: 'Outfit', sans-serif; font-size: 1.15rem; font-weight: 700; color: var(--text); }
.result-email { color: var(--muted); font-size: .85rem; margin-top: 2px; }

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.result-item {
  background: rgba(255,255,255,.75);
  border: 1px solid #fde68a;
  border-radius: 10px;
  padding: 12px 14px;
}

.result-item .ri-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .72rem;
  font-weight: 700;
  color: var(--primary-dark);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 5px;
}

.result-item span { font-weight: 600; font-size: .9rem; color: var(--text); }

/* ─── TOAST ─── */
#toast {
  position: fixed;
  bottom: 28px; right: 28px;
  padding: 14px 20px;
  border-radius: 14px;
  font-weight: 600;
  font-size: .87rem;
  max-width: 380px;
  z-index: 9999;
  transform: translateY(100px);
  opacity: 0;
  transition: all .4s cubic-bezier(.4,0,.2,1);
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-lg);
}
#toast.show    { transform: translateY(0); opacity: 1; }
#toast.success { background: var(--success-bg); border: 1.5px solid var(--success-bdr); color: var(--success); }
#toast.error   { background: var(--error-bg);   border: 1.5px solid var(--error-bdr);   color: var(--error); }

.toast-icon { font-size: 1rem; width: 18px; text-align: center; }

/* ─── WARNING BOX ─── */
.warn-box {
  background: #fef2f2;
  border: 1.5px solid var(--error-bdr);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-top: 20px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.warn-box .warn-icon { color: var(--error); font-size: 1rem; margin-top: 1px; flex-shrink: 0; }
.warn-box p { color: #991b1b; font-size: .875rem; line-height: 1.6; }

/* ─── MODAL ─── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15,23,42,.4);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity .25s;
}
.modal-overlay.show { opacity: 1; pointer-events: all; }

.modal {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px;
  max-width: 420px; width: 90%;
  transform: scale(.9) translateY(20px);
  transition: transform .28s cubic-bezier(.4,0,.2,1);
  box-shadow: var(--shadow-lg);
}
.modal-overlay.show .modal { transform: scale(1) translateY(0); }

.modal-icon-box {
  width: 54px; height: 54px;
  background: var(--error-bg);
  border: 1.5px solid var(--error-bdr);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  color: var(--error); font-size: 1.4rem;
  margin-bottom: 18px;
}

.modal h3 { font-family: 'Outfit', sans-serif; font-size: 1.25rem; font-weight: 700; margin-bottom: 8px; }
.modal p  { color: var(--muted); line-height: 1.65; font-size: .9rem; margin-bottom: 24px; }
.modal .btn-row { margin-top: 0; }

/* ─── SPINNER ─── */
.spinner {
  display: inline-block;
  width: 15px; height: 15px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── FOOTER ─── */
footer {
  background: #fff;
  border-top: 1px solid var(--border);
  padding: 24px clamp(16px,4vw,48px);
  text-align: center;
  color: var(--muted);
  font-size: .82rem;
  margin-top: 52px;
}
footer strong { color: var(--text2); }

/* ─── RESPONSIVE ─── */
@media (max-width: 640px) {
  .tab-bar { width: 100%; }
  .tab-btn { flex: 1; justify-content: center; padding: 9px 10px; font-size: .78rem; }
  .tab-btn .tab-label { display: none; }
}

/* ─── CUSTOM SCROLLBAR ─── */

/* Webkit browsers: Chrome, Edge, Safari */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 999px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--primary-dark), var(--primary));
  border-radius: 999px;
  border: 2px solid #f1f5f9;
  transition: background .2s;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #b45309, var(--primary-dark));
}

::-webkit-scrollbar-corner {
  background: #f1f5f9;
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--primary) #f1f5f9;
}
