/* =========================================================================
   Strathroy Dairy - Orders Online
   Enterprise design system (v103)

   Principles: flat surfaces, 1px borders, 4px corners, one typeface,
   high-contrast readable text (14px base, 12px minimum), brand navy for
   primary actions, brand green only as an accent / positive state.
   Brand colours are taken from the Strathroy logo.
   ========================================================================= */

:root {
    --sr-navy: #212E84;          /* logo navy  - primary */
    --sr-navy-700: #1A2470;
    --sr-navy-800: #141C5A;
    --sr-navy-050: #EEF0F8;
    --sr-navy-100: #DDE1F1;
    --sr-green: #1FB25A;         /* logo green - accent */
    --sr-green-700: #137A3B;     /* green for text/buttons (AA contrast) */
    --sr-green-050: #EAF6EF;

    --sr-text: #1F2328;
    --sr-text-2: #4A5261;
    --sr-text-3: #6B7280;
    --sr-page: #F3F4F6;
    --sr-surface: #FFFFFF;
    --sr-surface-2: #F7F8FA;
    --sr-line: #D9DDE3;
    --sr-line-2: #E8EBEF;
    --sr-input-line: #B9C0CB;

    --sr-danger: #B42318;
    --sr-danger-050: #FDEDEC;
    --sr-warning: #8A5A00;
    --sr-warning-050: #FFF6E0;

    --sr-font: "Segoe UI", "Segoe UI Web (West European)", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
    --sr-radius: 4px;
    --sr-shell-h: 56px;
}

