/* ===== BRIDGECON app shell (P0) ===== */
:root {
  --teal-900: #066b7c;
  --teal-800: #087f91;
  --teal-700: #0795a5;
  --teal-600: #13a9b4;
  --teal-500: #2ad3da;
  --teal-100: #e9f8f9;
  --teal-50: #f2fbfc;
  --ink-900: #142139;
  --ink-700: #3c4a60;
  --ink-500: #718095;
  --ink-300: #a9b4c2;
  --line: #e1e8ef;
  --bg: #f4f7fa;
  --card: #ffffff;
  --red: #e5484d;
  --orange: #f5a524;
  --green: #12a56b;
  --radius: 11px;
  --shadow: 0 5px 18px rgba(25, 54, 79, .07);
}

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

body {
  font-family: Inter, "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", sans-serif;
  background: var(--bg);
  color: var(--ink-900);
  font-size: 14px;
}

a { color: var(--teal-700); text-decoration: none; }

/* ===== layout ===== */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 208px;
  flex-shrink: 0;
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 18px 12px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 22% 92%, rgba(42, 211, 218, .25), transparent 30%),
    linear-gradient(180deg, var(--teal-900) 0%, var(--teal-700) 55%, #09a6b5 100%);
}

.sidebar::after {
  content: "";
  position: absolute;
  left: -80px;
  bottom: -95px;
  width: 230px;
  height: 230px;
  border-radius: 50%;
  border: 32px solid rgba(255, 255, 255, .06);
  pointer-events: none;
}

.logo-wrap {
  display: flex;
  align-items: center;
  padding: 2px 4px 15px;
  border-bottom: 1px solid rgba(255, 255, 255, .17);
  margin-bottom: 13px;
}
.logo-wrap img {
  display: block;
  width: 158px;
  max-height: 40px;
  object-fit: contain;
  object-position: left center;
}

.nav-title {
  padding: 0 9px 7px;
  font-size: 10px;
  color: rgba(255, 255, 255, .62);
  letter-spacing: .08em;
}

.nav { display: flex; flex-direction: column; gap: 5px; flex: 1; position: relative; z-index: 1; }

.nav-item {
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, .88);
  padding: 9px;
  border-radius: 8px;
  text-align: left;
  transition: .18s ease;
}

