/*
 * Creglo Dash — design language ported from the creglo marketing theme
 * (wp-content/themes/creglo-theme). Tokens, fonts and the .c-button / .c-input
 * component classes mirror that theme so the dashboard reads as one product.
 */

/* ---- Fonts (copied to /public/fonts) ---------------------------------- */
@font-face {
  font-family: 'Argentum Sans';
  font-weight: 400; font-style: normal; font-display: swap;
  src: url("/fonts/argentum-sans-latin-400-normal.woff2") format('woff2'),
       url("/fonts/argentum-sans-latin-400-normal.woff") format('woff');
}
@font-face {
  font-family: 'Argentum Sans';
  font-weight: 500; font-style: normal; font-display: swap;
  src: url("/fonts/argentum-sans-latin-500-normal.woff2") format('woff2'),
       url("/fonts/argentum-sans-latin-500-normal.woff") format('woff');
}
@font-face {
  font-family: 'Argentum Sans';
  font-weight: 700; font-style: normal; font-display: swap;
  src: url("/fonts/argentum-sans-latin-700-normal.woff2") format('woff2'),
       url("/fonts/argentum-sans-latin-700-normal.woff") format('woff');
}
@font-face {
  font-family: 'Superior Title';
  font-weight: 500; font-style: italic; font-display: swap;
  src: url("/fonts/superior-title-medium-italic.otf") format('opentype');
}
@font-face {
  font-family: 'Gotham-Book';
  font-display: swap;
  src: url("/fonts/Gotham-Book.otf") format('opentype');
}

/* ---- Tokens (from creglo-theme common/colors.scss + core.scss) --------- */
:root {
  --cr-text: #231f20;
  --cr-orange: #ffcc79;
  --cr-yellow: #fffaa0;
  --cr-gray-bg: #f1f0f0;
  --cr-dark-teal: #092e40;
  --cr-input-bg: #faf5e8;
  --cr-input-text: #331715;
  --cr-white: #ffffff;
  --cr-red: #e24932;

  --font-body: 'Argentum Sans', sans-serif;
  --font-display: 'Superior Title', Georgia, serif;
  --font-label: 'Gotham-Book', sans-serif;

  --radius-input: 9px;
  --radius-button: 15px;
  --radius-card: 18px;
}

