:root{
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  color-scheme:light;
  --bg:#f4f7fb;
  --panel:#ffffff;
  --panel-2:#f8fafc;
  --panel-3:#eef2f7;
  --text:#25313c;
  --muted:#6f7d8b;
  --muted-2:#94a0ad;
  --line:#dde4ec;
  --line-strong:#c9d3df;
  --primary:#4099ff;
  --primary-strong:#2f82e6;
  --primary-soft:#eaf4ff;
  --success:#20b26b;
  --success-soft:#e9f8f1;
  --warning:#f0a124;
  --warning-soft:#fff4df;
  --danger:#e05260;
  --danger-soft:#fdebed;
  --purple:#7c5ce7;
  --purple-soft:#f0ecff;
  --sidebar:#263544;
  --sidebar-deep:#1f2d3b;
  --sidebar-text:#d2dbe4;
  --sidebar-muted:#8796a6;
  --sidebar-width:250px;
  --topbar-height:64px;
  --radius:8px;
  --shadow:0 2px 12px rgba(31,45,61,.055);
}
html[data-theme="dark"]{
  color-scheme:dark;
  --bg:#0f141b;
  --panel:#151b23;
  --panel-2:#1a222c;
  --panel-3:#202a35;
  --text:#eef2f6;
  --muted:#a4afba;
  --muted-2:#788695;
  --line:#2a3441;
  --line-strong:#3a4756;
  --primary:#66aaff;
  --primary-strong:#83baff;
  --primary-soft:#172e4d;
  --success:#70dba4;
  --success-soft:#173429;
  --warning:#f3bd60;
  --warning-soft:#3b2f18;
  --danger:#f08d98;
  --danger-soft:#3b2024;
  --purple:#a48af3;
  --purple-soft:#282044;
  --sidebar:#111827;
  --sidebar-deep:#0d1420;
  --sidebar-text:#dce3ea;
  --sidebar-muted:#758497;
  --shadow:none;
}
*{box-sizing:border-box}
html{min-height:100%;background:var(--bg)}
body{
  margin:0;
  min-height:100dvh;
  background:var(--bg);
  color:var(--text);
  font-size:15px;
  line-height:1.45;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}
button,input,select,textarea{font:inherit}
button,a{touch-action:manipulation}
a{color:var(--primary);text-decoration:none}
a:hover{color:var(--primary-strong)}
img{display:block;max-width:100%}
svg{display:block}
p{line-height:1.55}
.inline{display:inline}
[hidden]{display:none!important}

.app-shell{
  display:grid;
  grid-template-columns:var(--sidebar-width) minmax(0,1fr);
  min-height:100dvh;
}
html.sidebar-precollapsed,
body.sidebar-collapsed{--sidebar-width:76px}

