:root {
  --ixp-navy: #0f2742;
  --ixp-blue: #1d6f9f;
  --ixp-cyan: #4cc9d8;
  --ixp-mint: #e8f8f7;
  --ixp-ink: #162331;
  --ixp-muted: #667789;
  --ixp-line: rgba(15, 39, 66, .12);
  --ixp-card: rgba(255, 255, 255, .92);
  --ixp-shadow: 0 24px 70px rgba(15, 39, 66, .12);
}

* { box-sizing: border-box; }
body {
  color: var(--ixp-ink);
  font-family: "Inter", "Noto Sans TC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(76,201,216,.23), transparent 32rem),
    linear-gradient(135deg, #f6fbff 0%, #eef7f8 48%, #ffffff 100%);
  min-height: 100vh;
}
a { color: var(--ixp-blue); text-decoration: none; }
a:hover { color: var(--ixp-navy); }

/* Auth pages */
body.imagepro-auth {
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 0;
  text-align: left !important;
}
.imagepro-auth-shell {
  width: min(1120px, 100%);
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 430px;
  gap: 2rem;
  align-items: center;
  padding: 42px 24px;
}
.auth-panel {
  position: relative;
  overflow: hidden;
  min-height: 620px;
  border-radius: 34px;
  padding: 48px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(15,39,66,.97), rgba(29,111,159,.86)),
    radial-gradient(circle at 78% 12%, rgba(76,201,216,.38), transparent 22rem);
  box-shadow: var(--ixp-shadow);
}
.auth-panel::after {
  content: "";
  position: absolute;
  right: -140px;
  bottom: -140px;
  width: 360px;
  height: 360px;
  border: 1px solid rgba(255,255,255,.20);
  border-radius: 999px;
}
.auth-badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .55rem .85rem;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.18);
  font-size: .92rem;
}
.auth-title {
  margin-top: 48px;
  max-width: 680px;
  font-size: clamp(2.25rem, 5vw, 4.8rem);
  line-height: 1.05;
  letter-spacing: -.04em;
  font-weight: 800;
}
.auth-lead {
  margin-top: 24px;
  max-width: 600px;
  color: rgba(255,255,255,.78);
  font-size: 1.12rem;
  line-height: 1.8;
}
.auth-feature-grid {
  position: absolute;
  left: 48px;
  right: 48px;
  bottom: 48px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.auth-feature {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(14px);
}
.auth-feature strong { display: block; margin-bottom: 4px; }
.auth-feature span { color: rgba(255,255,255,.72); font-size: .88rem; }
.form-signin {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 32px;
  border-radius: 30px;
  background: var(--ixp-card);
  box-shadow: var(--ixp-shadow);
  border: 1px solid var(--ixp-line);
  text-align: left;
}
.auth-logo-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}
.auth-logo-row img {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(15,39,66,.15);
}
.auth-logo-row strong { display: block; font-size: 1.1rem; color: var(--ixp-navy); }
.auth-logo-row span { display: block; color: var(--ixp-muted); font-size: .9rem; }
.form-signin .form-floating { margin-bottom: 12px; }
.form-signin .form-control {
  min-height: 56px;
  border-radius: 16px !important;
  border: 1px solid rgba(15,39,66,.16);
  background: #fbfdff;
}
.form-signin .form-control:focus {
  border-color: rgba(29,111,159,.55);
  box-shadow: 0 0 0 .25rem rgba(29,111,159,.12);
}
.form-signin .btn {
  border-radius: 16px;
  padding: .9rem 1rem;
  font-weight: 700;
  letter-spacing: .02em;
}
.form-signin .btn-primary,
.form-signin .btn-dark {
  background: linear-gradient(135deg, var(--ixp-navy), var(--ixp-blue));
  border: 0;
}
.auth-secondary-link {
  margin: 18px 0 0;
  text-align: center;
  color: var(--ixp-muted);
}
.auth-secondary-link a { font-weight: 700; }
.auth-footer-nav {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--ixp-line);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  justify-content: center;
  font-size: .93rem;
}
.auth-copyright { text-align: center; color: var(--ixp-muted); font-size: .88rem; margin-top: 16px; }
.class_messagebox { border-radius: 16px; margin-top: 14px; }

