/* ═══════════════════════════════════════════
   GSC ADMIN — Dashboard & Login Styles
   ═══════════════════════════════════════════ */

:root {
  --sidebar-w: 260px;
  --navy:       #071e36;
  --navy-mid:   #0f2d4a;
  --teal:       #0d7377;
  --teal-lt:    #14a3a8;
  --gold:       #c9a84c;
  --bg:         #f1f5f9;
  --card:       #ffffff;
  --border:     #e2e8f0;
  --text:       #1e293b;
  --muted:      #64748b;
  --danger:     #ef4444;
  --success:    #22c55e;
  --warning:    #f59e0b;
  --info:       #3b82f6;
  --radius:     10px;
  --shadow:     0 1px 3px rgba(0,0,0,0.07), 0 4px 16px rgba(0,0,0,0.05);
  --topbar-h:   60px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
       font-size: 14px; color: var(--text); line-height: 1.5; }
a { text-decoration: none; }
button { font-family: inherit; }

/* ─────────────────────────────────────────
   LOGIN PAGE
───────────────────────────────────────── */
body.login-page {
  background: var(--navy);
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
}
.login-bg {
  position: fixed; inset: 0; z-index: 0;
  background: linear-gradient(135deg, #071e36 0%, #0d3a5c 55%, #071e36 100%);
}
.login-bg::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 18% 52%, rgba(13,115,119,0.18) 0%, transparent 58%),
    radial-gradient(circle at 82% 18%, rgba(201,168,76,0.09) 0%, transparent 50%);
}
.login-wrap { position: relative; z-index: 1; width: 100%; max-width: 420px; padding: 20px; }
.login-card {
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 20px;
  padding: 40px 36px;
  text-align: center;
}
.login-logos { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 22px; }
.login-logos .ll-main  { width: 60px; height: 60px; object-fit: contain; }
.login-logos .ll-sm    { width: 42px; height: 42px; object-fit: contain; opacity: 0.82; }
.login-logos .ll-round { border-radius: 50%; }
.login-title { color: #fff; font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.login-sub   { color: rgba(255,255,255,0.50); font-size: 13px; margin-bottom: 28px; }
.login-form  { text-align: left; }
.lf-group { margin-bottom: 16px; }
.lf-group label {
  display: block; color: rgba(255,255,255,0.65);
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.6px; margin-bottom: 6px;
}
.lf-group input {
  width: 100%; padding: 11px 14px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 8px; color: #fff; font-size: 14px;
  transition: border-color 0.2s, background 0.2s;
}
.lf-group input:focus { outline: none; border-color: var(--teal-lt); background: rgba(255,255,255,0.13); }
.lf-group input::placeholder { color: rgba(255,255,255,0.28); }
.login-error { min-height: 18px; color: #fca5a5; font-size: 13px; margin-bottom: 10px; display: none; }
.login-error.show { display: block; }
.login-btn {
  width: 100%; padding: 12px;
  background: var(--teal); border: none; border-radius: 8px;
  color: #fff; font-size: 14px; font-weight: 600;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: background 0.2s, transform 0.1s;
}
.login-btn:hover:not(:disabled) { background: var(--teal-lt); }
.login-btn:active { transform: scale(0.98); }
.login-btn:disabled { opacity: 0.7; cursor: not-allowed; }
.back-link { display: inline-block; margin-top: 20px; color: rgba(255,255,255,0.40); font-size: 13px; transition: color 0.2s; }
.back-link:hover { color: rgba(255,255,255,0.75); }

/* ─────────────────────────────────────────
   DASHBOARD LAYOUT
───────────────────────────────────────── */
body.dashboard-page { display: flex; background: var(--bg); }

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-w); min-height: 100vh;
  background: var(--navy);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 100; transition: transform 0.28s ease;
  overflow-y: auto;
}
.sb-header {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 16px; border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}
.sb-logo { width: 38px; height: 38px; object-fit: contain; flex-shrink: 0; }
.sb-brand-main { display: block; color: #fff; font-weight: 700; font-size: 14px; }
.sb-brand-sub  { display: block; color: rgba(255,255,255,0.42); font-size: 11px; margin-top: 1px; }
.sb-nav { flex: 1; padding: 10px 8px; display: flex; flex-direction: column; gap: 2px; }
.sb-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px;
  color: rgba(255,255,255,0.62); font-size: 13.5px; font-weight: 500;
  transition: background 0.15s, color 0.15s; cursor: pointer;
  position: relative; border: none; background: none; width: 100%; text-align: left;
}
.sb-link:hover  { background: rgba(255,255,255,0.07); color: #fff; }
.sb-link.active { background: var(--teal); color: #fff; }
.sb-icon { font-size: 15px; width: 20px; text-align: center; flex-shrink: 0; }
.sb-badge {
  margin-left: auto;
  background: var(--warning); color: #fff;
  font-size: 11px; font-weight: 700;
  padding: 1px 7px; border-radius: 20px;
  min-width: 20px; text-align: center; display: none;
}
.sb-badge.show { display: inline-block; }
.sb-footer {
  padding: 14px 16px; border-top: 1px solid rgba(255,255,255,0.07);
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
}
.sb-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--teal); color: #fff;
  font-weight: 700; font-size: 14px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.sb-user-info { flex: 1; min-width: 0; }
.sb-user-name { color: #fff; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-user-role { color: rgba(255,255,255,0.42); font-size: 11px; }
.sb-logout {
  background: none; border: none;
  color: rgba(255,255,255,0.42); font-size: 18px;
  cursor: pointer; padding: 5px; border-radius: 6px;
  transition: color 0.2s, background 0.2s; line-height: 1;
}
.sb-logout:hover { color: #fca5a5; background: rgba(239,68,68,0.12); }

/* MAIN */
.main-content { flex: 1; margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }

/* TOPBAR */
.topbar {
  height: var(--topbar-h); background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px;
  padding: 0 24px; position: sticky; top: 0; z-index: 50;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.topbar-menu { display: none; background: none; border: none; font-size: 20px; cursor: pointer; color: var(--muted); padding: 4px; }
.topbar-title { font-size: 15px; font-weight: 700; color: var(--text); flex: 1; }
.topbar-link  { color: var(--teal); font-size: 13px; font-weight: 500; }
.topbar-link:hover { text-decoration: underline; }

/* ─────────────────────────────────────────
   PAGES
───────────────────────────────────────── */
.page-wrap { flex: 1; padding: 24px; }
.page { display: none; }
.page.active { display: block; }
.page-header { margin-bottom: 22px; }
.page-header h2 { font-size: 20px; font-weight: 700; margin-bottom: 2px; }
.page-header p  { color: var(--muted); font-size: 13px; }

/* STAT CARDS */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px; margin-bottom: 24px;
}
.stat-card {
  background: var(--card); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 16px;
}
.stat-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.stat-val   { font-size: 24px; font-weight: 700; line-height: 1.1; }
.stat-label { font-size: 12px; color: var(--muted); margin-top: 3px; font-weight: 500; }

/* CARD */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 24px; overflow: hidden; }
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.card-header h3 { font-size: 14px; font-weight: 700; }

/* TABLE */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  padding: 11px 16px; text-align: left;
  font-size: 11px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.5px;
  background: #f8fafc; border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: #fafcff; }
.empty-row td { text-align: center; color: var(--muted); padding: 40px 16px; font-size: 13px; }

/* BADGES */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600; text-transform: capitalize;
  white-space: nowrap;
}
.badge-pending    { background: rgba(245,158,11,0.12); color: #b45309; }
.badge-confirmed  { background: rgba(59,130,246,0.12);  color: #1d4ed8; }
.badge-processing { background: rgba(139,92,246,0.12);  color: #6d28d9; }
.badge-delivered  { background: rgba(34,197,94,0.12);   color: #15803d; }
.badge-cancelled  { background: rgba(239,68,68,0.12);   color: #b91c1c; }
.badge-active     { background: rgba(34,197,94,0.12);   color: #15803d; }
.badge-inactive   { background: rgba(100,116,139,0.12); color: #475569; }

/* FILTER BAR */
.filter-bar { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.filter-btn {
  padding: 6px 16px; border: 1px solid var(--border);
  background: var(--card); border-radius: 20px;
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition: all 0.15s; color: var(--muted);
}
.filter-btn:hover  { border-color: var(--teal); color: var(--teal); }
.filter-btn.active { background: var(--teal); border-color: var(--teal); color: #fff; }

/* BUTTONS */
.btn-primary {
  background: var(--teal); color: #fff; border: none;
  padding: 9px 18px; border-radius: 8px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background 0.15s; white-space: nowrap;
}
.btn-primary:hover { background: var(--teal-lt); }
.btn-link { background: none; border: none; color: var(--teal); font-size: 13px; font-weight: 500; cursor: pointer; padding: 0; }
.btn-link:hover { text-decoration: underline; }
.btn-sm {
  padding: 5px 11px; border-radius: 6px;
  font-size: 12px; font-weight: 600; cursor: pointer;
  border: none; transition: all 0.15s; white-space: nowrap;
}
.btn-edit   { background: rgba(59,130,246,0.10); color: #1d4ed8; }
.btn-edit:hover   { background: rgba(59,130,246,0.20); }
.btn-delete { background: rgba(239,68,68,0.10);  color: #b91c1c; }
.btn-delete:hover { background: rgba(239,68,68,0.20); }
.btn-view   { background: rgba(13,115,119,0.10); color: var(--teal); }
.btn-view:hover   { background: rgba(13,115,119,0.20); }
.btn-accept { background: rgba(34,197,94,0.12); color: #15803d; font-weight: 700; }
.btn-accept:hover { background: rgba(34,197,94,0.25); }
.btn-ghost-sm {
  background: none; border: 1px solid var(--border);
  color: var(--text); padding: 9px 18px;
  border-radius: 8px; font-size: 13px; font-weight: 500; cursor: pointer;
}
.btn-ghost-sm:hover { background: var(--bg); }
.action-btns { display: flex; gap: 6px; flex-wrap: nowrap; }

/* STATUS SELECT */
.status-select {
  font-size: 12px; padding: 4px 8px;
  border: 1px solid var(--border); border-radius: 6px;
  background: #fff; cursor: pointer; color: var(--text);
}

/* ─────────────────────────────────────────
   MODALS
───────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(7,30,54,0.55);
  z-index: 200; display: none;
  align-items: center; justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--card); border-radius: 14px;
  width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0,0,0,0.22);
  animation: modalIn 0.22s ease;
}
.modal-lg { max-width: 680px; }
@keyframes modalIn { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: translateY(0); } }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--card); z-index: 1;
}
.modal-header h3 { font-size: 16px; font-weight: 700; }
.modal-close {
  background: none; border: none;
  font-size: 18px; cursor: pointer;
  color: var(--muted); padding: 4px; border-radius: 6px; line-height: 1;
}
.modal-close:hover { background: var(--bg); }
.modal-form { padding: 22px 24px; }
.modal-footer {
  display: flex; gap: 10px; justify-content: flex-end;
  margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border);
}

/* FORM FIELDS */
.mf-group { margin-bottom: 15px; }
.mf-group label {
  display: block; font-size: 11px; font-weight: 600;
  color: var(--muted); margin-bottom: 6px;
  text-transform: uppercase; letter-spacing: 0.45px;
}
.mf-group input,
.mf-group textarea,
.mf-group select {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #fff; font-family: inherit;
}
.mf-group input:focus,
.mf-group textarea:focus {
  outline: none; border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(13,115,119,0.10);
}
.mf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.inventory-grid { display: flex; gap: 10px; flex-wrap: wrap; }
.inv-item { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.inv-item span { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.inv-item input { width: 62px; text-align: center; padding: 8px 4px; }
.toggle-label {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; font-size: 14px; color: var(--text);
  font-weight: 400; text-transform: none; letter-spacing: 0;
}
.toggle-label input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--teal); cursor: pointer; }

/* IMAGE UPLOAD */
.img-upload-area {
  border: 2px dashed var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.2s, background 0.2s;
  cursor: pointer;
  position: relative;
}
.img-upload-area:hover,
.img-upload-area.drag-over { border-color: var(--teal); background: rgba(13,115,119,0.04); }
.img-upload-placeholder {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 6px; padding: 28px 16px; text-align: center;
}
.img-upload-icon { font-size: 32px; line-height: 1; }
.img-upload-placeholder p { font-size: 13px; font-weight: 500; color: var(--text); margin: 0; }
.img-upload-placeholder small { font-size: 12px; color: var(--muted); }
.img-preview {
  width: 100%; max-height: 220px;
  object-fit: contain; display: block;
  background: var(--bg); padding: 8px;
}
.img-remove-btn {
  display: block; width: 100%;
  padding: 8px; border: none;
  background: rgba(239,68,68,0.07);
  color: #b91c1c; font-size: 12px;
  font-weight: 600; cursor: pointer;
  transition: background 0.15s;
}
.img-remove-btn:hover { background: rgba(239,68,68,0.14); }
.img-upload-error { font-size: 12px; color: #b91c1c; margin-top: 5px; min-height: 16px; }

/* STOCK TABLE THUMBNAIL */
.stock-thumb {
  width: 48px; height: 48px;
  object-fit: cover; border-radius: 8px;
  border: 1px solid var(--border);
  display: block;
}
.stock-thumb-empty {
  width: 48px; height: 48px;
  border-radius: 8px; border: 1px dashed var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: var(--border); background: var(--bg);
}

/* ORDER DETAIL */
.order-detail-body { padding: 22px 24px; }
.od-section { margin-bottom: 22px; }
.od-section h4 {
  font-size: 11px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px;
}
.od-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.od-full { grid-column: 1 / -1; }
.od-field { background: var(--bg); padding: 10px 12px; border-radius: 8px; }
.od-field .od-lbl { font-size: 11px; color: var(--muted); font-weight: 500; }
.od-field .od-val { font-size: 13px; font-weight: 600; margin-top: 2px; }
.od-items-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.od-items-table th,
.od-items-table td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.od-items-table th {
  font-size: 11px; color: var(--muted); font-weight: 600;
  text-transform: uppercase; background: var(--bg);
}
.od-total-row { text-align: right; padding: 12px 0; font-size: 14px; }
.od-total { font-size: 20px; font-weight: 700; color: var(--teal); }
.od-status-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ─────────────────────────────────────────
   TOAST
───────────────────────────────────────── */
.toast-container {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 999; display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
}
.toast {
  padding: 12px 18px; border-radius: 10px;
  font-size: 13px; font-weight: 500; color: #fff;
  box-shadow: 0 4px 20px rgba(0,0,0,0.20);
  animation: toastIn 0.3s ease;
  max-width: 300px; pointer-events: auto;
  transition: opacity 0.3s;
}
.toast-success { background: #15803d; }
.toast-error   { background: #b91c1c; }
.toast-info    { background: var(--teal); }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─────────────────────────────────────────
   RESPONSIVE
───────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: 4px 0 24px rgba(0,0,0,0.3); }
  .main-content { margin-left: 0; }
  .topbar-menu { display: block; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .mf-row { grid-template-columns: 1fr; }
  .od-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .stat-grid  { grid-template-columns: 1fr; }
  .page-wrap  { padding: 14px; }
  .login-card { padding: 30px 22px; }
}
