/* Customer portal styling.
   Same brand rules as the employee portal: cream #F7F6F1 page, gold #FFCF00 as
   an accent only. Kept as its own file so nothing here can affect /portal/. */

:root {
  --gold:   #FFCF00;
  --cream:  #F7F6F1;
  --ink:    #1c1c1c;
  --muted:  #5a5a5a;
  --line:   #E3E0D6;
  --ok:     #1b7a3d;
  --warn:   #9a3412;
  --okbg:   #eaf5ee;
  --warnbg: #fdeee7;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.site-header { background: #fff; border-bottom: 1px solid var(--line); }

/* Logo block: these three rules are copied verbatim from the employee portal's
   style.css so the two portals sit identically. Do not "tidy" them apart -
   margin:0 auto on BOTH the wrapper and the image is what centres it. */
.site-header-brand { max-width: 900px; margin: 0 auto; padding: 28px 20px 20px; }
.brand-logo { width: 600px; max-width: 100%; height: auto; display: block; margin: 0 auto; }

.site-nav-strip { border-top: 1px solid var(--line); background: #fff; }
.site-nav {
  display: flex; flex-wrap: wrap; gap: 1.25rem; align-items: center;
  padding: .85rem 1.5rem; max-width: 1100px; margin: 0 auto;
}
.site-nav a { color: var(--ink); text-decoration: none; border-bottom: 2px solid transparent; padding-bottom: 2px; }
.site-nav a:hover { border-bottom-color: var(--gold); }
.greeting { font-weight: 700; margin-right: auto; }

.site-main { max-width: 1100px; margin: 0 auto; padding: 2rem 1.5rem 3rem; }

h1 { font-size: 1.9rem; margin: 0 0 1.25rem; }
h2 { font-size: 1.25rem; margin: 2rem 0 .75rem; }
h2:first-child { margin-top: 0; }

a { color: #1a4d8f; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }

/* Cards ------------------------------------------------------------------ */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.card { background: #fff; border: 1px solid var(--line); padding: 1.25rem; display: flex; flex-direction: column; gap: .35rem; }
.card-label { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.card-value { font-size: 2rem; font-weight: 700; line-height: 1.1; }
.card-value.small-value { font-size: 1.35rem; }
.card-note { font-size: .875rem; color: var(--muted); }
.card-link { margin-top: .5rem; font-size: .9rem; }

/* Panels ----------------------------------------------------------------- */
.panel { background: #fff; border: 1px solid var(--line); padding: 1.5rem; margin-bottom: 1.5rem; }
.panel h2 { margin-top: 0; }

/* Tables ----------------------------------------------------------------- */
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); margin-bottom: 1rem; }
th, td { text-align: left; padding: .7rem .85rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #fbfaf7; }
tbody tr:last-child td { border-bottom: none; }
.num { text-align: right; }
tr.is-you { background: #fffdf0; }

.pill { display: inline-block; padding: .15rem .55rem; border-radius: 999px; background: #f0efe9; font-size: .8rem; white-space: nowrap; }
.pill-warn { background: var(--warnbg); color: var(--warn); }
.pill-done { background: var(--okbg); color: var(--ok); }

/* Forms ------------------------------------------------------------------ */
.stack { display: flex; flex-direction: column; gap: 1.15rem; max-width: 640px; }
.field { display: flex; flex-direction: column; gap: .35rem; }
.field label { font-weight: 600; }
input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
  font: inherit; padding: .6rem .7rem; border: 1px solid #c9c5b8; background: #fff; border-radius: 2px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); outline-offset: 1px; border-color: #9c9789; }
textarea { resize: vertical; }
.hint { font-size: .85rem; color: var(--muted); }
.qty { width: 5.5rem; text-align: right; }
.order-table td { vertical-align: middle; }

.btn {
  font: inherit; font-weight: 700; cursor: pointer;
  background: var(--gold); color: var(--ink);
  border: 1px solid #e0b600; border-radius: 2px;
  padding: .7rem 1.4rem; align-self: flex-start;
}
.btn:hover { background: #ffd91f; }

/* Alerts ----------------------------------------------------------------- */
.alert { padding: .85rem 1.1rem; margin-bottom: 1.5rem; border: 1px solid; }
.alert-error   { background: var(--warnbg); border-color: #e7c3b3; color: var(--warn); }
.alert-success { background: var(--okbg);   border-color: #bcdcc7; color: var(--ok); }

/* Definition list -------------------------------------------------------- */
.detail { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1.25rem; margin: 0; }
.detail dt { font-weight: 600; color: var(--muted); }
.detail dd { margin: 0; }

/* Footer ----------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--line); background: #fff; padding: 1.5rem; text-align: center; color: var(--muted); font-size: .9rem; }
.site-footer p { margin: .25rem 0; }

@media (max-width: 600px) {
  .site-nav { gap: .9rem; font-size: .95rem; }
  .greeting { width: 100%; margin-right: 0; }
  h1 { font-size: 1.5rem; }
  .card-value { font-size: 1.65rem; }
}
