/* DIAKOB PORTAL — Main Stylesheet */
:root {
  --navy:   #0A2040;
  --brand:  #1A4A8A;
  --orange: #E8621A;
  --green:  #15803d;
  --red:    #b91c1c;
  --border: #e2e5ec;
  --muted:  #6b7280;
  --cream:  #f4f7fb;
  --white:  #ffffff;
  --sidebar-w: 230px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--cream);
  color: var(--navy);
  min-height: 100vh;
  font-size: 14px;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── LOGIN ── */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(165deg, #061428 0%, #0A2040 45%, #0f2235 100%); padding: 24px; }
.login-wrap { width: 100%; max-width: 940px; display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; }
.login-brand { color: #fff; flex: 1; min-width: 260px; }
.brand-mark { width: 52px; height: 52px; background: var(--orange); border-radius: 12px;
  display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 800;
  color: #fff; margin-bottom: 16px; box-shadow: 0 8px 24px rgba(232,98,26,.35); }
.login-brand h1 { font-size: 28px; font-weight: 700; letter-spacing: -.02em; margin-bottom: 8px; }
.login-brand p  { font-size: 14px; color: rgba(255,255,255,.55); line-height: 1.6; }
.login-card { background: var(--white); border-radius: 16px; padding: 32px; width: 100%; max-width: 400px;
  box-shadow: 0 32px 80px rgba(0,0,0,.45); }
.login-card h2 { font-size: 18px; color: var(--navy); margin-bottom: 20px; }

/* ── FORM ELEMENTS ── */
.form-label { display: block; font-size: 11px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .05em; margin-bottom: 5px; }
.form-label .req { color: var(--orange); }
.form-control { width: 100%; padding: 10px 12px; border: 1.5px solid var(--border);
  border-radius: 7px; font-size: 13px; font-family: inherit; color: var(--navy);
  background: #fafbfc; outline: none; transition: .15s; margin-bottom: 14px; }
.form-control:focus { border-color: var(--brand); background: var(--white);
  box-shadow: 0 0 0 3px rgba(26,74,138,.1); }
.form-control.is-invalid { border-color: var(--red); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row.col3 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 640px) { .form-row, .form-row.col3 { grid-template-columns: 1fr; } }
.form-group { margin-bottom: 0; }
.form-section { margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.form-section:last-child { border-bottom: none; margin-bottom: 0; }
.form-section-title { font-size: 12px; font-weight: 700; color: var(--orange);
  text-transform: uppercase; letter-spacing: .06em; margin-bottom: 14px; display: flex; align-items: center; gap: 7px; }
.form-actions { display: flex; gap: 10px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.alert { padding: 11px 14px; border-radius: 7px; font-size: 13px; margin-bottom: 16px; }
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; }
.alert-error   { background: #fef2f2; border: 1px solid #fecaca; color: var(--red); }
.alert-info    { background: #eff6ff; border: 1px solid #bfdbfe; color: #1d4ed8; }
.alert-warning { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }

/* ── BUTTONS ── */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px;
  border-radius: 7px; font-size: 13px; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: .15s; border: 1px solid transparent; white-space: nowrap; text-decoration: none; }
.btn:hover { text-decoration: none; }
.btn-primary  { background: var(--orange); color: #fff; border-color: var(--orange); }
.btn-primary:hover { background: #c9531a; }
.btn-secondary{ background: var(--white); color: var(--navy); border-color: var(--border); }
.btn-secondary:hover { background: var(--cream); }
.btn-navy     { background: var(--navy); color: #fff; }
.btn-navy:hover { background: #0d2a52; }
.btn-blue     { background: var(--brand); color: #fff; }
.btn-blue:hover { background: #0d3570; }
.btn-green    { background: var(--green); color: #fff; }
.btn-green:hover { background: #14532d; }
.btn-red      { background: #fef2f2; color: var(--red); border-color: #fecaca; }
.btn-red:hover { background: #fee2e2; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-icon { padding: 6px 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── SIDEBAR ── */
.sidebar { width: var(--sidebar-w); background: var(--navy); position: fixed; top: 0; left: 0;
  height: 100vh; display: flex; flex-direction: column; z-index: 50; overflow-y: auto; }
.sb-head { padding: 18px 16px 14px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sb-logo { display: flex; align-items: center; gap: 10px; }
.sb-logo-mark { width: 32px; height: 32px; background: var(--orange); border-radius: 7px;
  display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 800;
  color: #fff; flex-shrink: 0; }
.sb-logo-name { font-size: 13px; font-weight: 700; color: #fff; }
.sb-logo-io   { font-size: 10px; color: rgba(255,255,255,.3); letter-spacing: .12em; text-transform: uppercase; }
.sb-user { padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sb-user-name { font-size: 13px; font-weight: 600; color: #fff; }
.sb-user-sub  { font-size: 11px; color: rgba(255,255,255,.4); margin-top: 2px; }
.role-badge { display: inline-block; margin-top: 5px; padding: 2px 8px; border-radius: 10px;
  background: rgba(232,98,26,.2); color: #fb923c; font-size: 10px; font-weight: 700; }
.sb-nav  { flex: 1; padding: 8px; }
.nav-section { font-size: 10px; font-weight: 700; color: rgba(255,255,255,.22); text-transform: uppercase;
  letter-spacing: .09em; padding: 10px 12px 4px; }
.nav-item { display: flex; align-items: center; gap: 9px; padding: 9px 12px; border-radius: 7px;
  cursor: pointer; font-size: 13px; color: rgba(255,255,255,.55); text-decoration: none;
  transition: .12s; margin-bottom: 1px; }
.nav-item:hover  { background: rgba(255,255,255,.07); color: rgba(255,255,255,.9); text-decoration: none; }
.nav-item.active { background: rgba(26,74,138,.6); color: #fff; font-weight: 600; }
.nav-item .nav-icon { font-size: 17px; width: 18px; flex-shrink: 0; }
.sb-bottom { padding: 8px; border-top: 1px solid rgba(255,255,255,.08); }

/* ── MAIN LAYOUT ── */
.main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar { background: var(--white); border-bottom: 1px solid var(--border); padding: 13px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  position: sticky; top: 0; z-index: 30; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.topbar-title { font-size: 16px; font-weight: 700; color: var(--navy); }
.topbar-right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.content { flex: 1; padding: 22px 24px; }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.page-header h2 { font-size: 20px; font-weight: 700; }

/* ── CARDS ── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat-card { background: var(--white); border: 1px solid var(--border); border-radius: 11px;
  padding: 16px 18px; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.stat-card.accent-o { border-left: 3px solid var(--orange); }
.stat-card.accent-b { border-left: 3px solid var(--brand); }
.stat-card.accent-g { border-left: 3px solid var(--green); }
.stat-label { font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 5px; }
.stat-value { font-size: 26px; font-weight: 700; color: var(--navy); }
.stat-sub   { font-size: 11px; color: var(--muted); margin-top: 2px; }
.panel { background: var(--white); border: 1px solid var(--border); border-radius: 11px;
  padding: 18px 22px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.panel-title { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase;
  letter-spacing: .07em; margin-bottom: 14px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; margin-bottom: 16px; }
@media (max-width: 900px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* ── TABLES ── */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04); }
table.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data-table thead th { padding: 9px 12px; text-align: left; font-size: 11px; font-weight: 700;
  color: #fff; background: var(--brand); border-right: 1px solid rgba(255,255,255,.12);
  border-bottom: 2px solid var(--navy); white-space: nowrap; cursor: pointer; user-select: none; }
table.data-table thead th:hover { background: #0d3570; }
table.data-table thead th:last-child { border-right: none; }
table.data-table tbody td { padding: 8px 12px; border-top: 1px solid var(--border);
  border-right: 1px solid #f0f2f5; color: var(--navy); max-width: 180px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
table.data-table tbody td:last-child { border-right: none; }
table.data-table tbody tr:nth-child(even) td { background: #f8faff; }
table.data-table tbody tr:hover td { background: #eef3fb !important; }
.empty-state { text-align: center; padding: 44px; color: var(--muted); font-style: italic; }

/* ── FILTERS ── */
.filters-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; align-items: flex-end; }
.filters-bar .form-control { margin-bottom: 0; }
.filter-group { display: flex; flex-direction: column; gap: 4px; }
.filter-label { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.result-info { font-size: 12px; color: var(--muted); margin-bottom: 9px; }

/* ── PAGINATION ── */
.pager { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; flex-wrap: wrap; gap: 8px; }
.pager-info { font-size: 12px; color: var(--muted); }
.pager-btns { display: flex; gap: 4px; }
.page-btn { padding: 5px 11px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--white); cursor: pointer; font-size: 13px; color: var(--navy); transition: .1s; }
.page-btn:hover { background: var(--cream); }
.page-btn.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.page-btn:disabled { opacity: .4; cursor: default; }

/* ── BADGES ── */
.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.badge-blue   { background: #dbeafe; color: #1d4ed8; }
.badge-orange { background: #ffedd5; color: #c2410c; }
.badge-gray   { background: #f1f5f9; color: #475569; }
.badge-green  { background: #dcfce7; color: #15803d; }
.badge-red    { background: #fee2e2; color: var(--red); }
.badge-yellow { background: #fef9c3; color: #854d0e; }

/* ── PROGRESS BAR ── */
.progress-wrap { background: #f1f5f9; border-radius: 20px; height: 8px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 20px; transition: width .4s; }
.progress-bar.green  { background: var(--green); }
.progress-bar.orange { background: var(--orange); }
.progress-bar.red    { background: var(--red); }

/* ── BAR CHART ── */
.bar-chart-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.bar-chart-lbl { font-size: 12px; width: 120px; text-align: right; flex-shrink: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-chart-track { flex: 1; background: #f1f5f9; border-radius: 4px; height: 9px; overflow: hidden; }
.bar-chart-fill { height: 100%; border-radius: 4px; }
.bar-chart-n { font-size: 11px; color: var(--muted); width: 36px; text-align: right; font-weight: 600; flex-shrink: 0; }

/* ── MODAL ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(10,32,64,.5); display: flex;
  align-items: center; justify-content: center; z-index: 200; display: none; }
.modal-overlay.open { display: flex; }
.modal { background: var(--white); border-radius: 12px; padding: 26px; width: min(560px, 94vw);
  max-height: 88vh; overflow-y: auto; box-shadow: 0 24px 64px rgba(0,0,0,.2); }
.modal-header { display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.modal-title { font-size: 16px; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--muted); }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px;
  padding-top: 16px; border-top: 1px solid var(--border); }

/* ── SEARCH LANDING (Sales Navigator style) ── */
.search-hero { background: var(--navy); padding: 36px 24px; text-align: center; color: #fff; margin-bottom: 24px; border-radius: 11px; }
.search-hero h2 { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.search-hero p  { font-size: 14px; color: rgba(255,255,255,.6); margin-bottom: 20px; }
.search-input-wrap { display: flex; gap: 10px; max-width: 600px; margin: 0 auto; }
.search-input-wrap input { flex: 1; padding: 12px 16px; border-radius: 8px; border: 2px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.1); color: #fff; font-size: 15px; outline: none; font-family: inherit; }
.search-input-wrap input::placeholder { color: rgba(255,255,255,.45); }
.search-input-wrap input:focus { border-color: var(--orange); background: rgba(255,255,255,.15); }
.filter-accordion { margin-bottom: 16px; }
.filter-cat { background: var(--white); border: 1px solid var(--border); border-radius: 9px; margin-bottom: 8px; overflow: hidden; }
.filter-cat-header { display: flex; justify-content: space-between; align-items: center;
  padding: 13px 16px; cursor: pointer; font-size: 13px; font-weight: 600; user-select: none; }
.filter-cat-header:hover { background: var(--cream); }
.filter-cat-body { display: none; padding: 14px 16px; border-top: 1px solid var(--border); }
.filter-cat-body.open { display: block; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-chip { padding: 5px 12px; border: 1.5px solid var(--border); border-radius: 20px; font-size: 12px;
  cursor: pointer; user-select: none; transition: .12s; background: #fff; }
.filter-chip:hover  { border-color: var(--brand); color: var(--brand); }
.filter-chip.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.filter-search { width: 100%; padding: 8px 11px; border: 1px solid var(--border); border-radius: 7px;
  font-size: 13px; margin-bottom: 10px; font-family: inherit; outline: none; }
.filter-search:focus { border-color: var(--brand); }

/* ── KPI CARD ── */
.kpi-card { background: var(--white); border: 1px solid var(--border); border-radius: 11px; padding: 16px 18px; }
.kpi-card-name { font-size: 13px; font-weight: 600; color: var(--navy); margin-bottom: 6px; }
.kpi-points-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.kpi-points-earned { font-size: 20px; font-weight: 700; color: var(--navy); }
.kpi-target-lbl { font-size: 11px; color: var(--muted); }
.kpi-pct { font-size: 12px; font-weight: 600; color: var(--muted); margin-top: 4px; }

/* ── MISC ── */
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.text-muted { color: var(--muted); }
.text-orange { color: var(--orange); }
.text-green  { color: var(--green); }
.text-red    { color: var(--red); }
.fw-bold { font-weight: 700; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.d-flex { display: flex; }
.gap-2 { gap: 8px; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.month-selector { display: flex; align-items: center; gap: 10px; }
.month-selector label { font-size: 13px; font-weight: 600; color: var(--muted); }
input[type=month].form-control { width: auto; }
