/* Premium "Minimal Slate & Indigo" theme overrides for AdminLTE */

body, .brand-text, .card, .nav-link, .btn, h1, h2, h3, h4, h5, h6 {
    font-family: 'Inter', -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ── Sidebar: SAITHY design language ───────────────────────────
   Light shell, blue accent.

   Specificity notes, both learned the hard way:
   - Group-title rules are qualified with .nav-link so they beat the
     generic row rule on specificity, not on source order. At equal
     weight the later rule won and silently reset their type size.
   - The CTA states its colour explicitly: AdminLTE's
     [class*=sidebar-light-] link rules out-specify .btn-primary.
   ───────────────────────────────────────────────────────────── */

.main-sidebar,
.main-sidebar.sidebar-light-primary {
    background: #ffffff !important;
    border-right: 1px solid #eceef3;
    box-shadow: none !important;
}

/* The menu scrolls between the brand and the user panel.
   NOTE: the user panel deliberately lives OUTSIDE .sidebar in the markup.
   AdminLTE mounts OverlayScrollbars on .sidebar and wraps its children in
   .os-* divs, so anything inside it cannot be pinned with flex — the
   wrapper, not our element, becomes the flex child. Keeping the panel a
   sibling of .sidebar sidesteps that entirely. */
.main-sidebar .sidebar {
    position: absolute;
    top: 4rem;
    bottom: 4.5rem;
    left: 0;
    right: 0;
    padding: 0 .75rem;
    overflow-x: hidden;
}

/* Brand */
.main-sidebar .brand-link {
    display: flex;
    align-items: center;
    gap: .7rem;
    height: 4rem;
    padding: 0 1.15rem;
    border-bottom: 1px solid #eceef3;
}
.main-sidebar .brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.35rem;
    height: 2.35rem;
    border-radius: .7rem;
    background: #2f43e0;
    color: #fff;
    font-size: 1rem;
    flex-shrink: 0;
}
.main-sidebar .brand-text {
    color: #10131c !important;
    font-weight: 700;
    font-size: 1.02rem;
    letter-spacing: -.01em;
}

/* Primary action */
.main-sidebar .sidebar-cta {
    padding: 1rem .75rem .35rem;
}
/* AdminLTE's [class*=sidebar-light-] link rules out-specify .btn-primary
   (attribute+element beats one class), which was rendering this text dark.
   The colour has to be stated explicitly here — and on the icon. */
.main-sidebar .sidebar-cta .btn-primary,
.main-sidebar .sidebar-cta .btn-primary:hover,
.main-sidebar .sidebar-cta .btn-primary:focus,
.main-sidebar .sidebar-cta .btn-primary i {
    color: #fff !important;
}
.main-sidebar .sidebar-cta .btn-primary {
    background: #2f43e0;
    border-color: #2f43e0;
    border-radius: .55rem;
    padding: .58rem 1rem;
    font-weight: 600;
    font-size: .845rem;
    letter-spacing: .005em;
    box-shadow: 0 1px 2px rgba(47, 67, 224, .25);
}
.main-sidebar .sidebar-cta .btn-primary:hover {
    background: #2536c4;
    border-color: #2536c4;
}

/* Group title — a label for the rows beneath it, not a destination. */
.main-sidebar .nav-sidebar .nav-link.nav-group-title,
.main-sidebar .nav-sidebar .nav-link.nav-group-title.active {
    background: transparent !important;
    color: #4b5563 !important;
    display: flex;
    align-items: center;
    font-size: .875rem;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
    padding: .45rem .1rem .3rem;
    cursor: pointer;
    box-shadow: none !important;
}
/* A group title has no icon by design (see sidebar-menu.blade.php).
   If one ever sneaks back in, hide it rather than let a heading
   masquerade as a clickable row. */
.main-sidebar .nav-sidebar .nav-link.nav-group-title .nav-icon {
    display: none;
}
.main-sidebar .nav-sidebar .nav-link.nav-group-title:hover {
    color: #374151 !important;
}
.main-sidebar .nav-sidebar .nav-link.nav-group-title .right {
    font-size: .8rem;
    transition: transform .2s ease;
}
.main-sidebar .nav-sidebar .nav-group.menu-open > .nav-link.nav-group-title .right {
    transform: rotate(180deg);
}
.main-sidebar .nav-sidebar .nav-group + .nav-group,
.main-sidebar .nav-sidebar .nav-item + .nav-group {
    margin-top: .8rem;
}

