/* ============================================
   SGP – CoolPower  |  Original Visual Style
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* Brand */
  --orange:        #f97316;
  --orange-dark:   #c2570e;
  --orange-light:  rgba(249,115,22,0.12);

  /* Sidebar */
  --sb-bg:         #111111;
  --sb-hover:      #1c1c1c;
  --sb-border:     #2a2a2a;
  --sb-text:       #cccccc;
  --sb-muted:      #666666;
  --sb-label:      #555555;

  /* Content */
  --bg:            #f5f5f5;
  --card:          #ffffff;
  --border:        #e0e0e0;
  --border-light:  #f0f0f0;

  /* Text */
  --t1:            #1a1a1a;
  --t2:            #555555;
  --t3:            #999999;

  /* Status */
  --green:         #22c55e;
  --green-bg:      #f0fdf4;
  --amber:         #f59e0b;
  --amber-bg:      #fffbeb;
  --red:           #ef4444;
  --red-bg:        #fef2f2;
  --blue:          #3b82f6;
  --blue-bg:       #eff6ff;

  --font:   'Inter', system-ui, -apple-system, sans-serif;
  --r:      6px;
  --r-sm:   4px;
  --sh:     0 1px 3px rgba(0,0,0,0.08);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body  { height: 100%; font-family: var(--font); font-size: 13px; line-height: 1.5; color: var(--t1); background: var(--bg); -webkit-font-smoothing: antialiased; }
a           { text-decoration: none; color: inherit; }
ul          { list-style: none; }
select, input, button { font-family: inherit; font-size: inherit; }

/* ══════════════════ LAYOUT ══════════════════ */
.app        { display: flex; height: 100vh; overflow: hidden; }

/* ══════════════════ SIDEBAR ═════════════════ */
.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--sb-bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Logo */
.sidebar-logo {
  padding: 18px 16px 16px;
  border-bottom: 1px solid var(--sb-border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-icon {
  width: 38px; height: 38px;
  background: var(--orange);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.logo-icon svg { width: 22px; height: 22px; fill: #fff; }
.logo-wordmark { font-size: 17px; font-weight: 700; color: #fff; letter-spacing: -0.3px; }
.logo-wordmark span { color: var(--orange); }

/* Context selector */
.ctx-block {
  padding: 12px 14px;
  border-bottom: 1px solid var(--sb-border);
  display: flex; flex-direction: column; gap: 8px;
}
.ctx-row { display: flex; flex-direction: column; gap: 4px; }
.ctx-lbl {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sb-label);
}
.ctx-select {
  width: 100%;
  padding: 7px 28px 7px 10px;
  background: #1a1a1a;
  color: var(--sb-text);
  border: 1px solid var(--sb-border);
  border-radius: var(--r-sm);
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23666'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  font-size: 12.5px;
  font-weight: 500;
}
.ctx-select:focus { border-color: var(--orange); }

/* Nav */
.sidebar-nav { flex: 1; overflow-y: auto; padding: 10px 0 4px; }
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--sb-border); }

.nav-section {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sb-label);
  padding: 10px 16px 5px;
}
.nav-section:first-child { padding-top: 4px; }

.nav-item > a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  margin: 1px 8px;
  border-radius: var(--r-sm);
  color: var(--sb-text);
  font-size: 13px;
  font-weight: 500;
  transition: background 0.12s, color 0.12s;
}
.nav-item > a i { font-size: 16px; flex-shrink: 0; opacity: 0.7; }
.nav-item > a:hover { background: var(--sb-hover); color: #fff; }
.nav-item > a:hover i { opacity: 1; }

/* Active: solid orange pill (matches screenshot) */
.nav-item.active > a {
  background: var(--orange);
  color: #fff;
  font-weight: 600;
}
.nav-item.active > a i { opacity: 1; }

/* Footer */
.sidebar-footer {
  padding: 12px 14px;
  border-top: 1px solid var(--sb-border);
}
.sidebar-footer a {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 8px;
  border-radius: var(--r-sm);
  color: var(--sb-muted);
  font-size: 12.5px;
  font-weight: 500;
}
.sidebar-footer a:hover { color: var(--sb-text); background: var(--sb-hover); }

/* ══════════════════ MAIN ════════════════════ */
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }

