/* ===================================================================
   Edify Printech - Employee Sales Portal
   Standalone stylesheet (does not depend on admin.css / style.css)
   =================================================================== */

:root {
  --e-navy: #021e43;
  --e-navy-soft: #0b2a52;
  --e-navy-active: #183c6c;
  --e-page: #f5f8fc;
  --e-card: #ffffff;
  --e-border: #e6ecf3;
  --e-text: #0b1b33;
  --e-muted: #6b7a90;
  --e-blue: #2a65ed;
  --e-blue-soft: #588fef;
  --e-blue-tint: #e6eeff;
  --e-green: #1e9d56;
  --e-green-2: #69b74a;
  --e-green-tint: #e4f7ec;
  --e-yellow: #f5b301;
  --e-yellow-tint: #fdf3d9;
  --e-purple: #8853e1;
  --e-purple-tint: #efe7fd;
  --e-teal: #0085b9;
  --e-red: #f33857;
  --e-red-tint: #fde8ec;
  --e-orange: #f58220;
  --e-orange-tint: #fdeedd;
  --e-sidebar-w: 240px;
  --e-radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--e-page);
  color: var(--e-text);
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; }

/* ------------------------------------------------------------------
   Sidebar
------------------------------------------------------------------ */
.emp-sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--e-sidebar-w);
  background: var(--e-navy);
  display: flex;
  flex-direction: column;
  z-index: 1040;
  transition: transform .25s ease;
}

.emp-logo {
  padding: 20px 18px 18px;
  text-align: center;
}
.emp-logo img {
  max-width: 100%;
  height: 42px;
  object-fit: contain;
  /* the brand logo file is dark green artwork - flip it to white for the navy rail */
  filter: brightness(0) invert(1);
}

.emp-nav {
  flex: 1;
  overflow-y: auto;
  padding: 6px 10px 10px;
}
.emp-nav::-webkit-scrollbar { width: 6px; }
.emp-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-radius: 6px; }