/* Rows */
.main-sidebar .nav-sidebar .nav-link {
    position: relative;
    display: flex;
    align-items: center;
    color: #454c5c;
    border-radius: .5rem;
    padding: .44rem .6rem;
    margin-bottom: .05rem;
    font-size: .845rem;
    font-weight: 500;
}
/* AdminLTE sets .nav-treeview links to #777 via an attribute selector that
   out-specifies ours — and #777 is 4.48:1 on white, which fails WCAG AA.
   Restate the colour at matching weight. #454c5c is 8.6:1. */
.main-sidebar[class*="sidebar-light-"] .nav-treeview > .nav-item > .nav-link {
    color: #454c5c;
}
.main-sidebar[class*="sidebar-light-"] .nav-treeview > .nav-item > .nav-link.active {
    color: #2f43e0;
}
.main-sidebar .nav-sidebar .nav-link .nav-icon {
    color: #9aa2b1;
    font-size: .875rem;
    width: 1.5rem;
    text-align: center;
    margin-right: .35rem;
}
.main-sidebar .nav-sidebar .nav-link:not(.active):not(.nav-group-title):hover {
    background: #f4f6fb;
    color: #10131c;
}
.main-sidebar .nav-sidebar .nav-link:not(.active):hover .nav-icon {
    color: #5b6474;
}

/* You are here — tinted row, blue text, and a bar on the left edge.
   Never a solid fill: the row still has to be readable at a glance. */
.main-sidebar .nav-sidebar .nav-link.active:not(.nav-group-title) {
    background: #eef1fe !important;
    color: #2f43e0 !important;
    font-weight: 600;
    box-shadow: none;
}
.main-sidebar .nav-sidebar .nav-link.active:not(.nav-group-title) .nav-icon {
    color: #2f43e0;
}
.main-sidebar .nav-sidebar .nav-link.active:not(.nav-group-title)::before {
    content: "";
    position: absolute;
    left: -1.2rem;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 1.1rem;
    border-radius: 0 3px 3px 0;
    background: #2f43e0;
}

/* Children sit indented under their label. Two signals separate a
   heading from a link, and both are needed: the heading has no icon
   and no indent; the link has both. */
.main-sidebar .nav-sidebar.nav-child-indent .nav-treeview {
    padding-left: .45rem;
}
.main-sidebar .nav-treeview > .nav-item > .nav-link {
    padding-left: .5rem;
}
.main-sidebar .nav-icon-dot {
    font-size: .35rem;
}

/* Signed-in user, pinned to the foot of the rail. */
.main-sidebar .sidebar-user {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4.5rem;
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .85rem 1rem;
    border-top: 1px solid #eceef3;
    background: #fff;
}
.main-sidebar .sidebar-user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 50%;
    background: #1b2030;
    color: #fff;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .02em;
    flex-shrink: 0;
}
.main-sidebar .sidebar-user-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1 1 auto;
}
.main-sidebar .sidebar-user-name {
    color: #10131c;
    font-weight: 600;
    font-size: .825rem;
    line-height: 1.2;
}
.main-sidebar .sidebar-user-email {
    color: #98a0af;
    font-size: .72rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.main-sidebar .sidebar-user-action {
    color: #98a0af;
    padding: .35rem;
    border-radius: .4rem;
    flex-shrink: 0;
}
.main-sidebar .sidebar-user-action:hover {
    color: #2f43e0;
    background: #f4f6fb;
}

/* Keyboard focus must stay visible on a light shell. */
.main-sidebar .nav-sidebar .nav-link:focus-visible,
.main-sidebar .sidebar-user-action:focus-visible,
.main-sidebar .sidebar-cta .btn:focus-visible {
    outline: 2px solid #2f43e0;
    outline-offset: 1px;
}

/* Content area */
.content-wrapper {
    background: #f4f5f9;
}
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(20, 20, 40, .06), 0 6px 16px rgba(20, 20, 40, .05);
}
.card-header {
    background: transparent;
    border-bottom: 1px solid #eef0f5;
    border-top-left-radius: 12px !important;
    border-top-right-radius: 12px !important;
}

/* Stat box (used by the <x-stat-box> component) */
.stat-box {
    position: relative;
    overflow: hidden;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(20, 20, 40, .06), 0 6px 16px rgba(20, 20, 40, .05);
    padding: 20px;
    margin-bottom: 20px;
}
.stat-box .stat-icon {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #fff;
}
.stat-box .stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #1f2333;
}
.stat-box .stat-label {
    font-size: 13px;
    color: #6b7280;
    margin-top: 2px;
}
.stat-box .stat-sublabel {
    font-size: 12px;
    color: #9aa1b1;
    margin-top: 6px;
}
.stat-box .stat-progress {
    margin-top: 12px;
    height: 4px;
    border-radius: 2px;
    background: #eceef4;
    overflow: hidden;
}
.stat-box .stat-progress span {
    display: block;
    height: 100%;
}

