:root {
  --ami-primary: #16A34A;
  --ami-primary-dark: #0F8A3B;
  --ami-blue: #0EA5E9;
  --ami-bg: #F3F7F6;
  --ami-panel: #FFFFFF;
  --ami-ink: #172033;
  --ami-muted: #64748B;
  --ami-line: #E3EAF0;
  --ami-shadow: 0 14px 34px rgba(15, 23, 42, 0.075);
  --bg: var(--ami-bg);
  --card: #fff;
  --ink: var(--ami-ink);
  --muted: var(--ami-muted);
  --line: #dde9e3;
  --accent: var(--ami-primary-dark);
  --teal: #0f7890;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; width: 100%; }
body {
  font-family: "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  color: var(--ami-ink);
  background:
    radial-gradient(circle at top left, rgba(34, 197, 94, 0.16), transparent 25rem),
    radial-gradient(circle at bottom right, rgba(14, 165, 233, 0.12), transparent 28rem),
    var(--ami-bg);
  min-height: 100vh;
}

/* ===== mp1 shell ===== */
.app-shell {
  display: flex;
  gap: 20px;
  padding: 20px;
  min-height: 100vh;
  align-items: stretch;
}
.app-sidebar {
  width: 256px;
  min-width: 256px;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #FFFFFF 0%, #F2F7F5 100%);
  border: 1px solid rgba(212, 222, 230, 0.95);
  border-radius: 24px;
  box-shadow: 0 20px 46px rgba(15, 23, 42, 0.085);
  overflow: hidden;
  position: sticky;
  top: 20px;
  height: calc(100vh - 40px);
}
.side-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 22px 18px;
}
.side-brand .brand-mark,
.login-brand .brand-mark {
  display: block;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 8px 18px rgba(22, 163, 74, 0.18);
  line-height: 0;
}
.side-brand .brand-mark img,
.login-brand .brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}
.side-brand h1 {
  font-size: 17px;
  font-weight: 900;
  color: #10251D;
  letter-spacing: 0.01em;
}
.side-nav {
  flex: 1;
  padding: 4px 14px 10px;
  overflow-y: auto;
}
.nav-group { margin-bottom: 10px; }
.nav-group .nav-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  margin-bottom: 6px;
  border: 1px solid #D9E8DF;
  border-radius: 12px;
  background: linear-gradient(180deg, #FFFFFF 0%, #F3FAF6 100%);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #0F8A3B;
  text-transform: none;
  text-align: left;
  cursor: pointer;
  user-select: none;
}
.nav-group.is-collapsible .nav-title:hover {
  background: linear-gradient(180deg, #ECFDF5 0%, #DCFCE7 100%);
  border-color: #86EFAC;
  color: #15803D;
}
.nav-group:not(.is-collapsed) > .nav-title {
  background: linear-gradient(180deg, #DCFCE7 0%, #BBF7D0 100%);
  border-color: #86EFAC;
  color: #166534;
}
.nav-group .nav-chevron {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: #16A34A;
  transition: transform 0.18s ease;
}
.nav-group.is-collapsed .nav-chevron {
  transform: rotate(-90deg);
  color: #64748B;
}
.nav-group.is-collapsed > .nav-group-body { display: none; }
.nav-group-body {
  padding: 0 2px 4px 6px;
  border-left: 2px solid #DCFCE7;
  margin-left: 10px;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  margin-bottom: 4px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  color: #475569;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}
.nav-link svg { width: 20px; height: 20px; color: #64748B; flex-shrink: 0; }
.nav-link:hover { background: #E8F8EE; color: var(--ami-primary-dark); }
.nav-link:hover svg { color: var(--ami-primary-dark); }
.nav-link.active {
  background: linear-gradient(135deg, #16A34A 0%, #0F8A3B 100%);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 12px 26px rgba(22, 163, 74, 0.30);
  border: 1px solid rgba(255, 255, 255, 0.28);
}
.nav-link.active svg { color: #fff; }
.side-foot { padding: 16px; margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.logout-btn,
.switch-corp-btn,
.switch-user-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid #D9E5DE;
  border-radius: 14px;
  background: #fff;
  color: #475569;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.18s ease;
  box-sizing: border-box;
}
.logout-btn svg,
.switch-corp-btn svg,
.switch-user-btn svg { width: 20px; height: 20px; flex-shrink: 0; }
.logout-btn:hover { background: #FEF2F2; border-color: #FCA5A5; color: #DC2626; }
.switch-corp-btn { border-color: #BBF7D0; color: #0F8A3B; background: #F0FDF4; }
.switch-corp-btn:hover { background: #DCFCE7; color: #0F8A3B; }
.switch-user-btn { border-color: #BAE6FD; color: #0369A1; background: #F0F9FF; }
.switch-user-btn:hover { background: #E0F2FE; color: #0369A1; }
.app-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: #F8FBFA;
  border: 1px solid rgba(212, 222, 230, 0.96);
  border-radius: 24px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.085);
  overflow: hidden;
  max-height: calc(100vh - 40px);
}
.app-header {
  height: 60px;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--ami-line);
}
.header-left { display: flex; align-items: center; gap: 14px; }
.menu-toggle {
  display: none;
  padding: 8px;
  border: none;
  background: transparent;
  border-radius: 10px;
  cursor: pointer;
  color: #64748B;
}
.menu-toggle svg { width: 24px; height: 24px; }
.menu-toggle:hover { background: #EEF7F2; }
.header-title { font-size: 15px; font-weight: 700; color: #334155; }
.header-right { display: flex; align-items: center; gap: 18px; }
.header-corp {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: min(420px, 46vw);
  padding: 6px 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, #F0FDF4, #ECFDF5);
  border: 1px solid #BBF7D0;
}
.header-corp-title {
  font-size: 13px;
  font-weight: 700;
  color: #166534;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.header-corp-code,
.header-corp-name {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 900;
  color: var(--ami-primary-dark);
  letter-spacing: 0.02em;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid #BBF7D0;
}
.top-user { position: relative; }
.top-user-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 999px;
  transition: background 0.18s ease;
}
.top-user-trigger:hover { background: #EEF7F2; }
.top-user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: linear-gradient(135deg, #DCFCE7, #E0F2FE);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ami-primary-dark);
  flex-shrink: 0;
}
.top-user-avatar svg { width: 22px; height: 22px; }
.top-user-name { font-size: 14px; font-weight: 600; color: #374151; }
.top-user-caret { width: 16px; height: 16px; color: #9CA3AF; }
.top-user-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 230px;
  background: #fff;
  border: 1px solid var(--ami-line);
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
  padding: 12px;
  display: none;
  z-index: 60;
}
.top-user-menu.open { display: block; }
.top-user-menu .uinfo-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 8px;
  font-size: 13px;
  border-bottom: 1px dashed var(--ami-line);
}
.top-user-menu .uinfo-row .k { color: #94A3B8; font-weight: 600; white-space: nowrap; }
.top-user-menu .uinfo-row .v { color: #334155; font-weight: 700; text-align: right; word-break: break-all; }
.top-user-menu .uinfo-switch {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 9px;
  border: 1px solid #BAE6FD;
  border-radius: 10px;
  background: #F0F9FF;
  color: #0369A1;
  font-size: 13px;
  font-weight: 800;
  font-family: inherit;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  box-sizing: border-box;
}
.top-user-menu .uinfo-switch:hover { background: #E0F2FE; color: #0369A1; }
.top-user-menu .uinfo-logout {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 9px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #16A34A, #0F8A3B);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  font-family: inherit;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  box-sizing: border-box;
}
.top-user-menu .uinfo-logout:hover { filter: brightness(1.05); }
.app-main {
  flex: 1;
  overflow-y: auto;
  padding: 22px;
  background: linear-gradient(180deg, #F8FBFA 0%, #F3F7F6 100%);
}
.app-footer {
  min-height: 44px;
  padding: 11px 22px;
  background: #F8FBFA;
  border-top: 1px solid rgba(226, 232, 240, 0.65);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  color: #94A3B8;
}
.app-footer .team { display: flex; align-items: center; gap: 10px; }
.app-footer .team .ver { color: #64748B; font-weight: 700; }
.app-footer .team .step { color: var(--ami-primary-dark); font-weight: 800; }
.side-nav::-webkit-scrollbar,
.app-main::-webkit-scrollbar { width: 10px; }
.side-nav::-webkit-scrollbar-thumb,
.app-main::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.35);
  border-radius: 6px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
.mobile-overlay { display: none; }
@media (max-width: 1024px) {
  .app-shell { padding: 12px; gap: 0; }
  .app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    border-radius: 0 18px 18px 0;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 70;
  }
  body.sidebar-open .app-sidebar { transform: translateX(0); }
  .mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 60;
  }
  body.sidebar-open .mobile-overlay { display: block; }
  .menu-toggle { display: inline-flex; }
  .app-body { max-height: none; border-radius: 18px; }
}
@media (max-width: 640px) {
  .app-shell { padding: 8px; }
  .app-header { padding: 0 12px; }
  .header-corp { max-width: min(220px, 52vw); padding: 5px 10px; gap: 6px; }
  .header-corp-title { font-size: 12px; }
  .header-corp-code,
  .header-corp-name { font-size: 11px; padding: 1px 6px; }
  .top-user-name, .top-user-caret { display: none; }
  .app-main { padding: 14px; }
}

/* 登入頁（無側欄）— 對齊舊 Login.aspx／Login_Chang.aspx */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: linear-gradient(135deg, #2E8B57 0%, #3CB371 35%, #66CDAA 70%, #F0FFF0 100%);
  min-height: 100vh;
}
.login-shell { width: 100%; max-width: 460px; }
.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.login-brand h1 { font-size: 1.15rem; font-weight: 900; color: #10251D; margin: 0; }
.login-brand p { margin: 2px 0 0; font-size: 12px; color: #475569; font-weight: 700; }
.login-panel {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
  padding: 28px 24px;
  overflow: hidden;
}
.login-panel .hero { display: none; }
.login-panel .form.card,
.login-panel .card {
  border: 0;
  box-shadow: none;
  margin: 0;
  padding: 0;
  background: transparent;
}
.login-foot {
  text-align: center;
  margin-top: 16px;
  font-size: 12px;
  color: rgba(15, 23, 42, 0.55);
  font-weight: 700;
}
.login-body.no-outer-brand .login-brand { display: none; }

/* 登入卡片內文（對齊舊站） */
.login-card-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 6px;
}
.login-card-title h1 {
  font-size: 22px;
  font-weight: 900;
  color: #172033;
  margin: 0;
  text-align: center;
}
.login-card-sub {
  text-align: center;
  font-size: 13px;
  color: #64748B;
  margin-bottom: 22px;
  line-height: 1.6;
}
.login-field { margin-bottom: 14px; }
.login-field label {
  display: block;
  font-size: 13px;
  font-weight: 800;
  color: #475569;
  margin-bottom: 6px;
}
.login-field input {
  width: 100%;
  height: 44px;
  border: 1px solid #DDE9E3;
  border-radius: 12px;
  padding: 0 14px;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
}
.login-field input:focus {
  outline: none;
  border-color: #16A34A;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.12);
}
.btn-login {
  width: 100%;
  min-height: 46px;
  margin-top: 6px;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  background: linear-gradient(135deg, #16A34A, #0F8A3B);
  color: #fff;
  font-size: 16px;
  font-weight: 900;
  font-family: inherit;
  box-shadow: 0 10px 24px rgba(22, 163, 74, 0.28);
}
.btn-login:hover { filter: brightness(1.05); }
.login-msg {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}
.login-msg.err { background: #FEE2E2; border: 1px solid #FECACA; color: #B91C1C; }
.login-msg.ok { background: #DCFCE7; border: 1px solid #BBF7D0; color: #15803D; }

.corp-select { margin-top: 8px; }
.corp-select h3 {
  font-size: 15px;
  font-weight: 900;
  color: #172033;
  margin-bottom: 10px;
  text-align: center;
}
.corp-list {
  display: block;
  max-height: 240px;
  overflow-y: auto;
  margin: 0;
  padding: 0;
}
.corp-list.tall { max-height: 280px; }
.corp-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 8px;
  border: 1px solid #DDE9E3;
  border-radius: 12px;
  background: #F8FAFB;
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  color: #172033;
  line-height: 1.3;
}
.corp-list-item:hover { border-color: #16A34A; background: #F0FDF4; }
.corp-list-item input[type="radio"] { flex-shrink: 0; margin: 0; }
.btn-corp {
  display: block;
  width: 100%;
  min-height: 44px;
  margin-top: 12px;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  background: linear-gradient(135deg, #0EA5E9, #0284C7);
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  font-family: inherit;
  text-align: center;
  text-decoration: none;
  line-height: 44px;
}
.btn-corp:hover { filter: brightness(1.05); color: #fff; }
.btn-back {
  display: block;
  width: 100%;
  min-height: 40px;
  margin-top: 8px;
  border: 1px solid #DDE9E3;
  border-radius: 12px;
  cursor: pointer;
  background: #fff;
  color: #475569;
  font-size: 14px;
  font-weight: 800;
  font-family: inherit;
  text-align: center;
  text-decoration: none;
  line-height: 40px;
  box-sizing: border-box;
}
.btn-back:hover { background: #F8FAFB; color: #334155; }
.user-hint {
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  font-size: 13px;
  color: #166534;
  text-align: center;
  font-weight: 700;
}
.pw-panel {
  margin-top: 8px;
  padding: 16px;
  border-radius: 14px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
}
.pw-panel h3 {
  font-size: 15px;
  font-weight: 900;
  color: #172033;
  margin-bottom: 8px;
  text-align: center;
}
.pw-panel > p {
  font-size: 13px;
  color: #64748B;
  text-align: center;
  margin-bottom: 12px;
  line-height: 1.55;
}
.btn-pw {
  width: 100%;
  min-height: 44px;
  margin-top: 4px;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  background: linear-gradient(135deg, #16A34A, #0F8A3B);
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  font-family: inherit;
}
.btn-pw:hover { filter: brightness(1.05); }
.login-muted {
  margin-top: 12px;
  font-size: 12px;
  color: #64748B;
  text-align: center;
}

.cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 10px;
}
.cal-h { text-align: center; font-size: 12px; font-weight: 900; color: var(--muted); padding: 6px; }
.cal-cell {
  min-height: 110px; background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 8px; font-size: 12px;
}
.cal-cell.empty { background: transparent; border: 0; }
.cal-cell.set { border-color: #86efac; background: #f0fdf4; }
.cal-cell.rest { border-color: #fdba74; background: #fff7ed; }
.cal-cell.hol { background: #fef3c7; }
.cal-cell.abs { background: #fef2f2; }
.cal-d { font-weight: 900; margin-bottom: 4px; }
.cal-b { color: var(--teal); font-weight: 800; margin-bottom: 4px; }
.cal-f { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.cal-f select, .cal-f .btn { height: 28px; font-size: 11px; padding: 0 6px; min-height: 28px; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; font-size: 12px; font-weight: 700; color: var(--muted); }
.legend i { display: inline-block; width: 14px; height: 14px; border-radius: 3px; margin-right: 4px; vertical-align: -2px; }
.legend .s-0, .s-0 { background: #0ea5e9; }
.legend .s-1, .s-1 { background: #22c55e; }
.legend .s-2, .s-2 { background: #a855f7; }
.legend .s-3, .s-3 { background: #f59e0b; }
.legend .s-4, .s-4 { background: #ef4444; }
.legend .s-5, .s-5 { background: #14b8a6; }
.legend .s-off, .s-off { background: #94a3b8; }
.legend .ot-lg { background: repeating-linear-gradient(45deg,#f97316,#f97316 4px,#fdba74 4px,#fdba74 8px); }
.legend .carry-lg { background: #cbd5e1; border: 1px dashed #64748b; }
.team-cal { padding: 10px; overflow-x: auto; }
.team-month { width: 100%; border-collapse: collapse; table-layout: fixed; }
.team-month th, .team-month td { border: 1px solid var(--line); vertical-align: top; padding: 4px; height: 96px; }
.team-month th { background: #f8fafb; text-align: center; height: auto; font-size: 12px; color: var(--muted); }
.team-month td.out { background: #f8fafb; opacity: .5; }
.team-month td.sel { outline: 2px solid var(--accent); outline-offset: -2px; }
.team-month .day-link { display: block; text-decoration: none; color: inherit; min-height: 88px; }
.dnum { font-weight: 900; font-size: 13px; margin-bottom: 4px; }
.dnum .cnt { margin-left: 4px; background: #dcfce7; color: var(--accent); border-radius: 999px; padding: 0 6px; font-size: 11px; }
.stack { display: flex; flex-direction: column; gap: 2px; }
.tbar { color: #fff; font-size: 10px; font-weight: 800; border-radius: 4px; padding: 1px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tbar.ot { opacity: .85; border: 1px dashed #fff; }
.off-hint { font-size: 11px; color: var(--muted); font-weight: 700; }
.gantt { padding: 10px 12px 16px; overflow-x: auto; }
.gantt-head, .gantt-row { display: grid; grid-template-columns: 160px 1fr; gap: 8px; align-items: center; margin-bottom: 6px; }
.g-name { font-size: 13px; font-weight: 800; }
.g-name small { display: block; color: var(--muted); font-weight: 600; font-size: 11px; }
.g-name a { font-size: 11px; margin-left: 4px; }
.g-axis { position: relative; height: 18px; border-bottom: 1px solid var(--line); }
.g-axis span { position: absolute; top: 0; transform: translateX(-50%); font-size: 10px; color: var(--muted); font-weight: 700; }
.g-track { position: relative; height: 28px; background: #f1f5f9; border-radius: 6px; }
.gbar {
  position: absolute; top: 3px; height: 22px; border-radius: 5px; color: #fff;
  font-size: 10px; font-weight: 800; line-height: 22px; padding: 0 4px; overflow: hidden; white-space: nowrap;
}
.gbar.ot { background: repeating-linear-gradient(45deg,#f97316,#f97316 4px,#fdba74 4px,#fdba74 8px) !important; color: #7c2d12; }
.gbar.carry { opacity: .65; border: 1px dashed #334155; }
.gbar.empty { position: static; background: transparent; color: var(--muted); }
.gbar.s-off { background: #94a3b8; }
@media (max-width: 900px) {
  .gantt-head, .gantt-row { grid-template-columns: 100px 1fr; }
}
.wrap { max-width: none; margin: 0; padding: 0 0 24px; }
.foot { display: none; }
.hero {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
  background: linear-gradient(135deg, #20be62, #0ea5e9); color: #fff;
  border-radius: 16px; padding: 18px 22px; margin-bottom: 16px;
}
.hero.compact { padding: 14px 18px; }
.hero h1 { margin: 0 0 4px; font-size: 1.4rem; }
.hero p { margin: 0; opacity: .92; font-size: 13px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 38px; padding: 8px 14px; border-radius: 12px; border: 1px solid #e2e8f0;
  background: #f1f5f9; color: #334155; font-weight: 800; text-decoration: none; cursor: pointer;
}
.btn.primary { background: #fff; color: var(--accent); border: 0; }
.search { display: flex; gap: 8px; align-items: end; margin-bottom: 14px; }
.search input, .form input, .form select {
  width: 100%; height: 36px; border: 1px solid var(--line); border-radius: 9px; padding: 0 10px;
}
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: 0 10px 28px rgba(15,23,42,.06); }
.card-h { padding: 14px 16px; border-bottom: 1px solid #eef2f7; font-weight: 900; }
.pill { margin-left: 8px; background: #dcfce7; color: var(--accent); border-radius: 999px; padding: 2px 9px; font-size: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 12px 14px; border-bottom: 1px solid #eef2f7; text-align: left; }
th { color: var(--muted); background: #f8fafb; }
.muted { color: #94a3b8; font-weight: 600; }
.img-cnt {
  display: inline-flex; min-width: 28px; height: 26px; padding: 0 9px; border-radius: 999px;
  font-size: 12px; font-weight: 900; align-items: center; justify-content: center;
  background: #eff6ff; color: #1d4ed8;
}
.img-cnt.zero { background: #f1f5f9; color: #94a3b8; }
.form { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 800; color: #475569; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.img-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.lbl { font-size: 12px; font-weight: 800; color: var(--teal); margin-bottom: 6px; }
.thumb {
  width: 96px; height: 96px; object-fit: cover; border-radius: 10px; border: 1px solid #cde4ec;
  cursor: zoom-in; display: block; margin-bottom: 6px; background: #f8fafb;
}
.thumb.wide { width: 140px; height: 88px; }
.chk { font-size: 12px; color: #b91c1c; font-weight: 700; }
.hint { font-size: 12px; color: var(--muted); font-weight: 600; }
.actions { display: flex; gap: 8px; margin-top: 8px; }
a.danger, .danger { color: #b91c1c; font-weight: 800; margin-left: 10px; text-decoration: none; }
.alert { background: #fef2f2; color: #b91c1c; padding: 10px 14px; border-radius: 10px; margin-bottom: 12px; font-weight: 700; }
.zoom {
  position: fixed; inset: 0; background: rgba(15,23,42,.78); display: none;
  align-items: center; justify-content: center; z-index: 9999; padding: 16px;
}
.zoom.open { display: flex; }
.zoom-inner { position: relative; background: #0f172a; border-radius: 12px; padding: 8px; }
.zoom-inner img { max-width: min(94vw, 1080px); max-height: 86vh; object-fit: contain; display: block; }
.zoom-x {
  position: absolute; top: -10px; right: -10px; width: 32px; height: 32px; border: 0; border-radius: 999px;
  background: #fff; font-size: 18px; font-weight: 900; cursor: pointer;
}
@media (max-width: 800px) {
  .grid2, .img-row { grid-template-columns: 1fr; }
}
