/*
 * Mimi — Auction House London staff intranet.
 *
 * The design handoff gives every value as an inline style on a prototype. They
 * are lifted here into tokens and classes instead, because the same red appears
 * in eleven places and a rebrand must not be eleven edits. Values are otherwise
 * unchanged from the handoff: if a number here disagrees with
 * design/design_handoff_mimi_intranet/README.md, the README is right.
 */

:root {
  --brand:          #E7253B;  /* primary buttons, links, active nav, focus */
  --brand-hover:    #D01F33;
  --brand-deep:     #B81428;  /* link hover, pill text */
  --tint-field:     #F3DEE0;  /* login background */
  --tint-surface:   #FCF1F2;  /* active nav, sidebar card, tinted pill */
  --motif:          #8E1223;  /* decorative house marks only */

  --bg:             #F6F4F3;
  --surface:        #FFFFFF;
  --border:         #EDE7E5;
  --border-strong:  #E2DBD9;
  --divider:        #F1ECEA;

  --ink:            #201A19;
  --ink-2:          #3A3230;
  --muted:          #5C534F;
  --muted-light:    #7A716E;
  --muted-lighter:  #9A918E;
  --muted-lightest: #A9A19E;
  --disabled-text:  #B6ADAA;

  --focus-ring: 0 0 0 3px rgba(231, 37, 59, 0.16);
  --shadow-login: 0 18px 44px rgba(102, 14, 26, 0.14);
  --shadow-card-hover: 0 4px 14px rgba(32, 26, 25, 0.06);

  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--brand-deep); }

.serif { font-family: var(--serif); letter-spacing: -0.01em; font-weight: 400; }

/* ---------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.2;
  border: 0;
  border-radius: 10px;
  padding: 11px 16px;
  cursor: pointer;
  transition: all 0.15s;
}
.btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.btn--primary { font-weight: 600; color: #fff; background: var(--brand); }
.btn--primary:hover { background: var(--brand-hover); }
.btn--primary:active { transform: translateY(1px); }

.btn--secondary {
  font-weight: 500;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--border-strong);
}
.btn--secondary:hover { background: var(--bg); }

.btn--text { font-weight: 500; color: var(--brand); background: transparent; padding: 11px 12px; }
.btn--text:hover { background: var(--tint-surface); }

/* Small controls: table rows, card actions, toolbars. */
.btn--sm { font-size: 13px; padding: 8px 13px; border-radius: 9px; }
.btn--sm.btn--primary { padding: 9px 15px; }
.btn--sm.btn--text { padding: 8px 10px; border-radius: 9px; }

.btn--block { width: 100%; }

.btn:disabled,
.btn--disabled {
  background: var(--divider);
  color: var(--disabled-text);
  border: 0;
  cursor: not-allowed;
  transform: none;
}
.btn:disabled:hover, .btn--disabled:hover { background: var(--divider); }

/* ----------------------------------------------------------------- inputs */

.input {
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--surface);
  padding: 10px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  outline: none;
  transition: all 0.15s;
  width: 100%;
}
.input::placeholder { color: var(--muted-lightest); }
/* The native outline is suppressed above, so this ring is the only focus
   affordance there is. Never remove it. */
.input:focus { border-color: var(--brand); box-shadow: var(--focus-ring); }

/* ------------------------------------------------------------------ login */

.login {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background: var(--tint-field);
}
.login__glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(70% 55% at 50% 18%, rgba(255,255,255,0.75), rgba(255,255,255,0) 72%);
}
/* The span carries the position and size; the SVG inside must fill it rather
   than fall back to the browser's 300x150 default. */
.login__motif { position: absolute; color: var(--motif); line-height: 0; }
.login__motif svg { display: block; width: 100%; height: auto; }
.login__motif--bl { left: -140px; bottom: -160px; width: 520px; opacity: 0.09; }
.login__motif--tr { right: -90px; top: -80px; width: 340px; opacity: 0.08; }

.login__col {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 48px 24px;
}

