/* ============================================================
   CustomClipon Wholesale — Shared Styles (style.css)
   Clean professional optical industry aesthetic
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&family=Source+Sans+3:wght@300;400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --brand:       #1B4F72;
  --brand-dark:  #123456;
  --brand-light: #2E86AB;
  --gold:        #C49A22;
  --gold-lt:     #E8C94A;
  --ink:         #1A1A2A;
  --body:        #3D3D50;
  --muted:       #7A7A8C;
  --border:      #D8DCE6;
  --bg:          #F7F8FC;
  --white:       #FFFFFF;
  --success:     #1B6B3A;
  --success-bg:  #EDFBF2;
  --warn:        #92500A;
  --warn-bg:     #FFF8EC;
  --danger:      #9B1B2A;
  --danger-bg:   #FEF2F4;
  --info:        #1B4F72;
  --info-bg:     #EEF4FB;
  --shadow-sm:   0 1px 4px rgba(26,26,42,0.08);
  --shadow:      0 4px 16px rgba(26,26,42,0.10);
  --shadow-lg:   0 12px 40px rgba(26,26,42,0.14);
  --radius:      8px;
  --radius-lg:   14px;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Source Sans 3', sans-serif;
  background: var(--bg);
  color: var(--body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1,h2,h3,h4,h5 {
  font-family: 'Libre Baskerville', serif;
  color: var(--ink);
  line-height: 1.25;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── TOPBAR ─────────────────────────────────────────────────── */
