:root {
    --bg: #f4f7f9;
    --panel: #ffffff;
    --text: #172033;
    --muted: #667085;
    --line: #dce4ef;
    --brand: #0f8b8d;
    --brand-dark: #0a6567;
    --warning: #f5b841;
    --done: #43aa8b;
    --danger: #d95550;
    --shadow: 0 18px 48px rgba(23, 32, 51, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
}

.app-shell {
    width: min(1500px, calc(100% - 32px));
    margin: 0 auto;
    padding: 22px 0 40px;
}

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

.topbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.brand-block {
    display: flex;
    align-items: center;
    gap: 14px;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

.brand-logo {
    width: 72px;
    height: 72px;
    object-fit: contain;
}

.eyebrow,
.section-heading p,
small {
    color: var(--muted);
}

.eyebrow {
    margin: 0 0 4px;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

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

h1 {
    font-size: 36px;
    line-height: 1;
}

h2 {
    font-size: 18px;
}

.map-link,
.api-pill,
.primary-button,
.admin-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border: 0;
    border-radius: 8px;
    padding: 0 14px;
    color: #ffffff;
    font: inherit;
    font-size: 14px;
    font-weight: 900;
    text-decoration: none;
    background: var(--brand);
    cursor: pointer;
}

.map-link:hover,
.api-pill:hover,
.primary-button:hover,
.admin-nav a:hover,
.admin-nav a.active {
    background: var(--brand-dark);
}

.admin-nav {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.admin-nav a {
    min-height: 38px;
    background: rgba(15, 139, 141, 0.14);
    color: var(--brand-dark);
}

.admin-nav a i {
    margin-right: 8px;
}

.admin-nav a.active,
.admin-nav a:hover {
    color: #ffffff;
}

.notice {
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 14px;
    font-weight: 800;
}

.notice.success {
    color: #1f6b56;
    background: rgba(67, 170, 139, 0.14);
}

.notice.error {
    color: #9b2f2a;
    background: rgba(217, 85, 80, 0.13);
}

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

.metric,
.delivery-form,
.table-panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: 0 12px 30px rgba(23, 32, 51, 0.06);
}

.metric {
    padding: 16px;
}

.metric strong {
    display: block;
    font-size: 30px;
    line-height: 1;
}

.metric span {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.metric.warning strong {
    color: #9a6700;
}

.metric.done strong {
    color: #1f6b56;
}

.metric.muted strong {
    color: var(--muted);
}

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

.dashboard-kpi,
.dashboard-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 12px 30px rgba(23, 32, 51, 0.06);
}

.dashboard-kpi {
    position: relative;
    overflow: hidden;
    min-height: 142px;
    padding: 18px;
}

.dashboard-kpi::after {
    content: "";
    position: absolute;
    right: -34px;
    bottom: -42px;
    width: 116px;
    height: 116px;
    border-radius: 50%;
    background: rgba(15, 139, 141, 0.12);
}

.dashboard-kpi span,
.dashboard-kpi small {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.dashboard-kpi strong {
    display: block;
    margin: 16px 0 8px;
    font-size: clamp(30px, 4vw, 48px);
    line-height: 0.95;
}

.dashboard-kpi.primary strong {
    color: var(--brand-dark);
}

.dashboard-kpi.success strong {
    color: #1f6b56;
}

.dashboard-kpi.warning strong {
    color: #9a6700;
}

.dashboard-kpi.dark strong {
    color: #172033;
}

.dashboard-main,
.dashboard-secondary {
    display: grid;
    gap: 14px;
    margin-bottom: 14px;
}

.dashboard-main {
    grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.4fr);
}

.dashboard-secondary {
    grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
}

.dashboard-card {
    padding: 18px;
}

.dashboard-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.dashboard-card-header p,
.dashboard-card-header span {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.dashboard-card-header span {
    min-height: 30px;
    border-radius: 999px;
    padding: 7px 10px 0;
    color: var(--brand-dark);
    font-size: 12px;
    font-weight: 900;
    background: rgba(15, 139, 141, 0.1);
}

.status-donut-wrap {
    position: relative;
    display: grid;
    width: min(260px, 72vw);
    aspect-ratio: 1;
    place-items: center;
    margin: 4px auto 18px;
}

.status-donut {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background:
        conic-gradient(
            var(--done) 0 var(--done-slice),
            var(--warning) var(--done-slice) calc(var(--done-slice) + var(--pending-slice)),
            var(--danger) calc(var(--done-slice) + var(--pending-slice)) calc(var(--done-slice) + var(--pending-slice) + var(--cancelled-slice)),
            #eef4f7 calc(var(--done-slice) + var(--pending-slice) + var(--cancelled-slice)) 100%
        );
    box-shadow: inset 0 0 0 22px #ffffff, 0 18px 42px rgba(23, 32, 51, 0.12);
}

.status-donut-copy {
    position: absolute;
    display: grid;
    place-items: center;
}

.status-donut-copy strong {
    font-size: 42px;
    line-height: 1;
}

.status-donut-copy span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.dashboard-legend {
    display: grid;
    gap: 9px;
}

.dashboard-legend span {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dot.done {
    background: var(--done);
}

.dot.pending {
    background: var(--warning);
}

.dot.cancelled {
    background: var(--danger);
}

.daily-chart {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 12px;
    min-height: 292px;
    align-items: end;
}

.daily-bar {
    display: grid;
    gap: 8px;
    justify-items: center;
}

.daily-bar-track {
    position: relative;
    display: flex;
    align-items: end;
    justify-content: center;
    width: 100%;
    height: 210px;
    border-radius: 8px;
    background: #eef4f7;
}

.daily-bar-total,
.daily-bar-done {
    position: absolute;
    bottom: 0;
    width: 42%;
    border-radius: 8px 8px 0 0;
}

.daily-bar-total {
    background: rgba(15, 139, 141, 0.24);
}

.daily-bar-done {
    width: 24%;
    background: var(--done);
}

.daily-bar strong {
    font-size: 13px;
}

.daily-bar small {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
}

.driver-load-list,
.pulse-list {
    display: grid;
    gap: 12px;
}

.driver-load-row {
    display: grid;
    grid-template-columns: minmax(150px, 0.45fr) minmax(0, 1fr);
    gap: 12px;
    align-items: center;
}

.driver-load-row strong,
.driver-load-row span {
    display: block;
}

.driver-load-row span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}

.driver-load-meter {
    height: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: #eef4f7;
}

.driver-load-meter span {
    display: block;
    width: var(--width);
    height: 100%;
    border-radius: inherit;
    background:
        linear-gradient(90deg, var(--done) 0 var(--done-share), var(--warning) var(--done-share) 100%);
}

.pulse-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.pulse-list div {
    display: grid;
    gap: 8px;
    min-height: 118px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    background: #f8fafc;
}

.pulse-list i {
    color: var(--brand-dark);
    font-size: 21px;
}

.pulse-list strong {
    font-size: 28px;
    line-height: 1;
}

.pulse-list span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.admin-layout {
    display: grid;
    grid-template-columns: 360px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

.delivery-form,
.table-panel {
    padding: 16px;
}

.delivery-form {
    display: grid;
    gap: 12px;
    position: sticky;
    top: 14px;
}

.section-heading {
    margin-bottom: 2px;
}

.section-heading p {
    margin: 5px 0 0;
    font-size: 14px;
}

.table-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.api-pill {
    min-height: 34px;
    color: var(--brand-dark);
    background: rgba(15, 139, 141, 0.12);
}

.api-pill:hover {
    color: #ffffff;
}

label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

input,
textarea,
select {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text);
    font: inherit;
    font-size: 14px;
    text-transform: none;
    background: #ffffff;
}

textarea {
    resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--brand);
    outline: 3px solid rgba(15, 139, 141, 0.16);
}

.heading-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    justify-content: flex-end;
}

.table-new-button {
    min-height: 34px;
    white-space: nowrap;
}

.table-filters {
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-select-label,
.date-filter-label {
    display: block;
}

.filter-select-label {
    min-width: 180px;
}

.filter-select-label select,
.date-filter-label input {
    min-height: 34px;
    padding: 6px 10px;
    font-size: 13px;
}

.date-filter-label {
    min-width: 128px;
}

.date-filter-label input {
    color: var(--muted);
}

.date-filter-label input:valid {
    color: var(--text);
}

.status-filters {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.status-filters a {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    border: 1px solid rgba(15, 139, 141, 0.18);
    border-radius: 999px;
    padding: 0 12px;
    color: var(--brand-dark);
    font-size: 12px;
    font-weight: 900;
    text-decoration: none;
    background: rgba(15, 139, 141, 0.08);
}

.status-filters a:hover {
    color: #ffffff;
    border-color: var(--brand);
    background: var(--brand);
}

.status-filters a.status-pendiente {
    color: #7a4e00;
    border-color: rgba(245, 184, 65, 0.34);
    background: rgba(245, 184, 65, 0.16);
}

.status-filters a.status-pendiente.active,
.status-filters a.status-pendiente:hover {
    color: #ffffff;
    border-color: #9a6700;
    background: #9a6700;
}

.status-filters a.status-entregado {
    color: #1f6b56;
    border-color: rgba(67, 170, 139, 0.34);
    background: rgba(67, 170, 139, 0.16);
}

.status-filters a.status-entregado.active,
.status-filters a.status-entregado:hover {
    color: #ffffff;
    border-color: #1f6b56;
    background: #1f6b56;
}

.status-filters a.status-all.active {
    color: #ffffff;
    border-color: var(--brand);
    background: var(--brand);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.location-input-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
    gap: 8px;
    align-items: center;
}

.location-input-row input {
    width: 100%;
}

.map-picker-button {
    display: inline-grid;
    width: 44px;
    min-height: 42px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: #ffffff;
    font-size: 16px;
    background: var(--brand);
    cursor: pointer;
}

.map-picker-button:hover {
    background: var(--brand-dark);
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 980px;
}

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

th {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    background: #f8fafc;
}

td {
    font-size: 14px;
}

td strong,
td small {
    display: block;
}

td small {
    margin-top: 4px;
    font-size: 12px;
}

.status {
    display: inline-flex;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 900;
    text-transform: capitalize;
}

.status.pendiente {
    color: #7a4e00;
    background: rgba(245, 184, 65, 0.2);
}

.status.entregado {
    color: #1f6b56;
    background: rgba(67, 170, 139, 0.18);
}

.status.cancelado {
    color: #8d2b27;
    background: rgba(217, 85, 80, 0.14);
}

.muted-text,
.empty-state {
    color: var(--muted);
}

.signature-thumb {
    width: 86px;
    height: 48px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0;
    background: #ffffff;
    cursor: zoom-in;
}

.signature-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.signature-modal {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(23, 32, 51, 0.7);
}

.signature-modal[hidden] {
    display: none;
}

.signature-modal img {
    max-width: min(760px, 96vw);
    max-height: 82vh;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: var(--shadow);
}

.modal-close {
    position: fixed;
    top: 18px;
    right: 18px;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    color: var(--text);
    font-size: 20px;
    font-weight: 900;
    background: #ffffff;
    cursor: pointer;
}

.mobile-view-heading,
.mobile-view-cell {
    display: none;
}

.delivery-sheet {
    position: fixed;
    inset: 0;
    z-index: 18;
    display: grid;
    align-items: end;
    padding: 12px;
    background: rgba(23, 32, 51, 0.38);
    backdrop-filter: blur(10px);
}

.delivery-sheet[hidden] {
    display: none;
}

.delivery-sheet-card {
    width: min(560px, 100%);
    max-height: min(760px, calc(100vh - 24px));
    overflow-y: auto;
    margin: 0 auto;
    border: 1px solid var(--line);
    border-radius: 16px 16px 8px 8px;
    padding: 10px 16px 16px;
    background: #ffffff;
    box-shadow: var(--shadow);
}

.sheet-handle {
    width: 46px;
    height: 4px;
    margin: 0 auto 12px;
    border-radius: 999px;
    background: #c9d5e4;
}

.sheet-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.sheet-header h2 {
    margin: 0;
    font-size: 20px;
}

.sheet-header p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.sheet-kicker {
    color: #7a4e00 !important;
    font-size: 11px !important;
    font-weight: 900;
    text-transform: uppercase;
}

.sheet-close {
    width: 36px;
    height: 36px;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--text);
    font-size: 18px;
    font-weight: 900;
    background: #ffffff;
    cursor: pointer;
}

.sheet-grid {
    display: grid;
    gap: 10px;
}

.sheet-grid div,
.sheet-signature {
    display: grid;
    gap: 4px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
}

.sheet-grid span,
.sheet-signature > span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.sheet-grid strong {
    font-size: 14px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.sheet-signature {
    margin-top: 10px;
}

.sheet-signature-button {
    width: min(220px, 100%);
    height: 112px;
}

.view-delivery-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 34px;
    border: 1px solid rgba(15, 139, 141, 0.26);
    border-radius: 8px;
    color: var(--brand-dark);
    font: inherit;
    font-size: 12px;
    font-weight: 900;
    background: rgba(15, 139, 141, 0.1);
    cursor: pointer;
}

.actions-cell {
    display: table-cell;
    white-space: nowrap;
}

.actions-cell .icon-button + .icon-button {
    margin-left: 4px;
}

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 50%;
    color: var(--muted);
    font: inherit;
    font-size: 15px;
    background: transparent;
    cursor: pointer;
}

.icon-button:hover {
    color: var(--brand-dark);
    background: rgba(15, 139, 141, 0.1);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.side-drawer {
    position: fixed;
    inset: 0;
    z-index: 24;
    display: flex;
    justify-content: flex-end;
    background: rgba(23, 32, 51, 0.28);
    backdrop-filter: blur(6px);
}

.side-drawer[hidden] {
    display: none;
}

.drawer-panel {
    width: min(480px, 100%);
    height: 100%;
    overflow-y: auto;
    border-left: 1px solid var(--line);
    padding: 20px;
    background: #ffffff;
    box-shadow: var(--shadow);
    animation: drawer-in 210ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes drawer-in {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

.drawer-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.drawer-close {
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--text);
    font-size: 18px;
    font-weight: 900;
    background: #ffffff;
    cursor: pointer;
}

.drawer-form {
    display: grid;
    gap: 12px;
}

.check-label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.check-label input {
    width: 18px;
    min-height: 18px;
}

.drivers-table {
    min-width: 720px;
}

.readonly-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.readonly-grid div,
.readonly-signature {
    display: grid;
    gap: 5px;
    border-top: 1px solid var(--line);
    padding-top: 10px;
}

.readonly-grid span,
.readonly-signature > span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.readonly-grid strong {
    font-size: 14px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.readonly-wide {
    grid-column: 1 / -1;
}

.readonly-signature {
    margin-top: 12px;
}

.readonly-signature-button {
    width: 100%;
    height: 190px;
}

@media (max-width: 1080px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-main,
    .dashboard-secondary {
        grid-template-columns: 1fr;
    }

    .admin-layout {
        grid-template-columns: 1fr;
    }

    .delivery-form {
        position: static;
    }
}

@media (max-width: 720px) {
    .app-shell {
        width: min(100% - 20px, 1500px);
        padding: 12px 0 28px;
    }

    .topbar,
    .topbar-actions,
    .table-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .topbar {
        gap: 12px;
        margin-bottom: 12px;
    }

    .brand-logo {
        width: 58px;
        height: 58px;
    }

    h1 {
        font-size: 30px;
    }

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

    .topbar-actions,
    .admin-nav {
        width: 100%;
    }

    .admin-nav a {
        flex: 1;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .dashboard-kpi {
        min-height: 126px;
        padding: 16px;
    }

    .dashboard-card {
        padding: 14px;
    }

    .dashboard-card-header {
        flex-direction: column;
        margin-bottom: 14px;
    }

    .daily-chart {
        gap: 7px;
        min-height: 232px;
    }

    .daily-bar-track {
        height: 160px;
    }

    .driver-load-row,
    .pulse-list {
        grid-template-columns: 1fr;
    }

    .metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .metric {
        padding: 12px;
    }

    .metric strong {
        font-size: 25px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .delivery-form,
    .table-panel {
        padding: 14px;
    }

    .table-heading {
        align-items: stretch;
        flex-direction: column;
        gap: 10px;
    }

    .api-pill {
        width: 100%;
    }

    .heading-actions {
        width: 100%;
        align-items: stretch;
        flex-wrap: wrap;
    }

    .heading-actions .api-pill,
    .table-new-button,
    .table-heading > .primary-button {
        width: 100%;
    }

    .table-filters,
    .filter-select-label,
    .date-filter-label,
    .status-filters {
        width: 100%;
    }

    .status-filters a {
        flex: 1;
        justify-content: center;
    }

    table {
        min-width: 0;
    }

    table:not(.drivers-table) th:nth-child(3),
    table:not(.drivers-table) th:nth-child(5),
    table:not(.drivers-table) th:nth-child(6),
    table:not(.drivers-table) th:nth-child(7),
    table:not(.drivers-table) th:nth-child(8),
    table:not(.drivers-table) td:nth-child(3),
    table:not(.drivers-table) td:nth-child(5),
    table:not(.drivers-table) td:nth-child(6),
    table:not(.drivers-table) td:nth-child(7),
    table:not(.drivers-table) td:nth-child(8) {
        display: none;
    }

    .drivers-table th:nth-child(4),
    .drivers-table td:nth-child(4) {
        display: none;
    }

    .readonly-grid {
        grid-template-columns: 1fr;
    }

    .mobile-view-heading,
    .mobile-view-cell {
        display: table-cell;
    }

    th,
    td {
        padding: 10px 8px;
        font-size: 13px;
    }

    .empty-state {
        display: table-cell;
        min-height: 0;
        border-bottom: 0;
        padding: 14px;
    }

    .signature-thumb {
        width: min(140px, 100%);
        height: 72px;
    }

    .signature-modal {
        padding: 14px;
    }

    .signature-modal img {
        max-width: 96vw;
        max-height: 76vh;
    }

    .modal-close {
        top: 12px;
        right: 12px;
    }
}

@media (max-width: 420px) {
    .metrics {
        grid-template-columns: 1fr 1fr;
    }

    .table-panel {
        padding: 10px;
    }

    th,
    td {
        padding: 9px 6px;
    }

    td small {
        font-size: 11px;
    }

    .status {
        padding: 5px 8px;
        font-size: 11px;
    }
}