.login__card {
  width: 432px;
  max-width: calc(100vw - 48px);
  background: var(--surface);
  border-radius: 22px;
  padding: 44px;
  box-shadow: var(--shadow-login);
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand img { display: block; width: 52px; height: 52px; }
.brand__word { font-family: var(--serif); font-size: 30px; color: var(--ink); letter-spacing: -0.01em; }

.login__heading { font-family: var(--serif); font-size: 27px; font-weight: 400; margin-top: 22px; letter-spacing: -0.01em; }
.login__sub { font-size: 15px; color: var(--muted-light); margin-top: 6px; }
.login__actions { display: flex; flex-direction: column; gap: 14px; margin-top: 30px; }
/* The sign-in button is a size of its own: bigger than any button inside the
   app, because on this screen it is the only thing to do. */
.login__actions .btn--block { font-size: 15px; padding: 14px; }
.login__helper { font-size: 13px; color: var(--muted-light); text-align: center; line-height: 1.5; }
.login__helper a { font-weight: 500; }

/* Microsoft's four-square mark. Drawn rather than fetched so the sign-in
   button never waits on, or leaks a request to, a third party. */
.ms-mark { display: grid; grid-template-columns: 8px 8px; grid-template-rows: 8px 8px; gap: 2px; }
.ms-mark span:nth-child(1) { background: #F25022; }
.ms-mark span:nth-child(2) { background: #7FBA00; }
.ms-mark span:nth-child(3) { background: #00A4EF; }
.ms-mark span:nth-child(4) { background: #FFB900; }

/* Calm, per the handoff: an error is text under the button, not a red box. */
.login__error { color: var(--brand-deep); font-size: 13px; line-height: 1.5; text-align: center; }

/* The password override. Visually quiet and set apart, because it is a
   temporary measure and should never read as an equal way in. */
.override { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--border); }
.override__label { font-size: 13px; color: var(--muted-light); }
.override__row { display: flex; gap: 8px; margin-top: 8px; }
.override__row .input { flex: 1; min-width: 0; }
.override__note { font-size: 12px; color: var(--muted-lightest); margin-top: 8px; line-height: 1.5; }

.notice {
  display: flex;
  align-items: center;
  gap: 7px;
  max-width: 432px;
  font-size: 12px;
  line-height: 1.55;
  color: rgba(64, 10, 18, 0.6);
}
.notice svg { flex: none; }

/* ------------------------------------------------------------------ shell */

.shell { display: flex; min-height: 100vh; }

.sidebar {
  /* content-box, deliberately. The prototype's aside is the one element in the
     handoff without box-sizing: border-box, so its 244px sits INSIDE the 16px
     padding and the column renders 276px wide. Keeping the arithmetic here
     rather than writing 276 means these numbers still match the handoff. */
  box-sizing: content-box;
  width: 244px;
  flex: none;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  gap: 26px;
}
.sidebar__brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; }
.sidebar__brand img { width: 34px; height: 34px; display: block; }
.sidebar__brand span { font-family: var(--serif); font-size: 23px; letter-spacing: -0.01em; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav__item {
  display: flex;
  align-items: center;
  gap: 11px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  color: var(--ink-2);
  background: transparent;
  border: 0;
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.nav__item:hover { background: var(--bg); }
.nav__item.is-active { background: var(--tint-surface); color: var(--brand); font-weight: 600; }
.nav__item.is-active:hover { background: var(--tint-surface); }
.nav__icon { width: 18px; display: flex; justify-content: center; flex: none; }

.sidebar__foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
.side-card { background: var(--tint-surface); border-radius: 12px; padding: 14px; }
.side-card__title { font-size: 13px; font-weight: 600; }
.side-card__body { font-size: 13px; color: var(--muted-light); margin-top: 3px; line-height: 1.5; }
.side-card .btn { margin-top: 10px; width: 100%; font-size: 13px; padding: 9px; border-radius: 9px; }

.userrow { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; }
.avatar {
  border-radius: 50%;
  background: var(--border);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  flex: none;
}
.avatar--sm { width: 32px; height: 32px; font-size: 12px; }
.avatar--lg { width: 44px; height: 44px; font-size: 14px; background: var(--divider); }
.userrow__name { font-size: 13px; font-weight: 600; }
.userrow__role { font-size: 12px; color: var(--muted-lighter); }
.userrow__text { line-height: 1.3; min-width: 0; }
.userrow__text > div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 68px;
  flex: none;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 28px;
}
.topbar .input { flex: 1; max-width: 380px; }
.topbar__right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.topbar .btn--secondary { padding: 9px 15px; }
.topbar .btn--primary { padding: 10px 16px; }

.content { flex: 1; padding: 32px 28px 44px; display: flex; flex-direction: column; gap: 26px; }
.page-title { font-family: var(--serif); font-size: 27px; letter-spacing: -0.01em; }
.page-sub { font-size: 15px; color: var(--muted-light); margin-top: 5px; }

.footer-notice {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted-lightest);
  font-size: 12px;
  margin-top: auto;
  padding-top: 24px;
}

/* ------------------------------------------------------------------ cards */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
}
.card__title { font-size: 15px; font-weight: 600; }
.divider { height: 1px; background: var(--border); margin: 22px 0; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px; }
.stat__label { font-size: 13px; color: var(--muted-light); }
.stat__value { font-family: var(--serif); font-size: 30px; margin-top: 6px; }

/* minmax(0, …) not a bare 1fr: a bare track refuses to shrink below its
   content and pushes the whole page into horizontal scroll. */
.home-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.home-grid__side { display: flex; flex-direction: column; gap: 18px; }

.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }

.list { display: flex; flex-direction: column; margin-top: 4px; }
.list__row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--divider); }
.list__row:last-child { border-bottom: 0; }
.list__title { font-size: 14px; font-weight: 500; }
.list__meta { font-size: 13px; color: var(--muted-lighter); margin-top: 2px; }
.list__grow { flex: 1; min-width: 0; }