/* Topbar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  height: 54px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.topbar-title  { font-size: 16px; font-weight: 700; color: var(--t1); }
.topbar-sub    { font-size: 11px; color: var(--t3); margin-top: 1px; }
.topbar-right  { display: flex; align-items: center; gap: 12px; }

.status-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 12px; font-weight: 500;
  color: var(--t2);
  background: #fff;
}
.status-chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }

.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  border: 2px solid var(--border); object-fit: cover;
}

/* Content scroll */
.content { flex: 1; overflow-y: auto; padding: 20px 22px; }

/* ══════════════════ COMPONENTS ═════════════ */

/* KPI strip */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.kpi {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 13px 15px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: var(--sh);
}
.kpi-ico {
  width: 38px; height: 38px;
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; flex-shrink: 0;
}
.kpi-ico.o  { background: rgba(249,115,22,.1); color: var(--orange); }
.kpi-ico.g  { background: var(--green-bg);     color: var(--green);  }
.kpi-ico.b  { background: var(--blue-bg);       color: var(--blue);   }
.kpi-ico.gr { background: #f5f5f5;              color: #888;          }
.kpi-val  { font-size: 22px; font-weight: 700; line-height: 1.1; }
.kpi-lbl  { font-size: 11px; color: var(--t3); margin-top: 2px; }

/* Card */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--sh);
  margin-bottom: 14px;
  overflow: hidden;
}
.card-head {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; justify-content: space-between;
  background: #fafafa;
}
.card-head h3  { font-size: 13px; font-weight: 700; }
.card-head sub { font-size: 11px; color: var(--t3); display: block; margin-top: 1px; }
.card-body     { padding: 14px; }

/* Hito accordion */
.hito-row {
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  margin-bottom: 7px;
  overflow: hidden;
}
.hito-head {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px;
  background: #fafafa;
  border-bottom: 1px solid transparent;
  cursor: pointer;
  user-select: none;
}
.hito-row.open .hito-head { border-bottom-color: var(--border-light); }

.hito-num {
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  background: #ebebeb; color: var(--t2); flex-shrink: 0;
}
.hito-row.done .hito-num { background: var(--green-bg); color: var(--green); }

.hito-name { flex: 1; font-weight: 600; font-size: 12.5px; color: var(--t1); }
.pill {
  display: inline-block; padding: 2px 8px;
  border-radius: 3px; font-size: 10px; font-weight: 700; text-transform: uppercase;
}
.pill.done    { background: var(--green-bg); color: var(--green); }
.pill.pending { background: var(--amber-bg); color: var(--amber); }
.hito-chev    { color: var(--t3); font-size: 14px; transition: transform 0.18s; }
.hito-row.open .hito-chev { transform: rotate(180deg); }

.hito-body { display: none; }
.hito-row.open .hito-body { display: block; }

/* Activity table (inside accordion & hito view) */
.act-tbl { width: 100%; border-collapse: collapse; }
.act-tbl th {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--t3);
  padding: 7px 14px; text-align: left;
  background: #fafafa; border-bottom: 1px solid var(--border);
}
.act-tbl td {
  padding: 8px 14px; border-bottom: 1px solid var(--border-light);
  vertical-align: top; font-size: 12.5px;
}
.act-tbl tr:last-child td { border-bottom: none; }
.act-tbl tr:hover td { background: #fafafa; }
.aname { font-weight: 600; }
.adesc { font-size: 11.5px; color: var(--t3); margin-top: 2px; }
.adel  { font-size: 11.5px; color: var(--t2); }

/* Info banner */
.info-banner {
  display: flex; gap: 9px; align-items: flex-start;
  background: rgba(249,115,22,.06); border: 1px solid rgba(249,115,22,.18);
  border-radius: var(--r); padding: 10px 14px; margin-bottom: 12px;
}
.info-banner i { color: var(--orange); font-size: 15px; margin-top: 1px; flex-shrink: 0; }
.info-banner strong { font-size: 12.5px; display: block; margin-bottom: 2px; }
.info-banner p { font-size: 11.5px; color: var(--t2); }

/* Empty */
.empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 56px 20px;
  color: var(--t3); text-align: center; gap: 10px;
}
.empty i { font-size: 34px; opacity: 0.35; }
.empty p { font-size: 13px; }

/* Clickable SGP Activities */
.act-card-clickable {
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.act-card-clickable:hover {
  border-color: rgba(249, 115, 22, 0.4) !important;
  background-color: rgba(249, 115, 22, 0.02) !important;
}

