/* ============================================================
   Wonmi Copy Center — Shared Stylesheet (style.css)
   I-link sa lahat ng pages:
   <link rel="stylesheet" href="style.css"/>
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── CSS Variables ─────────────────────────────── */
:root {
  --red:       #e8404a;
  --red-d:     #c0313a;
  --red-l:     #fbeaea;
  --red-m:     rgba(232,64,74,.08);
  --white:     #ffffff;
  --gray-50:   #f8f8f8;
  --gray-100:  #f0f0f0;
  --gray-200:  #e0e0e0;
  --gray-300:  #cccccc;
  --gray-400:  #aaaaaa;
  --gray-600:  #666666;
  --gray-800:  #333333;
  --green:     #10b981;
  --green-l:   #d1fae5;
  --green-d:   #065f46;
  --amber:     #f59e0b;
  --amber-l:   #fef3c7;
  --amber-d:   #92400e;
  --blue:      #3b82f6;
  --blue-l:    #dbeafe;
  --blue-d:    #1e40af;
  --purple:    #8b5cf6;
  --purple-l:  #ede9fe;
  --purple-d:  #5b21b6;
  --sidebar-w: 200px;
  --radius:    10px;
  --radius-sm: 7px;
  --shadow-sm: 0 1px 4px rgba(0,0,0,.06);
  --shadow:    0 4px 18px rgba(0,0,0,.10);
}

/* ── Base ──────────────────────────────────────── */
html, body {
  height: 100%;
  font-family: 'Inter', sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
}
a { text-decoration: none; }

/* ── Layout ────────────────────────────────────── */
.layout { display: flex; min-height: 100vh; }
.layout-fixed { display: flex; height: 100vh; overflow: hidden; }