.notices { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }
.notices__title { font-size: 14px; font-weight: 500; line-height: 1.45; }
.notices__date { font-size: 13px; color: var(--muted-lighter); margin-top: 3px; }

/* --------------------------------------------------------------- auctions */

.table-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.table-card__toolbar { display: flex; align-items: center; gap: 10px; padding: 16px 22px; border-bottom: 1px solid var(--border); }
.table-card__toolbar .btn--primary { margin-left: auto; }

.table-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.2fr) minmax(0, 0.8fr) minmax(0, 0.9fr) 110px;
  gap: 16px;
  align-items: center;
  padding: 15px 22px;
  border-bottom: 1px solid var(--divider);
  font-size: 14px;
}
.table-row:last-child { border-bottom: 0; }
.table-row .btn--sm { padding: 7px 12px; }
.table-row__name { font-weight: 500; }
.table-row__cell { color: var(--muted); }
.table-row__actions { display: flex; justify-content: flex-end; gap: 8px; }

.table-head {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-lighter);
  padding: 12px 22px;
  border-bottom: 1px solid var(--divider);
  align-items: end;
}

.pill {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--divider);
  color: var(--muted);
}
.pill--open { background: var(--tint-surface); color: var(--brand-deep); }

/* ------------------------------------------------- documents / directory */

.toolbar { display: flex; gap: 10px; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }

.doc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.15s;
}
.doc-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-card-hover); }
.doc-card__title { font-size: 15px; font-weight: 600; }
.doc-card__meta { font-size: 13px; color: var(--muted-lighter); margin-top: 4px; }
.doc-card__actions { display: flex; gap: 8px; margin-top: auto; }

.person-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.person-card__name { font-size: 15px; font-weight: 600; }
.person-card__role { font-size: 13px; color: var(--muted-lighter); margin-top: 2px; }

/* A standing reminder that the inside pages are not wired to AMS yet. It is
   deliberately visible: a demo that looks live is how a placeholder number
   ends up quoted in a meeting. */
.sample-flag {
  font-size: 12px;
  color: var(--muted-lighter);
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
  padding: 8px 12px;
  align-self: flex-start;
}

/* ------------------------------------------------------------ responsive */

/* Below ~900px the sidebar becomes a strip: icons only, no drawer. The drawer
   is not designed yet (handoff: "ask before shipping mobile"), and a strip is
   honest about that rather than pretending to be a phone layout. */
@media (max-width: 900px) {
  .sidebar { width: 56px; padding: 22px 10px; align-items: center; }  /* 76px with its padding */
  .sidebar__brand span,
  .nav__item span:not(.nav__icon),
  .side-card,
  .userrow__text { display: none; }
  .nav__item { justify-content: center; padding: 10px; }
  .home-grid { grid-template-columns: minmax(0, 1fr); }
  .content { padding: 24px 18px 36px; }
  .topbar { padding: 0 18px; }
}