/* ---- Base ------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--cr-text);
  background: var(--cr-gray-bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, p { margin: 0; }
a { color: var(--cr-dark-teal); }

/* ---- Buttons (creglo-theme common/buttons.scss) ----------------------- */
.c-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-body); font-weight: 700; font-size: 16px; line-height: 1.2;
  text-align: center; text-decoration: none;
  background: var(--cr-orange); color: var(--cr-text);
  border: none; outline: none; border-radius: var(--radius-button);
  padding: 12px 32px; cursor: pointer;
  transition: background 150ms ease-out, transform 150ms ease-out;
}
.c-button:hover { background: #ffbe55; }
.c-button:active { transform: translateY(1px); }
.c-button--yellow { background: var(--cr-yellow); }
.c-button--yellow:hover { background: #fff582; }
.c-button--block { width: 100%; }
.c-button--ghost {
  background: transparent; color: var(--cr-dark-teal);
  border: 1.5px solid rgba(9, 46, 64, 0.2);
}
.c-button--ghost:hover { background: rgba(9, 46, 64, 0.06); }

/* ---- Inputs (creglo-theme common/inputs.scss) ------------------------- */
.c-input__title {
  display: block; margin-bottom: 8px;
  font-family: var(--font-label); font-size: 15px; line-height: 1.2;
  color: var(--cr-text);
}
.c-input {
  width: 100%; box-sizing: border-box;
  padding: 14px; border: none; outline: none;
  border-radius: var(--radius-input);
  background: var(--cr-input-bg); color: var(--cr-input-text);
  font-family: var(--font-body); font-size: 16px;
}
.c-input::placeholder { color: rgba(51, 23, 21, 0.55); }
.c-input:focus { box-shadow: 0 0 0 2px var(--cr-orange); }
.c-input--invalid { box-shadow: 0 0 0 2px var(--cr-red); }
.c-field { margin-bottom: 18px; }

/* ---- App shell -------------------------------------------------------- */
.c-navbar {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px; padding: 0 28px;
  background: var(--cr-white); border-bottom: 1px solid #e7e6e6;
}
.c-navbar__logo { height: 30px; }
.c-navbar__right { display: flex; align-items: center; gap: 18px; }
.c-navbar__user { font-size: 14px; color: rgba(35, 31, 32, 0.7); }
.c-navbar__signout {
  background: none; border: none; cursor: pointer; padding: 0;
  font-family: var(--font-body); font-size: 14px; color: var(--cr-dark-teal);
  text-decoration: underline;
}

.c-main { max-width: 1100px; margin: 0 auto; padding: 36px 28px; }

.c-card {
  background: var(--cr-white); border-radius: var(--radius-card);
  padding: 28px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.c-card + .c-card { margin-top: 18px; }

.c-page-title {
  font-family: var(--font-display); font-style: italic; font-weight: 500;
  font-size: 34px; margin-bottom: 6px;
}
.c-page-subtitle { color: rgba(35, 31, 32, 0.6); margin-bottom: 28px; }

.c-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 18px; }
.c-stat { background: var(--cr-white); border-radius: var(--radius-card); padding: 22px; }
.c-stat__value { font-family: var(--font-display); font-style: italic; font-size: 40px; line-height: 1; }
.c-stat__label { margin-top: 8px; font-size: 14px; color: rgba(35, 31, 32, 0.6); }

/* ---- Auth (login / password reset) ------------------------------------ */
.c-auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.c-auth__card { width: 100%; max-width: 420px; background: var(--cr-white); border-radius: var(--radius-card); padding: 40px 36px; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.06); }
.c-auth__logo { height: 34px; margin-bottom: 28px; }
.c-auth__title { font-family: var(--font-display); font-style: italic; font-weight: 500; font-size: 30px; margin-bottom: 6px; }
.c-auth__subtitle { color: rgba(35, 31, 32, 0.6); margin-bottom: 28px; font-size: 15px; }
.c-auth__links { margin-top: 22px; font-size: 14px; display: flex; flex-direction: column; gap: 8px; }
.c-auth__check { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; font-size: 14px; color: rgba(35, 31, 32, 0.75); }

/* ---- Tables / detail lists -------------------------------------------- */
.c-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.c-table th { text-align: left; padding: 0 14px 12px; color: rgba(35, 31, 32, 0.5); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
.c-table td { padding: 14px; border-top: 1px solid #efeeee; }
.c-button--sm { padding: 7px 16px; font-size: 13px; }
.c-detail { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 28px; margin: 0; }
.c-detail dt { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: rgba(35, 31, 32, 0.5); margin-bottom: 4px; }
.c-detail dd { margin: 0; font-size: 15px; word-break: break-word; }
.c-navbar__link { font-size: 14px; color: var(--cr-text); text-decoration: none; font-weight: 500; }
.c-navbar__link:hover { color: var(--cr-dark-teal); }
.c-badge {
  display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--cr-red); color: var(--cr-white);
  font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
}

/* ---- Notifications / assignments (1D) --------------------------------- */
.c-assign-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.c-assign-form .c-input { width: auto; min-width: 180px; }
.c-notif {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  width: 100%; text-align: left; padding: 14px 4px; border: none; border-top: 1px solid #efeeee;
  background: none; cursor: pointer; font-family: var(--font-body); font-size: 14px; color: var(--cr-text);
}
.c-notif:first-child { border-top: none; }
.c-notif--unread { font-weight: 600; }
.c-notif--unread .c-notif__text::before {
  content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 8px;
  border-radius: 50%; background: var(--cr-red); vertical-align: middle;
}
.c-notif__time { color: rgba(35, 31, 32, 0.5); font-size: 13px; white-space: nowrap; }

/* ---- Inbox ------------------------------------------------------------ */
.c-convo-list { list-style: none; margin: 0; padding: 0; }
.c-convo { border-top: 1px solid #efeeee; }
.c-convo:first-child { border-top: none; }
.c-convo__link { display: block; padding: 14px 6px; text-decoration: none; color: inherit; border-radius: 8px; }
.c-convo__link:hover { background: #faf9f8; }
.c-convo__top { display: flex; justify-content: space-between; align-items: baseline; }
.c-convo__brand { font-weight: 600; }
.c-convo__time { color: #9a9698; font-size: 13px; }
.c-convo__subject { font-size: 14px; margin: 2px 0 6px; }
.c-convo__meta { font-size: 12px; color: #6b6768; display: flex; align-items: center; gap: 6px; }

.c-badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.c-badge--open { background: #e7f6ec; color: #1f6b3b; }
.c-badge--awaiting_reply { background: #fff4e0; color: #9a6a16; }
.c-badge--closed { background: #eee; color: #777; }

.c-thread { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.c-bubble { max-width: 74%; padding: 14px 16px; border-radius: 16px; background: var(--cr-white); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); }
.c-bubble--inbound { align-self: flex-start; border-top-left-radius: 4px; }
.c-bubble--outbound { align-self: flex-end; background: var(--cr-input-bg); border-top-right-radius: 4px; }
.c-bubble__meta { font-size: 12px; color: #9a9698; margin-bottom: 6px; }
.c-bubble__body { font-size: 15px; line-height: 1.5; }
.c-bubble__body p { margin: 0 0 8px; }
.c-bubble__body p:last-child { margin-bottom: 0; }
.c-bubble__attachments { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 8px; }
.c-attachment { font-size: 12px; background: #f1f0f0; border-radius: 8px; padding: 4px 8px; }
.c-reply { margin-top: 22px; }
.c-reply__box { min-height: 110px; resize: vertical; }

/* ---- Flash ------------------------------------------------------------ */
.c-flash { max-width: 1100px; margin: 16px auto 0; padding: 0 28px; }
.c-flash__msg { padding: 12px 16px; border-radius: 10px; font-size: 14px; margin-bottom: 8px; }
.c-flash__msg--notice { background: #e7f6ec; color: #1f6b3b; }
.c-flash__msg--alert { background: #fdecea; color: #a3271a; }