/* ── SIDEBAR ───────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--red);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100vh;
  position: sticky;
  top: 0;
}

/* Brand */
.sidebar-brand {
  padding: 1.4rem 1.2rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.15);
}
.brand-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.brand-icon {
  width: 32px; height: 32px;
  background: rgba(255,255,255,.2);
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.brand-icon svg { width: 18px; height: 18px; }
.brand-name  { font-size: 1rem; font-weight: 600; color: #fff; line-height: 1.2; }
.brand-tagline { font-size: .68rem; color: rgba(255,255,255,.65); margin-left: 40px; }

/* Nav */
.sidebar-nav {
  flex: 1;
  padding: 1rem .75rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}
.sidebar-nav::-webkit-scrollbar { width: 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: .6rem .8rem;
  border-radius: 8px;
  font-size: .82rem;
  font-weight: 500;
  color: rgba(255,255,255,.75);
  text-decoration: none;
  transition: background .15s, color .15s;
}
.nav-item:hover  { background: rgba(255,255,255,.12); color: #fff; }
.nav-item.active { background: rgba(0,0,0,.15); color: #fff; }
.nav-item svg    { width: 16px; height: 16px; flex-shrink: 0; }

/* Footer */
.sidebar-footer {
  padding: .9rem .75rem;
  border-top: 1px solid rgba(255,255,255,.15);
}
.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: .5rem .6rem;
  border-radius: 8px;
  background: rgba(0,0,0,.12);
  margin-bottom: 8px;
}
.user-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,.25);
  display: flex; align-items: center; justify-content: center;
  font-size: .68rem; font-weight: 600; color: #fff;
  flex-shrink: 0;
}
.user-info .uname { font-size: .78rem; font-weight: 500; color: #fff; line-height: 1; margin-bottom: 2px; }
.user-info .urole { font-size: .65rem; color: rgba(255,255,255,.6); text-transform: capitalize; }

.btn-logout {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: .5rem .8rem;
  background: rgba(0,0,0,.12);
  border: none;
  border-radius: 8px;
  color: rgba(255,255,255,.8);
  font-family: 'Inter', sans-serif;
  font-size: .78rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s;
  text-decoration: none;
}
.btn-logout:hover { background: rgba(0,0,0,.22); color: #fff; }
.btn-logout svg  { width: 14px; height: 14px; }

/* ── MAIN ──────────────────────────────────────── */
.main { flex: 1; overflow-y: auto; min-width: 0; }
.main-flex { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }

/* ── TOPBAR ────────────────────────────────────── */
.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: .9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}
.page-title { font-size: 1.05rem; font-weight: 600; color: var(--gray-800); }
.page-sub   { font-size: .74rem; color: var(--gray-400); margin-top: 2px; }
.tb-right   { display: flex; align-items: center; gap: 9px; }

/* ── BUTTONS ───────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: .78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  border: none;
  white-space: nowrap;
  text-decoration: none;
}
.btn svg { width: 13px; height: 13px; }

.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-d); transform: translateY(-1px); box-shadow: 0 3px 10px rgba(232,64,74,.3); }

.btn-outline { background: transparent; border: 1px solid var(--gray-200); color: var(--gray-600); }
.btn-outline:hover { border-color: var(--gray-400); color: var(--gray-800); background: var(--gray-50); }

.btn-ghost {
  padding: 7px 14px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: transparent;
  font-family: 'Inter', sans-serif;
  font-size: .78rem;
  font-weight: 500;
  color: var(--gray-600);
  cursor: pointer;
  transition: all .15s;
}
.btn-ghost:hover { border-color: var(--gray-400); color: var(--gray-800); }

.btn-danger {
  flex: 1;
  padding: 9px;
  border: none;
  border-radius: var(--radius-sm);
  background: #ef4444;
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.btn-danger:hover { background: #dc2626; }

/* ── SEARCH ────────────────────────────────────── */
.search-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  width: 220px;
}
.search-wrap svg { width: 13px; height: 13px; color: var(--gray-400); flex-shrink: 0; }
.search-wrap input {
  border: none;
  background: transparent;
  font-family: 'Inter', sans-serif;
  font-size: .78rem;
  color: var(--gray-800);
  outline: none;
  width: 100%;
}
.search-wrap input::placeholder { color: var(--gray-400); }

/* ── CARDS ─────────────────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1.2rem;
  box-shadow: var(--shadow-sm);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.card-title { font-size: .88rem; font-weight: 600; color: var(--gray-800); }
.card-sub   { font-size: .72rem; color: var(--gray-400); margin-top: 2px; }
.card-link  {
  font-size: .75rem;
  color: var(--red);
  font-weight: 500;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 3px;
}
.card-link:hover { text-decoration: underline; }
.card-link svg { width: 12px; height: 12px; }

/* ── STAT CARDS ────────────────────────────────── */
.stats-row { display: grid; grid-template-columns: repeat(4,1fr); gap: 11px; flex-shrink: 0; }

.stat-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: .9rem 1rem;
  display: flex;
  align-items: center;
  gap: 11px;
  box-shadow: var(--shadow-sm);
  transition: transform .15s, box-shadow .15s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.stat-ico {
  width: 36px; height: 36px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-ico svg { width: 16px; height: 16px; }

.ico-blue   { background: var(--blue-l);   } .ico-blue   svg { color: var(--blue);   }
.ico-red    { background: var(--red-l);    } .ico-red    svg { color: var(--red);    }
.ico-green  { background: var(--green-l);  } .ico-green  svg { color: var(--green);  }
.ico-purple { background: var(--purple-l); } .ico-purple svg { color: var(--purple); }
.ico-amber  { background: var(--amber-l);  } .ico-amber  svg { color: var(--amber);  }

.stat-val { font-size: 1.3rem; font-weight: 700; color: var(--gray-800); line-height: 1; }
.stat-lbl { font-size: .68rem; color: var(--gray-400); margin-top: 2px; }

/* ── BADGES ────────────────────────────────────── */
.badge {
  font-size: .68rem;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 20px;
  display: inline-block;
}
.badge-green  { background: var(--green-l);  color: var(--green-d); }
.badge-red    { background: #fee2e2;          color: #991b1b; }
.badge-amber  { background: var(--amber-l);  color: var(--amber-d); }
.badge-blue   { background: var(--blue-l);   color: var(--blue-d); }
.badge-purple { background: var(--purple-l); color: var(--purple-d); }
.badge-gray   { background: var(--gray-100); color: var(--gray-600); }

/* Role badges */
.role-badge { font-size: .62rem; font-weight: 600; padding: 2px 8px; border-radius: 20px; }
.rb-admin   { background: var(--red-l);    color: var(--red);   }
.rb-staff   { background: var(--green-l);  color: var(--green-d); }
.rb-manager { background: var(--blue-l);   color: var(--blue-d); }

/* ── FILTER PILLS ──────────────────────────────── */
.filter-pills { display: flex; gap: 5px; flex-wrap: wrap; }
.fpill {
  padding: 5px 14px;
  border-radius: 20px;
  border: 1px solid var(--gray-200);
  background: var(--white);
  font-family: 'Inter', sans-serif;
  font-size: .74rem;
  font-weight: 500;
  color: var(--gray-600);
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.fpill:hover  { border-color: var(--red); color: var(--red); }
.fpill.active { background: var(--red); border-color: var(--red); color: #fff; }
.fpill .cnt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px; height: 17px;
  padding: 0 4px;
  border-radius: 10px;
  font-size: .58rem;
  font-weight: 700;
  margin-left: 4px;
  background: rgba(255,255,255,.25);
}
.fpill:not(.active) .cnt { background: var(--gray-100); color: var(--gray-600); }

/* ── TABLE ─────────────────────────────────────── */
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .8rem; }
thead th {
  text-align: left;
  padding: .6rem 1rem;
  font-size: .64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--gray-400);
  border-bottom: 1px solid var(--gray-100);
  background: var(--gray-50);
  white-space: nowrap;
  position: sticky; top: 0; z-index: 2;
}
tbody td {
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background .12s; }
tbody tr:hover td { background: #fafafa; }

tfoot td {
  padding: .85rem 1rem;
  font-weight: 600;
  color: var(--gray-800);
  background: var(--gray-50);
  border-top: 1px solid var(--gray-200);
}

/* ── PAGINATION ────────────────────────────────── */
.pagination {
  padding: .7rem 1rem;
  border-top: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.pg-info { font-size: .7rem; color: var(--gray-400); }
.pg-btns { display: flex; gap: 3px; }
.pg-btn {
  width: 28px; height: 28px;
  border-radius: 6px;
  border: 1px solid var(--gray-200);
  background: var(--white);
  font-family: 'Inter', sans-serif;
  font-size: .72rem;
  color: var(--gray-600);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.pg-btn:hover  { border-color: var(--red); color: var(--red); }
.pg-btn.active { background: var(--red); color: #fff; border-color: var(--red); }
.pg-btn:disabled { opacity: .35; cursor: not-allowed; }
.pg-btn svg { width: 11px; height: 11px; }

/* ── FORMS ─────────────────────────────────────── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group.full { grid-column: 1 / -1; }

.form-label {
  font-size: .68rem;
  font-weight: 700;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.form-input {
  padding: 8px 11px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: .8rem;
  color: var(--gray-800);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  background: var(--white);
  width: 100%;
}
.form-input:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(232,64,74,.1); }
select.form-input { cursor: pointer; }
textarea.form-input { resize: vertical; min-height: 68px; }
.form-hint { font-size: .66rem; color: var(--gray-400); margin-top: 2px; }

/* ── MODAL ─────────────────────────────────────── */
.modal-bd {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.38);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; pointer-events: none;
  transition: opacity .2s;
}
.modal-bd.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--white);
  border-radius: 14px;
  width: 100%; max-width: 500px; max-height: 90vh;
  display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,.18);
  transform: translateY(14px) scale(.97);
  transition: transform .28s cubic-bezier(.34,1.56,.64,1);
}
.modal-bd.open .modal { transform: translateY(0) scale(1); }

.modal-head {
  padding: 1.1rem 1.3rem .9rem;
  border-bottom: 1px solid var(--gray-100);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.modal-title { font-size: .95rem; font-weight: 600; color: var(--gray-800); }
.modal-sub   { font-size: .7rem; color: var(--gray-400); margin-top: 2px; }

.modal-close {
  width: 28px; height: 28px;
  border-radius: 7px;
  border: 1px solid var(--gray-200);
  background: transparent;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-400);
  transition: all .15s;
}
.modal-close:hover { border-color: var(--red); color: var(--red); background: var(--red-l); }
.modal-close svg { width: 12px; height: 12px; }

.modal-body { padding: 1.1rem 1.3rem; overflow-y: auto; flex: 1; }
.modal-body::-webkit-scrollbar { width: 3px; }

.modal-foot {
  padding: .9rem 1.3rem;
  border-top: 1px solid var(--gray-100);
  display: flex; align-items: center; justify-content: flex-end;
  gap: 8px; flex-shrink: 0;
}

/* Delete modal */
.del-modal { max-width: 360px; }
.del-ico {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: #fee2e2;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1rem;
}
.del-ico svg { width: 24px; height: 24px; color: #ef4444; }
.del-title { font-size: .95rem; font-weight: 600; color: var(--gray-800); margin-bottom: .4rem; text-align: center; }
.del-sub   { font-size: .78rem; color: var(--gray-600); line-height: 1.5; text-align: center; }
.del-foot  { display: flex; gap: 8px; margin-top: 1.2rem; }

/* ── TOAST ─────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 20px; right: 20px;
  background: var(--gray-800);
  color: #fff;
  font-size: .76rem; font-weight: 500;
  padding: 10px 16px;
  border-radius: 9px;
  box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 8px;
  z-index: 200;
  transform: translateY(6px); opacity: 0;
  transition: all .25s cubic-bezier(.34,1.56,.64,1);
  pointer-events: none;
  max-width: 320px;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast svg  { width: 13px; height: 13px; flex-shrink: 0; }
.toast.ok  svg { color: var(--green); }
.toast.err svg { color: #ef4444; }

/* ── SPINNER ───────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 13px; height: 13px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── SKELETON ──────────────────────────────────── */
.skel {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-50) 50%, var(--gray-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  margin-bottom: 8px;
}
@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* ── ANIMATIONS ────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(8px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── EMPTY STATE ───────────────────────────────── */
.empty-state {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 50px 20px; gap: 10px; color: var(--gray-300);
}
.empty-state svg { width: 48px; height: 48px; }
.empty-state h3  { font-size: .88rem; font-weight: 600; color: var(--gray-400); }
.empty-state p   { font-size: .76rem; color: var(--gray-300); text-align: center; }

/* ── VIEW TOGGLE ───────────────────────────────── */
.view-toggle { display: flex; gap: 3px; }
.vt-btn {
  width: 30px; height: 30px;
  border-radius: 6px;
  border: 1px solid var(--gray-200);
  background: var(--white);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-400);
  transition: all .15s;
}
.vt-btn:hover  { border-color: var(--red); color: var(--red); }
.vt-btn.active { background: var(--red); border-color: var(--red); color: #fff; }
.vt-btn svg    { width: 13px; height: 13px; }

/* ── SORT SELECT ───────────────────────────────── */
.sort-sel {
  padding: 6px 10px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: .74rem;
  color: var(--gray-800);
  background: var(--white);
  cursor: pointer;
  outline: none;
}

/* ── RESPONSIVE ────────────────────────────────── */
@media (max-width: 900px) {
  .stats-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .sidebar { display: none; }
}
@media print {
  .sidebar, .btn-print, .no-print { display: none !important; }
}