.topbar {
  background: var(--brand-dark);
  color: rgba(255,255,255,0.7);
  font-size: 0.8rem;
  padding: 6px 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.topbar strong { color: rgba(255,255,255,0.95); }

/* ── NAVBAR ─────────────────────────────────────────────────── */
.navbar {
  background: var(--white);
  border-bottom: 3px solid var(--brand);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: var(--shadow-sm);
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.brand-logo {
  width: 42px; height: 42px;
}
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-text .brand-name { font-family: 'Libre Baskerville', serif; font-size: 1.15rem; color: var(--brand-dark); font-weight: 700; }
.brand-text .brand-sub  { font-size: 0.7rem; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; }
.navbar-links { display: flex; align-items: center; gap: 0.25rem; }
.nav-link {
  padding: 8px 14px;
  border-radius: var(--radius);
  color: var(--body);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  border: none;
  background: none;
  font-family: 'Source Sans 3', sans-serif;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.nav-link:hover { background: var(--bg); color: var(--brand); text-decoration: none; }
.nav-link.active { background: var(--info-bg); color: var(--brand); font-weight: 600; }
.nav-btn-primary {
  background: var(--brand);
  color: white !important;
  padding: 8px 20px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border: none;
  font-family: 'Source Sans 3', sans-serif;
  transition: background 0.15s;
}
.nav-btn-primary:hover { background: var(--brand-dark); text-decoration: none; }

/* ── BUTTONS ────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 22px;
  border-radius: var(--radius);
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.95rem; font-weight: 600;
  cursor: pointer; border: 2px solid transparent;
  transition: all 0.15s; text-decoration: none;
  white-space: nowrap;
}
.btn-primary   { background: var(--brand); color: white; border-color: var(--brand); }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-outline   { background: transparent; color: var(--brand); border-color: var(--brand); }
.btn-outline:hover { background: var(--info-bg); }
.btn-success   { background: var(--success); color: white; border-color: var(--success); }
.btn-danger    { background: var(--danger);  color: white; border-color: var(--danger); }
.btn-warn      { background: var(--warn);    color: white; border-color: var(--warn); }
.btn-ghost     { background: transparent; color: var(--body); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg); }
.btn-gold      { background: var(--gold); color: var(--ink); border-color: var(--gold); }
.btn-sm   { padding: 6px 14px; font-size: 0.82rem; }
.btn-lg   { padding: 13px 32px; font-size: 1.05rem; }
.btn-full { width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── CARDS ──────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header {
  padding: 1.25rem 1.75rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
}
.card-header h2, .card-header h3 {
  font-family: 'Libre Baskerville', serif;
  font-size: 1.1rem;
}
.card-body { padding: 1.75rem; }
.card-footer {
  padding: 1rem 1.75rem;
  background: var(--bg);
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
}

/* ── FORMS ──────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.1rem; }
.form-label {
  display: block;
  font-size: 0.8rem; font-weight: 700;
  color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.07em;
  margin-bottom: 0.4rem;
}
.form-label .req { color: var(--danger); }
.form-control {
  width: 100%;
  padding: 9px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.95rem; color: var(--ink);
  background: var(--white);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}
.form-control:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(27,79,114,0.1); }
.form-control::placeholder { color: #B0B4C0; }
textarea.form-control { resize: vertical; min-height: 80px; }
select.form-control { cursor: pointer; }
.form-hint { font-size: 0.8rem; color: var(--muted); margin-top: 0.25rem; }
.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
.form-row-4 { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 1rem; }

/* ── ALERTS ─────────────────────────────────────────────────── */
.alert { border-radius: var(--radius); padding: 12px 16px; font-size: 0.9rem; display: flex; gap: 10px; align-items: flex-start; margin-bottom: 1rem; }
.alert-success { background: var(--success-bg); color: var(--success); border: 1px solid #86EFB4; }
.alert-danger  { background: var(--danger-bg);  color: var(--danger);  border: 1px solid #FCA5B4; }
.alert-warn    { background: var(--warn-bg);    color: var(--warn);    border: 1px solid #FCD98A; }
.alert-info    { background: var(--info-bg);    color: var(--info);    border: 1px solid #93C5D8; }

/* ── BADGES ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 20px;
  font-size: 0.75rem; font-weight: 700; white-space: nowrap;
  font-family: 'IBM Plex Mono', monospace;
}
.badge-pending    { background: #FEF3C7; color: #92400E; }
.badge-approved   { background: var(--success-bg); color: var(--success); }
.badge-rejected   { background: var(--danger-bg);  color: var(--danger); }
.badge-received   { background: #DBEAFE; color: #1E40AF; }
.badge-processing { background: #EDE9FE; color: #5B21B6; }
.badge-shipped    { background: #D1FAE5; color: #065F46; }
.badge-delivered  { background: var(--success-bg); color: var(--success); border: 1px solid #86EFB4; }
.badge-taxable    { background: #FEF3C7; color: #92400E; }
.badge-nontaxable { background: var(--success-bg); color: var(--success); }

/* ── TABLE ──────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
thead { background: var(--bg); }
th { padding: 10px 14px; text-align: left; font-size: 0.75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.07em; white-space: nowrap; }
td { padding: 11px 14px; border-bottom: 1px solid #F0F2F8; color: var(--ink); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(27,79,114,0.02); }
.td-mono { font-family: 'IBM Plex Mono', monospace; font-size: 0.82rem; }

/* ── STATS ──────────────────────────────────────────────────── */
.stat-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card { background: var(--white); border-radius: var(--radius-lg); padding: 1.25rem 1.5rem; box-shadow: var(--shadow); border-top: 3px solid var(--brand); }
.stat-card .stat-num { font-family: 'IBM Plex Mono', monospace; font-size: 2rem; color: var(--ink); font-weight: 500; line-height: 1; }
.stat-card .stat-lbl { font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.07em; margin-top: 4px; }
.stat-card .stat-sub { font-size: 0.8rem; color: var(--muted); margin-top: 2px; }

/* ── MODAL ──────────────────────────────────────────────────── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(10,10,30,0.55); z-index: 1000;
  align-items: center; justify-content: center; padding: 1rem;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--white); border-radius: var(--radius-lg);
  width: 100%; max-width: 700px; max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-header {
  background: var(--brand-dark); padding: 1.25rem 1.75rem;
  display: flex; align-items: center; justify-content: space-between;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.modal-header h3 { font-family: 'Libre Baskerville', serif; color: white; font-size: 1.1rem; }
.modal-close { color: rgba(255,255,255,0.7); background: none; border: none; font-size: 1.3rem; cursor: pointer; }
.modal-close:hover { color: white; }
.modal-body { padding: 1.75rem; }
.modal-footer { padding: 1rem 1.75rem; border-top: 1px solid var(--border); background: var(--bg); display: flex; gap: 0.75rem; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

/* ── TOAST ──────────────────────────────────────────────────── */
#toast-container {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 9999;
  display: flex; flex-direction: column; gap: 0.5rem;
}
.toast {
  background: var(--ink); color: white;
  padding: 12px 18px; border-radius: var(--radius);
  font-size: 0.875rem; box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--brand);
  transform: translateX(120%); opacity: 0;
  transition: all 0.3s; max-width: 340px;
}
.toast.show { transform: translateX(0); opacity: 1; }
.toast.success { border-color: var(--success); }
.toast.error   { border-color: var(--danger); }
.toast.warn    { border-color: var(--gold); }

/* ── FOOTER ─────────────────────────────────────────────────── */
footer {
  background: var(--brand-dark); color: rgba(255,255,255,0.65);
  padding: 2.5rem 2rem 1.5rem; margin-top: 4rem; font-size: 0.875rem;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; max-width: 960px; margin: 0 auto 2rem; }
.footer-col h4 { font-family: 'Libre Baskerville', serif; color: white; margin-bottom: 0.75rem; font-size: 0.95rem; }
.footer-col p, .footer-col a { color: rgba(255,255,255,0.6); display: block; margin-bottom: 0.4rem; font-size: 0.85rem; }
.footer-col a:hover { color: var(--gold-lt); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 1.25rem; text-align: center; font-size: 0.8rem; color: rgba(255,255,255,0.4); max-width: 960px; margin: 0 auto; }

/* ── PRINT ──────────────────────────────────────────────────── */
@media print {
  .no-print, nav, .topbar, footer, #toast-container { display: none !important; }
  .card { box-shadow: none; border: 1px solid #DDD; }
}

/* ── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .form-row-3, .form-row-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .navbar { padding: 0 1rem; }
  .form-row, .form-row-3, .form-row-4 { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}
