/* ═══════════════════════════════════════════════════════════════════════
   Partner Hub — Starbucks Cyprus Design System
   ═══════════════════════════════════════════════════════════════════════ */

/* ─── Tokens ──────────────────────────────────────────────────────────── */
:root {
  --sb-green:        #006241;
  --sb-green-mid:    #00754A;
  --sb-green-dark:   #1E3932;
  --sb-green-darker: #0b3b2e;
  --sb-green-soft:   #D4E9E2;
  --sb-green-softer: #e6f2ee;

  --hero-grad: linear-gradient(90deg, #0b5a46, #08483a, #063b31);
  --hero-arc:  #0b4a3a;

  --bg-page:    #f7f7f5;
  --bg-card:    #ffffff;
  --border:     rgba(0,0,0,.08);
  --border-mid: #e0e0e0;

  --text-primary:   #1E3932;
  --text-body:      #111111;
  --text-muted:     #6b7280;
  --text-meta:      rgba(30,57,50,.75);

  --danger:      #c62828;
  --danger-dark: #8e1b1b;
  --warning:     #b8860b;

  --radius-pill: 999px;
  --radius-card: 22px;
  --radius-modal: 22px;
  --radius-input: 14px;
  --radius-btn:  999px;
  --radius-sm:   10px;

  --shadow-card:  0 6px 14px rgba(0,0,0,.06);
  --shadow-card2: 0 8px 18px rgba(0,0,0,.08);
  --shadow-hero:  0 18px 40px rgba(0,0,0,.07);
  --shadow-btn:   0 12px 22px rgba(0,0,0,.10);
  --shadow-modal: 0 24px 70px rgba(0,0,0,.34);

  --transition: .18s ease;
}

/* ─── Reset / Base ────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  background: var(--bg-page);
  color: var(--text-body);
  line-height: 1.55;
  min-height: 100vh;
}
a { color: var(--sb-green); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }

/* ─── Layout ──────────────────────────────────────────────────────────── */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 40px 22px;
}
.page-wrap { display: flex; flex-direction: column; min-height: 100vh; }
.main-content { flex: 1; padding-top: 0; }

/* ─── Navigation ──────────────────────────────────────────────────────── */
.navbar {
  background: var(--sb-green-dark);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 12px rgba(0,0,0,.18);
}
.navbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 22px;
  display: flex;
  align-items: center;
  gap: 0;
  height: 58px;
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 900;
  font-size: 16px;
  letter-spacing: -.01em;
  text-decoration: none;
  margin-right: 24px;
  flex-shrink: 0;
}
.navbar-brand svg { width: 28px; height: 28px; }
.navbar-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
  flex: 1;
  flex-wrap: nowrap;
  overflow: hidden;
}
.navbar-nav .nav-item { position: relative; }
.navbar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 5px;
  color: rgba(255,255,255,.82);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 10px;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
  text-decoration: none;
}
.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  background: rgba(255,255,255,.12);
  color: #fff;
  text-decoration: none;
}
.navbar-nav .nav-link .nav-icon { font-size: 15px; }

/* Dropdown */
.nav-dropdown { position: relative; }
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 190px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,.14);
  padding: 6px;
  z-index: 2000;
  border: 1px solid var(--border);
}
.nav-dropdown:hover .nav-dropdown-menu { display: block; }
.nav-dropdown-menu a {
  display: block;
  padding: 9px 14px;
  font-size: 13px;
  color: var(--text-body);
  border-radius: 10px;
  transition: background var(--transition);
  text-decoration: none;
}
.nav-dropdown-menu a:hover { background: var(--sb-green-softer); color: var(--sb-green); }
.dropdown-arrow { font-size: 10px; opacity: .7; }

.navbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  color: rgba(255,255,255,.82);
  font-size: 13px;
  flex-shrink: 0;
}
.navbar-user .user-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(255,255,255,.1);
  border-radius: var(--radius-pill);
  padding: 4px 12px 4px 6px;
}
.user-avatar {
  width: 28px; height: 28px;
  background: var(--sb-green-mid);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}
.btn-logout {
  background: rgba(255,255,255,.12);
  color: rgba(255,255,255,.9);
  border: none;
  border-radius: var(--radius-pill);
  padding: 5px 13px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition);
  text-decoration: none;
  display: inline-block;
}
.btn-logout:hover { background: rgba(255,255,255,.2); text-decoration: none; }

