/* WOLFF-ST portal theme: shared styles for the login, document, sales and admin pages.
   Fonts: Cormorant Garamond and Inter, both SIL Open Font License 1.1. */

@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 500 600;
  font-display: swap;
  src: url('fonts/cormorant-garamond-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/inter-latin.woff2') format('woff2');
}

:root {
  --bg: #F7F3EA; --surface: #FFFFFF; --surface2: #F1EADB; --text: #161616; --muted: #5E5A52;
  --border: #D9CFB9; --accent: #2F6B4A; --btn: #2F6B4A; --btnfg: #FFFFFF; --mint: #DDEFE5;
  --cork: #F3E3D2; --danger: #9C4A3A; --dangerfg: #FFFFFF; --pos: #1E6B45; --neg: #9C4A3A;
  --shadow: 0 1px 2px rgba(22,22,22,.06), 0 8px 24px rgba(22,22,22,.06);
  --glass: rgba(255,255,255,.66); --glass-edge: rgba(217,207,185,.7);
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: Inter, 'Segoe UI', system-ui, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #121212; --surface: #1C1C1C; --surface2: #262626; --text: #EFE6D2; --muted: #A8A8A8;
  --border: #3A3A3A; --accent: #8CCFA9; --btn: #8CCFA9; --btnfg: #101010; --mint: #1F3A2D;
  --cork: #33271C; --danger: #E58B78; --dangerfg: #101010; --pos: #7FD1A4; --neg: #E58B78;
  --shadow: 0 0 0 1px #2A2A2A;
  --glass: rgba(28,28,28,.62); --glass-edge: rgba(255,255,255,.08);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); }
body.wf {
  margin: 0; min-height: 100vh; padding: 0;
  background: var(--bg); color: var(--text);
  font-family: var(--sans); font-size: 15px; line-height: 1.5;
}
:where(.wf) a { text-decoration: none; color: inherit; }
.wf a:focus-visible, .wf button:focus-visible, .wf input:focus-visible,
.wf select:focus-visible, .wf textarea:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Header and navigation */
.wf-header {
  background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50;
}
/* Glass effect where the browser supports it; otherwise the solid surface above stays */
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .wf-header {
    background: var(--glass);
    -webkit-backdrop-filter: blur(16px) saturate(170%);
    backdrop-filter: blur(16px) saturate(170%);
    border-bottom-color: var(--glass-edge);
  }
}
.wf-header-inner {
  max-width: 1160px; margin: 0 auto; padding: 10px 24px;
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 28px;
}
.wf-brand { font-family: var(--serif); font-size: 22px; font-weight: 600; letter-spacing: .18em; }
.wf-nav { display: flex; flex-wrap: wrap; gap: 4px; flex: 1 1 auto; }
.wf-actions { display: flex; align-items: center; gap: 12px; }
.nl {
  display: inline-flex; align-items: center; height: 44px; padding: 0 14px; border-radius: 8px;
  font-size: 14px; font-weight: 500; color: var(--muted);
}
.nl:hover { background: var(--surface2); color: var(--text); }
.nl.on { background: var(--surface2); color: var(--text); font-weight: 600; }
.wf-user { font-size: 13px; color: var(--muted); }
.wf-user strong { color: var(--text); font-weight: 600; }
.wf-avatar {
  width: 40px; height: 40px; border-radius: 50%; background: var(--btn); color: var(--btnfg);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 15px;
}

/* Buttons */
.btn, .btn2, .tg, .btn-danger {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px; border-radius: 8px; font-size: 14px; font-weight: 600;
  font-family: inherit; cursor: pointer; border: 0; line-height: 1;
}
.btn { background: var(--btn); color: var(--btnfg); }
.btn:hover { filter: brightness(1.06); }
.btn2 { background: transparent; color: var(--text); border: 1px solid var(--border); padding: 0 18px; }
.btn2:hover { background: var(--surface2); }
.btn-danger { background: var(--danger); color: var(--dangerfg); }
.btn-lg { height: 48px; font-size: 15px; }
.tg {
  padding: 0 16px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-size: 13px;
}
.tg svg { flex: none; }
.tg .i-sun { display: none; }
:root[data-theme="dark"] .tg .i-sun { display: inline; }
:root[data-theme="dark"] .tg .i-moon { display: none; }

/* Page layout */
.wf-main {
  max-width: 1160px; margin: 0 auto; padding: 48px 24px 72px;
  display: flex; flex-direction: column; gap: 40px;
}
.wf-main.narrow { max-width: 720px; }
.wf-title { margin: 0; font-family: var(--serif); font-size: 48px; font-weight: 500; line-height: 1.05; }
.wf-sub { margin-top: 8px; font-size: 16px; color: var(--muted); }
.wf-head { display: flex; flex-direction: column; gap: 8px; }
.wf-eyebrow {
  margin: 0; font-size: 13px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
}
.wf-section { display: flex; flex-direction: column; gap: 16px; }

