/* SpeedTex Stage One Back Office visual system - v0.31.0 */
:root {
    --blue: #1266b1;
    --blue-dark: #0b3f73;
    --blue-deep: #082f57;
    --blue-soft: #eaf4fc;
    --green: #2c9b5a;
    --green-dark: #17663a;
    --green-soft: #eaf7ef;
    --ink: #152338;
    --muted: #607086;
    --line: #d9e3ed;
    --line-strong: #c5d3e0;
    --panel: #ffffff;
    --canvas: #f3f7fa;
    --danger: #b42318;
    --warning: #a86100;
    --shadow-sm: 0 2px 8px rgba(10, 48, 84, .06);
    --shadow-md: 0 14px 38px rgba(10, 48, 84, .09);
    --radius-sm: .65rem;
    --radius-md: .95rem;
    --radius-lg: 1.25rem;
}

html { background: var(--canvas); }
body {
    min-width: 320px;
    color: var(--ink);
    background:
        radial-gradient(circle at 100% 0, rgba(18, 102, 177, .055), transparent 26rem),
        var(--canvas);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

::selection { color: #fff; background: var(--blue); }
a { transition: color .16s ease, background .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
h1, h2, h3 { color: var(--ink); line-height: 1.18; letter-spacing: -.025em; }
h1 { font-size: clamp(1.75rem, 2vw, 2.35rem); }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { line-height: 1.62; }

/* Application shell */
.speedtex-shell { grid-template-columns: 18rem minmax(0, 1fr); }
.speedtex-shell > aside {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    padding: 1.35rem 1.1rem 1.15rem;
    border-right: 1px solid rgba(255, 255, 255, .08);
    background:
        radial-gradient(circle at 20% 0, rgba(54, 167, 101, .18), transparent 15rem),
        linear-gradient(165deg, #0a477e 0%, #082e53 58%, #072744 100%);
    box-shadow: 10px 0 35px rgba(8, 40, 72, .08);
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.28) transparent;
    z-index: 20;
}

.speedtex-shell aside .speedtex-brand {
    width: 100%;
    height: 3.65rem;
    padding: .55rem .7rem;
    border: 1px solid rgba(255,255,255,.8);
    border-radius: .9rem;
    background-color: #fff;
    background-size: calc(100% - 1.35rem) auto;
    box-shadow: 0 10px 28px rgba(0, 22, 44, .18);
}

.speedtex-shell aside .speedtex-eyebrow {
    margin: 1rem .55rem .15rem;
    color: #9ce7b8;
    font-size: .69rem;
    letter-spacing: .14em;
}

.speedtex-shell nav {
    gap: .22rem;
    margin-top: .85rem;
}

.speedtex-shell nav a,
.speedtex-shell nav span,
.speedtex-logout {
    position: relative;
    min-height: 2.55rem;
    padding: .65rem .75rem .65rem 2.35rem;
    border: 1px solid transparent;
    border-radius: .7rem;
    color: #dbeaf8;
    font-size: .91rem;
    font-weight: 650;
}

.speedtex-shell nav a::before,
.speedtex-logout::before {
    position: absolute;
    left: .82rem;
    top: 50%;
    width: .58rem;
    height: .58rem;
    border: 2px solid #75b4e6;
    border-radius: .2rem;
    content: "";
    transform: translateY(-50%) rotate(45deg);
    opacity: .78;
}

.speedtex-shell nav a:hover {
    border-color: rgba(255,255,255,.1);
    background: rgba(255,255,255,.075);
    color: #fff;
    transform: translateX(2px);
}

.speedtex-shell nav a.active {
    border-color: rgba(255,255,255,.12);
    color: #fff;
    background: linear-gradient(100deg, rgba(47, 157, 91, .95), rgba(25, 126, 178, .9));
    box-shadow: 0 8px 22px rgba(0, 25, 52, .22);
}
.speedtex-shell nav a.active::before { border-color: #fff; background: rgba(255,255,255,.2); opacity: 1; }

.speedtex-logout {
    margin-top: 1.25rem;
    border-color: rgba(255,255,255,.1);
    color: #dcecf9;
    background: rgba(0,0,0,.12);
}
.speedtex-logout::before { border-radius: 50%; border-color: #91b9d9; }
.speedtex-logout:hover { color: #fff; background: rgba(180,35,24,.22); }

.speedtex-shell > main {
    width: 100%;
    max-width: 112rem;
    min-width: 0;
    padding: 2rem clamp(1.15rem, 3vw, 3.25rem) 4rem;
}

.speedtex-shell > main > header {
    position: relative;
    min-height: 4.3rem;
    margin: -.2rem 0 1.65rem;
    padding: .35rem 0 1.1rem;
    border-bottom: 1px solid var(--line);
}
.speedtex-shell > main > header::after {
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 5.5rem;
    height: 3px;
    border-radius: 999px;
    content: "";
    background: linear-gradient(90deg, var(--blue), var(--green));
}
.speedtex-shell header .speedtex-eyebrow { margin-top: 0; }
.speedtex-shell header h1 { margin: 0; }
.speedtex-user {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    padding: .5rem .78rem .5rem .55rem;
    border-color: var(--line-strong);
    color: #314258;
    box-shadow: var(--shadow-sm);
    font-size: .88rem;
    font-weight: 700;
}
.speedtex-user::before {
    display: grid;
    place-items: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(135deg, var(--blue), var(--green));
    content: "S";
    font-size: .72rem;
    font-weight: 900;
}

/* Dashboard */
.speedtex-dashboard-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(18rem, .8fr);
    gap: 1.25rem;
    align-items: center;
    margin-bottom: 1.25rem;
    padding: clamp(1.25rem, 2.4vw, 2rem);
    overflow: hidden;
    border: 1px solid #cfe1ef;
    border-radius: var(--radius-lg);
    background:
        radial-gradient(circle at 92% 15%, rgba(44,155,90,.19), transparent 15rem),
        linear-gradient(125deg, #ffffff 0%, #edf7fe 100%);
    box-shadow: var(--shadow-md);
}
.speedtex-dashboard-hero h2 { margin: 0 0 .45rem; font-size: clamp(1.35rem, 2vw, 1.8rem); }
.speedtex-dashboard-hero p { max-width: 48rem; margin: 0; }
.speedtex-dashboard-hero-actions { display: flex; flex-wrap: wrap; gap: .65rem; justify-content: flex-end; }
.speedtex-dashboard-hero-actions a,
.speedtex-quick-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.7rem;
    padding: .68rem .9rem;
    border: 1px solid var(--line-strong);
    border-radius: .72rem;
    color: var(--blue-dark);
    background: #fff;
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    font-weight: 800;
}
.speedtex-dashboard-hero-actions a:first-child { border-color: var(--blue); color: #fff; background: var(--blue); }
.speedtex-dashboard-hero-actions a:hover,
.speedtex-quick-actions a:hover { border-color: var(--blue); transform: translateY(-2px); box-shadow: 0 9px 20px rgba(18,102,177,.12); }

.speedtex-metrics { gap: .9rem; }
.speedtex-metrics article,
.speedtex-work-order-summary article {
    position: relative;
    overflow: hidden;
    min-height: 7.2rem;
    padding: 1.1rem 1.15rem 1rem;
    border-color: #d8e4ee;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}
.speedtex-metrics article::before,
.speedtex-work-order-summary article::before {
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    content: "";
    background: var(--blue);
}
.speedtex-metrics article:nth-child(2)::before { background: #7c5dc7; }
.speedtex-metrics article:nth-child(3)::before { background: var(--warning); }
.speedtex-metrics article:nth-child(4)::before { background: var(--danger); }
.speedtex-metrics strong { font-size: 2rem; line-height: 1; }
.speedtex-metrics span { max-width: 11rem; font-size: .86rem; font-weight: 650; }

.speedtex-quick-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .75rem;
    margin-top: 1rem;
}
.speedtex-quick-actions a { justify-content: flex-start; min-height: 3.7rem; padding: .85rem 1rem; }

.speedtex-capability-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .7rem;
    padding: 0;
    list-style: none;
}
.speedtex-capability-grid li {
    position: relative;
    margin: 0;
    padding: .8rem .9rem .8rem 2.55rem;
    border: 1px solid #dbe8e0;
    border-radius: .72rem;
    color: #2b4936;
    background: #f4fbf6;
}
.speedtex-capability-grid li::before {
    position: absolute;
    left: .9rem;
    top: .83rem;
    display: grid;
    place-items: center;
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 50%;
    color: #fff;
    background: var(--green);
    content: "✓";
    font-size: .72rem;
    font-weight: 900;
}

/* Panels and data */
.speedtex-panel {
    padding: clamp(1.05rem, 1.7vw, 1.45rem);
    border-color: #d8e3ed;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}
.speedtex-panel:hover { border-color: #c9d9e7; }
.speedtex-panel h2 { margin-bottom: .35rem; }
.speedtex-panel-head { align-items: flex-start; gap: 1rem; }
.speedtex-table-wrap {
    margin-top: .75rem;
    border: 1px solid var(--line);
    border-radius: .8rem;
    background: #fff;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.75);
}
table { border-collapse: separate; border-spacing: 0; }
th {
    padding: .72rem .78rem;
    border-bottom-color: #ccdae6;
    color: #496076;
    background: #edf4f9;
    font-size: .7rem;
    font-weight: 850;
    letter-spacing: .065em;
}
td { padding: .78rem; border-bottom-color: #e4ebf1; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #f8fbfd; }
td a { color: var(--blue-dark); font-weight: 750; text-decoration-thickness: 1px; text-underline-offset: 2px; }

.speedtex-device-card,
.speedtex-stock-grid article,
.speedtex-action-columns form,
.speedtex-register-actions > form,
.speedtex-zone-card {
    border-color: #d8e4ed;
    border-radius: .85rem;
    background: linear-gradient(145deg, #fff, #f7fafc);
    box-shadow: var(--shadow-sm);
}
.speedtex-record-list li { padding: .85rem; border: 1px solid var(--line); border-radius: .72rem; background: #fbfdff; }

/* Forms and actions */
label { color: #2a3b50; font-size: .91rem; }
input[type="text"],
input[type="password"],
input[type="email"],
input[type="search"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
input[type="file"],
select,
textarea {
    min-height: 2.85rem;
    border-color: #b8c9d8 !important;
    border-radius: .67rem !important;
    color: var(--ink);
    background-color: #fff;
    box-shadow: inset 0 1px 2px rgba(12, 47, 79, .04);
}
textarea { min-height: 6.5rem; }
input:hover, select:hover, textarea:hover { border-color: #8fa9bf !important; }
input:focus, select:focus, textarea:focus {
    border-color: var(--blue) !important;
    outline: 3px solid rgba(18, 102, 177, .14) !important;
    box-shadow: 0 0 0 1px rgba(18,102,177,.06);
}

button,
.button,
.speedtex-link-button,
.speedtex-secondary-link {
    min-height: 2.75rem;
    border-radius: .7rem;
    box-shadow: 0 5px 14px rgba(11, 63, 115, .1);
}
.speedtex-shell button { width: auto; padding: .74rem 1rem; }
button:hover, .button:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(11,63,115,.16); }
.speedtex-secondary-button,
.speedtex-secondary-link { border-color: #c9d7e3; color: #334b62; background: #edf3f7; box-shadow: none; }
.speedtex-danger-button { background: var(--danger); }

.speedtex-notice,
.speedtex-alert,
.speedtex-readiness {
    border-radius: .72rem;
    box-shadow: var(--shadow-sm);
}
.speedtex-status-pill,
.speedtex-queue-status,
.speedtex-priority,
.speedtex-zone-state,
.speedtex-check-status {
    border: 1px solid rgba(0,0,0,.055);
    letter-spacing: .01em;
}

/* Login and customer-facing status */
.speedtex-tbo-login {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 10% 0, rgba(38, 135, 201, .2), transparent 28rem),
        radial-gradient(circle at 100% 100%, rgba(44, 155, 90, .19), transparent 28rem),
        linear-gradient(145deg, #eef6fb, #f7fbf8);
}
.speedtex-tbo-login::before {
    position: fixed;
    inset: 0;
    pointer-events: none;
    content: "";
    opacity: .34;
    background-image: linear-gradient(rgba(18,102,177,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(18,102,177,.045) 1px, transparent 1px);
    background-size: 32px 32px;
}
.speedtex-login-card {
    position: relative;
    width: min(100%, 30rem);
    padding: clamp(1.6rem, 5vw, 2.75rem);
    border-color: rgba(182, 204, 221, .85);
    border-radius: 1.35rem;
    box-shadow: 0 28px 80px rgba(9, 48, 83, .16);
}
.speedtex-login-card::after {
    position: absolute;
    inset: 0 0 auto;
    height: 5px;
    border-radius: 1.35rem 1.35rem 0 0;
    content: "";
    background: linear-gradient(90deg, var(--blue), var(--green));
}
.speedtex-login-card .speedtex-brand { width: 13.5rem; height: 3.4rem; margin-bottom: 1.25rem; }
.speedtex-login-card button { width: 100%; }
.speedtex-status-card { border-radius: 1.2rem; box-shadow: var(--shadow-md); }

/* Dense operational groups */
.speedtex-financial-summary span,
.speedtex-pos-totals span,
.speedtex-import-summary span,
.speedtex-location-chips span {
    border-color: #d5e2ed;
    background: linear-gradient(145deg, #fff, #f2f7fb);
    box-shadow: var(--shadow-sm);
}
.speedtex-financial-summary strong,
.speedtex-pos-totals strong { color: var(--blue-dark); }

@media (max-width: 1180px) {
    .speedtex-shell { grid-template-columns: 15.5rem minmax(0, 1fr); }
    .speedtex-quick-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .speedtex-dashboard-hero { grid-template-columns: 1fr; }
    .speedtex-dashboard-hero-actions { justify-content: flex-start; }
}

@media (max-width: 900px) {
    .speedtex-shell { display: block; }
    .speedtex-shell > aside {
        position: relative;
        height: auto;
        padding: 1rem;
        overflow: visible;
    }
    .speedtex-shell aside .speedtex-brand { width: 13rem; height: 3.1rem; }
    .speedtex-shell aside .speedtex-eyebrow { position: absolute; left: 14.7rem; top: 1.35rem; margin: 0; }
    .speedtex-shell nav {
        display: flex;
        gap: .4rem;
        margin-top: .85rem;
        padding-bottom: .25rem;
        overflow-x: auto;
        scrollbar-width: thin;
    }
    .speedtex-shell nav a,
    .speedtex-shell nav span { flex: 0 0 auto; min-height: 2.35rem; padding: .55rem .75rem .55rem 2.15rem; white-space: nowrap; }
    .speedtex-logout { position: absolute; top: 1.1rem; right: 1rem; margin: 0; }
    .speedtex-shell > main { padding-top: 1.35rem; }
    .speedtex-shell > main > header { min-height: 3.9rem; }
}

@media (max-width: 650px) {
    .speedtex-shell aside .speedtex-eyebrow { display: none; }
    .speedtex-shell aside .speedtex-brand { width: 10.5rem; }
    .speedtex-logout { min-height: 2.45rem; padding-left: 2.15rem; font-size: .82rem; }
    .speedtex-shell > main { padding: 1.1rem .85rem 3rem; }
    .speedtex-shell > main > header { align-items: flex-start; margin-bottom: 1.15rem; }
    .speedtex-dashboard-hero { padding: 1.15rem; }
    .speedtex-dashboard-hero-actions { display: grid; grid-template-columns: 1fr; }
    .speedtex-quick-actions,
    .speedtex-capability-grid { grid-template-columns: 1fr; }
    .speedtex-panel { padding: 1rem; }
    .speedtex-table-wrap { margin-inline: -.25rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

@media print {
    .speedtex-shell { display: block; }
    .speedtex-shell > aside,
    .speedtex-shell > main > header,
    .speedtex-dashboard-hero-actions,
    .speedtex-quick-actions { display: none !important; }
    .speedtex-shell > main { max-width: none; padding: 0; }
    .speedtex-panel, .speedtex-table-wrap { box-shadow: none; }
}