.nav-item .nav-icon { width: 24px; height: 24px; display: grid; place-items: center; }
.nav-item .nav-icon svg {
  width: 18px; height: 18px;
  fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.nav-item .nav-copy strong { display: block; font-size: 13px; font-weight: 600; }
.nav-item .nav-copy small { display: block; margin-top: 2px; color: rgba(255, 255, 255, .58); font-size: 9px; }

.nav-sub-list { display: flex; flex-direction: column; gap: 2px; padding: 2px 0 4px 32px; }
.nav-sub {
  color: rgba(255, 255, 255, .72);
  font-size: 11.5px;
  padding: 6px 9px;
  border-radius: 7px;
  transition: .18s ease;
}
.nav-sub:hover { background: rgba(255, 255, 255, .11); color: #fff; }
.nav-sub.active { background: rgba(255, 255, 255, .18); color: #fff; font-weight: 700; }

.nav-item:hover { background: rgba(255, 255, 255, .11); color: #fff; }
.nav-item.active {
  color: var(--teal-900);
  background: #fff;
  box-shadow: 0 6px 14px rgba(2, 62, 75, .18);
}
.nav-item.active .nav-copy small { color: #6f8991; }
.nav-item.disabled { opacity: 0.45; cursor: default; }

.sidebar-user {
  border-top: 1px solid rgba(255, 255, 255, .18);
  padding-top: 13px;
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  position: relative;
  z-index: 1;
}
.sidebar-user .avatar {
  background: #fff;
  color: var(--teal-800);
  border: 2px solid rgba(255, 255, 255, .65);
  font-weight: 900;
}
.sidebar-user small { display: block; font-size: 9px; color: rgba(255, 255, 255, .68); margin-top: 2px; }

@media (max-width: 1080px) {
  .sidebar { width: 78px; padding: 16px 9px; }
  .logo-wrap { justify-content: center; padding-inline: 0; }
  .logo-wrap img { width: 52px; height: 38px; object-fit: cover; object-position: left center; }
  .nav-title, .nav-item .nav-copy, .sidebar-user .user-info, .nav-sub-list { display: none; }
  .nav-item { grid-template-columns: 1fr; justify-items: center; padding: 10px; }
  .sidebar-user { justify-content: center; }
}

.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--teal-500);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar h1 { font-size: 18px; }

.topbar-actions { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--ink-500); }

.content { padding: 24px 28px; max-width: 1280px; width: 100%; }

/* ===== components ===== */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}

.card-title { font-size: 15px; font-weight: 700; margin-bottom: 14px; }

.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.kpi .num { font-size: 28px; font-weight: 700; margin-top: 6px; }
.kpi .label { color: var(--ink-500); font-size: 13px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
  background: var(--teal-700);
  color: #fff;
  font-family: inherit;
}
.btn:hover { background: var(--teal-600); }
.btn.secondary { background: #fff; border-color: var(--line); color: var(--ink-700); }
.btn.secondary:hover { border-color: var(--teal-500); color: var(--teal-700); }
.btn.danger { background: #fff; border-color: #f3c1c3; color: var(--red); }
.btn.danger:hover { background: #fdf2f2; }
.btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 7px; }

/* ===== table ===== */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left;
  font-size: 12px;
  color: var(--ink-500);
  font-weight: 600;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #fafcfc;
  white-space: nowrap;
}
.table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:hover td { background: var(--teal-50); }

.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
  background: var(--teal-100);
  color: var(--teal-800);
}
.badge.gray { background: #eef1f1; color: var(--ink-500); }
.badge.red { background: #fde8e8; color: var(--red); }
.badge.green { background: #e3f6ea; color: var(--green); }

/* ===== forms ===== */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; color: var(--ink-700); font-weight: 600; }
.field .req { color: var(--red); }

input[type="text"], input[type="email"], input[type="password"], select {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px 12px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--ink-900);
  width: 100%;
}
input:focus, select:focus { outline: 2px solid var(--teal-100); border-color: var(--teal-500); }

.checks { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.checks label { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; }

.form-actions { display: flex; gap: 10px; margin-top: 20px; }

/* ===== flash ===== */
.flash { border-radius: 10px; padding: 12px 16px; margin-bottom: 16px; font-size: 14px; }
.flash.success { background: #e3f6ea; color: #116631; border: 1px solid #bfe8cd; }
.flash.error { background: #fde8e8; color: #9c2226; border: 1px solid #f3c1c3; }

/* ===== admin tabs ===== */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tab {
  padding: 10px 18px;
  font-size: 14px;
  color: var(--ink-500);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab:hover { color: var(--teal-700); }
.tab.active { color: var(--teal-700); font-weight: 700; border-bottom-color: var(--teal-700); }

/* ===== filter bar ===== */
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 16px; }
.filter-bar .field { min-width: 180px; }

/* ===== pagination ===== */
.pagination { display: flex; gap: 6px; list-style: none; margin-top: 16px; }
.pagination a, .pagination strong, .pagination span {
  display: inline-block;
  min-width: 32px;
  text-align: center;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink-700);
  font-size: 13px;
}
.pagination strong { background: var(--teal-700); border-color: var(--teal-700); color: #fff; }

/* ===== login ===== */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 18% 88%, rgba(42, 211, 218, .22), transparent 34%),
    linear-gradient(135deg, var(--teal-900) 0%, var(--teal-700) 60%, #09a6b5 100%);
}
.login-logo { display: block; margin: 0 auto 10px; width: 210px; max-height: 56px; object-fit: contain; }
.login-card {
  width: 400px;
  background: #fff;
  border-radius: 16px;
  padding: 40px 36px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}
.login-card .brand-lg {
  font-size: 24px; font-weight: 800; letter-spacing: 1px;
  color: var(--teal-800); text-align: center; margin-bottom: 6px;
}
.login-card .sub { text-align: center; color: var(--ink-500); font-size: 13px; margin-bottom: 26px; }
.login-card .field { margin-bottom: 16px; }
.login-card .btn { width: 100%; justify-content: center; padding: 11px; font-size: 15px; margin-top: 6px; }

.muted { color: var(--ink-500); font-size: 13px; }
.inline-form { display: inline; }

/* ===== notification bell ===== */
.bell { position: relative; font-size: 18px; text-decoration: none; }
.bell-count {
  position: absolute; top: -6px; right: -10px;
  background: var(--red); color: #fff;
  border-radius: 999px; font-size: 10px; font-weight: 700;
  min-width: 16px; height: 16px; padding: 0 4px;
  display: inline-flex; align-items: center; justify-content: center;
}

/* ===== tabs pill row (list pages) ===== */
.pill-tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.pill-tab {
  padding: 7px 16px; border-radius: 999px; font-size: 13px;
  border: 1px solid var(--line); background: #fff; color: var(--ink-700);
}
.pill-tab:hover { border-color: var(--teal-500); color: var(--teal-700); }
.pill-tab.active { background: var(--teal-700); border-color: var(--teal-700); color: #fff; font-weight: 600; }
.pill-tab .cnt { opacity: .75; margin-left: 4px; }

/* ===== calendar ===== */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); border-left: 1px solid var(--line); border-top: 1px solid var(--line); }
.cal-head { background: #fafcfc; padding: 8px; text-align: center; font-size: 12px; color: var(--ink-500); font-weight: 600; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cal-cell { min-height: 96px; padding: 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fff; vertical-align: top; }
.cal-cell.dim { background: #fafbfb; color: var(--ink-300); }
.cal-cell.today { background: var(--teal-50); }
.cal-day { font-size: 12px; color: var(--ink-500); margin-bottom: 4px; font-weight: 600; }
.cal-event { display: block; font-size: 11.5px; padding: 2px 6px; border-radius: 6px; margin-bottom: 3px; background: var(--teal-100); color: var(--teal-800); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-event.type-project { background: #e3ecfb; color: #2456a6; }
.cal-event.type-strategy { background: #f0e6fb; color: #6b2fb3; }
.cal-event.type-regular { background: #fdf0d5; color: #94660c; }

/* ===== detail head ===== */
.detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.detail-title { font-size: 22px; font-weight: 800; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.detail-meta { color: var(--ink-500); font-size: 13px; margin-top: 6px; display: flex; gap: 14px; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 1100px) { .grid-2 { grid-template-columns: 1fr; } }

.list-plain { list-style: none; }
.list-plain li { padding: 9px 0; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.list-plain li:last-child { border-bottom: none; }

.timeline { list-style: none; }
.timeline li { position: relative; padding: 0 0 16px 20px; border-left: 2px solid var(--line); margin-left: 6px; }
.timeline li::before { content: ''; position: absolute; left: -6px; top: 2px; width: 10px; height: 10px; border-radius: 50%; background: var(--teal-600); }
.timeline li:last-child { padding-bottom: 0; }
.timeline .t-time { font-size: 12px; color: var(--ink-500); }

textarea {
  border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px;
  font-size: 14px; font-family: inherit; width: 100%; min-height: 90px; resize: vertical;
  background: #fff; color: var(--ink-900);
}
textarea:focus { outline: 2px solid var(--teal-100); border-color: var(--teal-500); }

.save-hint { font-size: 12px; color: var(--ink-500); }

/* ===== ops dashboards (interface.html shell) ===== */
.ops-topbar {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 14px; margin-bottom: 16px; flex-wrap: wrap;
}
.ops-heading { font-size: 21px; font-weight: 800; }
.ops-subtitle { color: var(--ink-500); font-size: 13px; margin-top: 4px; }

.ops-frame-shell { position: relative; }
.ops-panel { display: none; }
.ops-panel.active { display: block; }
.ops-panel iframe {
  width: 100%; min-height: 900px; border: 0;
  border-radius: var(--radius); background: #fff;
  border: 1px solid var(--line);
  opacity: 0; transition: opacity .25s ease;
  display: block;
}
.ops-loading {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 60px 0; color: var(--ink-500); font-size: 14px;
}
.ops-spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 3px solid var(--teal-100); border-top-color: var(--teal-600);
  animation: ops-spin .8s linear infinite;
}
@keyframes ops-spin { to { transform: rotate(360deg); } }

/* ===== quick login (dev only) ===== */
.quick-login { margin-top: 24px; border-top: 1px dashed var(--line); padding-top: 16px; }
.quick-login-title { text-align: center; color: var(--ink-300); font-size: 12px; margin-bottom: 12px; }
.quick-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 8px 12px;
  margin-bottom: 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink-900);
  text-align: left;
}
.quick-btn:hover { border-color: var(--teal-500); background: var(--teal-50); }
.quick-btn .quick-name { flex: 1; font-weight: 600; }