/* Cards */
.card { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); border: 1px solid var(--border); }
.lift:hover { border-color: var(--accent); }
.card-pad { padding: 28px; }
.card-mint { background: var(--mint); }
.grid-season { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }
.grid-files { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.season-card { padding: 28px; display: flex; flex-direction: column; gap: 18px; }
.season-name { font-family: var(--serif); font-size: 44px; font-weight: 500; line-height: 1.05; }
.season-meta { font-size: 14px; color: var(--muted); }
.row-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.file-card {
  display: flex; align-items: center; gap: 14px; min-height: 72px; padding: 14px 18px; border-radius: 12px;
}
.file-ico {
  flex: none; width: 40px; height: 40px; border-radius: 10px; background: var(--surface2);
  display: inline-flex; align-items: center; justify-content: center; color: var(--muted);
}
.file-name { flex: 1; min-width: 0; font-size: 15px; font-weight: 600; line-height: 1.3; word-break: break-word; }
.file-tag { flex: none; font-size: 12px; font-weight: 600; padding: 4px 8px; border-radius: 6px; background: var(--surface2); color: var(--muted); }
.cta-band {
  padding: 28px 32px; display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 20px;
}
.cta-band h2 { margin: 0; font-family: var(--serif); font-size: 30px; font-weight: 600; }
.cta-band p { margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.empty-message { margin: 0; padding: 24px; text-align: center; color: var(--muted); }

/* Forms */
.wf-form { display: flex; flex-direction: column; gap: 20px; }
.wf-field { display: flex; flex-direction: column; gap: 6px; }
.wf-label { font-size: 13px; font-weight: 600; }
.wf-hint { font-size: 12px; color: var(--muted); }
.fld, .wf select, .wf textarea {
  height: 48px; border: 1px solid var(--border); border-radius: 8px; padding: 0 14px;
  font-size: 16px; font-family: inherit; background: var(--surface); color: var(--text); width: 100%;
}
.wf textarea { height: auto; padding: 12px 14px; }
.fld:focus, .wf select:focus { border-color: var(--accent); }
.wf-check { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.wf-check input { width: 18px; height: 18px; accent-color: var(--accent); }

/* Messages */
.wf-alert { padding: 14px 18px; border-radius: 10px; font-size: 14px; border: 1px solid var(--border); background: var(--surface2); }
.wf-alert.ok { background: var(--mint); border-color: var(--pos); color: var(--text); }
.wf-alert.err { border-color: var(--neg); color: var(--neg); background: var(--surface); }

/* Tables */
.wf-table-wrap { overflow-x: auto; }
.wf-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.wf-table th {
  text-align: left; padding: 12px 16px; font-size: 12px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--border); white-space: nowrap;
}
.wf-table td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.wf-table tr:last-child td { border-bottom: 0; }
.wf-table tbody tr:hover { background: var(--surface2); }
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--surface2); color: var(--text); }
.pill.on { background: var(--mint); color: var(--pos); }
.pill.off { background: var(--surface2); color: var(--neg); }

/* Login: logo, form card and theme toggle */
.wf-login { display: flex; flex-direction: column; min-height: 100vh; padding: 24px; }
.wf-login-top { display: flex; justify-content: flex-end; }
.wf-login-center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 36px; padding-bottom: 48px; }
.wf-logo { display: block; width: min(100%, 460px); height: auto; color: var(--text); }
.wf-login-card { width: 100%; max-width: 400px; padding: 32px; }
.wf-login-head { text-align: center; }
.wf-login-head h1 { margin: 0 0 6px; font-family: var(--serif); font-size: 38px; font-weight: 600; line-height: 1.1; color: var(--text); }
.wf-login-head p { margin: 0; font-size: 14px; color: var(--muted); }

