:root {
  --zoho-red: #e42527;
  --zoho-blue: #0279c8;
  --zoho-blue-hover: #0169b0;
  --zoho-blue-soft: #e7f3fb;
  --bg: #f0f4f8;
  --panel: #ffffff;
  --sidebar: #f7f9fb;
  --line: #e4e8ee;
  --text: #313949;
  --muted: #6c737f;
  --ok: #128a4b;
  --ok-bg: #e8f7ee;
  --warn: #c47b00;
  --warn-bg: #fff6e5;
  --danger: #d93939;
  --danger-bg: #fdecec;
  --shadow: 0 1px 3px rgba(16, 24, 40, .06);
  --header-h: 52px;
  --sidebar-w: 232px;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Nuosu", "Puvi", "Source Sans 3", "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.45;
}
a { color: var(--zoho-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.shell { min-height: 100vh; display: flex; flex-direction: column; }
.header {
  height: var(--header-h);
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: var(--shadow);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 196px;
  text-decoration: none;
  color: var(--text);
}
.brand:hover { text-decoration: none; }
.mark {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  background: var(--zoho-red);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -1px;
}
.brand-name { font-weight: 700; font-size: 16px; letter-spacing: .02em; }
.brand-name span { color: var(--muted); font-weight: 500; font-size: 12px; margin-left: 6px; }
.global-search {
  flex: 1;
  max-width: 560px;
  position: relative;
  overflow: hidden;
}
.global-search input {
  width: 100%;
  height: 34px;
  border: 1px solid #d7dee8;
  border-radius: 4px;
  background: #f7f9fb;
  padding: 0 12px 0 34px;
  color: var(--text);
}
.global-search input:focus {
  outline: none;
  border-color: var(--zoho-blue);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(2, 121, 200, .12);
}
.header svg,
.icon-btn svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}
.global-search svg {
  position: absolute;
  left: 10px;
  top: 8px;
  width: 16px;
  height: 16px;
  color: var(--muted);
  pointer-events: none;
}
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  border-radius: 4px;
  color: #4a5568;
  display: grid;
  place-items: center;
  position: relative;
  text-decoration: none;
}
.icon-btn:hover { background: #eef2f6; text-decoration: none; }
.icon-btn .dot {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  border-radius: 8px;
  background: var(--zoho-red);
  color: #fff;
  font-size: 9px;
  line-height: 14px;
  text-align: center;
  font-weight: 700;
}
.userchip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 4px 4px;
  border-radius: 20px;
  text-decoration: none;
  color: var(--text);
}
.userchip:hover { background: #eef2f6; text-decoration: none; }
.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #0b5cab;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
}
.userchip small { display: block; color: var(--muted); font-size: 11px; line-height: 1.1; }
.userchip strong { font-size: 12px; }
.logout-link { color: var(--muted); font-size: 12px; margin-left: 4px; }