/* ─── Hero Banner ─────────────────────────────────────────────────────── */
.hero {
  background: var(--hero-grad);
  border-radius: 20px;
  padding: 30px 32px;
  color: #fff;
  box-shadow: var(--shadow-card2);
  overflow: hidden;
  position: relative;
  margin-bottom: 28px;
}
.hero-title {
  font-size: 28px;
  font-weight: 950;
  letter-spacing: -.02em;
  margin-bottom: 6px;
}
.hero-sub { font-size: 14px; opacity: .82; font-weight: 400; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: var(--radius-pill);
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.hero-deco {
  position: absolute;
  right: -20px; top: -20px;
  width: 180px; height: 180px;
  background: rgba(255,255,255,.04);
  border-radius: 50%;
}

/* ─── Cards ───────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-hero);
  overflow: hidden;
}
.card-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-mid);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
}
.card-body { padding: 22px; }
.card-pad { padding: 26px 28px; }

/* Stat cards */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 22px 24px;
  box-shadow: var(--shadow-card);
}
.stat-value { font-size: 32px; font-weight: 980; color: var(--text-primary); }
.stat-label {
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  margin-top: 4px;
}
.stat-icon {
  width: 40px; height: 40px;
  background: var(--sb-green-softer);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  margin-bottom: 12px;
}