.sidebar{
  position:sticky;
  top:0;
  align-self:start;
  height:100dvh;
  display:flex;
  flex-direction:column;
  background:var(--sidebar);
  color:var(--sidebar-text);
  border-right:1px solid rgba(255,255,255,.04);
  overflow:hidden;
}
.sidebar-head{
  min-height:76px;
  padding:15px 14px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  background:var(--sidebar-deep);
  border-bottom:1px solid rgba(255,255,255,.055);
}
.sidebar-brand{
  min-width:0;
  display:flex;
  align-items:center;
  gap:10px;
  color:#fff;
}
.sidebar-brand:hover{color:#fff}
.brand-mark{
  width:42px;
  height:42px;
  flex:0 0 42px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:9px;
  background:#fff;
}
.brand-mark img{width:36px;height:36px}
.brand-copy{min-width:0;display:flex;flex-direction:column}
.brand-copy b{
  max-width:160px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:14px;
  line-height:1.15;
}
.brand-copy small{
  margin-top:4px;
  color:var(--sidebar-muted);
  font-size:10px;
}
.sidebar-close{
  display:none;
  width:36px;
  height:36px;
  padding:0;
  border:0;
  border-radius:7px;
  align-items:center;
  justify-content:center;
  background:transparent;
  color:var(--sidebar-text);
  cursor:pointer;
}
.sidebar-close svg,
.sidebar-collapse svg,
.mobile-menu svg,
.nav-icon svg,
.theme-choice svg,
.icon-action svg,
.metric-icon svg,
.quick-icon svg,
.search-icon svg,
.entity-icon svg,
.entity-card-icon svg,
.entity-arrow svg{
  width:18px;
  height:18px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.8;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.sidebar-scroll{
  flex:1;
  overflow:auto;
  padding:15px 12px 10px;
}
.nav-group{margin-bottom:18px}
.nav-label{
  padding:0 10px 7px;
  color:var(--sidebar-muted);
  font-size:10px;
  font-weight:800;
  letter-spacing:.1em;
  text-transform:uppercase;
}
.nav-link{
  min-height:44px;
  margin:2px 0;
  padding:10px 11px;
  display:flex;
  align-items:center;
  gap:11px;
  border:0;
  border-radius:7px;
  background:transparent;
  color:var(--sidebar-text);
  font-size:13.5px;
  font-weight:650;
  text-align:left;
  cursor:pointer;
}
.nav-link:hover{background:rgba(255,255,255,.065);color:#fff}
.nav-link.active{background:var(--primary);color:#fff}
.nav-icon{
  width:20px;
  height:20px;
  flex:0 0 20px;
  display:flex;
  align-items:center;
  justify-content:center;
}
.nav-text{white-space:nowrap}
.sidebar-footer{
  padding:11px 12px 13px;
  border-top:1px solid rgba(255,255,255,.055);
  background:var(--sidebar-deep);
}
.nav-install{width:100%;color:var(--sidebar-text)}
.sidebar-version{
  display:flex;
  flex-direction:column;
  gap:2px;
  margin-top:6px;
  padding:9px 11px;
  border-radius:7px;
  color:var(--sidebar-text);
}
.sidebar-version:hover{background:rgba(255,255,255,.055);color:#fff}
.sidebar-version span{font-size:12px;font-weight:650}
.sidebar-version small{font-size:10px;color:var(--sidebar-muted)}

body.sidebar-collapsed .brand-copy,
body.sidebar-collapsed .nav-text,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .sidebar-version,
html.sidebar-precollapsed .brand-copy,
html.sidebar-precollapsed .nav-text,
html.sidebar-precollapsed .nav-label,
html.sidebar-precollapsed .sidebar-version{display:none}
body.sidebar-collapsed .sidebar-head,
html.sidebar-precollapsed .sidebar-head{justify-content:center;padding-left:10px;padding-right:10px}
body.sidebar-collapsed .sidebar-brand,
html.sidebar-precollapsed .sidebar-brand{justify-content:center}
body.sidebar-collapsed .nav-link,
html.sidebar-precollapsed .nav-link{justify-content:center;padding-left:8px;padding-right:8px}
body.sidebar-collapsed .sidebar-footer,
html.sidebar-precollapsed .sidebar-footer{padding-left:8px;padding-right:8px}

.sidebar-backdrop{display:none}
.workspace{min-width:0}
.workspace-topbar{
  position:sticky;
  top:0;
  z-index:30;
  height:var(--topbar-height);
  padding:0 24px;
  display:flex;
  align-items:center;
  gap:12px;
  background:var(--panel);
  border-bottom:1px solid var(--line);
  box-shadow:0 1px 4px rgba(31,45,61,.035);
}
.mobile-menu,.sidebar-collapse{
  width:36px;
  height:36px;
  padding:0;
  border:1px solid var(--line);
  border-radius:7px;
  align-items:center;
  justify-content:center;
  background:var(--panel);
  color:var(--muted);
  cursor:pointer;
}
.mobile-menu{display:none}
.sidebar-collapse{display:flex}
.mobile-menu:hover,.sidebar-collapse:hover{background:var(--panel-3);color:var(--text)}
.topbar-title{
  display:flex;
  align-items:baseline;
  gap:8px;
}
.topbar-title span{
  color:var(--muted);
  font-size:11px;
  font-weight:800;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.topbar-title b{font-size:14px}
.topbar-spacer{flex:1}
.notification-wrap{position:relative}
.icon-action,.theme-choice{
  width:34px;
  height:34px;
  padding:0;
  border:0;
  border-radius:7px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:transparent;
  color:var(--muted);
  cursor:pointer;
}
.icon-action:hover,.theme-choice:hover{background:var(--panel-3);color:var(--text)}
.notification-button{position:relative}
.notification-count{
  position:absolute;
  top:-3px;
  right:-2px;
  min-width:18px;
  height:18px;
  padding:0 4px;
  display:flex;
  align-items:center;
  justify-content:center;
  border:2px solid var(--panel);
  border-radius:999px;
  background:var(--danger);
  color:#fff;
  font-size:9px;
  font-weight:800;
}
.notification-panel{
  position:absolute;
  top:42px;
  right:0;
  z-index:90;
  width:380px;
  max-width:calc(100vw - 24px);
  overflow:hidden;
  border:1px solid var(--line);
  border-radius:9px;
  background:var(--panel);
  box-shadow:0 18px 48px rgba(31,45,61,.2);
}
.notification-head{
  padding:14px 15px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  border-bottom:1px solid var(--line);
  background:var(--panel-2);
}
.notification-head div{display:flex;flex-direction:column}
.notification-head b{font-size:13px}
.notification-head span{margin-top:3px;color:var(--muted);font-size:11px}
.notification-head>a{font-size:11px;font-weight:700}
.notification-list{max-height:380px;overflow:auto}
.notification-list>a{
  padding:12px 14px;
  display:flex;
  align-items:flex-start;
  gap:10px;
  border-bottom:1px solid var(--line);
  color:var(--text);
}
.notification-list>a:last-child{border-bottom:0}
.notification-list>a:hover{background:var(--panel-2);color:var(--text)}
.notification-list>a>span:last-child{min-width:0;display:flex;flex-direction:column}
.notification-list b{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:12.5px;
}
.notification-list small{margin-top:3px;color:var(--muted);font-size:11px}
.notification-dot{
  display:block;
  inline-size:10px;
  block-size:10px;
  flex:0 0 10px;
  aspect-ratio:1;
  margin-top:5px;
  border-radius:999px;
  background:var(--primary);
}
.notification-dot.is-danger{background:var(--danger)}
.notification-dot.is-today{background:var(--warning)}
.notification-empty{padding:28px;text-align:center;color:var(--muted);font-size:12px}

.theme-switcher{
  display:flex;
  align-items:center;
  gap:2px;
  padding:3px;
  border:1px solid var(--line);
  border-radius:8px;
  background:var(--panel-2);
}
.theme-choice{width:30px;height:30px}
.theme-choice.active{
  background:var(--panel);
  color:var(--primary);
  box-shadow:0 1px 3px rgba(31,45,61,.09);
}
.user-chip{
  padding-left:12px;
  display:flex;
  align-items:center;
  gap:9px;
  border-left:1px solid var(--line);
}
.user-avatar,.mini-avatar{
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:50%;
  background:var(--primary-soft);
  color:var(--primary);
  font-weight:800;
}
.user-avatar{width:34px;height:34px;font-size:12px}
.user-meta{display:flex;flex-direction:column;line-height:1.1}
.user-meta b{font-size:12.5px}
.user-meta small{margin-top:4px;color:var(--muted);font-size:10.5px}

.content{
  width:100%;
  min-width:0;
  max-width:1660px;
  padding:26px 28px 42px;
}
.page-heading{
  margin-bottom:20px;
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:16px;
}
.page-heading h1{
  margin:3px 0 0;
  font-size:29px;
  line-height:1.15;
  letter-spacing:-.025em;
}
.page-eyebrow{
  color:var(--muted);
  font-size:11px;
  font-weight:800;
  letter-spacing:.09em;
  text-transform:uppercase;
}
.page-meta{display:flex;align-items:center;gap:9px;color:var(--muted);font-size:11.5px}
.version-chip{
  padding:4px 8px;
  border-radius:999px;
  background:var(--panel-3);
  color:var(--muted);
  font-size:10.5px;
  font-weight:750;
}

.card,.metric-card,.create-panel,.entity-summary{
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
}
.card{margin-bottom:16px;padding:20px}
.section-heading,.card-header-row{
  margin-bottom:16px;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
}
.section-heading h2,.card-header-row h2{
  margin:2px 0 0;
  font-size:18px;
  line-height:1.25;
  letter-spacing:-.01em;
}
.eyebrow{
  display:block;
  color:var(--muted);
  font-size:10.5px;
  font-weight:800;
  letter-spacing:.09em;
  text-transform:uppercase;
}
.muted{color:var(--muted);font-size:13px}
h2{margin:0 0 14px;font-size:18px}
h3{margin:18px 0 8px;font-size:15px}

.metric-grid{
  margin-bottom:16px;
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:14px;
}
.metric-card{
  min-height:132px;
  padding:18px;
  border-top:3px solid var(--primary);
}
.metric-card.tone-purple{border-top-color:var(--purple)}
.metric-card.tone-orange{border-top-color:var(--warning)}
.metric-card.tone-red{border-top-color:var(--danger)}
.metric-card.tone-green{border-top-color:var(--success)}
.metric-top{display:flex;align-items:center;gap:10px}
.metric-icon{
  width:38px;
  height:38px;
  flex:0 0 38px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:9px;
  background:var(--primary-soft);
  color:var(--primary);
}
.metric-card.tone-purple .metric-icon{background:var(--purple-soft);color:var(--purple)}
.metric-card.tone-orange .metric-icon{background:var(--warning-soft);color:var(--warning)}
.metric-card.tone-red .metric-icon{background:var(--danger-soft);color:var(--danger)}
.metric-card.tone-green .metric-icon{background:var(--success-soft);color:var(--success)}
.metric-label{color:var(--muted);font-size:12.5px;font-weight:700}
.metric-value{margin-top:17px;font-size:32px;line-height:1;font-weight:780;letter-spacing:-.03em}
.metric-hint{margin-top:8px;color:var(--muted-2);font-size:11.5px}

.page-stat-strip{
  margin-bottom:16px;
  display:flex;
  align-items:stretch;
  gap:1px;
  overflow:hidden;
  border:1px solid var(--line);
  border-radius:8px;
  background:var(--line);
}
.page-stat-strip>div{
  min-width:135px;
  padding:12px 16px;
  display:flex;
  align-items:baseline;
  gap:8px;
  background:var(--panel);
}
.page-stat-strip b{font-size:20px}
.page-stat-strip span{color:var(--muted);font-size:11.5px}

.analytics-grid{
  margin-bottom:16px;
  display:grid;
  grid-template-columns:minmax(0,1.7fr) minmax(285px,.7fr);
  gap:16px;
}
.analytics-card,.focus-card{margin:0}
.card-header-row p{margin:6px 0 0;color:var(--muted);font-size:12px}
.analytics-summary{text-align:right}
.analytics-summary b{display:block;font-size:25px}
.analytics-summary span{color:var(--muted);font-size:10.5px}
.bar-chart{
  height:205px;
  padding:12px 8px 0;
  display:grid;
  grid-template-columns:repeat(14,minmax(16px,1fr));
  align-items:end;
  gap:8px;
  border-top:1px solid var(--line);
}
.bar-column{
  height:100%;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:flex-end;
  gap:7px;
}
.bar-track{
  position:relative;
  width:100%;
  max-width:24px;
  height:155px;
  display:flex;
  align-items:flex-end;
  justify-content:center;
}
.bar-total,.bar-done{
  position:absolute;
  bottom:0;
  display:block;
  border-radius:5px 5px 2px 2px;
}
.bar-total{width:100%;background:color-mix(in srgb,var(--primary) 26%,transparent)}
.bar-done{width:55%;background:var(--primary);z-index:1}
.bar-column.today .bar-total{box-shadow:0 0 0 2px color-mix(in srgb,var(--warning) 50%,transparent)}
.bar-column small{color:var(--muted);font-size:10px}
.bar-h-0{height:0}.bar-h-1{height:10%}.bar-h-2{height:20%}.bar-h-3{height:30%}.bar-h-4{height:40%}.bar-h-5{height:50%}.bar-h-6{height:60%}.bar-h-7{height:70%}.bar-h-8{height:80%}.bar-h-9{height:90%}.bar-h-10{height:100%}
.chart-legend{
  margin-top:11px;
  display:flex;
  align-items:center;
  gap:16px;
  color:var(--muted);
  font-size:11px;
}
.chart-legend span{display:flex;align-items:center;gap:6px}
.chart-legend i{width:10px;height:10px;border-radius:2px}
.legend-total{background:color-mix(in srgb,var(--primary) 26%,transparent)}
.legend-done{background:var(--primary)}
.chart-period{margin-left:auto}

.focus-list{display:grid;gap:9px}
.focus-list>div{
  min-height:60px;
  padding:11px 13px;
  display:flex;
  align-items:center;
  gap:12px;
  border:1px solid var(--line);
  border-radius:8px;
  background:var(--panel-2);
}
.focus-dot{
  display:block;
  inline-size:11px;
  block-size:11px;
  flex:0 0 11px;
  aspect-ratio:1;
  border-radius:999px;
  background:var(--primary);
}
.focus-dot.is-danger{background:var(--danger)}
.focus-dot.is-warning{background:var(--warning)}
.focus-dot.is-info{background:var(--primary)}
.focus-dot.is-success{background:var(--success)}
.focus-list b{display:block;font-size:19px;line-height:1}
.focus-list small{display:block;margin-top:5px;color:var(--muted);font-size:11.5px}
.progress-block{margin-top:15px;padding-top:14px;border-top:1px solid var(--line)}
.progress-label{display:flex;justify-content:space-between;gap:10px;font-size:12px}
.progress-label b{font-size:12px}
.progress-track{
  height:8px;
  margin:8px 0;
  overflow:hidden;
  border-radius:999px;
  background:var(--panel-3);
}
.progress-fill{display:block;height:100%;border-radius:inherit;background:var(--success)}
.progress-p-0{width:0}.progress-p-1{width:10%}.progress-p-2{width:20%}.progress-p-3{width:30%}.progress-p-4{width:40%}.progress-p-5{width:50%}.progress-p-6{width:60%}.progress-p-7{width:70%}.progress-p-8{width:80%}.progress-p-9{width:90%}.progress-p-10{width:100%}
.progress-block>small{color:var(--muted);font-size:11px}

.dashboard-lower-grid{
  display:grid;
  grid-template-columns:minmax(0,1.65fr) minmax(280px,.7fr);
  gap:16px;
}
.dashboard-lower-grid>.card{margin-bottom:16px}
.live-badge{display:inline-flex;align-items:center;gap:6px;color:var(--success);font-size:11px;font-weight:800}
.live-badge i{width:8px;height:8px;border-radius:50%;background:var(--success)}
.activity-list{display:grid}
.activity-item{
  padding:12px 0;
  display:flex;
  align-items:flex-start;
  gap:10px;
  border-top:1px solid var(--line);
}
.activity-item:first-child{padding-top:0;border-top:0}
.activity-icon{
  width:30px;
  height:30px;
  flex:0 0 30px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:50%;
  background:var(--success-soft);
  color:var(--success);
  font-size:12px;
  font-weight:900;
}
.activity-item>div{min-width:0;display:flex;flex-direction:column}
.activity-item b{font-size:12.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.activity-item span{margin-top:3px;color:var(--muted);font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.activity-item small{margin-top:4px;color:var(--muted-2);font-size:10px}

.table-toolbar{
  min-height:44px;
  margin:-2px 0 10px;
  padding:5px 0;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.table-search{position:relative;display:block;width:100%;max-width:360px}
.table-search input{min-height:38px;padding-left:36px;background:var(--panel-2)}
.search-icon{
  position:absolute;
  left:11px;
  top:50%;
  z-index:1;
  transform:translateY(-50%);
  color:var(--muted);
}
.search-icon svg{width:16px;height:16px}
.table-count{color:var(--muted);font-size:11.5px;white-space:nowrap}
.responsive-table-wrap,.tablewrap{overflow:auto}
table{width:100%;border-collapse:collapse}
th,td{
  padding:12px 10px;
  border-bottom:1px solid var(--line);
  text-align:left;
  vertical-align:middle;
  font-size:13px;
}
th{
  color:var(--muted);
  font-size:10.5px;
  font-weight:800;
  letter-spacing:.055em;
  text-transform:uppercase;
  white-space:nowrap;
}
tbody tr:last-child td{border-bottom:0}
tbody tr:hover{background:var(--panel-2)}
.data-table tbody tr[data-href]{cursor:pointer}
.table-sub{display:block;margin-top:4px;color:var(--muted);font-size:10.5px}
.count-pill{
  min-width:28px;
  padding:4px 8px;
  display:inline-flex;
  justify-content:center;
  border-radius:999px;
  background:var(--primary-soft);
  color:var(--primary);
  font-size:11px;
  font-weight:800;
}
.due-badge,.status{
  display:inline-flex;
  align-items:center;
  min-height:25px;
  padding:4px 8px;
  border-radius:999px;
  background:var(--panel-3);
  color:var(--muted);
  font-size:11px;
  font-weight:800;
  white-space:nowrap;
}
.due-badge.is-danger,.status.paused{background:var(--danger-soft);color:var(--danger)}
.due-badge.is-warning,.status.warning{background:var(--warning-soft);color:var(--warning)}
.status.active{background:var(--success-soft);color:var(--success)}

.grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:13px;
}
.wide{grid-column:1/-1}
label{
  display:flex;
  flex-direction:column;
  gap:6px;
  color:var(--text);
  font-size:12.5px;
  font-weight:700;
}
input,select,textarea{
  width:100%;
  min-height:42px;
  padding:9px 11px;
  border:1px solid var(--line-strong);
  border-radius:7px;
  background:var(--panel);
  color:var(--text);
  outline:none;
}
textarea{min-height:100px;resize:vertical}
input::placeholder,textarea::placeholder{color:var(--muted-2)}
input:focus,select:focus,textarea:focus{
  border-color:var(--primary);
  box-shadow:0 0 0 3px color-mix(in srgb,var(--primary) 13%,transparent);
}
input[type="checkbox"]{width:auto;min-height:0;accent-color:var(--primary)}
input[type="file"]{padding:7px}
.checkbox{
  min-height:42px;
  display:flex;
  flex-direction:row;
  align-items:center;
  gap:9px;
}
button.primary,a.primary,a.button,button.button,
button.secondary,a.secondary,
button.danger,a.danger,.iconbtn{
  min-height:40px;
  padding:9px 13px;
  border:0;
  border-radius:7px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  font-size:12.5px;
  font-weight:750;
  cursor:pointer;
}
button.primary,a.primary,a.button,button.button{background:var(--primary);color:#fff}
button.primary:hover,a.primary:hover,a.button:hover,button.button:hover{background:var(--primary-strong);color:#fff}
button.secondary,a.secondary,.iconbtn{background:var(--panel-3);color:var(--text)}
button.secondary:hover,a.secondary:hover,.iconbtn:hover{background:var(--panel-2);color:var(--text)}
button.danger,a.danger{background:var(--danger);color:#fff}
button.danger:hover,a.danger:hover{filter:brightness(.94)}
.button-small{min-height:34px!important;padding:7px 10px!important;font-size:11.5px!important}
.plus{
  width:36px;
  height:36px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:7px;
  background:var(--primary);
  color:#fff;
  font-size:20px;
}
.plus:hover{background:var(--primary-strong);color:#fff}
.iconbtn{min-width:40px;padding:8px 10px}

.section-actions{display:flex;align-items:center;gap:8px}
.toolbar{
  margin-bottom:12px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
}
.toolbar h2{margin:0}
.toolbar form{display:flex;align-items:center;gap:8px}
.columns{
  display:grid;
  grid-template-columns:minmax(0,1.08fr) minmax(0,.92fr);
  gap:16px;
}
.cards{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
}
.tile,.listlink,.files a,.entity-card{
  color:var(--text);
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:7px;
}
.tile,.listlink{display:block;padding:12px}
.tile:hover,.listlink:hover,.files a:hover,.entity-card:hover{background:var(--panel-2);color:var(--text)}
.tile span,.listlink span,.files small{display:block;margin-top:4px;color:var(--muted);font-size:11.5px}
.listlink{margin-bottom:7px}
.files{display:grid;gap:8px;margin-top:12px}
.files a{padding:10px;display:flex;align-items:center;gap:9px}
.file-icon{
  width:30px;
  height:30px;
  flex:0 0 30px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:7px;
  background:var(--primary-soft);
  color:var(--primary);
}
.files b{font-size:12.5px}

.entity-summary{
  min-height:88px;
  margin-bottom:16px;
  padding:14px 16px;
  display:flex;
  align-items:center;
  gap:13px;
}
.entity-icon{
  width:46px;
  height:46px;
  flex:0 0 46px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:9px;
  background:var(--primary-soft);
  color:var(--primary);
}
.entity-icon svg{width:22px;height:22px}
.entity-main{min-width:0;flex:1}
.entity-main h2{margin:1px 0 4px;font-size:19px}
.entity-main>a{font-size:12px}
.entity-stat{
  padding-left:20px;
  border-left:1px solid var(--line);
  text-align:center;
}
.entity-stat b{display:block;font-size:24px}
.entity-stat span{color:var(--muted);font-size:11px}
.entity-stat-group{
  display:flex;
  overflow:hidden;
  border:1px solid var(--line);
  border-radius:7px;
  background:var(--line);
  gap:1px;
}
.entity-stat-group>div{
  min-width:82px;
  padding:9px 11px;
  text-align:center;
  background:var(--panel);
}
.entity-stat-group b{display:block;font-size:18px}
.entity-stat-group span{color:var(--muted);font-size:10px}

.info-list{display:grid}
.info-list>div{
  padding:11px 0;
  display:grid;
  grid-template-columns:130px minmax(0,1fr);
  align-items:center;
  gap:12px;
  border-top:1px solid var(--line);
}
.info-list>div:first-child{padding-top:0;border-top:0}
.info-list>div>span:first-child{
  color:var(--muted);
  font-size:10.5px;
  font-weight:800;
  letter-spacing:.04em;
  text-transform:uppercase;
}
.info-list b,.info-list a{font-size:13px}
.note-box{
  margin-top:13px;
  padding:11px 12px;
  border:1px solid var(--line);
  border-radius:7px;
  background:var(--panel-2);
}
.note-box>span{color:var(--muted);font-size:10.5px;font-weight:800;text-transform:uppercase;letter-spacing:.05em}
.note-box p{margin:6px 0 0;font-size:13px}
.upload-box{
  margin-bottom:12px;
  padding:12px;
  display:grid;
  gap:10px;
  border:1px dashed var(--line-strong);
  border-radius:7px;
  background:var(--panel-2);
}
.card-actions{margin-top:15px;padding-top:14px;border-top:1px solid var(--line)}
.entity-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:9px;
}
.entity-card{
  padding:12px;
  display:flex;
  align-items:center;
  gap:10px;
}
.entity-card-icon{
  width:34px;
  height:34px;
  flex:0 0 34px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:7px;
  background:var(--primary-soft);
  color:var(--primary);
}
.entity-card>span:nth-child(2){min-width:0;flex:1;display:flex;flex-direction:column}
.entity-card b{font-size:12.5px}
.entity-card small{
  margin-top:3px;
  overflow:hidden;
  color:var(--muted);
  font-size:11px;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.entity-arrow{color:var(--muted-2)}

.address-control{
  display:grid;
  grid-template-columns:minmax(0,1fr) 40px 40px;
  gap:7px;
}
.address-text{
  min-height:42px;
  padding:9px 11px;
  display:flex;
  align-items:center;
  border:1px solid var(--line);
  border-radius:7px;
  background:var(--panel-2);
  color:var(--text);
  font-size:13px;
}
.phone{font-size:14px;font-weight:700}

.permission-note,.settings-note{
  margin-bottom:14px;
  padding:12px 13px;
  border:1px solid var(--line);
  border-radius:7px;
  background:var(--primary-soft);
  color:var(--muted);
  font-size:12.5px;
}
.permission-note{display:flex;gap:8px}
.permission-note b{color:var(--primary);white-space:nowrap}
.settings-subhead{
  margin-top:4px;
  padding-top:13px;
  display:flex;
  align-items:baseline;
  gap:9px;
  border-top:1px solid var(--line);
}
.settings-subhead span{color:var(--muted);font-size:11px}
.settings-divider{margin:18px 0;border:0;border-top:1px solid var(--line)}
.test-mail-form{align-items:end}

.create-panel{margin-bottom:16px;overflow:hidden}
.create-panel summary{
  min-height:58px;
  padding:13px 16px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  list-style:none;
  cursor:pointer;
}
.create-panel summary::-webkit-details-marker{display:none}
.create-panel summary:hover{background:var(--panel-2)}
.create-panel summary span:first-child{display:flex;flex-direction:column}
.create-panel summary b{font-size:13px}
.create-panel summary small{margin-top:3px;color:var(--muted);font-size:11px}
.summary-plus{
  width:30px;
  height:30px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:7px;
  background:var(--primary-soft);
  color:var(--primary);
  font-size:20px;
}
.create-panel[open] .summary-plus{transform:rotate(45deg)}
.create-panel-body{padding:16px;border-top:1px solid var(--line)}
.form-actions{display:flex;justify-content:flex-end}

.user-cell{display:flex;align-items:center;gap:9px;min-width:0}
.user-cell>span:last-child{min-width:0}
.mini-avatar{width:30px;height:30px;flex:0 0 30px;font-size:10px}
.muted-avatar{background:var(--panel-3);color:var(--muted)}
.compact-list{display:grid;gap:8px}
.compact-row{
  padding:10px 11px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  border:1px solid var(--line);
  border-radius:7px;
  background:var(--panel);
}
.compact-row b{display:block;font-size:12.5px}
.compact-row small,.compact-row span{margin-top:3px;color:var(--muted);font-size:11px}
.orphan-card{border-style:dashed}

.flash{
  margin-bottom:14px;
  padding:11px 13px;
  border:1px solid var(--line);
  border-radius:7px;
  font-size:12.5px;
  font-weight:700;
}
.flash.ok{background:var(--success-soft);border-color:color-mix(in srgb,var(--success) 35%,var(--line));color:var(--success)}
.flash.error{background:var(--danger-soft);border-color:color-mix(in srgb,var(--danger) 35%,var(--line));color:var(--danger)}

.empty-state{
  min-height:160px;
  padding:22px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:7px;
  text-align:center;
  color:var(--muted);
}
.empty-state.compact{min-height:90px}
.empty-state b{color:var(--text);font-size:14px}
.empty-state span{font-size:12.5px}
.error-state{color:var(--danger)}
.audit-table code{
  padding:3px 6px;
  border-radius:5px;
  background:var(--panel-3);
  color:var(--text);
  font-size:11px;
}

.taskrow{
  padding:13px 0;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  border-top:1px solid var(--line);
}
.taskrow:first-of-type{border-top:0}
.taskrow-main{display:flex;align-items:flex-start;gap:11px}
.taskrow span{display:block;margin-top:4px;color:var(--muted);font-size:11.5px}
.taskrow form{
  min-width:310px;
  display:flex;
  align-items:end;
  justify-content:flex-end;
  gap:8px;
  flex-wrap:wrap;
}
.taskrow form input{max-width:220px}
.mobile-photo{min-width:150px}
.task-date-badge{
  width:46px;
  flex:0 0 46px;
  padding:7px 4px;
  text-align:center;
  border:1px solid var(--line);
  border-radius:7px;
  background:var(--panel-2);
}
.task-date-badge b{display:block;font-size:16px}
.task-date-badge span{margin-top:1px!important;font-size:9px!important;text-transform:uppercase}

.mobile-task-card{padding:14px 0;border-top:1px solid var(--line)}
.mobile-task-card:first-of-type{border-top:0}
.mobile-task-head{
  margin-bottom:11px;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
}
.mobile-task-head b{font-size:13px}
.mobile-task-head span{display:block;margin-top:3px;color:var(--muted);font-size:11.5px}
.mobile-task-card form{display:grid;grid-template-columns:1fr 1fr auto;gap:8px;align-items:end}
.running-time{
  margin-bottom:12px;
  padding:11px;
  display:flex;
  align-items:center;
  gap:10px;
  border:1px solid var(--line);
  border-radius:7px;
  background:var(--panel-2);
}
.pulse-dot{width:10px;height:10px;border-radius:50%;background:var(--success)}
.running-time b{display:block;font-size:12.5px}
.running-time small{display:block;margin-top:3px;color:var(--muted);font-size:11px}

.calendar-head{
  margin-bottom:10px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
}
.calendar-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch}
.calendar{
  min-width:780px;
  overflow:hidden;
  border:1px solid var(--line);
  border-radius:7px;
  background:var(--panel);
}
.cal-weekdays,.cal-grid{display:grid;grid-template-columns:repeat(7,1fr)}
.cal-weekdays div{
  padding:9px;
  border-right:1px solid var(--line);
  background:var(--panel-2);
  color:var(--muted);
  text-align:center;
  font-size:10.5px;
  font-weight:800;
}
.cal-day{
  min-height:110px;
  padding:7px;
  border-top:1px solid var(--line);
  border-right:1px solid var(--line);
  background:var(--panel);
}
.cal-date{margin-bottom:5px;color:var(--muted);font-size:11px;font-weight:800}
.muted-day{background:var(--panel-2);opacity:.68}
.cal-item{
  margin:4px 0;
  padding:5px 6px;
  display:block;
  border-left:3px solid var(--primary);
  border-radius:4px;
  background:var(--panel-2);
  color:var(--text);
  font-size:10px;
}
.cal-item:hover{background:var(--panel-3);color:var(--text)}
.cal-item span{display:block;margin-top:2px;color:var(--muted);font-size:9px}
.cal-item.done{opacity:.5;text-decoration:line-through}
.cal-item.skipped{opacity:.35}
.cal-c0{border-color:#2f80ed}.cal-c1{border-color:#e83e8c}.cal-c2{border-color:#20b26b}.cal-c3{border-color:#f0a124}.cal-c4{border-color:#7c5ce7}.cal-c5{border-color:#17a2b8}.cal-c6{border-color:#7ab648}.cal-c7{border-color:#e04f5f}

.loginwrap{max-width:430px;margin:7vh auto;padding:18px}
.login-brand{
  margin-bottom:18px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:11px;
}
.login-logo{
  width:54px;
  height:54px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:10px;
  background:#fff;
  box-shadow:var(--shadow);
}
.login-logo img{width:48px;height:48px}
.login-brand div{display:flex;flex-direction:column}
.login-brand b{font-size:18px}
.login-brand span{margin-top:3px;color:var(--muted);font-size:11px}
.login{padding:24px}
.login form{display:grid;gap:13px}

.version-hero{
  margin-bottom:16px;
  padding:18px;
  display:flex;
  align-items:center;
  gap:14px;
  border:1px solid var(--line);
  border-radius:var(--radius);
  background:var(--panel);
  box-shadow:var(--shadow);
}
.version-logo{
  width:60px;
  height:60px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:10px;
  background:var(--primary-soft);
}
.version-logo img{width:52px;height:52px}
.version-hero h2{margin:0 0 4px;font-size:20px}
.version-hero p{margin:0;color:var(--muted);font-size:12px}
.changelog-list{display:grid;gap:12px}
.changelog-entry{margin:0}
.release-version{font-weight:800}
.release-date{margin-left:8px;color:var(--muted);font-size:11px}
.changelog-entry ul{margin:10px 0 0;padding-left:20px}
.changelog-entry li{margin:6px 0;color:var(--muted);font-size:12.5px}

.app-footer{
  margin-top:18px;
  padding:15px 2px 0;
  display:flex;
  justify-content:space-between;
  gap:12px;
  border-top:1px solid var(--line);
  color:var(--muted-2);
  font-size:10.5px;
}
.install-help{
  position:fixed;
  right:18px;
  bottom:18px;
  z-index:100;
  max-width:360px;
  padding:15px 40px 15px 15px;
  border:1px solid var(--line);
  border-radius:9px;
  background:var(--panel);
  box-shadow:0 14px 38px rgba(31,45,61,.2);
}
.install-help b{display:block;margin-bottom:5px}
.install-help p{margin:0;color:var(--muted);font-size:12px}
.install-help-close{
  position:absolute;
  right:8px;
  top:6px;
  border:0;
  background:transparent;
  color:var(--muted);
  font-size:22px;
  cursor:pointer;
}

@media(max-width:1150px){
  :root{--sidebar-width:224px}
  .metric-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .analytics-grid,.dashboard-lower-grid{grid-template-columns:1fr}
  .entity-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:850px){
  html.sidebar-precollapsed{--sidebar-width:250px}
  body.sidebar-collapsed{--sidebar-width:250px}
  body{overflow-x:hidden}
  .app-shell{display:block}
  .sidebar{
    position:fixed;
    left:0;
    top:0;
    z-index:70;
    width:280px;
    max-width:88vw;
    transform:translateX(-102%);
    box-shadow:0 0 38px rgba(0,0,0,.26);
  }
  body.sidebar-open{overflow:hidden}
  body.sidebar-open .sidebar{transform:translateX(0)}
  .sidebar-close{display:flex}
  body.sidebar-collapsed .brand-copy,
  body.sidebar-collapsed .nav-text,
  body.sidebar-collapsed .nav-label,
  body.sidebar-collapsed .sidebar-version{display:flex}
  body.sidebar-collapsed .sidebar-version{display:flex}
  body.sidebar-collapsed .sidebar-head{justify-content:space-between}
  body.sidebar-collapsed .nav-link{justify-content:flex-start}
  .sidebar-backdrop{
    position:fixed;
    inset:0;
    z-index:65;
    border:0;
    background:rgba(15,23,42,.5);
    cursor:pointer;
  }
  body.sidebar-open .sidebar-backdrop{display:block}
  .workspace-topbar{height:58px;padding:0 11px;gap:7px}
  .mobile-menu{display:flex}
  .sidebar-collapse{display:none}
  .topbar-title span{display:none}
  .topbar-title b{font-size:13px}
  .user-meta{display:none}
  .user-chip{padding-left:0;border-left:0}
  .user-avatar{width:31px;height:31px}
  .notification-panel{position:fixed;top:60px;left:10px;right:10px;width:auto}
  .content{padding:16px 14px 30px}
  .page-heading{margin-bottom:15px}
  .page-heading h1{font-size:24px}
  .page-eyebrow{display:none}
  .page-stat-strip{overflow-x:auto}
  .page-stat-strip>div{min-width:112px;padding:10px 12px}
  .metric-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .metric-card{min-height:118px;padding:14px}
  .metric-value{font-size:28px}
  .bar-chart{height:185px;gap:4px}
  .bar-track{height:135px}
  .bar-column small{font-size:9px}
  .grid,.columns{grid-template-columns:1fr}
  .wide{grid-column:auto}
  .cards,.entity-grid{grid-template-columns:1fr}
  .info-list>div{grid-template-columns:1fr;gap:5px}
  .entity-stat-group{display:none}
  .table-toolbar{align-items:stretch;flex-wrap:wrap}
  .table-search{max-width:none}
  .mobile-task-card form{grid-template-columns:1fr}
  .taskrow{display:block}
  .taskrow form{min-width:0;margin-top:11px;display:grid;justify-content:stretch}
  .taskrow form input{max-width:none}
  .mobile-photo{min-width:0}
  .toolbar form{width:100%}
  .toolbar form label{width:100%}
  .calendar{min-width:690px}
  table.responsive-table thead{display:none}
  table.responsive-table,
  table.responsive-table tbody,
  table.responsive-table tr,
  table.responsive-table td{display:block;width:100%}
  table.responsive-table tr{
    margin-bottom:9px;
    padding:10px;
    border:1px solid var(--line);
    border-radius:7px;
    background:var(--panel);
  }
  table.responsive-table td{padding:6px 3px;border:0}
  table.responsive-table td:before{
    content:attr(data-label);
    display:block;
    margin-bottom:2px;
    color:var(--muted);
    font-size:9px;
    font-weight:800;
    letter-spacing:.05em;
    text-transform:uppercase;
  }
  .form-actions{display:block}
  .form-actions .primary{width:100%}
  .permission-note{display:block}
  .permission-note b{display:block;margin-bottom:4px}
}
@media(max-width:540px){
  .theme-choice{width:28px;height:28px}
  .user-avatar{display:none}
  .icon-action{width:31px;height:31px}
  .page-meta span:first-child{display:none}
  .metric-grid{grid-template-columns:1fr 1fr}
  .employee-metrics{grid-template-columns:1fr 1fr}
  .metric-label{font-size:11.5px}
  .metric-hint{font-size:10.5px}
  .analytics-summary{display:none}
  .bar-chart{padding-left:0;padding-right:0;gap:3px}
  .chart-legend{font-size:10px}
  .entity-summary{align-items:flex-start}
  .entity-stat{display:none}
  .card{padding:15px}
  .address-control{grid-template-columns:minmax(0,1fr) 38px 38px}
  button.primary,a.primary,a.button,button.button,
  button.secondary,a.secondary,
  button.danger,a.danger{width:100%}
  .toolbar .plus{width:36px}
  .install-help{left:12px;right:12px;bottom:12px;max-width:none}
}


/* HVS v1.9 — Admindek-inspired component system */

html[data-layout-width="fixed"] .content{
  max-width:1380px;
  margin-left:auto;
  margin-right:auto;
}
html[data-density="compact"] .content{padding-top:20px}
html[data-density="compact"] .card{padding:16px}
html[data-density="compact"] th,
html[data-density="compact"] td{padding-top:9px;padding-bottom:9px}
html[data-density="compact"] input,
html[data-density="compact"] select,
html[data-density="compact"] textarea{min-height:38px}
html[data-density="compact"] .nav-link{min-height:40px;padding-top:8px;padding-bottom:8px}

html[data-sidebar-theme="light"] .sidebar,
html[data-sidebar-theme="light"] .sidebar-footer,
html[data-sidebar-theme="light"] .sidebar-head{
  background:var(--panel);
  color:var(--text);
  border-color:var(--line);
}
html[data-sidebar-theme="light"] .sidebar{
  border-right:1px solid var(--line);
}
html[data-sidebar-theme="light"] .sidebar-head{border-bottom:1px solid var(--line)}
html[data-sidebar-theme="light"] .sidebar-footer{border-top:1px solid var(--line)}
html[data-sidebar-theme="light"] .sidebar-brand{color:var(--text)}
html[data-sidebar-theme="light"] .sidebar-brand:hover{color:var(--text)}
html[data-sidebar-theme="light"] .brand-copy small,
html[data-sidebar-theme="light"] .nav-label,
html[data-sidebar-theme="light"] .sidebar-version small{color:var(--muted)}
html[data-sidebar-theme="light"] .nav-link,
html[data-sidebar-theme="light"] .sidebar-version{color:var(--muted)}
html[data-sidebar-theme="light"] .nav-link:hover,
html[data-sidebar-theme="light"] .sidebar-version:hover{background:var(--panel-3);color:var(--text)}
html[data-sidebar-theme="light"] .nav-link.active{background:var(--primary);color:#fff}
html[data-sidebar-theme="light"] .sidebar-close{color:var(--text)}

.nav-progress{
  position:fixed;
  inset:0 0 auto 0;
  z-index:300;
  height:3px;
  overflow:hidden;
  pointer-events:none;
  opacity:0;
}
.nav-progress span{
  display:block;
  width:28%;
  height:100%;
  transform:translateX(-120%);
  border-radius:0 999px 999px 0;
  background:var(--primary);
}
body.ui-navigating .nav-progress{opacity:1}
body.ui-navigating .nav-progress span{animation:hvs-nav-progress .85s ease-in-out infinite}
@keyframes hvs-nav-progress{
  0%{transform:translateX(-120%) scaleX(.8)}
  55%{transform:translateX(180%) scaleX(1.3)}
  100%{transform:translateX(430%) scaleX(.8)}
}

.topbar-search{
  min-width:190px;
  height:36px;
  padding:0 9px;
  display:flex;
  align-items:center;
  gap:8px;
  border:1px solid var(--line);
  border-radius:7px;
  background:var(--panel-2);
  color:var(--muted);
  cursor:pointer;
}
.topbar-search:hover{border-color:var(--line-strong);background:var(--panel-3);color:var(--text)}
.topbar-search-icon{display:flex}
.topbar-search-icon svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round}
.topbar-search-text{font-size:12px;flex:1;text-align:left}
.topbar-search kbd,
.command-input-wrap kbd{
  padding:2px 6px;
  border:1px solid var(--line);
  border-bottom-width:2px;
  border-radius:5px;
  background:var(--panel);
  color:var(--muted);
  font:600 9px/1.4 ui-monospace,SFMono-Regular,Menlo,monospace;
}

.user-menu-wrap{position:relative}
.user-chip-button{
  border:0;
  background:transparent;
  cursor:pointer;
  color:var(--text);
}
.user-chip-button:hover{background:var(--panel-2)}
.user-chip-button{
  padding:5px 7px 5px 10px;
  border-radius:8px;
}
.user-chevron{color:var(--muted);font-size:13px}
.user-menu{
  position:absolute;
  top:44px;
  right:0;
  z-index:90;
  width:270px;
  overflow:hidden;
  border:1px solid var(--line);
  border-radius:9px;
  background:var(--panel);
  box-shadow:0 18px 48px rgba(31,45,61,.2);
  transform-origin:top right;
  animation:hvs-pop .16s ease-out;
}
.user-menu-head{
  padding:14px;
  display:flex;
  align-items:center;
  gap:10px;
  background:var(--panel-2);
  border-bottom:1px solid var(--line);
}
.user-avatar-lg{width:40px;height:40px;font-size:14px}
.user-menu-head>div{min-width:0;display:flex;flex-direction:column}
.user-menu-head b{font-size:13px}
.user-menu-head span:last-child{margin-top:3px;color:var(--muted);font-size:10px}
.user-menu-links{padding:6px}
.user-menu-links a,
.user-menu-logout{
  width:100%;
  min-height:38px;
  padding:8px 9px;
  display:flex;
  align-items:center;
  gap:9px;
  border:0;
  border-radius:6px;
  background:transparent;
  color:var(--text);
  font-size:12px;
  text-align:left;
  cursor:pointer;
}
.user-menu-links a:hover,
.user-menu-logout:hover{background:var(--panel-3);color:var(--text)}
.user-menu-links svg,
.user-menu-logout svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round}
.user-menu form{padding:6px;border-top:1px solid var(--line)}
.user-menu-logout{color:var(--danger)}

.command-palette{
  position:fixed;
  inset:0;
  z-index:200;
  display:flex;
  align-items:flex-start;
  justify-content:center;
  padding:11vh 16px 16px;
}
.command-backdrop{
  position:absolute;
  inset:0;
  background:rgba(15,23,42,.46);
  backdrop-filter:blur(3px);
  animation:hvs-fade .14s ease-out;
}
.command-dialog{
  position:relative;
  width:min(660px,100%);
  max-height:72vh;
  overflow:hidden;
  border:1px solid var(--line);
  border-radius:12px;
  background:var(--panel);
  box-shadow:0 24px 70px rgba(15,23,42,.3);
  animation:hvs-modal-in .18s ease-out;
}
.command-input-wrap{
  min-height:58px;
  padding:10px 13px;
  display:flex;
  align-items:center;
  gap:10px;
  border-bottom:1px solid var(--line);
}
.command-input-wrap>span{color:var(--muted)}
.command-input-wrap>span svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round}
.command-input-wrap input{
  flex:1;
  min-height:36px;
  padding:0;
  border:0;
  box-shadow:none!important;
  background:transparent;
  font-size:15px;
}
.command-list{max-height:52vh;overflow:auto;padding:7px}
.command-list a{
  min-height:52px;
  padding:8px 10px;
  display:flex;
  align-items:center;
  gap:10px;
  border-radius:8px;
  color:var(--text);
}
.command-list a:hover,
.command-list a.is-active{background:var(--primary-soft);color:var(--text)}
.command-icon{
  width:34px;
  height:34px;
  flex:0 0 34px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:8px;
  background:var(--panel-3);
  color:var(--primary);
}
.command-icon svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round}
.command-list a>span:nth-child(2){min-width:0;flex:1;display:flex;flex-direction:column}
.command-list b{font-size:12.5px}
.command-list small{margin-top:2px;color:var(--muted);font-size:10px}
.command-enter{color:var(--muted);font-size:13px}
.command-empty{padding:28px;text-align:center;color:var(--muted);font-size:12px}
.command-footer{
  min-height:38px;
  padding:7px 12px;
  display:flex;
  gap:14px;
  border-top:1px solid var(--line);
  background:var(--panel-2);
  color:var(--muted);
  font-size:9px;
}

.ui-customizer{
  position:fixed;
  inset:0;
  z-index:190;
}
.customizer-backdrop{
  position:absolute;
  inset:0;
  background:rgba(15,23,42,.35);
  animation:hvs-fade .14s ease-out;
}
.customizer-panel{
  position:absolute;
  top:0;
  right:0;
  width:min(380px,92vw);
  height:100%;
  display:flex;
  flex-direction:column;
  background:var(--panel);
  border-left:1px solid var(--line);
  box-shadow:-16px 0 48px rgba(15,23,42,.18);
  animation:hvs-slide-right .2s ease-out;
}
.customizer-panel>header{
  min-height:72px;
  padding:14px 16px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  border-bottom:1px solid var(--line);
}
.customizer-panel h2{margin:2px 0 0;font-size:18px}
.customizer-body{padding:16px;overflow:auto}
.customizer-section{padding:15px 0;border-top:1px solid var(--line)}
.customizer-section:first-child{padding-top:0;border-top:0}
.customizer-section>b{font-size:12.5px}
.customizer-section>p{margin:4px 0 10px;color:var(--muted);font-size:10.5px}
.segmented{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:4px;
  padding:4px;
  border:1px solid var(--line);
  border-radius:8px;
  background:var(--panel-2);
}
.wide-segment{grid-template-columns:repeat(3,minmax(0,1fr))}
.segmented button{
  min-height:36px;
  padding:7px 8px;
  border:0;
  border-radius:6px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  background:transparent;
  color:var(--muted);
  font-size:11px;
  font-weight:700;
  cursor:pointer;
}
.segmented button svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round}
.segmented button:hover{color:var(--text)}
.segmented button.active{
  background:var(--panel);
  color:var(--primary);
  box-shadow:0 1px 3px rgba(31,45,61,.09);
}
.customizer-reset{width:100%;margin-top:8px}
.customizer-settings-link{display:block;margin-top:12px;text-align:center;font-size:11px;font-weight:700}

.toast-stack{
  position:fixed;
  top:76px;
  right:18px;
  z-index:170;
  width:min(380px,calc(100vw - 24px));
  display:grid;
  gap:9px;
  pointer-events:none;
}
.ui-toast{
  min-height:66px;
  padding:11px 11px 11px 12px;
  display:grid;
  grid-template-columns:30px minmax(0,1fr) 26px;
  align-items:start;
  gap:9px;
  border:1px solid var(--line);
  border-left:3px solid var(--primary);
  border-radius:9px;
  background:var(--panel);
  box-shadow:0 14px 38px rgba(15,23,42,.18);
  pointer-events:auto;
  animation:hvs-toast-in .22s ease-out;
}
.ui-toast.toast-success{border-left-color:var(--success)}
.ui-toast.toast-danger{border-left-color:var(--danger)}
.ui-toast.toast-warning{border-left-color:var(--warning)}
.toast-mark{
  width:28px;
  height:28px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:50%;
  background:var(--primary-soft);
  color:var(--primary);
  font-size:12px;
  font-weight:900;
}
.toast-success .toast-mark{background:var(--success-soft);color:var(--success)}
.toast-danger .toast-mark{background:var(--danger-soft);color:var(--danger)}
.toast-warning .toast-mark{background:var(--warning-soft);color:var(--warning)}
.ui-toast b{display:block;font-size:12.5px}
.ui-toast p{margin:3px 0 0;color:var(--muted);font-size:11px;line-height:1.35}
.ui-toast>button{
  width:26px;
  height:26px;
  padding:0;
  border:0;
  border-radius:5px;
  background:transparent;
  color:var(--muted);
  font-size:18px;
  cursor:pointer;
}
.ui-toast>button:hover{background:var(--panel-3);color:var(--text)}
.ui-toast.is-leaving{animation:hvs-toast-out .16s ease-in forwards}

.ui-modal,
.confirm-modal{
  position:fixed;
  inset:0;
  z-index:180;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:20px;
}
.ui-modal-backdrop{
  position:absolute;
  inset:0;
  background:rgba(15,23,42,.48);
  backdrop-filter:blur(2px);
  animation:hvs-fade .14s ease-out;
}
.ui-modal-dialog{
  position:relative;
  width:100%;
  max-height:calc(100vh - 40px);
  display:flex;
  flex-direction:column;
  overflow:hidden;
  border:1px solid var(--line);
  border-radius:10px;
  background:var(--panel);
  box-shadow:0 24px 70px rgba(15,23,42,.28);
  animation:hvs-modal-in .2s cubic-bezier(.2,.8,.2,1);
}
.ui-modal-sm{max-width:480px}
.ui-modal-md{max-width:650px}
.ui-modal-lg{max-width:860px}
.ui-modal-xl{max-width:1100px}
.ui-modal-header{
  min-height:70px;
  padding:14px 16px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  border-bottom:1px solid var(--line);
  background:var(--panel-2);
}
.ui-modal-header h2{margin:0;font-size:18px}
.ui-modal-header p{margin:4px 0 0;color:var(--muted);font-size:11px}
.ui-modal-close{
  width:34px;
  height:34px;
  padding:0;
  border:0;
  border-radius:7px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:transparent;
  color:var(--muted);
  cursor:pointer;
}
.ui-modal-close:hover{background:var(--panel-3);color:var(--text)}
.ui-modal-close svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round}
.ui-modal-body{padding:16px;overflow:auto}
.modal-actions{
  padding-top:12px;
  display:flex;
  justify-content:flex-end;
  gap:8px;
  border-top:1px solid var(--line);
}
body.modal-open{overflow:hidden}

.confirm-dialog{
  position:relative;
  width:min(420px,100%);
  padding:22px;
  text-align:center;
  border:1px solid var(--line);
  border-radius:10px;
  background:var(--panel);
  box-shadow:0 24px 70px rgba(15,23,42,.28);
  animation:hvs-modal-in .18s ease-out;
}
.confirm-icon{
  width:42px;
  height:42px;
  margin:0 auto 11px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:50%;
  background:var(--danger-soft);
  color:var(--danger);
  font-size:20px;
  font-weight:900;
}
.confirm-dialog h2{margin:0;font-size:17px}
.confirm-dialog p{margin:8px 0 18px;color:var(--muted);font-size:12px}
.confirm-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px}

.table-pager{
  min-height:42px;
  padding-top:10px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  color:var(--muted);
  font-size:10.5px;
}
.table-pager-left{display:flex;align-items:center;gap:7px}
.table-pager select{width:auto;min-height:32px;padding:4px 26px 4px 8px;font-size:10px}
.table-pagination{display:flex;align-items:center;gap:4px}
.table-pagination button{
  min-width:32px;
  height:32px;
  padding:0 8px;
  border:1px solid var(--line);
  border-radius:6px;
  background:var(--panel);
  color:var(--text);
  font-size:10px;
  cursor:pointer;
}
.table-pagination button:hover:not(:disabled){border-color:var(--primary);color:var(--primary)}
.table-pagination button:disabled{opacity:.4;cursor:default}
.table-pagination .current-page{min-width:70px;text-align:center;color:var(--muted)}
.data-table th.is-sortable{cursor:pointer;user-select:none}
.data-table th.is-sortable:hover{color:var(--primary)}
.data-table th.is-sortable::after{
  content:"↕";
  margin-left:5px;
  color:var(--muted-2);
  font-size:9px;
}
.data-table th.sort-asc::after{content:"↑";color:var(--primary)}
.data-table th.sort-desc::after{content:"↓";color:var(--primary)}

button.is-loading,
a.is-loading{
  position:relative;
  color:transparent!important;
  pointer-events:none;
}
button.is-loading::after,
a.is-loading::after{
  content:"";
  position:absolute;
  left:50%;
  top:50%;
  width:16px;
  height:16px;
  margin:-8px 0 0 -8px;
  border:2px solid rgba(255,255,255,.45);
  border-top-color:#fff;
  border-radius:50%;
  animation:hvs-spin .7s linear infinite;
}
button.secondary.is-loading::after,
a.secondary.is-loading::after{border-color:color-mix(in srgb,var(--text) 30%,transparent);border-top-color:var(--text)}

.reveal-card{
  transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease;
}
@media(hover:hover){
  .metric-card:hover,
  .entity-card:hover,
  .quick-links>a:hover{transform:translateY(-2px);box-shadow:0 10px 26px rgba(31,45,61,.09)}
  .reveal-card:hover{border-color:color-mix(in srgb,var(--primary) 16%,var(--line))}
}
body.motion-ready .reveal-card{animation:hvs-fade-up .28s ease-out both}
body:not(.ui-ready) .progress-animate{width:0!important}
body.ui-ready .progress-animate{transition:width .65s cubic-bezier(.2,.8,.2,1)}

.dropzone-hint{
  padding:12px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  border:1px dashed var(--line-strong);
  border-radius:7px;
  background:var(--panel);
  pointer-events:none;
}
.dropzone-hint>span{
  width:34px;height:34px;margin-bottom:6px;
  display:flex;align-items:center;justify-content:center;
  border-radius:50%;
  background:var(--primary-soft);color:var(--primary);font-size:18px
}
.dropzone-hint b{font-size:12px}
.dropzone-hint small{margin-top:3px;color:var(--muted);font-size:10px}
.upload-box.is-dragover{
  border-color:var(--primary);
  background:var(--primary-soft);
}
.upload-box.is-dragover .dropzone-hint{border-color:var(--primary)}

.empty-state-icon{
  width:44px;
  height:44px;
  margin-bottom:5px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:10px;
  background:var(--primary-soft);
  color:var(--primary);
}
.empty-state-icon svg,
.empty-mini-icon svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round}
.empty-mini-icon{
  width:30px;height:30px;
  display:flex;align-items:center;justify-content:center;
  border-radius:50%;background:var(--success-soft);color:var(--success)
}
.notification-empty{
  min-height:130px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:4px;
}
.notification-empty b{font-size:12px}
.notification-empty>span:last-child{color:var(--muted);font-size:10px}

.settings-tabs{margin-bottom:16px}
.tab-list{
  display:flex;
  gap:3px;
  margin-bottom:12px;
  padding:4px;
  border:1px solid var(--line);
  border-radius:8px;
  background:var(--panel);
  overflow-x:auto;
}
.tab-button{
  min-height:36px;
  padding:7px 12px;
  border:0;
  border-radius:6px;
  background:transparent;
  color:var(--muted);
  font-size:11.5px;
  font-weight:750;
  white-space:nowrap;
  cursor:pointer;
}
.tab-button:hover{background:var(--panel-2);color:var(--text)}
.tab-button.active{background:var(--primary);color:#fff}
.tab-panel{animation:hvs-fade .15s ease-out}
.switch-row{
  min-height:62px;
  padding:10px 11px;
  display:flex!important;
  flex-direction:row!important;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  border:1px solid var(--line);
  border-radius:7px;
  background:var(--panel-2);
}
.switch-row>span:first-child{display:flex;flex-direction:column}
.switch-row b{font-size:12px}
.switch-row small{margin-top:3px;color:var(--muted);font-size:10px;font-weight:500}
.switch-control{position:relative;width:42px;height:24px;flex:0 0 42px}
.switch-control input{position:absolute;opacity:0;width:1px;height:1px}
.switch-control i{
  position:absolute;inset:0;border-radius:999px;background:var(--line-strong);transition:background .15s
}
.switch-control i::after{
  content:"";
  position:absolute;top:3px;left:3px;width:18px;height:18px;border-radius:50%;background:#fff;
  box-shadow:0 1px 3px rgba(31,45,61,.2);transition:transform .15s
}
.switch-control input:checked+i{background:var(--primary)}
.switch-control input:checked+i::after{transform:translateX(18px)}
.sticky-actionbar{
  min-height:56px;
  margin-top:4px;
  padding:9px 10px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  border:1px solid var(--line);
  border-radius:7px;
  background:var(--panel-2);
}
.sticky-actionbar>span{color:var(--muted);font-size:10.5px}
.settings-feature-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.settings-feature-grid>div{
  padding:16px;
  border:1px solid var(--line);
  border-radius:8px;
  background:var(--panel-2);
}
.settings-feature-icon{
  width:38px;height:38px;margin-bottom:10px;
  display:flex;align-items:center;justify-content:center;border-radius:8px;
  background:var(--primary-soft);color:var(--primary)
}
.settings-feature-icon svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round}
.settings-feature-grid b{display:block;font-size:13px}
.settings-feature-grid p{min-height:42px;margin:5px 0 12px;color:var(--muted);font-size:10.5px}

@keyframes hvs-fade{from{opacity:0}to{opacity:1}}
@keyframes hvs-pop{from{opacity:0;transform:scale(.97) translateY(-4px)}to{opacity:1;transform:scale(1) translateY(0)}}
@keyframes hvs-modal-in{from{opacity:0;transform:translateY(12px) scale(.975)}to{opacity:1;transform:translateY(0) scale(1)}}
@keyframes hvs-slide-right{from{transform:translateX(100%)}to{transform:translateX(0)}}
@keyframes hvs-toast-in{from{opacity:0;transform:translateX(28px)}to{opacity:1;transform:translateX(0)}}
@keyframes hvs-toast-out{to{opacity:0;transform:translateX(30px)}}
@keyframes hvs-spin{to{transform:rotate(360deg)}}
@keyframes hvs-fade-up{from{opacity:.01;transform:translateY(5px)}to{opacity:1;transform:translateY(0)}}

@media(max-width:1100px){
  .topbar-search{min-width:150px}
  .topbar-search kbd{display:none}
}
@media(max-width:850px){
  .topbar-search{
    width:34px;
    min-width:34px;
    padding:0;
    justify-content:center;
    border:0;
    background:transparent;
  }
  .topbar-search:hover{background:var(--panel-3)}
  .topbar-search-text,.topbar-search kbd{display:none}
  .user-chevron{display:none}
  .toast-stack{top:68px;right:10px;width:calc(100vw - 20px)}
  .command-palette{padding-top:8vh}
  .command-dialog{max-height:78vh}
  .customizer-panel{width:min(380px,94vw)}
  .table-pager{align-items:flex-start;flex-direction:column}
  .table-pagination{width:100%;justify-content:space-between}
  .settings-feature-grid{grid-template-columns:1fr}
  .settings-feature-grid p{min-height:0}
  .ui-modal{padding:10px}
  .ui-modal-dialog{max-height:calc(100vh - 20px)}
  .ui-modal-header{min-height:62px}
  .ui-modal-body{padding:14px}
  .modal-actions{position:sticky;bottom:-14px;margin:10px -14px -14px;padding:10px 14px;background:var(--panel);z-index:2}
}
@media(max-width:540px){
  .user-chip-button{padding-left:5px;padding-right:5px}
  .command-palette{padding:0}
  .command-dialog{
    width:100%;
    height:100%;
    max-height:none;
    border:0;
    border-radius:0;
  }
  .command-list{max-height:calc(100vh - 98px)}
  .command-footer{display:none}
  .confirm-actions{grid-template-columns:1fr}
  .segmented button span{display:none}
  .wide-segment button span{display:inline}
  .modal-actions{display:grid;grid-template-columns:1fr}
}

@media(prefers-reduced-motion:reduce){
  *,
  *::before,
  *::after{
    scroll-behavior:auto!important;
    animation-duration:.001ms!important;
    animation-iteration-count:1!important;
    transition-duration:.001ms!important;
  }
}

.page-loader{
  position:fixed;
  inset:var(--topbar-height) 0 0 var(--sidebar-width);
  z-index:140;
  padding:28px;
  background:var(--bg);
  pointer-events:none;
}
.page-loader-card{
  max-width:680px;
  padding:18px;
  border:1px solid var(--line);
  border-radius:8px;
  background:var(--panel);
}
.page-loader-grid{
  margin-top:14px;
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:14px;
}
.skeleton{
  display:block;
  overflow:hidden;
  position:relative;
  border-radius:7px;
  background:var(--panel-3);
}
.skeleton::after{
  content:"";
  position:absolute;
  inset:0;
  transform:translateX(-100%);
  background:linear-gradient(90deg,transparent,color-mix(in srgb,var(--panel) 58%,transparent),transparent);
  animation:hvs-skeleton 1.1s ease-in-out infinite;
}
.skeleton-title{width:42%;height:22px;margin-bottom:14px}
.skeleton-line{width:100%;height:12px;margin-top:9px}
.skeleton-line.short{width:63%}
.skeleton-box{height:120px}
@keyframes hvs-skeleton{to{transform:translateX(100%)}}
body.sidebar-collapsed .page-loader,
html.sidebar-precollapsed .page-loader{left:76px}
@media(max-width:850px){
  .page-loader{inset:58px 0 0 0;padding:16px 14px}
  .page-loader-grid{grid-template-columns:1fr 1fr}
}
@media(max-width:540px){
  .page-loader-grid{grid-template-columns:1fr}
}