/* Dashboard pages */
body.imagepro-dashboard main { padding: 28px 0 42px; }
.imagepro-dashboard .container { max-width: 1240px; }
.portal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border-radius: 26px;
  background: rgba(255,255,255,.86);
  border: 1px solid var(--ixp-line);
  box-shadow: 0 18px 50px rgba(15,39,66,.08);
  margin-bottom: 24px;
}
.portal-brand { display: flex; align-items: center; gap: 14px; color: var(--ixp-ink); }
.portal-brand img { width: 52px; height: 52px; border-radius: 16px; }
.portal-brand-title { display: block; font-size: 1.1rem; font-weight: 800; color: var(--ixp-navy); }
.portal-brand-subtitle { display: block; font-size: .88rem; color: var(--ixp-muted); }
.portal-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.portal-actions .btn, .portal-header .btn {
  border-radius: 999px;
  padding: .65rem 1rem;
  font-weight: 700;
}
.btn-dashboard-primary {
  color: #fff !important;
  background: linear-gradient(135deg, var(--ixp-navy), var(--ixp-blue));
  border: 0;
}
.portal-hero, .portal-card, .portal-table-card {
  border-radius: 28px;
  background: rgba(255,255,255,.88);
  border: 1px solid var(--ixp-line);
  box-shadow: 0 18px 50px rgba(15,39,66,.08);
}
.portal-hero {
  overflow: hidden;
  padding: 30px;
  margin-bottom: 22px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: center;
}
.portal-kicker {
  display: inline-flex;
  padding: .38rem .75rem;
  border-radius: 999px;
  color: var(--ixp-blue);
  background: rgba(76,201,216,.12);
  font-weight: 800;
  font-size: .86rem;
}
.portal-hero h1, .portal-section-title {
  color: var(--ixp-navy);
  font-weight: 850;
  letter-spacing: -.02em;
}
.portal-hero h1 { margin: 12px 0 10px; font-size: clamp(1.9rem, 4vw, 3.2rem); }
.portal-hero p, .portal-muted { color: var(--ixp-muted); line-height: 1.75; }
.portal-support {
  min-width: 280px;
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(232,248,247,.88), rgba(255,255,255,.90));
}
.portal-support strong { color: var(--ixp-navy); }
.portal-card {
  padding: 24px;
  height: 100%;
}
.portal-card h2, .portal-card h3 { color: var(--ixp-navy); font-weight: 800; }
.portal-card .form-control {
  border-radius: 14px;
  min-height: 48px;
  border-color: rgba(15,39,66,.16);
}
.portal-card .form-control:focus {
  border-color: rgba(29,111,159,.5);
  box-shadow: 0 0 0 .25rem rgba(29,111,159,.10);
}
.portal-card .btn { border-radius: 999px; font-weight: 700; padding: .7rem 1.05rem; }
.portal-table-card {
  padding: 24px;
  margin-bottom: 22px;
  overflow: hidden;
}
.portal-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.table-responsive { border-radius: 20px; border: 1px solid var(--ixp-line); }
.imagepro-dashboard table { margin-bottom: 0; background: #fff; }
.imagepro-dashboard thead th {
  background: #f2f8fb;
  color: var(--ixp-navy);
  white-space: nowrap;
  font-size: .9rem;
  border-bottom: 1px solid var(--ixp-line) !important;
}
.imagepro-dashboard tbody td { vertical-align: middle; }
.portal-admin-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 22px;
}
.admin-module {
  position: relative;
  overflow: hidden;
  padding: 26px;
  min-height: 220px;
  border-radius: 28px;
  color: #fff;
  background: linear-gradient(135deg, var(--ixp-navy), var(--ixp-blue));
  box-shadow: 0 18px 50px rgba(15,39,66,.13);
}
.admin-module:nth-child(2) { background: linear-gradient(135deg, #174567, #1d6f9f); }
.admin-module:nth-child(3) { background: linear-gradient(135deg, #162331, #0f2742); }
.admin-module p { color: rgba(255,255,255,.75); line-height: 1.7; }
.admin-module .btn { border-radius: 999px; font-weight: 700; }
.admin-module::after {
  content: "";
  position: absolute;
  right: -55px;
  bottom: -55px;
  width: 150px;
  height: 150px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.18);
}
.portal-footer {
  color: var(--ixp-muted);
  text-align: center;
  padding-top: 22px;
  margin-top: 22px;
  border-top: 1px solid var(--ixp-line);
}

@media (max-width: 940px) {
  .imagepro-auth-shell { grid-template-columns: 1fr; }
  .auth-panel { min-height: 460px; }
  .auth-feature-grid { position: static; margin-top: 28px; grid-template-columns: 1fr; }
  .portal-hero { grid-template-columns: 1fr; }
  .portal-admin-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .imagepro-auth-shell { padding: 18px 12px; }
  .auth-panel { padding: 28px; border-radius: 24px; }
  .form-signin { padding: 24px; border-radius: 24px; }
  .portal-header { flex-direction: column; align-items: flex-start; }
  .portal-actions { width: 100%; }
  .portal-actions .btn { flex: 1; }
  .portal-hero, .portal-card, .portal-table-card { padding: 20px; border-radius: 22px; }
}

.admin-language-switch { display: inline-flex; align-items: center; gap: .35rem; padding: .35rem; border: 1px solid rgba(15,23,42,.12); border-radius: 999px; background: rgba(255,255,255,.78); box-shadow: 0 10px 30px rgba(15,23,42,.06); }
.admin-language-switch .lang-pill { border: 0; border-radius: 999px; padding: .45rem .75rem; font-size: .9rem; font-weight: 700; color: #475569; background: transparent; text-decoration: none; cursor: pointer; }
.admin-language-switch .lang-pill.active { color: #fff; background: linear-gradient(135deg,#0ea5e9,#4f46e5); }
@media (max-width: 768px) { .portal-actions { width: 100%; justify-content: flex-start; flex-wrap: wrap; } .admin-language-switch { order: -1; } }
