:root {
    --bg: #f4f7fb;
    --panel: #ffffff;
    --panel-soft: #f8fafc;
    --text: #172033;
    --muted: #667085;
    --line: #e4e9f1;
    --primary: #0f766e;
    --primary-dark: #115e59;
    --danger: #b42318;
    --warning: #b54708;
    --shadow: 0 18px 45px rgba(17, 24, 39, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(15, 118, 110, 0.10), transparent 28rem),
        linear-gradient(180deg, #f8fbff 0%, var(--bg) 52%, #eef3f8 100%);
}

a {
    color: var(--primary);
    text-decoration: none;
}

.track-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.track-panel,
.summary,
.details,
.timeline,
.approval,
.top-search,
.notice,
.data-panel,
.dashboard-hero,
.metric-card,
.admin-card {
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.track-panel {
    width: min(720px, 100%);
    padding: 42px;
}

.dashboard-shell,
.page {
    width: min(1280px, 100%);
    margin: 0 auto;
    padding: 28px;
}

.page.wide {
    width: min(1280px, 100%);
}

.dashboard-hero {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: flex-start;
    padding: 28px;
    margin-bottom: 18px;
}

.hero-copy h1 {
    font-size: clamp(28px, 3vw, 42px);
    line-height: 1.05;
    margin: 0;
}

.hero-copy p {
    max-width: 760px;
    color: var(--muted);
    margin: 10px 0 0;
}

.eyebrow {
    margin: 0 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 12px;
    color: var(--primary-dark);
    font-weight: 800;
}

h1,
h2 {
    margin: 0;
    letter-spacing: 0;
}

h2 {
    font-size: 20px;
}

.license-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
    color: var(--muted);
}

.license-strip span {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 11px;
    border-radius: 999px;
    background: var(--panel-soft);
    border: 1px solid var(--line);
    font-size: 13px;
    font-weight: 700;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.metric-card {
    padding: 18px;
}

.metric-card span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.metric-card strong {
    display: block;
    margin-top: 8px;
    font-size: 34px;
    line-height: 1;
}

.filter-bar,
.top-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px auto;
    gap: 10px;
    padding: 14px;
    margin-bottom: 18px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.track-form {
    margin-top: 28px;
}

label {
    display: block;
    margin-bottom: 7px;
    color: #344054;
    font-size: 13px;
    font-weight: 800;
}

input,
select {
    width: 100%;
    min-width: 0;
    height: 42px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 0 12px;
    font-size: 14px;
    color: var(--text);
    background: #fff;
    outline: none;
}

input:focus,
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

button,
.link-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border: 0;
    border-radius: 8px;
    padding: 0 16px;
    background: var(--primary);
    color: #fff;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
}

button:hover,
.link-button:hover {
    background: var(--primary-dark);
}

.link-button.ghost {
    background: #172033;
}

.data-panel {
    overflow-x: auto;
    margin-bottom: 18px;
    padding: 18px;
}

.panel-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 14px;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

th,
td {
    padding: 14px 12px;
    text-align: left;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

th {
    background: #f8fafc;
    color: #475467;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 900;
}

tbody tr:hover {
    background: #fbfdfc;
}

td {
    font-size: 14px;
}

td span,
.muted {
    color: var(--muted);
    font-size: 13px;
}

.tracking-link {
    display: inline-flex;
    padding: 5px 8px;
    border-radius: 8px;
    background: #ecfdf3;
    color: var(--primary-dark);
    font-weight: 900;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 9px;
    border-radius: 999px;
    background: #eef4ff;
    color: #3538cd;
    font-size: 12px;
    font-weight: 900;
}

.badge-ok {
    background: #ecfdf3;
    color: #027a48;
}

.badge-danger {
    background: #fef3f2;
    color: var(--danger);
}

.badge-soft {
    background: #fff7ed;
    color: var(--warning);
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.admin-card {
    padding: 20px;
}

.admin-card h2 {
    margin-bottom: 16px;
}

.admin-card input,
.admin-card select {
    margin-bottom: 12px;
}

.inline-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.inline-form select {
    min-width: 130px;
}

.inline-form button {
    min-height: 36px;
}

.summary {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 24px;
    margin-bottom: 16px;
}

.summary p,
.approval p,
.timeline p {
    color: var(--muted);
}

.status-card {
    min-width: 220px;
    border-left: 4px solid var(--primary);
    padding-left: 16px;
}

.status-card span,
.details span,
.timeline span {
    display: block;
    color: var(--muted);
    font-size: 13px;
}

.status-card strong {
    display: block;
    margin-top: 6px;
    font-size: 22px;
}

.details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    overflow: hidden;
    margin-bottom: 16px;
}

.details div {
    padding: 16px;
    background: #fff;
}

.details strong {
    display: block;
    margin-top: 5px;
}

.timeline,
.approval {
    padding: 24px;
    margin-bottom: 16px;
}

.approval {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
}

.approval form {
    display: flex;
    gap: 10px;
}

button.secondary {
    background: var(--danger);
}

.timeline article {
    border-left: 3px solid #cbd5df;
    padding: 0 0 18px 14px;
    margin-top: 18px;
}

.notice {
    padding: 16px;
}

.notice.compact {
    display: inline-flex;
    padding: 8px 12px;
    margin-top: 14px;
}

.error {
    border-color: #fecaca;
    color: var(--danger);
}

.success {
    border-color: #a7f3d0;
    color: #027a48;
    margin-bottom: 16px;
}

.customer-page {
    background:
        radial-gradient(circle at 16% 12%, rgba(15, 118, 110, 0.16), transparent 28rem),
        linear-gradient(135deg, #f8fafc 0%, #eef6f5 52%, #f8fafc 100%);
}

.customer-hero {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.customer-card,
.customer-job-hero,
.info-tile,
.customer-action-panel,
.customer-timeline,
.workshop-contact {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow);
}

.customer-card {
    width: min(760px, 100%);
    padding: clamp(28px, 6vw, 56px);
}

.customer-card h1 {
    max-width: 620px;
    margin-top: 10px;
    font-size: clamp(34px, 6vw, 58px);
    line-height: 1;
}

.customer-card p {
    max-width: 600px;
    margin: 18px 0 0;
    color: var(--muted);
    font-size: 18px;
}

.customer-mark {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    background: #ecfdf3;
    color: var(--primary-dark);
    font-size: 13px;
    font-weight: 900;
}

.tracking-search {
    margin-top: 30px;
}

.tracking-search.compact {
    margin-top: 0;
}

.btn-autosop {
    background: var(--primary);
    color: #fff;
    font-weight: 800;
}

.btn-autosop:hover {
    background: var(--primary-dark);
    color: #fff;
}

.customer-dashboard {
    max-width: 1120px;
}

.customer-job-hero {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    gap: 20px;
    padding: 24px;
}

.brand-block {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.brand-block img,
.brand-initial {
    width: 64px;
    height: 64px;
    border-radius: 14px;
    object-fit: cover;
    flex: 0 0 auto;
}

.brand-initial {
    display: grid;
    place-items: center;
    background: #ecfdf3;
    color: var(--primary-dark);
    font-size: 28px;
    font-weight: 900;
}

.brand-block h1 {
    margin-top: 10px;
    font-size: clamp(26px, 4vw, 42px);
}

.brand-block p {
    max-width: 720px;
    margin: 10px 0 0;
    color: var(--muted);
}

.status-tile {
    min-width: 260px;
    border-radius: 12px;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary), #0b4f4a);
    color: #fff;
}

.status-tile span,
.info-tile span {
    display: block;
    font-size: 13px;
    font-weight: 800;
    opacity: 0.78;
}

.status-tile strong {
    display: block;
    margin-top: 8px;
    font-size: 28px;
    line-height: 1.08;
}

.info-tile {
    height: 100%;
    padding: 16px;
}

.info-tile strong {
    display: block;
    margin-top: 7px;
    word-break: break-word;
}

.customer-action-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding: 22px;
}

.customer-action-panel h2,
.customer-timeline h2,
.workshop-contact h2 {
    font-size: 20px;
}

.customer-action-panel p {
    margin: 8px 0 0;
    color: var(--muted);
    word-break: break-all;
}

.customer-action-panel.invoice {
    border-color: #a7f3d0;
}

.customer-timeline,
.workshop-contact {
    padding: 24px;
}

.customer-timeline article {
    position: relative;
    padding: 0 0 22px 28px;
    margin-top: 20px;
    border-left: 2px solid #d8e2ec;
}

.customer-timeline article::before {
    content: "";
    position: absolute;
    left: -7px;
    top: 0;
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: var(--primary);
    box-shadow: 0 0 0 4px #ecfdf3;
}

.customer-timeline time {
    display: block;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.customer-timeline strong {
    display: block;
    margin-top: 5px;
}

.customer-timeline p,
.workshop-contact p {
    margin: 6px 0 0;
    color: var(--muted);
}

@media (max-width: 920px) {
    .dashboard-hero,
    .customer-job-hero,
    .customer-action-panel,
    .summary,
    .approval,
    .approval form {
        flex-direction: column;
    }

    .metric-grid,
    .admin-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filter-bar,
    .top-search {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .dashboard-shell,
    .page {
        padding: 16px;
    }

    .metric-grid,
    .admin-grid,
    .details {
        grid-template-columns: 1fr;
    }

    button,
    .link-button {
        width: 100%;
    }
}