.emp-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  margin-bottom: 2px;
  border-radius: 8px;
  color: #dfe7f3;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.1;
}
.emp-nav a i {
  width: 18px;
  text-align: center;
  font-size: 15px;
  color: #b9c8dd;
}
.emp-nav a:hover { background: var(--e-navy-soft); color: #fff; }
.emp-nav a:hover i { color: #fff; }
.emp-nav a.active {
  background: var(--e-navy-active);
  color: #fff;
  font-weight: 600;
}
.emp-nav a.active i { color: #fff; }

.emp-user {
  border-top: 1px solid rgba(255,255,255,.12);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 11px;
}
.emp-user .avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: #e9eef6;
  color: var(--e-navy);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  overflow: hidden;
  flex: 0 0 auto;
}
.emp-user .avatar img { width: 100%; height: 100%; object-fit: cover; }
.emp-user .meta { min-width: 0; }
.emp-user .hello { color: #a9bad2; font-size: 11px; line-height: 1.2; }
.emp-user .who {
  color: #fff; font-size: 13.5px; font-weight: 700; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.emp-user .role { color: #a9bad2; font-size: 11px; line-height: 1.2; }
.emp-user .logout { margin-left: auto; color: #a9bad2; font-size: 14px; }
.emp-user .logout:hover { color: #fff; }

.emp-sidebar-footer {
  border-top: 1px solid rgba(255,255,255,.12);
  padding: 10px;
}
.emp-home-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 8px;
  color: #dfe7f3;
  font-size: 13.5px;
  font-weight: 500;
}
.emp-home-link i { width: 18px; text-align: center; font-size: 15px; color: #b9c8dd; }
.emp-home-link:hover { background: var(--e-navy-soft); color: #fff; }
.emp-home-link:hover i { color: #fff; }

/* ------------------------------------------------------------------
   Main column
------------------------------------------------------------------ */
.emp-main {
  margin-left: var(--e-sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 18px 22px 0;
}

.emp-topbar {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.emp-burger {
  display: none;
  background: #fff;
  border: 1px solid var(--e-border);
  border-radius: 8px;
  width: 38px; height: 38px;
  color: var(--e-navy);
  font-size: 15px;
}
.emp-title {
  font-size: 25px;
  font-weight: 800;
  letter-spacing: .2px;
  margin: 0;
  color: #0b1b33;
  text-transform: uppercase;
}
.emp-sub { color: var(--e-muted); font-size: 12.5px; margin: 3px 0 0; }
.emp-topbar-tools { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.emp-daterange {
  background: #fff;
  border: 1px solid var(--e-border);
  border-radius: 8px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 500;
  color: #23324a;
  display: flex; align-items: center; gap: 26px;
  cursor: pointer;
}
.emp-daterange i { color: var(--e-muted); font-size: 13px; }

.emp-filter-btn {
  background: var(--e-navy);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  display: flex; align-items: center; gap: 26px;
}
.emp-filter-btn:hover { background: #062f60; color: #fff; }

.emp-filter-panel {
  min-width: 300px;
  padding: 16px;
  border: 1px solid var(--e-border);
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(11,27,51,.12);
}
.emp-filter-panel label {
  font-size: 11.5px; font-weight: 600; color: var(--e-muted);
  text-transform: uppercase; letter-spacing: .4px; margin-bottom: 4px; display: block;
}
.emp-filter-panel .form-control,
.emp-filter-panel .form-select {
  font-size: 13px; border-color: var(--e-border);
}

/* ------------------------------------------------------------------
   Cards + grids
------------------------------------------------------------------ */
.emp-card {
  background: var(--e-card);
  border: 1px solid var(--e-border);
  border-radius: var(--e-radius);
  padding: 16px 18px;
  box-shadow: 0 1px 2px rgba(16,34,64,.04);
}
.emp-card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 14px;
}
.emp-card-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .35px;
  text-transform: uppercase;
  color: #0b1b33;
  margin: 0;
}
.emp-select {
  border: 1px solid var(--e-border);
  border-radius: 7px;
  padding: 5px 26px 5px 10px;
  font-size: 12px;
  color: #23324a;
  background: #fff url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%236b7a90' d='M8 11L3 6h10z'/%3E%3C/svg%3E") no-repeat right 8px center/10px 10px;
  appearance: none;
  outline: none;
}

.emp-grid { display: grid; gap: 14px; margin-bottom: 14px; }
.grid-kpi { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grid-r2  { grid-template-columns: 1.5fr 1fr 1.03fr; }
.grid-r3  { grid-template-columns: 1.4fr 1fr 1.22fr 1fr; }
.grid-r4  { grid-template-columns: 1.17fr 1fr 1.08fr; }
.grid-2   { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3   { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4   { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-cust { grid-template-columns: 1fr 1.6fr; }

/* ------------------------------------------------------------------
   KPI cards
------------------------------------------------------------------ */
.kpi-card { position: relative; }
.kpi-label {
  font-size: 11.5px; font-weight: 700; letter-spacing: .4px;
  text-transform: uppercase; color: #5b6b82; margin: 0 0 8px;
}
.kpi-value { font-size: 27px; font-weight: 800; line-height: 1.05; margin: 0; letter-spacing: -.4px; }
.kpi-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 16px; }
.kpi-foot-text { font-size: 11.5px; color: var(--e-muted); }
.kpi-foot-text b { color: #23324a; font-weight: 600; }
.kpi-delta { font-size: 11.5px; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }
.kpi-delta.up { color: var(--e-green); }
.kpi-delta.down { color: var(--e-red); }
.kpi-icon {
  position: absolute; top: 14px; right: 16px;
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
}
.kpi-icon.blue   { background: var(--e-blue-tint);   color: var(--e-blue); }
.kpi-icon.green  { background: var(--e-green-tint);  color: var(--e-green); }
.kpi-icon.yellow { background: var(--e-yellow-tint); color: #d99b00; }
.kpi-icon.purple { background: var(--e-purple-tint); color: var(--e-purple); }
.kpi-icon.red    { background: var(--e-red-tint);    color: var(--e-red); }

.prog-track { height: 7px; border-radius: 6px; background: #e9eef5; overflow: hidden; flex: 1; }
.prog-fill  { height: 100%; border-radius: 6px; background: var(--e-blue); }

/* ------------------------------------------------------------------
   Charts
------------------------------------------------------------------ */
.chart-box { position: relative; width: 100%; }
.chart-legend { display: flex; align-items: center; gap: 18px; margin-bottom: 6px; font-size: 11.5px; color: #3d4d66; }
.chart-legend .sw { width: 11px; height: 11px; border-radius: 2px; display: inline-block; margin-right: 6px; vertical-align: -1px; }
.chart-legend .dash {
  display: inline-block; width: 22px; height: 0; border-top: 2px dashed #1b2a4a;
  margin-right: 6px; vertical-align: 4px;
}

.donut-wrap { position: relative; }
.donut-center {
  position: absolute; inset: 0; top: 0; left: 0; transform: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  pointer-events: none; text-align: center;
}
.donut-center .big { font-size: 17px; font-weight: 800; line-height: 1.1; }
.donut-center .small { font-size: 11px; color: var(--e-muted); margin-top: 2px; }

.legend-list { list-style: none; margin: 0; padding: 0; }
.legend-list li { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 12px; font-size: 12px; }
.legend-list li:last-child { margin-bottom: 0; }
.legend-list .sw { width: 10px; height: 10px; border-radius: 2px; margin-top: 4px; flex: 0 0 auto; }
.legend-list .name { color: #23324a; line-height: 1.35; }
.legend-list .amt { color: var(--e-muted); font-size: 11.5px; }
.legend-list .pct { margin-left: auto; font-weight: 700; font-size: 12.5px; white-space: nowrap; }

/* Territory bars */
.terr-row { display: flex; align-items: center; gap: 10px; margin-bottom: 13px; font-size: 12px; }
.terr-row:last-child { margin-bottom: 0; }
.terr-name { width: 108px; flex: 0 0 108px; color: #3d4d66; line-height: 1.25; }
.terr-track { flex: 1; height: 13px; background: #f0f4f9; border-radius: 3px; overflow: hidden; }
.terr-fill { display: block; height: 100%; border-radius: 3px; }
.terr-val { width: 128px; flex: 0 0 128px; text-align: right; font-size: 11.5px; color: #23324a; white-space: nowrap; }
.terr-val b { font-weight: 600; }

/* ------------------------------------------------------------------
   Tables
------------------------------------------------------------------ */
.emp-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.emp-table thead th {
  font-size: 11.5px; font-weight: 700; color: #1c2b44;
  padding: 0 8px 9px; border-bottom: 1px solid var(--e-border);
  text-align: left; white-space: nowrap;
}
.emp-table tbody td {
  padding: 9px 8px; border-bottom: 1px solid #f0f4f9; color: #3d4d66; vertical-align: middle;
}
.emp-table tbody tr:last-child td { border-bottom: 1px solid var(--e-border); }
.emp-table tfoot td {
  padding: 10px 8px 2px; font-weight: 700; color: #0b1b33; font-size: 12.5px;
}
.emp-table .num { text-align: right; white-space: nowrap; }
.emp-table .mid { text-align: center; white-space: nowrap; }
.emp-table .rank { width: 26px; color: #5b6b82; }
.emp-table tbody tr:hover td { background: #fbfcfe; }

.ach-cell { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.ach-track { width: 78px; height: 7px; border-radius: 5px; background: #eef2f7; overflow: hidden; flex: 0 0 78px; }
.ach-fill { display: block; height: 100%; border-radius: 5px; }
.ach-num { width: 52px; text-align: right; font-size: 12px; color: #23324a; }

.bar-cell { display: flex; align-items: center; gap: 10px; }
.bar-track { flex: 1; height: 8px; }
.bar-fill { height: 8px; border-radius: 2px; background: var(--e-blue); }

.thumb-sm { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; }

.pill { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.pill.blue   { background: var(--e-blue-tint);   color: #1c4fd0; }
.pill.green  { background: var(--e-green-tint);  color: #147244; }
.pill.yellow { background: var(--e-yellow-tint); color: #9a7300; }
.pill.red    { background: var(--e-red-tint);    color: #c31d3b; }
.pill.orange { background: var(--e-orange-tint); color: #b35c00; }
.pill.grey   { background: #eef2f7;              color: #52607a; }

/* ------------------------------------------------------------------
   Pipeline / funnel
------------------------------------------------------------------ */
.pipeline-wrap { display: flex; gap: 16px; align-items: flex-start; }
.funnel { flex: 0 0 150px; }
.pipeline-rows { flex: 1; min-width: 0; }
.pipe-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; font-size: 12px; padding: 6px 0; color: #3d4d66;
}
.pipe-row b { color: #23324a; font-weight: 600; white-space: nowrap; }
.conv-box {
  margin-top: 8px; background: var(--e-blue-tint); border-radius: 8px;
  padding: 10px; text-align: center;
}
.conv-box .lbl { font-size: 11.5px; color: #1c4fd0; font-weight: 600; }
.conv-box .val { font-size: 19px; font-weight: 800; color: #1c4fd0; line-height: 1.2; }

/* ------------------------------------------------------------------
   Forecast + opportunity tiles
------------------------------------------------------------------ */
.forecast-hero { text-align: center; margin-bottom: 6px; }
.forecast-hero .big { font-size: 25px; font-weight: 800; color: var(--e-blue); line-height: 1.1; }
.forecast-hero .cap { font-size: 11.5px; color: var(--e-muted); }
.forecast-hero .vs { font-size: 11.5px; color: var(--e-muted); margin-top: 8px; }
.forecast-hero .pct { font-size: 14px; font-weight: 700; color: var(--e-green); }

.opp-tile { border: 1px solid var(--e-border); border-radius: 9px; padding: 13px 14px; position: relative; }
.opp-tile .lbl { font-size: 11.5px; color: #5b6b82; font-weight: 600; }
.opp-tile .val { font-size: 23px; font-weight: 800; line-height: 1.2; margin-top: 2px; }
.opp-tile .amt { font-size: 12px; color: var(--e-muted); margin-top: 2px; }
.opp-tile .ico {
  position: absolute; top: 12px; right: 13px;
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 14px;
}
.opp-tile.blue   .val { color: var(--e-blue); }
.opp-tile.green  .val { color: var(--e-green); }
.opp-tile.red    .val { color: var(--e-red); }
.opp-tile.orange .val { color: var(--e-orange); }
.opp-tile.blue   .ico { background: var(--e-blue-tint);   color: var(--e-blue); }
.opp-tile.green  .ico { background: var(--e-green-tint);  color: var(--e-green); }
.opp-tile.red    .ico { background: var(--e-red-tint);    color: var(--e-red); }
.opp-tile.orange .ico { background: var(--e-orange-tint); color: var(--e-orange); }

/* ------------------------------------------------------------------
   Footer
------------------------------------------------------------------ */
.emp-footer {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap;
  padding: 14px 2px 18px;
  font-size: 11.5px; color: var(--e-muted);
  margin-top: auto;
}

/* ------------------------------------------------------------------
   Login page
------------------------------------------------------------------ */
.emp-login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #021e43 0%, #0b3d2e 100%);
  padding: 24px;
}
.emp-login-card {
  width: 100%; max-width: 410px;
  background: #fff; border-radius: 14px;
  padding: 32px 30px;
  box-shadow: 0 20px 55px rgba(2,30,67,.35);
}
.emp-login-card .brand { text-align: center; margin-bottom: 22px; }
.emp-login-card .brand img { height: 46px; object-fit: contain; }
.emp-login-card h1 { font-size: 19px; font-weight: 800; margin: 14px 0 2px; }
.emp-login-card .sub { font-size: 12.5px; color: var(--e-muted); margin: 0; }
.emp-login-card label { font-size: 12px; font-weight: 600; color: #23324a; margin-bottom: 5px; display: block; }
.emp-login-card .form-control { border-color: var(--e-border); padding: 10px 12px; font-size: 14px; }
.emp-login-card .form-control:focus { border-color: var(--e-blue); box-shadow: 0 0 0 3px rgba(42,101,237,.12); }
.emp-btn-primary {
  width: 100%; background: var(--e-navy); color: #fff; border: 0;
  border-radius: 8px; padding: 11px; font-weight: 700; font-size: 14px;
}
.emp-btn-primary:hover { background: #062f60; color: #fff; }
.emp-login-note { font-size: 11.5px; color: var(--e-muted); text-align: center; margin: 18px 0 0; line-height: 1.6; }
.emp-register-card { max-width: 560px; }

/* ------------------------------------------------------------------
   Utilities + responsive
------------------------------------------------------------------ */
.text-up { color: var(--e-green); }
.text-down { color: var(--e-red); }
.muted { color: var(--e-muted); }
.sec-note { font-size: 11.5px; color: var(--e-muted); margin: 0 0 12px; }
.emp-sidebar-backdrop {
  display: none; position: fixed; inset: 0; background: rgba(2,30,67,.45); z-index: 1035;
}
.emp-sidebar-backdrop.show { display: block; }

@media (max-width: 1399px) {
  .grid-kpi { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-r3  { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-r4  { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1199px) {
  .grid-r2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-cust { grid-template-columns: minmax(0, 1fr); }
  .grid-4  { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 991px) {
  .emp-sidebar { transform: translateX(-100%); }
  .emp-sidebar.show { transform: translateX(0); }
  .emp-main { margin-left: 0; padding: 14px 14px 0; }
  .emp-burger { display: inline-flex; align-items: center; justify-content: center; }
  .emp-title { font-size: 19px; }
  .emp-topbar-tools { width: 100%; margin-left: 0; }
  .grid-kpi, .grid-r2, .grid-r3, .grid-r4, .grid-2, .grid-3, .grid-4, .grid-cust {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .pipeline-wrap { flex-direction: column; }
  .funnel { width: 100%; flex: 0 0 auto; }
}
@media (max-width: 575px) {
  .grid-kpi, .grid-r2, .grid-r3, .grid-r4, .grid-2, .grid-3, .grid-4, .grid-cust {
    grid-template-columns: minmax(0, 1fr);
  }
  .emp-daterange { flex: 1; justify-content: space-between; }
  .terr-name { width: 88px; flex: 0 0 88px; }
  .terr-val { width: 104px; flex: 0 0 104px; }
}
