/* ============================================================
   PMG Portal — style.css
   Theme: matches KumoGuard.sg exactly
   Palette: washi paper / sumi ink / seal red / moss green / gold
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Zen+Maru+Gothic:wght@400;500;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --sumi:    #1F2421;
  --ink:     #2E2E2A;
  --washi:   #F4EFE6;
  --paper:   #FBF8F1;
  --stone:   #8A8175;
  --moss:    #3D6B52;
  --seal:    #A2463A;
  --gold:    #C7A76C;
  --smoke:   #DDD3C4;
  --smoke2:  #C8BFB0;

  /* semantic aliases */
  --color-bg:        var(--washi);
  --color-surface:   var(--paper);
  --color-border:    var(--smoke);
  --color-primary:   var(--seal);
  --color-primary-h: #8B3A2F;
  --color-success:   var(--moss);
  --color-warning:   #7A5E12;
  --color-danger:    var(--seal);
  --color-muted:     var(--stone);
  --color-text:      var(--sumi);
  --color-header-bg: var(--sumi);
  --color-header-fg: var(--paper);
  --radius:          12px;
  --radius-lg:       22px;
  --shadow-sm:       0 2px 8px rgba(31,36,33,.07);
  --shadow-md:       0 8px 32px rgba(31,36,33,.11);
  --font:            'Inter', -apple-system, sans-serif;
  --font-jp:         'Zen Maru Gothic', sans-serif;
  --font-mono:       'JetBrains Mono', monospace;
}

html { font-size: 15px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background:
    radial-gradient(circle at 10% 10%, rgba(199,167,108,.13), transparent 28%),
    linear-gradient(135deg, var(--paper), var(--washi));
  color: var(--sumi);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Same grid watermark as site */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .22;
  background-image:
    linear-gradient(rgba(31,36,33,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31,36,33,.025) 1px, transparent 1px);
  background-size: 42px 42px;
  z-index: -1;
}

a { color: var(--seal); text-decoration: none; }
a:hover { color: var(--color-primary-h); text-decoration: underline; }

/* ── HEADER — matches screenshot exactly ─────────── */
/* Washi background — one shade darker than page paper */
.site-header {
  background: var(--smoke);
  border-bottom: 1px solid var(--smoke2);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 72px;
  display: flex;
  align-items: center;
  gap: 2rem;
}

/* Brand: kanji circle + split-color name */
.brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  white-space: nowrap;
  text-decoration: none;
  flex-shrink: 0;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--seal);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-jp);
  font-size: 14px;
  color: var(--seal);
  flex-shrink: 0;
  line-height: 1;
}
.brand-name {
  font-family: var(--font-jp);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--sumi);
  letter-spacing: .01em;
}

/* Nav: plain ink text, no pill background by default */
.main-nav { display: flex; gap: 0; flex: 1; justify-content: center; }
.main-nav a {
  color: var(--ink);
  padding: .4rem 1.1rem;
  font-size: .95rem;
  font-weight: 400;
  transition: color .15s;
  text-decoration: none;
  white-space: nowrap;
}
.main-nav a:hover  { color: var(--seal); text-decoration: none; }
.main-nav a.active { color: var(--seal); font-weight: 600; }

/* Impersonation banner */
.impersonation-banner {
  background: rgba(199,167,108,.12);
  color: var(--ink);
  border-bottom: 1px solid rgba(199,167,108,.28);
  padding: .6rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: .83rem;
  font-family: var(--font-mono);
  letter-spacing: .02em;
  position: sticky;
  top: 72px;
  z-index: 99;
}
.impersonation-banner .btn { white-space: nowrap; }

.header-user { display: flex; align-items: center; gap: .75rem; margin-left: auto; flex-shrink: 0; }
.domain-badge {
  background: rgba(162,70,58,.08);
  color: var(--seal);
  border-radius: 999px;
  padding: .18rem .8rem;
  font-size: .73rem;
  font-weight: 600;
  font-family: var(--font-mono);
  letter-spacing: .06em;
  border: 1px solid rgba(162,70,58,.16);
}
.user-name { font-size: .82rem; color: var(--stone); display: none; }
@media(min-width:700px){ .user-name { display: inline; } }
.logout-form { display: inline; }