/* ─── Buttons ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 20px;
  border-radius: var(--radius-btn);
  font-weight: 950;
  font-size: 13px;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  box-shadow: var(--shadow-btn);
  white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--sb-green);
  color: #fff;
}
.btn-primary:hover { background: var(--sb-green-mid); color: #fff; }

.btn-secondary {
  background: var(--sb-green-softer);
  color: var(--sb-green-dark);
  box-shadow: none;
}
.btn-secondary:hover { background: var(--sb-green-soft); }

.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover { background: var(--danger-dark); color: #fff; }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  box-shadow: none;
  border: 1px solid var(--border-mid);
}
.btn-ghost:hover { background: var(--bg-page); }

.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-xs { padding: 4px 10px; font-size: 11px; }

/* ─── Badges & Chips ──────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  background: rgba(212,233,226,.75);
  border: 1px solid rgba(30,57,50,.12);
  color: var(--text-primary);
}
.badge-green  { background: var(--sb-green-softer); color: var(--sb-green-dark); }
.badge-red    { background: #fde8e8; color: var(--danger); }
.badge-yellow { background: #fff8e1; color: var(--warning); }
.badge-gray   { background: #f3f4f6; color: var(--text-muted); }
.badge-active   { background: #ecfdf5; color: #065f46; border-color: rgba(6,95,70,.2); }
.badge-inactive { background: #fde8e8; color: var(--danger); border-color: rgba(198,40,40,.2); }

/* Role badges */
.role-admin    { background: #1E3932; color: #fff; }
.role-hq       { background: #006241; color: #fff; }
.role-ops      { background: #00754A; color: #fff; }
.role-dm       { background: #5c7a6e; color: #fff; }
.role-store    { background: #d4e9e2; color: #1E3932; }

/* ─── Tables ──────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius-card); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead tr { background: var(--sb-green-softer); }
thead th {
  padding: 13px 16px;
  text-align: left;
  font-weight: 800;
  color: var(--text-primary);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
  border-bottom: 2px solid var(--sb-green-soft);
}
tbody tr { border-bottom: 1px solid var(--border-mid); transition: background var(--transition); }
tbody tr:hover { background: #fafafa; }
tbody tr:last-child { border-bottom: none; }
td { padding: 13px 16px; color: var(--text-body); vertical-align: middle; }
.td-muted { color: var(--text-muted); font-size: 12px; }

/* ─── Forms & Inputs ──────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.form-control {
  display: block;
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-input);
  border: 1px solid rgba(0,0,0,.18);
  background: #fff;
  color: var(--text-body);
  font-size: 14px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus {
  outline: none;
  border-color: var(--sb-green);
  box-shadow: 0 0 0 3px rgba(0,98,65,.12);
}
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ─── Modals ──────────────────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.46);
  z-index: 99999;
  align-items: center;
  justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal {
  background: #fff;
  border-radius: var(--radius-modal);
  box-shadow: var(--shadow-modal);
  max-width: 560px;
  width: calc(100% - 32px);
  padding: 0;
  overflow: hidden;
  animation: modal-in .18s ease;
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to   { opacity: 1; transform: none; }
}
.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border-mid);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title { font-size: 17px; font-weight: 800; color: var(--text-primary); }
.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 20px;
  line-height: 1;
  padding: 0 4px;
  transition: color var(--transition);
}
.modal-close:hover { color: var(--text-body); }
.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-mid);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ─── Toast ───────────────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99999;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  pointer-events: none;
}
.toast {
  background: #1E3932;
  color: #fff;
  border-radius: var(--radius-pill);
  padding: 12px 22px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
  animation: toast-in .22s ease;
  pointer-events: auto;
}
.toast.success { background: var(--sb-green); }
.toast.error   { background: var(--danger); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

/* ─── Page sections ───────────────────────────────────────────────────── */
.section { margin-bottom: 32px; }
.section-title {
  font-size: 22px;
  font-weight: 950;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.section-sub {
  font-size: 14px;
  color: var(--text-muted);
  opacity: .8;
  margin-bottom: 18px;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ─── Sidebar layout ──────────────────────────────────────────────────── */
.sidebar-layout { display: grid; grid-template-columns: 260px 1fr; gap: 24px; align-items: start; }
.sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-body);
  border-bottom: 1px solid var(--border-mid);
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}
.sidebar-item:last-child { border-bottom: none; }
.sidebar-item:hover, .sidebar-item.active {
  background: var(--sb-green-softer);
  color: var(--sb-green);
  text-decoration: none;
}
.sidebar-item.active { font-weight: 800; }

/* ─── Filter bar ──────────────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  padding: 14px 20px;
  background: var(--bg-page);
  border-bottom: 1px solid var(--border-mid);
}
.filter-bar select, .filter-bar input {
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.15);
  background: #fff;
  font-size: 13px;
  color: var(--text-body);
}

/* ─── Login page ──────────────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  background: var(--hero-grad);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-card {
  background: #fff;
  border-radius: 24px;
  box-shadow: var(--shadow-modal);
  width: 100%;
  max-width: 400px;
  padding: 36px 32px 32px;
}
.login-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  margin-bottom: 28px;
}
.login-logo span {
  font-size: 20px;
  font-weight: 950;
  color: var(--sb-green-dark);
}
.login-title {
  font-size: 22px;
  font-weight: 950;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 6px;
}
.login-sub {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 28px;
}
.alert {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13px;
  margin-bottom: 16px;
}
.alert-error { background: #fde8e8; color: var(--danger); border: 1px solid rgba(198,40,40,.2); }
.alert-success { background: #ecfdf5; color: #065f46; border: 1px solid rgba(6,95,70,.2); }
.alert-warning { background: #fff8e1; color: var(--warning); border: 1px solid rgba(184,134,11,.2); }

/* ─── Tabs ────────────────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border-mid);
  margin-bottom: 24px;
}
.tab-link {
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  border: none;
  background: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color var(--transition), border-color var(--transition);
  text-decoration: none;
}
.tab-link.active, .tab-link:hover { color: var(--sb-green); border-bottom-color: var(--sb-green); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ─── Empty state ─────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state h3 { font-size: 16px; font-weight: 700; color: var(--text-primary); margin-bottom: 6px; }
.empty-state p { font-size: 13px; }

/* ─── Utilities ───────────────────────────────────────────────────────── */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-sm { gap: 10px; }
.gap    { gap: 16px; }
.gap-lg { gap: 24px; }
.mt-sm { margin-top: 10px; }
.mt    { margin-top: 18px; }
.mt-lg { margin-top: 28px; }
.mb-sm { margin-bottom: 10px; }
.mb    { margin-bottom: 18px; }
.mb-lg { margin-bottom: 28px; }
.text-right  { text-align: right; }
.text-center { text-align: center; }
.text-muted  { color: var(--text-muted); font-size: 12px; }
.fw-bold { font-weight: 800; }
.nowrap { white-space: nowrap; }
.w-100 { width: 100%; }

/* ─── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 980px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .sidebar-layout { grid-template-columns: 1fr; }
}
@media (max-width: 780px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .container { padding: 20px 16px; }
  .hero { padding: 22px 20px; }
  .hero-title { font-size: 22px; }
  .navbar-inner { padding: 0 14px; }
}
@media (max-width: 768px) {
  table thead { display: none; }
  table tr {
    display: block;
    border: 1px solid var(--border-mid);
    border-radius: 12px;
    margin-bottom: 10px;
    padding: 8px 0;
  }
  table td {
    display: flex;
    justify-content: space-between;
    padding: 8px 14px;
    border: none;
    border-bottom: 1px solid var(--border-mid);
    font-size: 13px;
  }
  table td:last-child { border-bottom: none; }
  table td::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .04em;
    flex-shrink: 0;
    margin-right: 12px;
  }
}
@media (max-width: 640px) {
  .stat-grid { grid-template-columns: 1fr; }
  .navbar-nav { display: none; }
}

/* ─── Admin specific ──────────────────────────────────────────────────── */
.admin-nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.admin-nav a {
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border-mid);
  text-decoration: none;
  transition: all var(--transition);
}
.admin-nav a:hover, .admin-nav a.active {
  background: var(--sb-green);
  color: #fff;
  border-color: var(--sb-green);
}

/* ─── Action row ──────────────────────────────────────────────────────── */
.action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.search-input {
  padding: 9px 14px 9px 36px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.15);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") no-repeat 12px center;
  font-size: 13px;
  min-width: 220px;
}
.search-input:focus { outline: none; border-color: var(--sb-green); box-shadow: 0 0 0 3px rgba(0,98,65,.1); }

/* ─── POQ status ──────────────────────────────────────────────────────── */
.status-pending  { background: #fff8e1; color: #8a6200; border-color: rgba(138,98,0,.2); }
.status-approved { background: #ecfdf5; color: #065f46; border-color: rgba(6,95,70,.2); }
.status-rejected { background: #fde8e8; color: var(--danger); border-color: rgba(198,40,40,.2); }

/* ─── Breadcrumb ──────────────────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.breadcrumb a { color: var(--sb-green); text-decoration: none; }
.breadcrumb-sep { opacity: .4; }
