:root {
    --ink: #17212b;
    --muted: #657383;
    --line: #dde5ea;
    --bg: #f5f7f9;
    --panel: #ffffff;
    --brand: #126c67;
    --brand-dark: #0d4f4b;
    --accent: #d97706;
    --danger: #b42318;
    --ok: #11845b;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--ink);
    background: var(--bg);
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
.shell { min-height: 100vh; display: grid; grid-template-columns: 260px 1fr; }
.sidebar {
    background: #102331;
    color: #f8fafc;
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.brand { display: flex; gap: 12px; align-items: center; min-width: 0; }
.brand div { min-width: 0; }
.brand strong {
    display: block;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: var(--brand);
    font-weight: 700;
}
.brand-logo {
    width: 48px;
    height: 48px;
    min-width: 48px;
    max-width: 48px;
    max-height: 48px;
    border-radius: 8px;
    object-fit: contain;
    background: #fff;
    padding: 4px;
    display: block;
}
.avatar {
    width: 44px;
    height: 44px;
    min-width: 44px;
    max-width: 44px;
    max-height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--line);
    background: #eef3f5;
}
.avatar.large {
    width: 92px;
    height: 92px;
    min-width: 92px;
    max-width: 92px;
    max-height: 92px;
}
.logo-preview {
    width: 180px;
    height: 90px;
    max-width: 180px;
    max-height: 90px;
    object-fit: contain;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px;
    display: block;
}
.login-logo {
    width: 180px !important;
    height: 90px !important;
    max-width: 180px !important;
    max-height: 90px !important;
    object-fit: contain !important;
    display: block !important;
    margin: 0 auto !important;
}
.login-logo-wrap {
    width: 100%;
    height: 100px;
    display: grid;
    place-items: center;
    margin-bottom: 16px;
    overflow: hidden;
}
.brand small { color: #a9b7c4; display: block; margin-top: 4px; }
nav { display: grid; gap: 6px; }
.mobile-menu-toggle { display: none; }
.mobile-menu-panel { display: contents; }
nav a, .logout {
    padding: 11px 12px;
    border-radius: 8px;
    color: #dce6ef;
}
nav a {
    display: flex;
    align-items: center;
    gap: 10px;
}
.nav-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: .9;
}
nav a.active, nav a:hover, .logout:hover { background: rgba(255,255,255,.11); color: #fff; }
.logout { margin-top: auto; }
.content { padding: 28px; min-width: 0; }
.topbar {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-bottom: 24px;
}
h1 { font-size: 28px; margin: 0 0 6px; letter-spacing: 0; }
h2 { font-size: 20px; margin: 0 0 14px; letter-spacing: 0; }
p { margin: 0; color: var(--muted); }
.top-actions, .actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.btn, button {
    border: 0;
    border-radius: 8px;
    padding: 10px 14px;
    background: var(--brand);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
}
.btn.secondary, button.secondary { background: #e8eef2; color: var(--ink); }
.btn.whatsapp-action {
    background: #e7f7ee;
    color: #137b45;
    border: 1px solid #bfe8ce;
}
.btn.compact, button.compact {
    min-height: 38px;
    padding: 8px 13px;
    border-radius: 7px;
    font-size: 13px;
}
.btn.warn { background: var(--accent); }
.btn.danger { background: var(--danger); }
.grid { display: grid; gap: 16px; }
.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 20px; }
.cash-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat, .panel, .card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
}
.stat strong { display: block; font-size: 28px; margin-bottom: 6px; }
.stat span { color: var(--muted); }
.stat-link {
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.stat-link:hover {
    transform: translateY(-1px);
    border-color: var(--brand);
    box-shadow: 0 12px 28px rgba(16,35,49,.08);
}
.tone-red { border-color: #fecaca; background: #fff1f2; }
.tone-red strong { color: #b42318; }
.tone-orange { border-color: #fed7aa; background: #fff7ed; }
.tone-orange strong { color: #c2410c; }
.tone-green { border-color: #bbf7d0; background: #f0fdf4; }
.tone-green strong, .badge.done { color: var(--ok); }
.tone-neutral { border-color: #cbd5e1; background: #f8fafc; }
.support-card { transition: transform .15s ease, border-color .15s ease; }
.support-card:hover { transform: translateY(-1px); border-color: var(--brand); }
.filters {
    display: grid;
    grid-template-columns: repeat(6, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}
.filter-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}
.job-count {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 8px 13px;
    margin-bottom: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--brand-dark);
    font-weight: 700;
}
label { display: grid; gap: 6px; font-weight: 700; font-size: 13px; color: #354453; }
input, select, textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 11px;
    font: inherit;
    background: #fff;
    color: var(--ink);
}
input:disabled, select:disabled, textarea:disabled {
    background: #eef3f5;
    color: #687684;
    cursor: not-allowed;
}
textarea { min-height: 96px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.full { grid-column: 1 / -1; }
.table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    overflow-y: visible;
    padding-bottom: 96px;
    margin-bottom: -96px;
}
table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: visible;
    table-layout: auto;
}
.print-only { display: none; }
th, td { padding: 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: #eef3f5; font-size: 13px; position: relative; }
tr:last-child td { border-bottom: 0; }
.jobs-table {
    table-layout: fixed;
    font-size: 12px;
}
.jobs-table th,
.jobs-table td {
    padding: 8px 7px;
    line-height: 1.25;
    overflow-wrap: anywhere;
    word-break: normal;
}
.jobs-table th:nth-child(1),
.jobs-table td:nth-child(1) { width: 3.5%; }
.jobs-table th:nth-child(2),
.jobs-table td:nth-child(2) { width: 6.5%; }
.jobs-table th:nth-child(3),
.jobs-table td:nth-child(3) { width: 7%; }
.jobs-table th:nth-child(4),
.jobs-table td:nth-child(4) { width: 8.5%; }
.jobs-table th:nth-child(5),
.jobs-table td:nth-child(5) { width: 5.5%; }
.jobs-table th:nth-child(6),
.jobs-table td:nth-child(6) { width: 5.5%; }
.jobs-table th:nth-child(7),
.jobs-table td:nth-child(7) { width: 6.5%; }
.jobs-table th:nth-child(8),
.jobs-table td:nth-child(8) { width: 6.5%; }
.jobs-table th:nth-child(9),
.jobs-table td:nth-child(9) { width: 5.5%; }
.jobs-table th:nth-child(10),
.jobs-table td:nth-child(10) { width: 5.5%; }
.jobs-table th:nth-child(11),
.jobs-table td:nth-child(11) { width: 6.5%; }
.jobs-table th:nth-child(12),
.jobs-table td:nth-child(12) { width: 8%; }
.jobs-table th:nth-child(13),
.jobs-table td:nth-child(13) { width: 5.5%; }
.jobs-table th:nth-child(14),
.jobs-table td:nth-child(14) { width: 7%; }
.jobs-table th:nth-child(15),
.jobs-table td:nth-child(15) { width: 11.5%; }
.jobs-table td.actions {
    display: table-cell;
    min-width: 82px;
}
.jobs-table .actions form {
    width: 100%;
    margin-top: 5px;
}
.jobs-table .actions form:first-of-type {
    margin-top: 5px;
}
.jobs-table .actions > .btn + .btn {
    margin-top: 5px;
}
.jobs-table .actions .btn,
.jobs-table .actions button {
    min-width: 0;
    min-height: 30px;
    padding: 6px 8px;
    font-size: 11px;
    border-radius: 6px;
    width: 100%;
    white-space: nowrap;
    word-break: keep-all;
    overflow-wrap: normal;
}
.jobs-table .th-filter {
    min-width: 0;
}
.jobs-table .th-filter summary {
    gap: 4px;
}
.route-form {
    display: grid;
    gap: 5px;
}
.route-form input {
    min-width: 0;
    padding: 7px 8px;
    font-size: 12px;
}
.route-form button {
    width: 100%;
}
.th-filter {
    position: relative;
    min-width: 120px;
}
.th-filter summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.th-filter summary::-webkit-details-marker { display: none; }
.th-filter summary::after {
    content: "v";
    color: var(--muted);
    font-size: 11px;
}
.th-filter[open] summary::after { content: "^"; }
.th-filter[open] { z-index: 3; }
.th-filter form,
.th-filter .th-filter-note {
    display: none;
}
.th-filter[open] form,
.th-filter[open] .th-filter-note {
    display: grid;
    position: absolute;
    top: 22px;
    left: 0;
    width: 220px;
    gap: 10px;
    padding: 12px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 14px 34px rgba(16,35,49,.16);
    z-index: 100;
}
.th-filter[open] form.align-right { left: auto; right: 0; }
.th-filter[open] label,
.th-filter[open] button {
    display: grid;
    position: relative;
    width: 100%;
    margin-top: 0;
    z-index: 1;
}
.th-filter-note {
    color: var(--muted);
    font-weight: 400;
}
.badge { display: inline-flex; border-radius: 999px; padding: 5px 9px; background: #edf7f5; color: var(--brand-dark); font-weight: 700; font-size: 12px; white-space: nowrap; }
.badge.urgent, span.badge.urgent { background: #fee2e2 !important; color: #b42318 !important; border: 1px solid #fecaca; }
.badge.waiting, span.badge.waiting { background: #ffedd5 !important; color: #c2410c !important; border: 1px solid #fed7aa; }
.badge.done, span.badge.done { background: #e7f6ef !important; color: var(--ok) !important; border: 1px solid #bbf7d0; }
.badge.cancel, span.badge.cancel { background: #fff0ef !important; color: var(--danger) !important; border: 1px solid #fecaca; }
.notice { padding: 12px 14px; border-radius: 8px; background: #fff7e6; border: 1px solid #f0d49d; margin-bottom: 16px; color: #5f3b00; }
.login-page {
    position: relative;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 54px;
    background:
        radial-gradient(circle at 12% 12%, rgba(18,108,103,.08), transparent 28%),
        radial-gradient(circle at 88% 8%, rgba(55,151,212,.08), transparent 24%),
        linear-gradient(135deg, #f8fbfd 0%, #eef6f8 48%, #f8fbfd 100%);
    overflow-x: hidden;
    overflow-y: auto;
}
.login-page::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        linear-gradient(135deg, rgba(255,255,255,.74), rgba(255,255,255,.28)),
        radial-gradient(circle at 50% 50%, rgba(18,108,103,.07), transparent 32%);
    pointer-events: none;
}
.login-dots {
    position: fixed;
    width: 180px;
    height: 130px;
    background-image: radial-gradient(circle, rgba(18,108,103,.25) 2px, transparent 2px);
    background-size: 16px 16px;
    opacity: .55;
    pointer-events: none;
}
.login-dots-top {
    top: 0;
    right: 26px;
}
.login-dots-bottom {
    left: 0;
    bottom: 0;
}
.login-box {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1480px;
    min-height: 760px;
    display: grid;
    grid-template-columns: minmax(0, 1.28fr) minmax(430px, .92fr);
    gap: 0;
    background: rgba(255,255,255,.78);
    border: 1px solid rgba(255,255,255,.95);
    border-radius: 34px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 28px 90px rgba(31,58,80,.14);
    backdrop-filter: blur(18px);
}
.login-main {
    position: relative;
    padding: 48px 56px;
    overflow: hidden;
}
.login-side {
    padding: 30px;
    background: rgba(255,255,255,.5);
    border-left: 1px solid rgba(226,235,241,.66);
    display: grid;
    gap: 18px;
    align-content: start;
}
.login-brand-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    color: #1b2740;
}
.login-brand-logo strong {
    font-size: 34px;
    font-style: italic;
    font-weight: 900;
    letter-spacing: .02em;
    line-height: 1;
}
.login-logo-bolt {
    width: 28px;
    height: 42px;
    background: linear-gradient(160deg, #159987, #0f766e);
    clip-path: polygon(44% 0, 100% 0, 64% 38%, 92% 38%, 24% 100%, 42% 52%, 8% 52%);
    display: block;
}
.login-box h1 {
    position: relative;
    z-index: 1;
    margin: 0 0 14px;
    max-width: 620px;
    font-size: clamp(34px, 3.25vw, 46px);
    line-height: 1.18;
    color: #1b2740;
}
.login-box h1 strong {
    color: var(--brand);
}
.login-main > p {
    position: relative;
    z-index: 1;
    max-width: 420px;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.65;
}
.login-kicker {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 58px;
    padding: 9px 14px;
    border-radius: 999px;
    background: rgba(18,108,103,.09);
    color: var(--brand);
    font-size: 13px;
    font-weight: 700;
}
.login-kicker svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.login-form {
    position: relative;
    z-index: 1;
    max-width: 520px;
    margin-top: 30px;
    gap: 16px;
}
.login-role-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    min-height: 54px;
    padding: 2px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255,255,255,.7);
    overflow: hidden;
}
.login-role-tabs label {
    display: block;
}
.login-role-tabs input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.login-role-tabs span {
    min-height: 50px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #4d5870;
    font-weight: 700;
    cursor: pointer;
}
.login-role-tabs input:checked + span {
    background: linear-gradient(135deg, #159987, var(--brand));
    border-color: var(--brand);
    color: #fff;
    box-shadow: 0 12px 26px rgba(18,108,103,.22);
}
.login-input-wrap {
    position: relative;
    display: block;
}
.field-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    width: 19px;
    height: 19px;
    transform: translateY(-50%);
    z-index: 1;
    fill: none;
    stroke: #8b96ad;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.login-input-wrap input {
    height: 52px;
    padding-left: 44px;
    border-color: #d8e1ea;
    box-shadow: 0 8px 24px rgba(31,58,80,.04);
}
.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    min-height: 32px;
    width: 34px;
    padding: 0;
    transform: translateY(-50%);
    background: transparent;
    color: #6f7b92;
    box-shadow: none;
}
.password-toggle svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.login-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    color: #64708a;
    font-size: 13px;
    font-weight: 400;
}
.remember-me {
    display: flex;
    grid-template-columns: none;
    align-items: center;
    gap: 8px;
    color: #64708a;
    font-weight: 400;
}
.remember-me input {
    width: 16px;
    height: 16px;
    padding: 0;
}
.login-form > button {
    min-height: 54px;
    margin-top: 8px;
    background: linear-gradient(135deg, #159987, var(--brand));
    box-shadow: 0 16px 34px rgba(18,108,103,.24);
}
.login-copy {
    position: absolute;
    left: 46px;
    bottom: 38px;
    color: #8490a4;
    font-size: 13px;
}
.demo-login-box {
    padding: 24px;
    border: 1px solid rgba(226,235,241,.9);
    border-radius: 24px;
    background: #fff;
    display: grid;
    gap: 14px;
    box-shadow: 0 18px 52px rgba(31,58,80,.08);
}
.login-side-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.login-side-head strong {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #1b2740;
    font-size: 18px;
}
.side-title-svg {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    fill: none;
    stroke: #1b2740;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.login-side-head span {
    padding: 7px 12px;
    border-radius: 999px;
    background: #edf7f5;
    color: var(--brand);
    font-size: 12px;
    font-weight: 700;
}
.demo-account {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
}
.demo-icon {
    grid-column: 1;
    grid-row: 1 / 3;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #ddf5f0;
    display: grid;
    place-items: center;
}
.demo-icon svg {
    width: 27px;
    height: 27px;
    fill: none;
    stroke: var(--brand);
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.demo-account span {
    grid-column: 2;
    grid-row: 1;
    align-self: end;
    color: #1b2740;
    font-size: 16px;
    font-weight: 800;
}
.demo-account small {
    color: #1b2740;
    word-break: break-word;
    font-size: 13px;
    font-weight: 700;
}
.demo-account code {
    color: #1b2740;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
    font-weight: 700;
}
.demo-copy-field {
    grid-column: 2;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 38px;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 5px 6px 5px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
}
.copy-demo {
    min-height: 34px;
    width: 38px;
    padding: 0;
    border: 1px solid #99d8d1;
    background: #fff;
    color: var(--brand);
    box-shadow: none;
}
.copy-demo svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.copy-demo.copied {
    background: #edf7f5;
}
.demo-login-box p,
.customer-login-box p {
    margin: 0;
    color: var(--muted);
    font-size: 15px;
    font-weight: 400;
    line-height: 1.55;
}
.customer-login-box {
    padding: 24px;
    border: 1px solid rgba(226,235,241,.9);
    border-radius: 24px;
    background: #fff;
    display: grid;
    gap: 14px;
    box-shadow: 0 18px 52px rgba(31,58,80,.08);
}
.customer-login-box form {
    gap: 12px;
}
.customer-login-box button.secondary {
    min-height: 50px;
    margin-top: 6px;
    background: linear-gradient(135deg, rgba(18,108,103,.08), rgba(18,108,103,.14));
    color: var(--brand);
    box-shadow: none;
}
.customer-track-page {
    min-height: 100vh;
    padding: 28px;
    background:
        linear-gradient(135deg, rgba(16,35,49,.96), rgba(18,108,103,.88)),
        url("landing/panel-gorunumu.jpg") center / cover fixed;
}
.customer-track-shell {
    width: min(980px, 100%);
    margin: 0 auto;
    display: grid;
    gap: 18px;
}
.tracking-hero {
    color: #fff;
    padding: 28px 0 8px;
}
.tracking-hero h1 {
    margin: 8px 0 10px;
    font-size: clamp(30px, 5vw, 54px);
    color: #fff;
}
.tracking-hero p {
    max-width: 680px;
    color: rgba(255,255,255,.78);
    line-height: 1.65;
}
.tracking-kicker {
    display: inline-flex;
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(217,119,6,.18);
    color: #fed7aa;
    border: 1px solid rgba(253,186,116,.38);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}
.tracking-card {
    background: rgba(255,255,255,.96);
    border: 1px solid rgba(255,255,255,.7);
    border-radius: 8px;
    padding: 18px;
    box-shadow: 0 18px 48px rgba(0,0,0,.18);
}
.tracking-form {
    grid-template-columns: 1fr 1fr auto;
    align-items: end;
}
.tracking-result-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}
.tracking-result-head span:first-child {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}
.tracking-result-head h2 {
    margin-bottom: 0;
}
.tracking-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}
.tracking-grid div {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    background: #fff;
}
.tracking-grid strong {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}
.tracking-grid span {
    display: block;
    color: var(--ink);
    font-weight: 700;
    line-height: 1.45;
}
.tracking-back {
    width: max-content;
    color: rgba(255,255,255,.82);
    font-weight: 700;
}
.photo-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.photo-grid img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.ticket { background: #fff; color: #000; padding: 28px; max-width: 860px; margin: 0 auto; }
.ticket-head { display: flex; justify-content: space-between; border-bottom: 2px solid #000; padding-bottom: 12px; margin-bottom: 16px; }
.ticket-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.signature { height: 86px; border: 1px solid #000; margin-top: 30px; padding: 8px; }
@media (max-width: 900px) {
    .shell { grid-template-columns: 1fr; }
    .sidebar {
        position: sticky;
        top: 0;
        z-index: 10;
        padding: 12px 14px;
        gap: 12px;
        box-shadow: 0 8px 24px rgba(0,0,0,.18);
    }
    .brand-logo, .brand-mark {
        width: 42px;
        height: 42px;
        min-width: 42px;
        max-width: 42px;
        max-height: 42px;
    }
    .brand strong { max-width: calc(100vw - 170px); font-size: 16px; }
    .brand small { font-size: 12px; }
    .mobile-menu-toggle {
        display: inline-flex;
        position: absolute;
        right: 14px;
        top: 14px;
        min-height: 38px;
        padding: 8px 12px;
        background: rgba(255,255,255,.12);
        color: #fff;
        border: 1px solid rgba(255,255,255,.18);
    }
    .mobile-menu-panel {
        display: none;
        padding-top: 8px;
    }
    .sidebar.menu-open .mobile-menu-panel { display: block; }
    .content { padding: 16px; overflow-x: hidden; }
    .table-wrap {
        overflow: visible;
        padding-bottom: 0;
        margin-bottom: 0;
    }
    nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }
    nav a, .logout {
        min-width: 0;
        text-align: center;
        padding: 10px;
        background: rgba(255,255,255,.07);
    }
    .logout {
        display: flex;
        justify-content: center;
        margin-top: 8px;
    }
    .topbar { align-items: flex-start; flex-direction: column; }
    .stats, .filters, .form-grid, .ticket-grid { grid-template-columns: minmax(0, 1fr); }
    .login-box {
        max-width: 620px;
        min-height: 0;
        grid-template-columns: minmax(0, 1fr);
        border-radius: 24px;
    }
    .login-main,
    .login-side {
        padding: 26px;
    }
    .login-side {
        border-left: 0;
        border-top: 1px solid var(--line);
        align-content: start;
    }
    .login-side-head {
        align-items: flex-start;
        flex-direction: column;
    }
    .login-side-head strong {
        font-size: 18px;
    }
    .login-side-head span {
        width: max-content;
    }
    .login-brand-logo {
        width: auto;
        margin-bottom: 14px;
    }
    .login-brand-logo strong {
        font-size: 28px;
    }
    .login-logo-bolt {
        width: 22px;
        height: 34px;
    }
    .login-box h1 {
        font-size: 34px;
    }
    .login-kicker {
        margin-bottom: 34px;
    }
    .login-copy {
        position: static;
        margin-top: 24px;
    }
    .demo-account {
        grid-template-columns: 48px minmax(0, 1fr);
        gap: 10px;
    }
    .demo-icon {
        width: 44px;
        height: 44px;
    }
    .demo-copy-field {
        grid-column: 2;
    }
    .tracking-form, .tracking-grid { grid-template-columns: minmax(0, 1fr); }
    .customer-track-page { padding: 18px; }
    .tracking-hero { padding-top: 10px; }
    .tracking-result-head { flex-direction: column; }
    .photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .panel, .card, .stat { padding: 14px; max-width: 100%; overflow-x: hidden; }
    .content table {
        display: block;
        width: 100%;
        max-width: 100%;
        table-layout: auto;
        border: 0;
        background: transparent;
        overflow: visible;
    }
    .content table.jobs-table,
    .content table.jobs-table tbody,
    .content table.jobs-table tr,
    .content table.jobs-table th,
    .content table.jobs-table td {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }
    .content table thead { display: none !important; }
    .content table tbody {
        display: grid;
        gap: 12px;
        width: 100%;
        min-width: 0;
    }
    .content table tr {
        display: block;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        background: #fff;
        border: 1px solid var(--line);
        border-radius: 8px;
        padding: 10px 12px;
    }
    .content table td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 12px;
        width: 100%;
        padding: 8px 0;
        border-bottom: 1px solid #edf2f5;
        word-break: break-word;
        overflow-wrap: anywhere;
        white-space: normal;
    }
    .content table td:last-child { border-bottom: 0; }
    .content table td[data-label]::before {
        content: attr(data-label);
        flex: 0 0 42%;
        max-width: 42%;
        color: var(--muted);
        font-weight: 700;
        word-break: normal;
        overflow-wrap: normal;
    }
    .content table td[data-label] > * {
        max-width: 58%;
    }
    .content table td.actions {
        justify-content: stretch;
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
    .content table td.actions::before { display: none; }
    .content table.jobs-table td.actions {
        display: flex;
        width: 100% !important;
    }
    .content table.jobs-table .actions form {
        margin-top: 0;
    }
    .content table.jobs-table .actions > .btn + .btn {
        margin-top: 0;
    }
    .content table.jobs-table .actions .btn,
    .content table.jobs-table .actions button {
        width: 100%;
        min-height: 38px;
        font-size: 13px;
    }
    .route-form {
        width: min(100%, 220px);
    }
    .actions { width: 100%; align-items: stretch; }
    .actions .btn, .actions button { flex: 1 1 auto; }
    input[type="file"] { font-size: 12px; }
}
@media (max-width: 520px) {
    .login-page {
        padding: 16px;
    }
    .login-box {
        border-radius: 20px;
    }
    .login-main,
    .login-side {
        padding: 20px;
    }
    .login-brand-logo {
        width: auto;
        margin-bottom: 12px;
    }
    .login-kicker {
        margin-bottom: 28px;
    }
    .login-box h1 {
        font-size: 30px;
    }
    .login-main > p {
        font-size: 15px;
    }
    .login-role-tabs span {
        font-size: 13px;
    }
    .login-options {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }
    .demo-login-box,
    .customer-login-box {
        padding: 18px;
        border-radius: 16px;
    }
    .login-side-head { gap: 8px; }
    .side-title-svg {
        width: 20px;
        height: 20px;
        flex-basis: 20px;
    }
    .demo-account {
        grid-template-columns: 42px minmax(0, 1fr);
        padding: 13px;
    }
    .demo-icon {
        width: 42px;
        height: 42px;
    }
    .demo-icon svg {
        width: 23px;
        height: 23px;
    }
    .demo-account span,
    .demo-copy-field {
        grid-column: 2;
    }
    .copy-demo {
        width: 38px;
    }
    .field-icon {
        width: 18px;
        height: 18px;
    }
    h1 { font-size: 23px; }
    .top-actions { width: 100%; }
    .top-actions .btn { flex: 1 1 100%; }
    nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    thead, tbody, tr { min-width: 0; }
}
@media print {
    @page { size: A4 portrait; margin: 7mm; }
    .sidebar, .topbar, .filters, .no-print, .actions, .table-wrap { display: none !important; }
    .shell, .content {
        display: block !important;
        width: 100% !important;
        max-width: none !important;
        padding: 0 !important;
        margin: 0 !important;
        background: #fff;
        overflow: visible !important;
    }
    body { background: #fff; color: #000; margin: 0; }
    .content .print-only.print-table {
        display: table !important;
        border-collapse: collapse;
        width: 100% !important;
        max-width: none !important;
        table-layout: fixed;
        background: #fff;
        border: 1px solid #666;
    }
    .content .print-table thead { display: table-header-group !important; }
    .content .print-table tbody { display: table-row-group !important; }
    .content .print-table tr {
        display: table-row !important;
        width: auto !important;
        max-width: none !important;
        min-width: 0 !important;
        border: 0;
        padding: 0;
        background: #fff;
        break-inside: avoid;
        page-break-inside: avoid;
    }
    .content .print-table th,
    .content .print-table td {
        display: table-cell !important;
        border: 1px solid #666;
        padding: 4px 5px;
        font-size: 8px;
        line-height: 1.25;
        vertical-align: top;
        overflow-wrap: anywhere;
        word-break: normal;
        white-space: normal;
        float: none !important;
    }
    .content .print-table th {
        background: #f1f4f6;
        font-weight: 700;
    }
    .content .print-table td[data-label]::before { display: none !important; content: none !important; }
    .content .print-table .print-seq { width: 6%; }
    .content .print-table .print-customer { width: 15%; }
    .content .print-table .print-address { width: 24%; }
    .content .print-table .print-district { width: 10%; }
    .content .print-table .print-work { width: 11%; }
    .content .print-table .print-product { width: 10%; }
    .content .print-table .print-desc { width: 16%; }
    .content .print-table .print-route { width: 8%; }
    .ticket { max-width: none; }
}