/* Embedded PDF viewer frame (sales and catalogs) */
.wf-viewer { width: 100%; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.wf-status { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 13px; color: var(--muted); }

/* Admin: users table and forms */
.btn-sm { height: 36px; padding: 0 14px; font-size: 13px; }
.delete-form { display: inline; margin: 0; }
.cell-sub { font-size: 12px; color: var(--muted); }
.role-pill { display: inline-flex; align-items: center; gap: 8px; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--muted); }
.dot-admin { background: var(--accent); }
.dot-webiq { background: #4E9A72; }
.dot-catalog { background: #C9976B; }
.dot-sales { background: #C8A96A; }
.dot-centos { background: #A8D5BE; }
.wf-back { font-size: 14px; font-weight: 600; color: var(--muted); }
.wf-back:hover { color: var(--text); }
.wf-form-card { padding: 32px; display: flex; flex-direction: column; gap: 22px; }
.wf-checklist { margin: 6px 0 0; padding-left: 18px; color: var(--muted); font-size: 14px; }
.wf-note { padding: 16px 18px; border-radius: 10px; background: var(--surface2); font-size: 14px; }
.wf-note b { display: block; margin-bottom: 4px; }

/* Home / admin tiles */
.tile-ico {
  flex: none; width: 48px; height: 48px; border-radius: 12px; background: var(--surface2); color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center;
}
.app-card { padding: 28px; display: flex; flex-direction: column; gap: 10px; }
.app-card h3, .link-card h3 { margin: 0; font-family: var(--serif); font-size: 30px; font-weight: 600; line-height: 1.1; }
.app-card p, .link-card p { margin: 0; font-size: 14px; color: var(--muted); }
.app-card .row-actions { margin-top: 10px; }
.link-card { padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.link-card h3 { font-size: 26px; }

/* Sales reports viewer */
.sales-head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 16px; }
.refresh-timer, .pdf-status {
  display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--surface2);
  color: var(--text); font-size: 13px; font-weight: 600;
}
.refresh-timer { min-width: 46px; text-align: center; }
.viewer-card { overflow: hidden; padding: 0; }
.pdf-frame { display: block; border: 0; width: 100%; height: calc(100vh - 230px); min-height: 520px; background: var(--surface); }
.update-notification {
  position: fixed; top: 84px; right: 20px; z-index: 60; display: none;
  background: var(--btn); color: var(--btnfg); padding: 12px 20px; border-radius: 10px; box-shadow: var(--shadow);
  font-size: 14px; font-weight: 600;
}
.update-notification.show { display: block; animation: wfSlideIn .25s ease; }
@keyframes wfSlideIn { from { transform: translateX(40px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@media (max-width: 640px) {
  .pdf-frame { height: calc(100vh - 200px); min-height: 420px; }
  .update-notification { right: 12px; left: 12px; top: 76px; text-align: center; }
}

/* Contact cards */
.contact-role { font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.contact-name { font-family: var(--serif); font-size: 30px; font-weight: 600; line-height: 1.1; }
.contact-mail { font-size: 14px; font-weight: 600; color: var(--accent); word-break: break-all; }
.contact-mail:hover { text-decoration: underline; }

/* Mobile menu button (hidden on desktop) */
.wf-menu-btn {
  display: none; position: relative; width: 44px; height: 44px; padding: 0;
  border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer;
}
.wf-menu-btn .bar {
  position: absolute; left: 12px; right: 12px; height: 2px; border-radius: 2px; background: currentColor;
}
.wf-menu-btn .bar:first-child { top: 16px; }
.wf-menu-btn .bar:last-child { top: 25px; }
.wf-header.open .wf-menu-btn .bar:first-child { top: 20.5px; transform: rotate(45deg); }
.wf-header.open .wf-menu-btn .bar:last-child { top: 20.5px; transform: rotate(-45deg); }

@media (max-width: 720px) {
  .wf-header-inner { flex-wrap: wrap; gap: 0 12px; padding: 8px 16px; }
  .wf-brand { flex: 1 1 auto; font-size: 18px; letter-spacing: .14em; }
  .wf-actions { gap: 8px; }
  .wf-menu-btn { display: inline-flex; }
  /* Theme toggle becomes icon-only */
  .tg { width: 44px; padding: 0; border-radius: 50%; }
  .tg [data-theme-label] { display: none; }
  /* Nav collapses into a dropdown panel under the header row */
  .wf-nav { display: none; order: 3; flex: 1 0 100%; flex-direction: column; gap: 2px; padding: 8px 0 8px; margin-top: 8px; border-top: 1px solid var(--border); }
  .wf-header.open .wf-nav { display: flex; }
  .nl { height: 48px; padding: 0 12px; font-size: 15px; }
}
@media (max-width: 640px) {
  .wf-title { font-size: 36px; }
  .season-name { font-size: 36px; }
  .wf-main { padding: 32px 16px 56px; }
  .wf-login { padding: 16px; }
  .wf-login-card { padding: 24px; }
}
@media (prefers-reduced-motion: no-preference) {
  .lift, .btn, .btn2, .nl { transition: border-color .15s, background .15s, filter .15s; }
  .wf-menu-btn .bar { transition: top .22s ease, transform .22s ease; }
}