.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  flex: 1;
  min-height: 0;
}
.sidebar {
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  overflow: auto;
  padding: 10px 8px 24px;
}
.nav-filter {
  width: 100%;
  height: 30px;
  margin: 4px 0 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 8px;
  background: #fff;
  font-size: 12px;
}
.nav-group {
  color: #8a93a0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 12px 10px 4px;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 4px;
  color: #3d4654;
  font-size: 13px;
  text-decoration: none;
}
.nav a svg { width: 16px; height: 16px; flex: 0 0 16px; color: #6b7280; }
.nav a:hover { background: #eef3f8; text-decoration: none; }
.nav a.active {
  background: var(--zoho-blue-soft);
  color: var(--zoho-blue);
  font-weight: 600;
}
.nav a.active svg { color: var(--zoho-blue); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 22px 0;
}
.crumb { color: var(--muted); font-size: 12px; }
.crumb b { color: var(--text); font-size: 20px; font-weight: 600; display: block; margin-top: 2px; }
.content { padding: 16px 22px 32px; }
.page-title { margin: 0 0 14px; font-size: 18px; font-weight: 600; }

.grid { display: grid; gap: 14px; }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 16px;
  box-shadow: var(--shadow);
}
.card h3 {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 600;
  color: #243040;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.kpi {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-left: 3px solid var(--zoho-blue);
  padding: 14px 16px 14px 14px;
}
.kpi:nth-child(2) { border-left-color: #12a05b; }
.kpi:nth-child(3) { border-left-color: #e67e22; }
.kpi:nth-child(4) { border-left-color: #8e44ad; }
.kpi:nth-child(5) { border-left-color: #0279c8; }
.kpi:nth-child(6) { border-left-color: #16a085; }
.kpi:nth-child(7) { border-left-color: #c0392b; }
.kpi:nth-child(8) { border-left-color: #2c3e50; }
.kpi .label { color: var(--muted); font-size: 12px; }
.kpi .value { font-size: 24px; font-weight: 700; color: #1f2a37; }

.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td {
  padding: 9px 12px;
  border-bottom: 1px solid #eef1f5;
  text-align: left;
  font-size: 13px;
}
th {
  background: #f7f9fb;
  color: #5b6573;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 1px solid var(--line);
}
tr:hover td { background: #f5f9fc; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--zoho-blue);
  color: #fff;
  border: 1px solid var(--zoho-blue);
  border-radius: 4px;
  padding: 7px 14px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--zoho-blue-hover); text-decoration: none; color: #fff; }
.btn.secondary {
  background: #fff;
  color: #334155;
  border-color: #cfd6de;
}
.btn.secondary:hover { background: #f7f9fb; color: #334155; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }

.form-row { margin-bottom: 12px; }
label { display: block; margin-bottom: 5px; color: #4b5563; font-size: 12px; font-weight: 600; }
input, select, textarea {
  width: 100%;
  background: #fff;
  color: var(--text);
  border: 1px solid #cfd6de;
  border-radius: 4px;
  padding: 8px 10px;
  font: inherit;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--zoho-blue);
  box-shadow: 0 0 0 3px rgba(2, 121, 200, .12);
}
textarea { min-height: 90px; }

.alert { padding: 10px 12px; border-radius: 4px; margin-bottom: 14px; font-size: 13px; }
.alert.error { background: var(--danger-bg); color: #9b1c1c; border: 1px solid #f4c7c7; }
.alert.ok { background: var(--ok-bg); color: #0f6b3b; border: 1px solid #b7e4c7; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
}
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.danger { background: var(--danger-bg); color: var(--danger); }
.badge.muted { background: #eef1f5; color: #5b6573; }

.toolbar { display: flex; justify-content: flex-end; align-items: center; margin-bottom: 14px; gap: 12px; }
.muted { color: var(--muted); }
.userbox { text-align: right; }
.userbox small { color: var(--muted); }
.install-ok { color: var(--ok); font-size: 13px; }

.search-group { margin-bottom: 18px; }
.search-group h3 { margin: 0 0 8px; font-size: 13px; color: var(--muted); text-transform: uppercase; }

body.modal-lock { overflow: hidden; }
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 40, .45);
  z-index: 80;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 16px 24px;
  overflow: auto;
}
.modal-overlay.is-open { display: flex; }
.modal-dialog {
  width: 100%;
  max-width: 560px;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 16px 48px rgba(16, 24, 40, .22);
  animation: modalIn .12s ease-out;
}
.modal-dialog.wide { max-width: 780px; }
@keyframes modalIn {
  from { transform: translateY(-10px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.modal-head h3 { margin: 0; font-size: 16px; font-weight: 600; border: 0; padding: 0; }
.modal-close {
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  color: #667085;
  cursor: pointer;
  border-radius: 4px;
}
.modal-close:hover { background: #eef2f6; }
.modal-body { padding: 16px 18px 20px; }
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  background: #fff;
}
.login-hero {
  background: linear-gradient(160deg, #0b5cab 0%, #0279c8 42%, #e42527 140%);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 64px;
}
.login-hero h2 { font-size: 32px; margin: 16px 0 10px; font-weight: 650; }
.login-hero p { max-width: 420px; opacity: .92; font-size: 15px; }
.login-panel { display: grid; place-items: center; background: #f7f9fb; }
.login-card {
  width: 400px;
  background: #fff;
  padding: 36px 32px;
  border-radius: 8px;
  border: 1px solid var(--line);
  box-shadow: 0 8px 30px rgba(16, 24, 40, .08);
}
.login-card h1 { margin: 10px 0 4px; font-size: 22px; }
.login-card .sub { color: var(--muted); margin: 0 0 22px; }
.login-card .btn { width: 100%; justify-content: center; height: 38px; }
.login-foot { margin-top: 18px; font-size: 12px; color: var(--muted); }

@media (max-width: 980px) {
  .login-wrap, .app { grid-template-columns: 1fr; }
  .login-hero, .sidebar { display: none; }
  .grid.cols-4, .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; }
  .global-search { display: none; }
}