/* ---------- Base ------------------------------------------------------- */
/* :where() keeps these base rules at zero specificity so page styles always win */
:where(body.sr-app) {
    margin: 0;
    background: var(--sr-page);
    color: var(--sr-text);
    font-family: var(--sr-font);
    font-size: 14px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
.sr-shell, .sr-shell *, .sr-pagehead, .sr-pagehead *, .sr-main, .sr-main * { box-sizing: border-box; }
:where(.sr-app) :where(input, select, textarea, button) { font-family: var(--sr-font); }

/* ---------- Application shell bar ------------------------------------- */
.sr-shell {
    display: flex;
    align-items: center;
    gap: 16px;
    height: var(--sr-shell-h);
    padding: 0 20px;
    background: var(--sr-navy);
    color: #fff;
    border-bottom: 3px solid var(--sr-green);
    font-family: var(--sr-font);
    position: relative;
    z-index: 50;
}
.sr-shell-logo { display: flex; align-items: center; height: 100%; }
.sr-shell-logo img { height: 34px; width: auto; display: block; }
.sr-shell-sep { width: 1px; height: 26px; background: rgba(255,255,255,.28); }
.sr-shell-app { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.sr-shell-app b { font-size: 15px; font-weight: 600; color: #fff; white-space: nowrap; }
.sr-shell-app span { font-size: 12px; color: rgba(255,255,255,.75); white-space: nowrap; }
.sr-shell-right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; }
.sr-shell-user { font-size: 13px; color: rgba(255,255,255,.85); white-space: nowrap; }
.sr-shell-user strong { color: #fff; font-weight: 600; }
.sr-shell a.sr-shell-link,
.sr-shell .sr-shell-link {
    display: inline-flex; align-items: center; height: 32px; padding: 0 12px;
    border: 1px solid rgba(255,255,255,.45); border-radius: var(--sr-radius);
    color: #fff !important; background: transparent !important; text-decoration: none;
    font: 600 13px var(--sr-font); cursor: pointer; white-space: nowrap; box-shadow: none !important;
    min-height: 0 !important;
}
.sr-shell .sr-shell-link:hover { background: rgba(255,255,255,.12) !important; }

/* ---------- Page header ----------------------------------------------- */
.sr-pagehead {
    background: var(--sr-surface);
    border-bottom: 1px solid var(--sr-line);
    padding: 16px 24px;
}
.sr-pagehead-inner { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; max-width: 1600px; margin: 0 auto; }
.sr-pagehead h1 { margin: 0; font-size: 22px; font-weight: 600; color: var(--sr-text); line-height: 1.25; }
.sr-pagehead p { margin: 4px 0 0; font-size: 14px; color: var(--sr-text-3); }
.sr-crumb { font-size: 12px; color: var(--sr-text-3); margin-bottom: 4px; }
.sr-crumb a { color: var(--sr-navy); text-decoration: none; }
.sr-crumb a:hover { text-decoration: underline; }

.sr-main { max-width: 1600px; margin: 0 auto; padding: 20px 24px 32px; }
.sr-main.narrow { max-width: 1200px; }

/* ---------- Panels ---------------------------------------------------- */
.sr-panel {
    background: var(--sr-surface);
    border: 1px solid var(--sr-line);
    border-radius: var(--sr-radius);
    margin-bottom: 16px;
}
.sr-panel-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    padding: 12px 16px;
    border-bottom: 1px solid var(--sr-line);
}
.sr-panel-head h2 { margin: 0; font-size: 16px; font-weight: 600; color: var(--sr-text); }
.sr-panel-head .sr-note { font-size: 13px; color: var(--sr-text-3); }
.sr-panel-body { padding: 16px; }
.sr-panel-body.flush { padding: 0; }

/* ---------- Buttons --------------------------------------------------- */
.sr-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 36px; min-width: 88px; padding: 0 16px;
    border: 1px solid var(--sr-navy); border-radius: var(--sr-radius);
    background: var(--sr-navy); color: #fff;
    font: 600 14px var(--sr-font); line-height: 1; text-decoration: none; white-space: nowrap;
    cursor: pointer; box-shadow: none; transition: background-color .12s ease, border-color .12s ease;
}
.sr-btn:hover { background: var(--sr-navy-700); border-color: var(--sr-navy-700); }
.sr-btn:focus-visible { outline: 2px solid var(--sr-navy); outline-offset: 2px; }
.sr-btn.secondary { background: #fff; color: var(--sr-navy); border-color: var(--sr-input-line); }
.sr-btn.secondary:hover { background: var(--sr-navy-050); border-color: var(--sr-navy); }
.sr-btn.success { background: var(--sr-green-700); border-color: var(--sr-green-700); }
.sr-btn.success:hover { background: #0F6630; border-color: #0F6630; }
.sr-btn.danger { background: #fff; color: var(--sr-danger); border-color: #E3B4B0; }
.sr-btn.small { height: 30px; min-width: 0; padding: 0 12px; font-size: 13px; }
.sr-btn.large { height: 44px; padding: 0 22px; font-size: 15px; }
.sr-btn[disabled], .sr-btn.aspNetDisabled { opacity: .5; cursor: not-allowed; }

/* ---------- Form fields ----------------------------------------------- */
.sr-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.sr-field > label, .sr-label { font-size: 13px; font-weight: 600; color: var(--sr-text-2); }
.sr-input, .sr-select {
    width: 100%; height: 36px; padding: 0 10px;
    border: 1px solid var(--sr-input-line); border-radius: var(--sr-radius);
    background: #fff; color: var(--sr-text);
    font: 14px var(--sr-font);
}
.sr-input:focus, .sr-select:focus { outline: none; border-color: var(--sr-navy); box-shadow: 0 0 0 1px var(--sr-navy); }
.sr-input[readonly] { background: var(--sr-surface-2); color: var(--sr-text-2); }

/* ---------- Data tables ----------------------------------------------- */
.sr-table-wrap { width: 100%; overflow-x: auto; }
.sr-table { width: 100%; border-collapse: collapse; font-size: 14px; background: #fff; }
.sr-table th {
    background: var(--sr-surface-2); color: var(--sr-text-2);
    font-size: 13px; font-weight: 600; text-align: left; white-space: nowrap;
    padding: 10px 12px; border-bottom: 1px solid var(--sr-line);
}
.sr-table td { padding: 9px 12px; border-bottom: 1px solid var(--sr-line-2); color: var(--sr-text); vertical-align: middle; }
.sr-table tr:hover td { background: #F5F7FB; }
.sr-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.sr-empty { padding: 28px 16px; text-align: center; color: var(--sr-text-3); }

/* ---------- Status / messages ----------------------------------------- */
.sr-msg { display: block; padding: 10px 14px; border-radius: var(--sr-radius); border: 1px solid; font-size: 14px; margin-bottom: 14px; }
.sr-msg.error { background: var(--sr-danger-050); border-color: #F1C0BB; color: var(--sr-danger); }
.sr-msg.ok { background: var(--sr-green-050); border-color: #BFE3CC; color: var(--sr-green-700); }

/* ---------- Key figures ------------------------------------------------ */
.sr-figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1px; background: var(--sr-line); border: 1px solid var(--sr-line); border-radius: var(--sr-radius); overflow: hidden; margin-bottom: 16px; }
.sr-figure { background: #fff; padding: 14px 16px; }
.sr-figure .k { font-size: 13px; color: var(--sr-text-3); margin-bottom: 4px; }
.sr-figure .v { font-size: 20px; font-weight: 600; color: var(--sr-text); min-height: 26px; display: block; }

/* ---------- Footer ----------------------------------------------------- */
.sr-foot { max-width: 1600px; margin: 0 auto; padding: 8px 24px 24px; font-size: 12px; color: var(--sr-text-3); }

/* ---------- Responsive ------------------------------------------------- */
@media (max-width: 900px) {
    .sr-shell { padding: 0 12px; gap: 10px; }
    .sr-shell-app span, .sr-shell-user .cap { display: none; }
    .sr-pagehead { padding: 14px 16px; }
    .sr-main { padding: 16px; }
}
@media (max-width: 600px) {
    .sr-shell-sep, .sr-shell-app { display: none; }
    .sr-shell-right { min-width: 0; }
    .sr-shell-right .sr-shell-link:not(:last-child) { display: none; }
    .sr-pagehead h1 { font-size: 19px; }
}

/* ---------- Print ------------------------------------------------------ */
@media print {
    .sr-shell { background: #fff !important; color: #000; border-bottom: 2px solid #000; }
    .sr-shell-right, .sr-no-print { display: none !important; }
    :where(body.sr-app) { background: #fff; }
    .sr-panel { border-color: #999; }
}