/* Sign out: pill outline exactly like "Start Free Trial" in the screenshot */
.btn-logout {
  background: transparent;
  border: 1.5px solid var(--sumi);
  color: var(--sumi);
  padding: .42rem 1.15rem;
  border-radius: 999px;
  font-size: .9rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: background .22s, color .22s;
  white-space: nowrap;
  line-height: 1;
}
.btn-logout:hover { background: var(--sumi); color: var(--paper); }

/* ── MAIN / FOOTER ───────────────────────────────── */
.main-content { max-width: 1200px; width: 100%; margin: 0 auto; padding: 1.75rem 1.5rem; flex: 1; }

.site-footer {
  background: var(--smoke);
  color: var(--stone);
  text-align: center;
  padding: .9rem 1rem;
  font-size: .75rem;
  font-family: var(--font-mono);
  letter-spacing: .05em;
  border-top: 1px solid var(--smoke2);
}
.footer-status {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-weight: 700;
  padding: .2rem .75rem;
  border-radius: 999px;
  font-size: .72rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.footer-status-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; background: currentColor; flex-shrink: 0; }
.footer-status.badge-success { background: rgba(61,107,82,.15);  color: #2A5940; border: 1px solid rgba(61,107,82,.30); }
.footer-status.badge-warning { background: rgba(161,120,18,.14); color: #6B4E0A; border: 1px solid rgba(161,120,18,.28); }
.footer-status.badge-danger  { background: rgba(162,70,58,.13);  color: #7A2E24; border: 1px solid rgba(162,70,58,.28); }

/* ── PAGE HEADER ─────────────────────────────────── */
.page-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 1rem; }
.page-title  { font-family: var(--font-jp); font-size: 1.45rem; font-weight: 700; color: var(--sumi); letter-spacing: -.01em; }
.page-sub    { color: var(--stone); font-size: .85rem; margin-top: .25rem; }
.page-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ── BUTTONS ─────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .5rem 1.1rem;
  border-radius: 999px;
  border: none;
  font-size: .875rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  text-decoration: none !important;
  transition: transform .2s ease, box-shadow .2s ease, filter .15s;
  white-space: nowrap;
  letter-spacing: .01em;
}
.btn:hover { text-decoration: none; }
.btn-primary   { background: var(--sumi); color: var(--paper); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(31,36,33,.20); filter: none; }
.btn-secondary { background: transparent; border: 1px solid var(--smoke2); color: var(--ink); }
.btn-secondary:hover { border-color: var(--sumi); }
.btn-success   { background: var(--moss); color: var(--paper); }
.btn-success:hover  { filter: brightness(.9); }
.btn-danger    { background: var(--seal); color: var(--paper); }
.btn-danger:hover   { filter: brightness(.9); }
.btn-warning   { background: var(--gold); color: var(--sumi); }
.btn-warning:hover  { filter: brightness(.9); }
.btn-block     { width: 100%; justify-content: center; }
.btn-sm  { padding: .35rem .85rem; font-size: .8rem; }
.btn-xs  { padding: .22rem .65rem; font-size: .74rem; }
.btn-group   { display: inline-flex; gap: .3rem; flex-wrap: wrap; }
.inline-form { display: inline; }

/* ── ALERTS ──────────────────────────────────────── */
.alert {
  padding: .85rem 1.1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: .9rem;
  border: 1px solid transparent;
  border-left: 3px solid transparent;
}
.alert-success { background: rgba(61,107,82,.08);   color: var(--moss);  border-color: rgba(61,107,82,.20);   border-left-color: var(--moss); }
.alert-danger  { background: rgba(162,70,58,.07);   color: var(--seal);  border-color: rgba(162,70,58,.20);   border-left-color: var(--seal); }
.alert-warning { background: rgba(199,167,108,.12); color: #6B4E0A;      border-color: rgba(199,167,108,.30); border-left-color: var(--gold); }
.alert-info    { background: rgba(31,36,33,.04);    color: var(--ink);   border-color: var(--smoke);          border-left-color: var(--stone); }

/* ── CARDS ───────────────────────────────────────── */
.card {
  background: rgba(251,248,241,.75);
  border: 1px solid var(--smoke);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 24px rgba(31,36,33,.08);
  overflow: hidden;
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .9rem 1.25rem;
  border-bottom: 1px solid var(--smoke);
  background: rgba(244,239,230,.5);
}
.card-header h3 { font-family: var(--font-jp); font-size: .95rem; font-weight: 700; color: var(--sumi); }
.card-body   { padding: 1.25rem; }
.card-body.p-0 { padding: 0; }
.mt-4 { margin-top: 1.25rem; }
.mb-4 { margin-bottom: 1.25rem; }

/* ── STAT CARDS ──────────────────────────────────── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 1rem; }
.stat-grid--compact .stat-card { padding: .75rem 1rem; }
.stat-card {
  background: rgba(251,248,241,.75);
  border: 1px solid var(--smoke);
  border-radius: var(--radius-lg);
  box-shadow: 0 2px 8px rgba(31,36,33,.06);
  padding: 1.1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: .9rem;
  position: relative;
  border-left: 4px solid var(--smoke2);
  transition: box-shadow .2s, transform .2s;
}
.stat-card:hover { box-shadow: 0 8px 28px rgba(31,36,33,.10); transform: translateY(-1px); }
.stat-card--quarantine { border-left-color: var(--gold); }
.stat-card--today      { border-left-color: var(--seal); }
.stat-card--blocked    { border-left-color: var(--seal); }
.stat-card--clean      { border-left-color: var(--moss); }
.stat-icon  { font-size: 1.75rem; line-height: 1; }
.stat-value { font-family: var(--font-mono); font-size: 1.6rem; font-weight: 700; line-height: 1; color: var(--sumi); letter-spacing: -.02em; }
.stat-label { font-size: .72rem; color: var(--stone); margin-top: .2rem; font-family: var(--font-mono); letter-spacing: .07em; text-transform: uppercase; }
.stat-link  { position: absolute; bottom: .55rem; right: .85rem; font-size: .72rem; color: var(--stone); }

/* ── TABLES ──────────────────────────────────────── */
.table-responsive { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.table th {
  background: rgba(244,239,230,.6);
  padding: .65rem .9rem;
  text-align: left;
  font-size: .70rem;
  font-weight: 700;
  color: var(--stone);
  white-space: nowrap;
  border-bottom: 1.5px solid var(--smoke2);
  font-family: var(--font-mono);
  letter-spacing: .09em;
  text-transform: uppercase;
}
.table td { padding: .62rem .9rem; border-bottom: 1px solid var(--smoke); vertical-align: middle; }
.table-hover tbody tr:hover { background: rgba(244,239,230,.45); }
.table tbody tr:last-child td { border-bottom: none; }
.nowrap      { white-space: nowrap; }
.text-center { text-align: center; }
.text-muted  { color: var(--stone); }
.td-email    { max-width: 200px; word-break: break-all; }

/* ── BADGES ──────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: .14rem .55rem;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 700;
  white-space: nowrap;
  font-family: var(--font-mono);
  letter-spacing: .05em;
}
.badge-success { background: rgba(61,107,82,.12);   color: var(--moss); }
.badge-warning { background: rgba(199,167,108,.20); color: #6B4E0A; }
.badge-danger  { background: rgba(162,70,58,.12);   color: var(--seal); }
.badge-info    { background: rgba(31,36,33,.07);    color: var(--ink);  }
.dir-badge { padding: .12rem .5rem; border-radius: 6px; font-size: .68rem; font-weight: 700; font-family: var(--font-mono); }
.dir-in    { background: rgba(162,70,58,.10); color: var(--seal); }
.dir-out   { background: rgba(61,107,82,.10); color: var(--moss); }

/* ── GUARDIAN STATUS ─────────────────────────────── */
.guardian-status-banner { display: flex; align-items: flex-start; gap: .85rem; }
.guardian-status-icon   { font-size: 1.6rem; line-height: 1; }

/* ── FORMS ───────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block;
  font-size: .72rem;
  font-weight: 700;
  color: var(--stone);
  margin-bottom: .38rem;
  font-family: var(--font-mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.form-control {
  width: 100%;
  padding: .55rem .9rem;
  border: 1px solid var(--smoke2);
  border-radius: var(--radius);
  font-size: .9rem;
  font-family: var(--font);
  color: var(--sumi);
  background: rgba(251,248,241,.9);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.form-control:focus { border-color: var(--seal); box-shadow: 0 0 0 3px rgba(162,70,58,.12); }
.search-form  { display: flex; gap: .5rem; flex-wrap: wrap; }
.search-input { flex: 1; min-width: 220px; }

/* ── FILTERS ─────────────────────────────────────── */
.filter-row { display: flex; gap: 1.25rem; flex-wrap: wrap; align-items: flex-end; }
.filter-group label {
  display: block; font-size: .70rem; font-weight: 700; color: var(--stone);
  margin-bottom: .3rem; text-transform: uppercase; letter-spacing: .09em; font-family: var(--font-mono);
}
.filter-group--search { flex: 1; display: flex; gap: .4rem; flex-wrap: wrap; align-items: flex-end; }
.filter-group--search .form-control { flex: 1; min-width: 180px; }

/* ── AUTH ────────────────────────────────────────── */
.auth-wrapper {
  min-height: calc(100vh - 72px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}
.auth-card {
  background: rgba(251,248,241,.82);
  border: 1px solid var(--smoke);
  border-radius: 28px;
  box-shadow: 0 28px 80px rgba(31,36,33,.12);
  padding: 2.75rem 2.25rem;
  width: 100%;
  max-width: 420px;
  position: relative;
  overflow: hidden;
}
/* subtle kanji watermark like the site's hero card */
.auth-card::after {
  content: "静";
  position: absolute;
  right: 14px;
  bottom: -20px;
  font-family: 'Noto Serif JP', serif;
  font-size: 130px;
  color: rgba(162,70,58,.055);
  pointer-events: none;
  line-height: 1;
}
.auth-logo { text-align: center; margin-bottom: 1rem; }
.auth-logo svg { width: 48px; height: 48px; color: var(--seal); }
.auth-title    { text-align: center; font-family: var(--font-jp); font-size: 1.35rem; font-weight: 700; margin-bottom: .3rem; color: var(--sumi); }
.auth-subtitle { text-align: center; color: var(--stone); font-size: .875rem; margin-bottom: 1.5rem; }

/* ── DETAIL ──────────────────────────────────────── */
.detail-grid { display: grid; grid-template-columns: auto 1fr; gap: .48rem 1rem; font-size: .875rem; }
.detail-grid dt { font-weight: 700; color: var(--stone); white-space: nowrap; font-family: var(--font-mono); font-size: .70rem; text-transform: uppercase; letter-spacing: .07em; }
.detail-grid dd { word-break: break-all; }
.action-bar { display: flex; gap: .75rem; flex-wrap: wrap; }

/* ── PAGINATION ──────────────────────────────────── */
.pagination { display: flex; align-items: center; justify-content: center; gap: .75rem; padding: 1rem; border-top: 1px solid var(--smoke); }
.page-info  { font-size: .8rem; color: var(--stone); font-family: var(--font-mono); letter-spacing: .03em; }

/* ── EMPTY STATE ─────────────────────────────────── */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--stone); font-size: .95rem; }

/* ── RESPONSIVE ──────────────────────────────────── */
@media (max-width: 600px) {
  .stat-grid    { grid-template-columns: repeat(2, 1fr); }
  .page-header  { flex-direction: column; }
  .header-inner { padding: 0 1rem; }
}