.stat-box.stat-primary .stat-icon { background: #6366f1; }
.stat-box.stat-primary .stat-progress span { background: #6366f1; }
.stat-box.stat-success .stat-icon { background: #22c55e; }
.stat-box.stat-success .stat-progress span { background: #22c55e; }
.stat-box.stat-warning .stat-icon { background: #f59e0b; }
.stat-box.stat-warning .stat-progress span { background: #f59e0b; }
.stat-box.stat-danger .stat-icon { background: #ef4444; }
.stat-box.stat-danger .stat-progress span { background: #ef4444; }

/* ── Compliance status badges ──────────────────────────────
   Ported from propertyxhub resources/views/owner/safety/_styles.blade.php
   Self-contained: no Bootstrap variables, safe across BS4/BS5.
   ───────────────────────────────────────────────────────── */
.safety-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    border: 1px solid transparent;
}
.safety-badge-ok        { background:#ecfdf5; color:#047857; border-color:#a7f3d0; }
.safety-badge-due-soon  { background:#fffbeb; color:#b45309; border-color:#fcd34d; }
.safety-badge-overdue   { background:#fef2f2; color:#b91c1c; border-color:#fecaca; }
.safety-badge-expired   { background:#1f2937; color:#fff;   border-color:#1f2937; }

/* === EPC band chip ===================================================== */
.epc-band-chip {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    letter-spacing: 0.02em;
    box-shadow: 0 1px 2px rgba(15,23,42,0.12);
}

.safety-badge-missing {
    /* Reuse the overdue palette: a missing statutory certificate is at
       least as serious as an expired one. */
    background: #fef2f2;
    color: #b91c1c;
    border: 1px dashed #fecaca;
}

/* ── Auth screens ──────────────────────────────────────────────
   Two panes. Left: the form, and nothing competing with it.
   Right: what the product is for, in its own vocabulary.

   The right pane reuses .safety-badge from the compliance module
   above — the login shows the same status language the dashboard
   does, so the vocabulary is learned before you even sign in.
   ───────────────────────────────────────────────────────────── */

/* These pages deliberately do NOT load AdminLTE/Bootstrap, so they do not
   inherit Bootstrap's global border-box reset either. Without this, an
   input at width:100% adds its padding and border on top and overflows
   its column — 3px of horizontal scroll on a phone. */
.auth-body,
.auth-body *,
.auth-body *::before,
.auth-body *::after {
    box-sizing: border-box;
}

.auth-body {
    margin: 0;
    font-family: 'Inter', -apple-system, "Segoe UI", Roboto, sans-serif;
    color: #10131c;
    background: #fff;
    -webkit-font-smoothing: antialiased;
}

.auth-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    min-height: 100vh;
}

/* Left — the form */
.auth-pane {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2.5rem clamp(1.5rem, 5vw, 4.5rem);
}
.auth-form {
    width: 100%;
    max-width: 23rem;
    margin: auto;
    padding: 2rem 0;
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: .65rem;
    margin-bottom: 2.5rem;
    text-decoration: none;
}
.auth-brand-text {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -.01em;
    color: #10131c;
}

.auth-heading {
    margin: 0 0 .4rem;
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -.02em;
    color: #10131c;
}
.auth-lede {
    margin: 0 0 1.85rem;
    font-size: .875rem;
    line-height: 1.5;
    color: #6b7280;
}

.auth-field {
    margin-bottom: 1.05rem;
}
.auth-field label {
    display: block;
    margin-bottom: .35rem;
    font-size: .8rem;
    font-weight: 600;
    color: #374151;
}
.auth-label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}
.auth-label-row label { margin-bottom: .35rem; }

.auth-input {
    width: 100%;
    padding: .65rem .8rem;
    font-size: .9rem;
    font-family: inherit;
    color: #10131c;
    background: #fff;
    border: 1px solid #dfe3ea;
    border-radius: .55rem;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.auth-input::placeholder { color: #aeb4c0; }
.auth-input:hover { border-color: #c8cedb; }
.auth-input:focus {
    outline: none;
    border-color: #2f43e0;
    box-shadow: 0 0 0 3px rgba(47, 67, 224, .13);
}
.auth-input.has-error {
    border-color: #d92d20;
}
.auth-input.has-error:focus {
    box-shadow: 0 0 0 3px rgba(217, 45, 32, .12);
}

/* Errors say what happened. They do not apologise. */
.auth-error {
    margin: .35rem 0 0;
    font-size: .78rem;
    color: #b42318;
}
.auth-hint {
    margin: .35rem 0 0;
    font-size: .75rem;
    color: #9aa2b1;
}

.auth-check {
    display: flex;
    align-items: center;
    gap: .5rem;
    min-height: 2.75rem;
    margin: .3rem 0 .9rem;
    font-size: .84rem;
    color: #454c5c;
    cursor: pointer;
    user-select: none;
}
.auth-check input {
    width: 1.05rem;
    height: 1.05rem;
    accent-color: #2f43e0;
    cursor: pointer;
}

.auth-submit {
    width: 100%;
    min-height: 2.75rem;
    padding: .7rem 1rem;
    font-family: inherit;
    font-size: .9rem;
    font-weight: 600;
    color: #fff;
    background: #2f43e0;
    border: 1px solid #2f43e0;
    border-radius: .55rem;
    cursor: pointer;
    transition: background .15s ease;
}
.auth-submit:hover { background: #2536c4; border-color: #2536c4; }
.auth-submit:active { background: #1f2ea8; }

.auth-link-sm {
    font-size: .78rem;
    font-weight: 500;
    color: #2f43e0;
    text-decoration: none;
}
.auth-link-sm:hover { text-decoration: underline; }

.auth-foot {
    margin: 1.5rem 0 0;
    font-size: .85rem;
    color: #6b7280;
    text-align: center;
}
.auth-foot a, .auth-body-text a {
    color: #2f43e0;
    font-weight: 600;
    text-decoration: none;
}
.auth-foot a:hover, .auth-body-text a:hover { text-decoration: underline; }

.auth-body-text {
    margin: 0 0 1.25rem;
    font-size: .875rem;
    line-height: 1.5;
    color: #454c5c;
}

.auth-note {
    margin: 0 0 1.25rem;
    padding: .7rem .85rem;
    font-size: .82rem;
    border-radius: .55rem;
}
.auth-note-ok {
    color: #05603a;
    background: #ecfdf3;
    border: 1px solid #abefc6;
}

.auth-legal {
    font-size: .74rem;
    color: #aeb4c0;
}

/* Right — the claim */
.auth-aside {
    position: relative;
    display: flex;
    align-items: center;
    padding: clamp(2rem, 5vw, 4.5rem);
    background: #10131c;
    overflow: hidden;
}
/* One quiet light source, off the top-right. Nothing else. */
.auth-aside::before {
    content: "";
    position: absolute;
    top: -30%;
    right: -20%;
    width: 70%;
    height: 90%;
    background: radial-gradient(circle, rgba(47, 67, 224, .5) 0%, transparent 68%);
    pointer-events: none;
}
.auth-aside-inner {
    position: relative;
    max-width: 30rem;
}

.auth-claim {
    margin: 0 0 1.15rem;
    font-size: clamp(1.9rem, 3.1vw, 2.6rem);
    font-weight: 700;
    line-height: 1.14;
    letter-spacing: -.028em;
    color: #fff;
}
.auth-sub {
    margin: 0 0 2.5rem;
    max-width: 26rem;
    font-size: .9rem;
    line-height: 1.6;
    color: #9096a8;
}

.auth-ledger {
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid rgba(255, 255, 255, .08);
}
.auth-ledger li {
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: .8rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.auth-code {
    flex-shrink: 0;
    width: 3.4rem;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .04em;
    color: #fff;
}
.auth-cert {
    flex: 1 1 auto;
    font-size: .8rem;
    color: #7d8496;
}
.auth-ledger .safety-badge {
    flex-shrink: 0;
}

/* One column on small screens. The claim is the first thing to go —
   someone on a phone is signing in, not being sold to. */
@media (max-width: 900px) {
    .auth-split { grid-template-columns: 1fr; }
    .auth-aside { display: none; }
    .auth-pane { min-height: 100vh; }
}

/* Quality floor */
.auth-body a:focus-visible,
.auth-submit:focus-visible,
.auth-check input:focus-visible {
    outline: 2px solid #2f43e0;
    outline-offset: 2px;
    border-radius: .3rem;
}
@media (prefers-reduced-motion: reduce) {
    .auth-input, .auth-submit { transition: none; }
}
