:root {
  --admin-primary: #ff5f3c;
  --admin-primary-hover: #c2341a;
  --admin-primary-soft: #ffe8e2;
  --admin-border: #e4e4e4;
  --admin-surface: #ffffff;
  --admin-canvas: #f4f4f4;
  --admin-ink: #191919;
  --admin-muted: #707070;
}

.material-symbols-outlined {
  display: inline-block;
  flex: 0 0 auto;
  font-family: "Material Symbols Outlined";
  font-size: 18px;
  font-style: normal;
  font-weight: 400;
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 20;
  letter-spacing: normal;
  line-height: 1;
  text-transform: none;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
}
.admin-nav-icon { width: 24px; font-size: 20px; color: #52525b; text-align: center; }
.admin-icon-spin { animation: admin-spin .7s linear infinite; }
@keyframes admin-spin { to { transform: rotate(360deg); } }

html { scroll-behavior: smooth; }
body {
  min-width: 320px;
  font-family: "Noto Sans TC", "Noto Sans", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--admin-ink);
  -webkit-font-smoothing: antialiased;
}
button, a, input, select, textarea { transition: color .12s ease, background-color .12s ease, border-color .12s ease, opacity .12s ease; }
button:disabled { cursor: not-allowed; opacity: .55; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--admin-primary); outline-offset: 2px; }
[data-sidebar] nav { max-height: calc(100vh - 156px); overflow-y: auto; }
[data-drawer], [data-details-drawer] { transition: transform .18s ease; }
[data-drawer].is-open, [data-details-drawer].is-open { transform: translateX(0); }
[data-fields] textarea { min-height: 112px; resize: vertical; }
[data-dropzone] { cursor: pointer; }
[data-dropzone].is-active { border-color: var(--admin-primary); background: var(--admin-primary-soft); }
[data-media-filter][aria-pressed="true"] { background: #18181b; color: #fff; }
[data-media-preview].aspect-\[2\/3\] { aspect-ratio: 2 / 3; max-height: 16rem; width: min(100%, 11rem); margin: 0 auto; }
[data-media-preview].aspect-\[16\/9\] { aspect-ratio: 16 / 9; }
[data-picker-grid] .aspect-\[2\/3\] { aspect-ratio: 2 / 3; }
[data-picker-grid] .aspect-\[16\/9\] { aspect-ratio: 16 / 9; }
[data-media-picker-overlay] { z-index: 80; }
[data-media-picker-modal] { z-index: 90; }
[data-cropper-overlay] {
  z-index: 130;
  align-items: center;
  justify-items: center;
}
[data-cropper-overlay].is-open { display: grid !important; }
[data-cropper-modal] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(100%, 960px);
  max-height: calc(100vh - 32px);
}
[data-cropper-body] {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 16px;
  min-height: 0;
  padding: 0 20px 4px;
}
[data-cropper-preview].aspect-\[2\/3\] { aspect-ratio: 2 / 3; width: 100%; }
[data-cropper-preview].aspect-\[16\/9\] { aspect-ratio: 16 / 9; width: 100%; }
[data-cropper-stage] {
  position: relative;
  width: 100%;
  height: min(56vh, 520px);
  min-height: 280px;
  overflow: hidden;
  background: #111;
}
[data-cropper-stage] > img {
  display: block;
  width: auto;
  height: auto;
  max-width: none;
  opacity: 0;
}
[data-cropper-stage] .cropper-container {
  background: #111;
}
[data-cropper-stage] .cropper-container img {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
}
[data-cropper-stage] .cropper-modal { background: rgba(0, 0, 0, .55); opacity: 1; }
[data-cropper-stage] .cropper-view-box { outline: 2px solid #fff; }
[data-cropper-stage] .cropper-face { opacity: .08; }
@media (max-width: 900px) {
  [data-cropper-body] { grid-template-columns: 1fr; }
  [data-cropper-stage] { height: min(48vh, 420px); }
}
[data-toast] { animation: toast-in .14s ease-out; }
@keyframes toast-in { from { opacity: 0; transform: translateY(4px); } }

.admin-table { min-width: 1080px; border-collapse: collapse; table-layout: auto; }
.admin-table th { white-space: nowrap; color: #52525b; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.admin-table td { vertical-align: middle; color: #27272a; white-space: nowrap; }
.admin-table td:first-child { min-width: 220px; max-width: 320px; white-space: normal; }
.admin-table th:last-child,
.admin-table td:last-child {
  width: 1%;
  min-width: 0;
  padding-left: 12px;
  white-space: nowrap;
}
.admin-table tbody tr:hover { background: #fafafa; }
.admin-table strong { font-weight: 600; font-variant-numeric: tabular-nums; }
.admin-row-actions {
  display: inline-flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 8px;
}

@media (max-width: 700px) {
  .admin-table thead { display: none; }
  .admin-table, .admin-table tbody, .admin-table tr, .admin-table td { display: block; width: 100%; }
  .admin-table tr { border-bottom: 1px solid #d4d4d8; padding: 8px 12px; }
  .admin-table td { display: grid; grid-template-columns: minmax(96px, 34%) 1fr; gap: 8px; border: 0; padding: 5px 0 !important; text-align: left !important; }
  .admin-table td::before { content: attr(data-label); color: #71717a; font-size: 10px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
  .admin-table td:last-child { align-items: center; }
  .admin-table td:last-child button { justify-self: start; }
}

.chart-bars { display: flex; align-items: flex-end; gap: 10px; height: 180px; padding-top: 8px; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; }
.chart-slot { width: 100%; height: 150px; display: flex; align-items: flex-end; justify-content: center; }
.chart-bar { width: 68%; max-width: 40px; min-height: 3px; border-radius: 0; background: var(--admin-primary); position: relative; transition: height .4s ease; }
.chart-bar:hover { opacity: .85; }
.chart-bar-val { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font-size: 10px; font-weight: 700; color: #3f3f46; white-space: nowrap; font-variant-numeric: tabular-nums; }
.chart-bar-label { font-size: 11px; color: #71717a; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.donut { width: 140px; height: 140px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; position: relative; }
.donut::after { content: ""; position: absolute; width: 90px; height: 90px; border-radius: 50%; background: #fff; }
.donut-center { position: relative; z-index: 1; text-align: center; line-height: 1.15; }
.donut-center b { display: block; font-size: 23px; font-weight: 700; font-variant-numeric: tabular-nums; color: #18181b; }
.donut-center span { font-size: 11px; color: #71717a; }
.chart-legend { display: flex; flex-direction: column; gap: 9px; flex: 1; min-width: 150px; }
.chart-legend-item { display: flex; align-items: center; gap: 9px; font-size: 13px; }
.chart-legend-dot { width: 11px; height: 11px; border-radius: 0; flex-shrink: 0; }
.chart-legend-item .lg-val { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; color: #27272a; }
.rank-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; margin-bottom: 14px; }
.rank-row:last-child { margin-bottom: 0; }
.rank-name { font-size: 13px; font-weight: 600; color: #18181b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-val { font-size: 12.5px; font-weight: 700; color: var(--admin-primary); font-variant-numeric: tabular-nums; text-align: right; }
.rank-track { grid-column: 1 / -1; height: 8px; border-radius: 0; background: #ececec; overflow: hidden; }
.rank-fill { height: 100%; border-radius: 0; background: var(--admin-primary); transition: width .4s ease; }
.chart-empty { display: grid; place-items: center; height: 150px; color: #a1a1aa; font-size: 13px; }

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

.portal-auth-body {
  min-height: 100vh;
  margin: 0;
  background: #fff;
  color: #18181b;
}
.portal-auth-appbar {
  height: 64px;
  border-bottom: 1px solid #ececec;
  background: #fff;
}
.portal-auth-appbar-inner,
.portal-auth-brand {
  display: flex;
  height: 64px;
  align-items: center;
}
.portal-auth-brand {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  color: inherit;
  text-decoration: none;
}
.portal-auth-logo {
  display: block;
  width: 100px;
  height: auto;
}
.portal-auth-main {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  padding: 48px 0 72px;
}
.portal-auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 400px);
  gap: 64px;
  align-items: center;
}
.portal-auth-panel {
  min-height: 460px;
  padding: 48px 40px;
  border: 1px solid var(--admin-border);
  border-radius: 0;
  background: var(--admin-canvas);
}
.portal-auth-illustration {
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  margin-bottom: 28px;
  border: 1px solid var(--admin-border);
  border-radius: 0;
  background: #fff;
  color: var(--admin-primary);
}
.portal-auth-illustration .material-symbols-outlined { font-size: 42px; }
.portal-auth-panel h2 {
  max-width: 360px;
  margin: 0 0 28px;
  font-size: 28px;
  font-weight: 500;
  line-height: 1.3;
}
.portal-auth-benefits { display: grid; gap: 16px; }
.portal-auth-benefit {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #3f3f46;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.45;
}
.portal-auth-benefit .material-symbols-outlined {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--admin-border);
  border-radius: 0;
  background: #fff;
  color: var(--admin-primary);
  font-size: 20px;
}
.portal-auth-formwrap { max-width: 380px; }
.portal-auth-formwrap h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 500;
}
.portal-auth-subtitle {
  margin: 8px 0 28px;
  color: #71717a;
  font-size: 13px;
}
.portal-auth-form { display: grid; }
.portal-auth-label {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 500;
}
.portal-auth-input {
  width: 100%;
  min-height: 44px;
  margin-bottom: 16px;
  border: 1px solid var(--admin-border);
  border-radius: 0;
  background: #fff;
  padding: 0 14px;
  font-size: 14px;
}
.portal-auth-input:focus {
  border-color: var(--admin-primary);
  outline: 0;
}
.portal-auth-password { position: relative; }
.portal-auth-password .portal-auth-input { padding-right: 44px; }
.portal-auth-eye {
  position: absolute;
  top: 22px;
  right: 8px;
  display: grid;
  width: 28px;
  height: 28px;
  transform: translateY(-50%);
  place-items: center;
  border: 0;
  background: transparent;
  color: #71717a;
}
.portal-auth-remember {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0 18px;
  color: #52525b;
  font-size: 13px;
}
.portal-auth-submit {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 0;
  background: var(--admin-primary);
  color: #fff;
  font-size: 15px;
  font-weight: 500;
}
.portal-auth-submit:hover { background: var(--admin-primary-hover); }
.portal-auth-legal {
  margin: 14px 0 0;
  color: #a1a1aa;
  font-size: 12px;
  line-height: 1.7;
}
.portal-auth-error {
  margin: 0 0 16px;
  border: 1px solid #f3b8ad;
  border-radius: 0;
  background: #fef0ed;
  padding: 10px 12px;
  color: #b91c1c;
  font-size: 13px;
}
@media (max-width: 959px) {
  .portal-auth-shell { grid-template-columns: 1fr; gap: 32px; }
  .portal-auth-panel { display: none; }
  .portal-auth-main { padding: 36px 0 64px; }
  .portal-auth-brand { width: calc(100% - 32px); }
}

/* Unified flat language: sharp corners, no elevation, brand orange */
.rounded,
.rounded-sm,
.rounded-md,
.rounded-lg,
.rounded-xl,
.rounded-2xl,
.rounded-full,
.rounded-t,
.rounded-b {
  border-radius: 0 !important;
}
.shadow,
.shadow-sm,
.shadow-md,
.shadow-lg,
.shadow-xl,
.hover\:shadow-sm:hover {
  box-shadow: none !important;
}
.bg-blue-50,
.bg-blue-100 { background-color: var(--admin-primary-soft) !important; }
.bg-blue-700,
.bg-blue-800,
.hover\:bg-blue-800:hover { background-color: var(--admin-primary) !important; }
.hover\:bg-blue-800:hover { background-color: var(--admin-primary-hover) !important; }
.text-blue-500,
.text-blue-600,
.text-blue-700,
.text-blue-800,
.hover\:text-blue-700:hover,
.hover\:text-blue-900:hover { color: var(--admin-primary) !important; }
.group:hover .group-hover\:text-blue-600 { color: var(--admin-primary) !important; }
.border-blue-200,
.border-blue-300,
.border-blue-700,
.hover\:border-blue-300:hover,
.hover\:border-blue-700:hover { border-color: var(--admin-primary) !important; }
.ring-2.ring-blue-200,
.ring-blue-200 { --tw-ring-color: var(--admin-primary-soft); box-shadow: none !important; }
.focus\:border-blue-700:focus { border-color: var(--admin-primary) !important; }
.focus\:ring-1:focus,
.focus\:ring-blue-700:focus {
  --tw-ring-shadow: 0 0 #0000 !important;
  box-shadow: none !important;
}
.accent-blue-700,
.text-blue-700[type="checkbox"] { accent-color: var(--admin-primary); }
.bg-violet-50,
.bg-sky-50,
.bg-orange-50,
.bg-indigo-50 { background-color: var(--admin-canvas) !important; }
.text-violet-600,
.text-sky-600,
.text-orange-500,
.text-indigo-600 { color: var(--admin-ink) !important; }
.bg-zinc-50 { background-color: var(--admin-canvas); }
[data-cropper-modal],
[data-media-picker-modal] > div,
[data-drawer],
[data-details-drawer],
[data-toast] {
  border-radius: 0 !important;
  box-shadow: none !important;
}

