:root {
    --brand-blue: #27718e;
    --brand-hover: #4B8DA2;
    --muted: #6b7280;
    --border: #e8eaeb;
    --sidebar-w: 256px;
}

[x-cloak] { display: none !important; }

body.crm-body {
    margin: 0;
    background: #f7f9fc;
    color: #1a1a1a;
    font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.new-sidebar {
    width: var(--sidebar-w);
    background: var(--brand-blue);
    color: #fff;
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 20;
    transition: width .2s ease;
}

.new-sidebar .sidebar-header {
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, .18);
}

.new-sidebar .flex-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.new-sidebar .brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    color: #fff;
    text-decoration: none;
}

.new-sidebar .brand img {
    width: 40px;
    height: auto;
    flex: none;
}

.new-sidebar .brand h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #fff;
}

.new-sidebar .sidebar-collapse-btn {
    margin-left: auto;
    background: transparent;
    border: 0;
    color: #fff;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    display: flex;
}

.new-sidebar .sidebar-collapse-btn:hover {
    background: rgba(75, 141, 162, .3);
}

.new-sidebar .sidebar-collapse-btn svg {
    width: 20px;
    height: 20px;
}

.new-sidebar .sidebar-nav {
    flex: 1;
    min-height: 0;
    padding: 16px;
    overflow: auto;
}

.new-sidebar .sidebar-nav > ul,
.new-sidebar .sidebar-footer {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.new-sidebar .sidebar-nav a,
.new-sidebar .sidebar-nav button,
.new-sidebar .sidebar-nav span.menu-row,
.new-sidebar .sidebar-footer a,
.new-sidebar .sidebar-footer button,
.new-sidebar .sidebar-footer span.menu-row {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #e5e7eb;
    font: inherit;
    font-size: 15px;
    font-weight: 500;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    box-sizing: border-box;
}

.new-sidebar .sidebar-nav svg,
.new-sidebar .sidebar-footer svg {
    width: 20px;
    height: 20px;
    flex: none;
}

.new-sidebar .sidebar-nav a:hover,
.new-sidebar .sidebar-footer a:hover,
.new-sidebar .sidebar-footer button:hover {
    background: rgba(75, 141, 162, .3);
}

.new-sidebar .sidebar-nav a.active,
.new-sidebar .sidebar-footer a.active {
    background: var(--brand-hover);
    color: #fff;
}

.new-sidebar .menu-toggle .chevron {
    margin-left: auto;
    width: 16px;
    height: 16px;
    transition: transform .15s ease;
}

.new-sidebar .menu-toggle.open .chevron {
    transform: rotate(180deg);
}

.new-sidebar .sub-menu {
    display: none;
    flex-direction: column;
    gap: 4px;
    margin-top: 4px;
    padding: 8px 0 8px 8px;
    background: rgba(0, 0, 0, .1);
    border-radius: 8px;
}

.new-sidebar li.open > .sub-menu {
    display: flex;
}

.new-sidebar .sub-menu li {
    border-left: 3px solid rgba(255, 255, 255, .4);
    margin-left: 8px;
    padding-left: 8px;
}

.new-sidebar .sub-menu a,
.new-sidebar .sub-menu span {
    display: block;
    padding: 10px 12px;
    border-radius: 8px;
    color: #e5e7eb;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
}

.new-sidebar .sub-menu a:hover {
    background: rgba(75, 141, 162, .3);
}

.new-sidebar .sub-menu a.active {
    background: var(--brand-hover);
    color: #fff;
}

.new-sidebar .sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, .18);
}

.nav-count {
    margin-left: auto;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
}

html.sidebar-collapsed .new-sidebar .nav-count {
    display: block;
    grid-column: 1;
    grid-row: 1;
    justify-self: end;
    align-self: start;
    margin: -8px -10px 0 0;
    min-width: 16px;
    height: 16px;
    padding: 0 3px;
    font-size: 10px;
    line-height: 16px;
}

html.sidebar-collapsed .new-sidebar {
    width: 80px;
}

html.sidebar-collapsed .new-sidebar .brand h1,
html.sidebar-collapsed .new-sidebar .sidebar-nav a > span,
html.sidebar-collapsed .new-sidebar .sidebar-nav button > span,
html.sidebar-collapsed .new-sidebar .sidebar-nav .menu-row > span,
html.sidebar-collapsed .new-sidebar .sidebar-footer a > span,
html.sidebar-collapsed .new-sidebar .sidebar-footer button > span,
html.sidebar-collapsed .new-sidebar .sidebar-footer .menu-row > span,
html.sidebar-collapsed .new-sidebar .sidebar-nav li.open > .sub-menu,
html.sidebar-collapsed .new-sidebar .sub-menu {
    display: none;
}

html.sidebar-collapsed .new-sidebar .sidebar-header {
    padding: 16px 12px;
}

html.sidebar-collapsed .new-sidebar .flex-container {
    flex-direction: column;
}

html.sidebar-collapsed .new-sidebar .sidebar-nav a,
html.sidebar-collapsed .new-sidebar .sidebar-nav button,
html.sidebar-collapsed .new-sidebar .sidebar-nav .menu-row,
html.sidebar-collapsed .new-sidebar .sidebar-footer a,
html.sidebar-collapsed .new-sidebar .sidebar-footer button,
html.sidebar-collapsed .new-sidebar .sidebar-footer .menu-row {
    display: grid;
    grid-template-columns: 20px 14px;
    grid-template-rows: 20px;
    justify-content: center;
    align-items: center;
    column-gap: 4px;
    padding: 12px 0;
}

html.sidebar-collapsed .new-sidebar .sidebar-nav a > svg,
html.sidebar-collapsed .new-sidebar .sidebar-nav button > svg,
html.sidebar-collapsed .new-sidebar .sidebar-nav .menu-row > svg,
html.sidebar-collapsed .new-sidebar .sidebar-footer a > svg,
html.sidebar-collapsed .new-sidebar .sidebar-footer button > svg,
html.sidebar-collapsed .new-sidebar .sidebar-footer .menu-row > svg {
    grid-column: 1;
    grid-row: 1;
}

html.sidebar-collapsed .new-sidebar .menu-toggle {
    column-gap: 4px;
    padding: 12px 0;
}

html.sidebar-collapsed .new-sidebar .menu-toggle.callout-open {
    background: rgba(75, 141, 162, .3);
}

html.sidebar-collapsed .new-sidebar .menu-toggle .chevron,
html.sidebar-collapsed .new-sidebar .menu-toggle.open .chevron {
    display: block;
    grid-column: 2;
    grid-row: 1;
    justify-self: center;
    margin-left: 0;
    width: 14px;
    height: 14px;
    transform: rotate(-90deg);
}

.sidebar-context {
    position: fixed;
    z-index: 40;
    min-width: 196px;
    margin: 0;
    padding: 10px 8px 8px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, .16);
}

.sidebar-context::before {
    content: "";
    position: absolute;
    left: -8px;
    top: var(--callout-arrow, 18px);
    border-width: 7px 8px 7px 0;
    border-style: solid;
    border-color: transparent #fff transparent transparent;
    filter: drop-shadow(-1px 0 0 #e5e7eb);
}

.sidebar-context[hidden] {
    display: none;
}

.sidebar-callout-title {
    margin: 0 8px 6px;
    padding: 2px 4px 8px;
    border-bottom: 1px solid #e8eaeb;
    color: var(--brand-blue);
    font-size: 13px;
    font-weight: 700;
}

.sidebar-callout-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-context a,
.sidebar-context span {
    display: block;
    margin: 0;
    padding: 8px 12px;
    border-radius: 6px;
    color: #1a1a1a;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.25;
    text-decoration: none;
}

.sidebar-context a:hover,
.sidebar-context span:hover {
    background: #e7f2f6;
    color: var(--brand-blue);
}

.sidebar-context a.active {
    background: var(--brand-blue);
    color: #fff;
}

.sidebar-context a.active:hover {
    background: var(--brand-hover);
    color: #fff;
}

.content-body {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    padding: 24px;
    background: #f7f9fc;
    box-sizing: border-box;
    transition: margin-left .2s ease;
}

html.sidebar-collapsed .content-body {
    margin-left: 80px;
}

.page-title {
    margin: 0;
    font-size: 30px;
    font-weight: 700;
    color: var(--brand-blue);
}

.dash-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 1.5rem;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem 1rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .05);
    color: inherit;
    text-decoration: none;
}

.user-chip:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, .1);
}

.user-chip .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--brand-blue);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: .875rem;
}

.user-chip strong {
    display: block;
    font-size: .875rem;
    color: #1a1a1a;
}

.user-chip small {
    display: block;
    font-size: .75rem;
    color: #6c757d;
}

.section-title {
    margin: 0 0 1rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--brand-blue);
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.quick-action {
    display: block;
    background: #fff;
    border: 2px dashed var(--brand-blue);
    border-radius: 12px;
    padding: 1.5rem 1rem;
    text-align: center;
    color: #1a1a1a;
    text-decoration: none;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

a.quick-action:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(39, 113, 142, .15);
    border-color: var(--brand-hover);
}

.quick-action svg {
    width: 32px;
    height: 32px;
    color: var(--brand-blue);
    margin-bottom: .75rem;
}

.quick-action span {
    display: block;
    font-size: .95rem;
    font-weight: 600;
}

.impersonation-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin: -24px -24px 24px;
    padding: 12px 24px;
    background: var(--brand-blue);
    color: #fff;
}

.content-body:has(.tracking-frame) .impersonation-bar {
    margin: 0 0 0;
}

.impersonation-bar button,
.directory-table button {
    height: 34px;
    border: 0;
    border-radius: 8px;
    padding: 0 12px;
    background: #fff;
    color: var(--brand-blue);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.directory-table button {
    background: var(--brand-blue);
    color: #fff;
}

.directory-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.directory-filters input,
.directory-filters select {
    height: 38px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0 12px;
    background: #fff;
    font: inherit;
}

.directory-filters input {
    flex: 1;
    min-width: 0;
}

.directory-filters button {
    height: 38px;
    border: 0;
    border-radius: 8px;
    padding: 0 16px;
    background: var(--brand-blue);
    color: #fff;
    font: inherit;
    cursor: pointer;
}

.directory-table {
    width: 100%;
    border-collapse: collapse;
}

.directory-table th {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--muted);
}

.directory-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.directory-table small {
    display: block;
    color: var(--muted);
}

.directory-table .badge-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}

.directory-table .badge-status .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #16a34a;
}

.directory-table .badge-status.inactive {
    color: var(--muted);
}

.directory-table .badge-status.inactive .dot {
    background: #9ca3af;
}

.directory-page .card-solid-white nav {
    margin-top: 16px;
}

.card-solid-white {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .05);
    padding: 1.25rem;
}

.note-empty {
    margin: 0;
    padding: 2rem 1rem;
    text-align: center;
    color: #6c757d;
}

.page-subtitle {
    margin: 4px 0 0;
    color: #6b7280;
    font-size: 14px;
}

.driver-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.driver-stat {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .05);
    padding: 20px 22px;
}

.driver-stat h2 {
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
}

.driver-stat strong {
    display: block;
    font-size: 32px;
    line-height: 1.1;
    font-weight: 700;
    color: #1e3a4a;
}

.driver-stat.done strong { color: #10b981; }
.driver-stat.training strong { color: #8b5cf6; }

.driver-stat small {
    display: block;
    margin-top: 6px;
    color: #6b7280;
}

.driver-panel { margin-bottom: 16px; }

.driver-panel h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
}

.driver-panel h2 svg {
    width: 18px;
    height: 18px;
    color: #f59e0b;
}

.driver-panel.pending h2 svg { color: #3b82f6; }

.expiry-row,
.pending-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 8px;
}

.expiry-row:last-child,
.pending-row:last-child { margin-bottom: 0; }

.expiry-row svg,
.pending-row svg {
    width: 16px;
    height: 16px;
    flex: none;
    margin-top: 2px;
}

.expiry-row.danger { background: #f8d7da; color: #842029; }
.expiry-row.warning { background: #fff3cd; color: #664d03; }
.expiry-row.info { background: #d1ecf1; color: #0c5460; }
.pending-row { background: #e8eeff; color: #1e3a5f; }

.expiry-row strong,
.pending-row strong { display: block; }

.expiry-row small,
.pending-row small {
    display: block;
    margin-top: 2px;
}

.expiry-flag { color: #b91c1c; }

.driver-panel.notices h2 svg { color: #3b82f6; }

.notice-new {
    margin-left: 8px;
    padding: 2px 7px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 16px;
    vertical-align: middle;
}

.notice-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    background: #f8f9fa;
    margin-bottom: 8px;
}

.notice-row:last-child { margin-bottom: 0; }

.notice-row.unread {
    background: #e3f2fd;
    border-left: 3px solid var(--brand-blue);
}

.notice-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
}

.notice-icon svg { width: 16px; height: 16px; }

.notice-line {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.notice-row strong {
    font-size: 14px;
    color: #1a1a1a;
    font-weight: 500;
}

.notice-row.unread strong { font-weight: 600; }

.notice-row time {
    flex: none;
    color: #6c757d;
    font-size: 11px;
    white-space: nowrap;
}

.notice-row p {
    margin: 2px 0 0;
    color: #6c757d;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.driver-action-panel { margin-top: 8px; }

.driver-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.driver-actions.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.driver-action {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .05);
    padding: 28px 16px;
    text-align: center;
}

.driver-action.create { border-left: 4px solid var(--brand-blue); }

.driver-action svg {
    width: 40px;
    height: 40px;
    margin-bottom: 12px;
}

.driver-action strong {
    display: block;
    margin-bottom: 4px;
    color: #1f2937;
    font-size: 16px;
    font-weight: 600;
}

.driver-action span {
    display: block;
    color: #6b7280;
    font-size: 13px;
}

.content-body:has(.tracking-frame) {
    padding: 0;
}

.content-body:has(.map-page),
.content-body:has(.devices-page),
.content-body:has(.trips-page),
.content-body:has(.camera-page) {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.tracking-frame:has(.map-page),
.tracking-frame:has(.devices-page),
.tracking-frame:has(.trips-page),
.tracking-frame:has(.camera-page) {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.page-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex: none;
    padding: 24px 24px 16px;
}

.devices-page #open-add {
    height: 34px;
    padding: 0 14px;
    border: 0;
    border-radius: 8px;
    background: var(--brand-blue);
    color: #fff;
    font: inherit;
    cursor: pointer;
}

@media (max-width: 1100px) {
    .quick-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .driver-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .driver-actions,
    .driver-actions.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
    .quick-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .driver-stats { grid-template-columns: 1fr; }
    .driver-actions,
    .driver-actions.four { grid-template-columns: 1fr; }
    .dash-head { flex-direction: column; }
}

.companies-page .page-title {
    font-size: 22px;
}

.page-subtitle {
    margin: 4px 0 0;
    color: var(--muted);
}

.companies-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
}

.btn-brand,
.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 16px;
    border-radius: 8px;
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.btn-brand {
    border: 0;
    background: var(--brand-blue);
    color: #fff;
}

.btn-brand svg,
.btn-outline svg {
    width: 16px;
    height: 16px;
}

.btn-outline {
    border: 1px solid #d1d5db;
    background: #fff;
    color: #374151;
}

.btn-outline.danger {
    border-color: #fca5a5;
    color: #dc2626;
}

.company-alert {
    margin-bottom: 16px;
    padding: 12px 16px;
    border-radius: 8px;
    background: #e7f6ef;
    color: #166534;
}

.companies-filters {
    display: grid;
    grid-template-columns: minmax(180px, 1.4fr) minmax(140px, .8fr) minmax(160px, .9fr) minmax(160px, 1fr) 42px;
    gap: 12px;
    margin-bottom: 16px;
    padding: 16px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
}

.companies-filters input,
.companies-filters select {
    height: 42px;
    border: 1px solid #dbe1e6;
    border-radius: 8px;
    padding: 0 12px;
    background: #fff;
    font: inherit;
}

.companies-filters button {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 8px;
    background: var(--brand-blue);
    color: #fff;
    cursor: pointer;
}

.companies-filters button svg {
    width: 16px;
    height: 16px;
}

.companies-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.companies-table {
    width: 100%;
    border-collapse: collapse;
}

.companies-table th {
    padding: 12px 14px;
    background: #1f6f8c;
    color: #fff;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
}

.companies-table .sort-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: inherit;
    text-decoration: none;
}

.sort-mark {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
}

.sort-mark::before,
.sort-mark::after {
    content: "";
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
}

.sort-mark::before {
    border-bottom: 4px solid rgba(255, 255, 255, .45);
}

.sort-mark::after {
    border-top: 4px solid rgba(255, 255, 255, .45);
}

.sort-link.is-asc .sort-mark::before {
    border-bottom-color: #fff;
}

.sort-link.is-desc .sort-mark::after {
    border-top-color: #fff;
}

.companies-table td {
    padding: 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.companies-table .muted {
    color: #9ca3af;
}

.company-name {
    color: #1a1a1a;
    font-weight: 700;
    text-decoration: none;
}

.companies-table .badge-status,
.page-subtitle .badge-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #e7f6ef;
    color: #14804a;
    font-weight: 600;
}

.page-subtitle .badge-status {
    margin-left: 8px;
}

.companies-table .badge-status .dot,
.page-subtitle .badge-status .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #16a34a;
}

.companies-table .badge-status.inactive,
.page-subtitle .badge-status.inactive {
    background: #f3f4f6;
    color: var(--muted);
}

.companies-table .badge-status.inactive .dot,
.page-subtitle .badge-status.inactive .dot {
    background: #9ca3af;
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.table-actions form {
    margin: 0;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
}

.icon-btn svg {
    width: 15px;
    height: 15px;
}

.icon-btn.info { color: #2563eb; border: 1px solid #93c5fd; }
.icon-btn.edit { color: #16a34a; border: 1px solid #86efac; }
.icon-btn.login { color: #0284c7; border: 1px solid #7dd3fc; }
.icon-btn.warn { color: #d97706; border: 1px solid #fcd34d; }
.icon-btn.success { color: #16a34a; border: 1px solid #86efac; }
.icon-btn.delete { color: #dc2626; border: 1px solid #fca5a5; }

.companies-filters.filters-three {
    grid-template-columns: minmax(180px, 1.6fr) minmax(140px, .8fr) minmax(140px, .8fr) 42px;
}

.companies-filters.filters-two {
    grid-template-columns: minmax(220px, 1.6fr) minmax(160px, .7fr) 42px;
}

.role-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    background: #e7f2f6;
    color: var(--brand-blue);
    font-size: 12px;
    font-weight: 600;
}

.companies-pages {
    padding: 12px 16px 16px;
}

.company-section {
    margin-bottom: 16px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.profile-page .company-section,
.profile-page .company-alert {
    max-width: 560px;
}

.profile-page .company-section .form-actions {
    padding: 0 18px 18px;
    margin: 0;
}

.profile-page .company-grid.password-grid .current-password {
    grid-column: 1 / -1;
}

.profile-page .company-grid.password-grid .current-password input {
    max-width: calc(50% - 8px);
}

.company-section h2 {
    margin: 0;
    padding: 14px 18px;
    background: #f4f8fa;
    color: var(--brand-blue);
    font-size: 15px;
}

.company-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 16px;
    padding: 18px;
}

.company-grid .span-2 {
    grid-column: 1 / -1;
}

.company-grid label {
    display: block;
    font-weight: 600;
}

.company-grid label > input,
.company-grid label > select,
.company-grid label > textarea,
.company-grid label > small {
    display: block;
    width: 100%;
    margin-top: 6px;
}

.company-grid > div {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-weight: 600;
}

.company-grid > div span {
    color: var(--muted);
    font-weight: 500;
}

.company-grid label span {
    color: #dc2626;
    font-weight: 500;
}

.company-grid input,
.company-grid select {
    height: 38px;
    border: 1px solid #dbe1e6;
    border-radius: 8px;
    padding: 0 12px;
    font: inherit;
    font-weight: 400;
    background-color: #fff;
}

.company-grid input:-webkit-autofill,
.company-grid input:-webkit-autofill:hover,
.company-grid input:-webkit-autofill:focus,
.company-grid input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px #fff inset;
    box-shadow: 0 0 0 1000px #fff inset;
    -webkit-text-fill-color: inherit;
    caret-color: inherit;
    transition: background-color 99999s ease-out;
}

.company-grid small,
.company-grid strong {
    font-weight: 600;
}

.company-grid small {
    color: #dc2626;
    font-weight: 500;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.detail-card {
    margin-bottom: 16px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
}

.detail-card h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    color: #1a1a1a;
    font-size: 15px;
}

.detail-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: #e7f2f6;
    color: var(--brand-blue);
}

.detail-icon svg {
    width: 16px;
    height: 16px;
}

.detail-fields {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 22px 16px;
    padding: 18px 20px 22px;
}

.detail-fields > div {
    grid-column: span 6;
}

.detail-fields > div.third {
    grid-column: span 4;
}

.detail-fields > div.unit {
    grid-column: span 3;
}

.detail-fields > div.street {
    grid-column: span 5;
}

.detail-fields > div.suburb {
    grid-column: span 4;
}

.detail-fields span {
    display: block;
    margin-bottom: 4px;
    color: #9ca3af;
    font-size: 13px;
    font-weight: 500;
}

.detail-fields strong,
.detail-fields a {
    color: #1a1a1a;
    font-weight: 600;
    text-decoration: none;
}

.detail-fields a {
    color: var(--brand-blue);
}

.detail-fields strong.blank {
    color: #9ca3af;
    font-weight: 500;
}

.detail-fields .role-badge,
.detail-fields .status-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.detail-fields strong.role-badge {
    background: var(--brand-blue);
    color: #fff;
}

.detail-fields strong.status-pill.active {
    background: #e7f6ef;
    color: #14804a;
}

.detail-fields strong.status-pill.inactive {
    background: #f3f4f6;
    color: #6b7280;
}

.driver-contact {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.driver-contact a {
    color: var(--brand-blue);
    font-weight: 600;
    text-decoration: none;
}

.rate-suffix {
    color: #9ca3af;
    font-weight: 500;
}

.detail-fields > div.span-note {
    grid-column: 1 / -1;
}

.company-grid textarea {
    min-height: 96px;
    border: 1px solid #dbe1e6;
    border-radius: 8px;
    padding: 8px 12px;
    font: inherit;
    font-weight: 400;
}

.expiry-overdue {
    color: #dc2626;
    font-weight: 700;
}

.expiry-soon {
    color: #d97706;
    font-weight: 700;
}

.expiry-empty {
    color: #9ca3af;
}

.list-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
}

.per-page {
    display: flex;
    align-items: center;
    color: var(--muted);
    font-size: 14px;
}

.per-page select {
    height: 32px;
    margin: 0 6px;
    border: 1px solid #dbe1e6;
    border-radius: 8px;
    background: #fff;
}

.assign-list {
    display: grid;
    gap: 8px;
    padding: 16px 20px 20px;
}

.assign-list label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.assign-list p {
    margin: 0;
    color: var(--muted);
}

.password-modal {
    width: min(480px, calc(100vw - 32px));
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .2);
}

.password-modal::backdrop {
    background: rgba(15, 23, 42, .45);
}

.password-modal header,
.password-modal footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
}

.password-modal header {
    border-bottom: 1px solid var(--border);
}

.password-modal h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: #1a1a1a;
    font-size: 16px;
}

.password-modal h2 svg {
    width: 18px;
    height: 18px;
    color: #0284c7;
}

.password-modal header button {
    border: 0;
    background: transparent;
    color: #6b7280;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.password-modal-body {
    padding: 18px 20px;
}

.password-modal-body p {
    margin: 0 0 8px;
}

.password-person {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 14px;
}

.password-person small,
.password-copy + small {
    color: var(--muted);
    font-weight: 500;
}

.password-note {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 14px;
}

.password-note.warn {
    background: #fff7ed;
    color: #9a3412;
}

.password-note.ok {
    background: #e7f6ef;
    color: #166534;
}

.password-note.info {
    background: #e7f2f6;
    color: #1f6f8c;
}

.password-note.danger {
    background: #fef2f2;
    color: #b91c1c;
}

.password-modal-body label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 14px;
    font-weight: 600;
}

.password-copy {
    display: flex;
}

.password-copy input {
    flex: 1;
    height: 40px;
    border: 1px solid #dbe1e6;
    border-right: 0;
    border-radius: 8px 0 0 8px;
    padding: 0 12px;
    font: inherit;
}

.password-copy button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    border: 1px solid #dbe1e6;
    border-radius: 0 8px 8px 0;
    background: #fff;
    cursor: pointer;
}

.password-copy svg {
    width: 16px;
    height: 16px;
}

.password-modal footer {
    justify-content: flex-end;
    border-top: 1px solid var(--border);
}

.password-loading {
    text-align: center;
    color: var(--muted);
}

.maint-page {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.maint-section,
.maint-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
}

.maint-section {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.maint-head,
.maint-card-head,
.maint-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.maint-head h2,
.maint-card-head h3 {
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
}

.maint-head svg,
.maint-card svg,
.maint-log svg {
    width: 16px;
    height: 16px;
    color: var(--brand-blue);
}

.maint-head .btn-outline,
.maint-head .btn-brand,
.maint-card-head .btn-outline {
    height: 32px;
    padding: 0 12px;
}

.maint-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.maint-stat {
    background: #fff;
    border: 1px solid var(--border);
    border-left: 3px solid var(--muted);
    border-radius: 10px;
    padding: 14px 16px;
}

.maint-stat strong {
    display: block;
    font-size: 28px;
    line-height: 1.1;
}

.maint-stat span {
    color: inherit;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.maint-stat.danger { border-left-color: #dc2626; color: #dc2626; }
.maint-stat.warning { border-left-color: #d97706; color: #d97706; }
.maint-stat.success { border-left-color: #16a34a; color: #16a34a; }
.maint-stat.info { border-left-color: #2563eb; color: #2563eb; }
.maint-stat.muted { border-left-color: #9ca3af; color: #6b7280; }

.maint-split {
    display: grid;
    grid-template-columns: 1.4fr .8fr;
    gap: 14px;
}

.maint-card { overflow: hidden; }

.maint-card-head { padding: 14px 16px; border-bottom: 1px solid var(--border); }

.maint-table { width: 100%; border-collapse: collapse; }

.maint-table th {
    text-align: left;
    font-size: 11px;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
}

.maint-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.maint-table strong,
.maint-log strong { display: block; }

.maint-table small,
.maint-log small { display: block; color: var(--muted); }

.maint-badge,
.maint-priority {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.maint-badge.overdue { background: #fee2e2; color: #dc2626; }
.maint-badge.soon { background: #ffedd5; color: #c2410c; }
.maint-badge.status { background: #dbeafe; color: #1d4ed8; }
.maint-priority.critical { color: #dc2626; }
.maint-priority.high,
.maint-priority.major { color: #ea580c; }
.maint-priority.medium,
.maint-priority.moderate { color: #ca8a04; }
.maint-priority.low,
.maint-priority.minor { color: #6b7280; }

.maint-log {
    display: flex;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.maint-log span {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #eef6f8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
}

.maint-empty {
    margin: 0;
    padding: 28px 16px;
    text-align: center;
    color: var(--muted);
}

.fleet-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.fleet-stat {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #fff;
    border: 1px solid var(--border);
    border-left: 3px solid #94a3b8;
    border-radius: 10px;
    padding: 16px 18px;
    color: inherit;
    text-decoration: none;
}

.fleet-stat svg { width: 28px; height: 28px; color: #94a3b8; flex: none; }
.fleet-stat strong { display: block; font-size: 26px; line-height: 1.1; color: #111827; }
.fleet-stat span { color: var(--muted); font-size: 13px; }
.fleet-stat.danger { border-left-color: #ef4444; }
.fleet-stat.danger svg { color: #ef4444; }
.fleet-stat.warning { border-left-color: #f59e0b; }
.fleet-stat.warning svg { color: #f59e0b; }
.fleet-stat.success { border-left-color: #10b981; }
.fleet-stat.success svg { color: #10b981; }
.fleet-stat.is-on { box-shadow: inset 0 0 0 1px var(--brand-blue); }

.programs-page td strong,
.programs-page td small { display: block; }
.programs-page td small,
.programs-page .muted { color: var(--muted); }
.programs-page td a { color: inherit; text-decoration: none; }

.prog-pill,
.prog-count {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 700;
}
.prog-pill.none { background: #f3f4f6; color: #6b7280; }
.prog-pill.info, .prog-count { background: #dbeafe; color: #1d4ed8; }
.prog-pill.overdue { background: #fee2e2; color: #dc2626; }
.prog-pill.soon { background: #ffedd5; color: #c2410c; }
.prog-pill.ok { background: #dcfce7; color: #166534; }

.programs-trailers { margin: 22px 0 10px; }
.programs-trailers h2 { margin: 0; font-size: 20px; }

.company-alert.error { background: #fee2e2; color: #991b1b; }

.assign-dialog {
    width: min(520px, calc(100vw - 32px));
    border: 0;
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 16px 50px rgba(15, 23, 42, .2);
}
.assign-dialog::backdrop { background: rgba(15, 23, 42, .45); }
.assign-dialog form { display: flex; flex-direction: column; gap: 8px; padding: 18px; }
.assign-dialog header, .assign-dialog footer { display: flex; align-items: center; justify-content: space-between; }
.assign-dialog h2 { margin: 0; font-size: 18px; }
.assign-dialog header button { border: 0; background: transparent; font-size: 22px; cursor: pointer; }
.assign-dialog input, .assign-dialog select {
    height: 40px;
    border: 1px solid #dbe1e6;
    border-radius: 8px;
    padding: 0 12px;
    font: inherit;
}
.assign-dialog .assign-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.assign-dialog .assign-dates label { display: flex; flex-direction: column; gap: 6px; }
.assign-dialog footer { gap: 8px; justify-content: flex-end; margin-top: 8px; }

@media (max-width: 900px) {
    .companies-filters,
    .company-grid,
    .maint-stats,
    .maint-split,
    .fleet-stats,
    .assign-dialog .assign-dates {
        grid-template-columns: 1fr;
    }

    .detail-fields > div,
    .detail-fields > div.third,
    .detail-fields > div.unit,
    .detail-fields > div.street,
    .detail-fields > div.suburb {
        grid-column: span 12;
    }
}

/* Auth / guest pages */
.auth-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(75, 141, 162, .18), transparent 42%),
        radial-gradient(circle at bottom right, rgba(39, 113, 142, .16), transparent 40%),
        #f7f9fc;
}

.auth-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 32px 16px;
    box-sizing: border-box;
}

.auth-brand-link {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    color: var(--brand-blue);
    text-decoration: none;
}

.auth-brand-link img {
    width: 56px;
    height: 56px;
    padding: 8px;
    object-fit: contain;
    background: var(--brand-blue);
    border-radius: 14px;
    box-shadow: 0 10px 24px rgba(39, 113, 142, .28);
}

.auth-brand-link span {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -.02em;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 28px 28px 24px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 18px 40px rgba(39, 113, 142, .12);
}

.auth-title {
    margin: 0 0 8px;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--brand-blue);
}

.auth-card > p,
.auth-card .auth-copy {
    margin: 0 0 18px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}

.auth-card label {
    color: #374151;
    font-size: 13px;
    font-weight: 600;
}

.auth-card input[type="text"],
.auth-card input[type="email"],
.auth-card input[type="password"],
.auth-card input:not([type]) {
    width: 100%;
    height: 42px;
    margin-top: 6px;
    padding: 0 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    color: #1a1a1a;
    font: inherit;
    box-shadow: none;
}

.auth-card input[type="text"]:focus,
.auth-card input[type="email"]:focus,
.auth-card input[type="password"]:focus,
.auth-card input:not([type]):focus {
    outline: none;
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 3px rgba(39, 113, 142, .18);
}

.auth-card input:-webkit-autofill,
.auth-card input:-webkit-autofill:hover,
.auth-card input:-webkit-autofill:focus,
.auth-card input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px #fff inset;
    box-shadow: 0 0 0 1000px #fff inset;
    -webkit-text-fill-color: #1a1a1a;
    caret-color: #1a1a1a;
    transition: background-color 99999s ease-out;
}

.auth-card input[type="checkbox"] {
    color: var(--brand-blue);
    border-color: #c5ced6;
    border-radius: 4px;
}

.auth-card input[type="checkbox"]:focus {
    --tw-ring-color: rgba(39, 113, 142, .35);
    box-shadow: 0 0 0 3px rgba(39, 113, 142, .18);
}

.auth-card a {
    color: var(--brand-blue);
    text-decoration: none;
    font-weight: 600;
}

.auth-card a:hover {
    color: var(--brand-hover);
    text-decoration: underline;
}

.auth-card button[type="submit"],
.auth-card .btn-brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 18px;
    border: 0;
    border-radius: 8px;
    background: var(--brand-blue);
    color: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    cursor: pointer;
    box-shadow: none;
}

.auth-card button[type="submit"]:hover,
.auth-card .btn-brand:hover {
    background: var(--brand-hover);
}

.auth-card button[type="submit"]:focus,
.auth-card .btn-brand:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(39, 113, 142, .25);
}

.auth-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.auth-actions.end {
    justify-content: flex-end;
}

.auth-status {
    margin-bottom: 16px;
    color: #15803d;
    font-size: 14px;
    font-weight: 600;
}

/* Toolbox modules — card grid (old CRM parity) */
.toolbox-module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.toolbox-module-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.toolbox-module-card:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.toolbox-module-body {
    padding: 1.25rem;
}

.toolbox-module-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.toolbox-module-title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
    color: #111827;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
    min-width: 0;
}

.toolbox-module-title a {
    color: inherit;
    text-decoration: none;
}

.toolbox-module-title a:hover {
    color: var(--brand-blue);
}

.toolbox-scope {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.toolbox-scope svg {
    width: 14px;
    height: 14px;
}

.toolbox-scope.global {
    color: #1486a0;
}

.toolbox-scope.company {
    color: #059669;
}

.toolbox-module-desc {
    margin: 0 0 1rem;
    min-height: 2.5rem;
    font-size: 0.875rem;
    color: #6b7280;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.toolbox-module-status {
    margin-bottom: 0.75rem;
}

.toolbox-module-status .badge-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #e7f6ef;
    color: #14804a;
    font-size: 0.75rem;
    font-weight: 600;
}

.toolbox-module-status .badge-status .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #16a34a;
}

.toolbox-module-status .badge-status.inactive {
    background: #f3f4f6;
    color: var(--muted);
}

.toolbox-module-status .badge-status.inactive .dot {
    background: #9ca3af;
}

.toolbox-module-stats {
    display: flex;
    gap: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.toolbox-module-stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.toolbox-module-stat svg {
    width: 16px;
    height: 16px;
    color: #9ca3af;
    flex-shrink: 0;
}

.toolbox-module-stat strong {
    display: inline;
    color: #111827;
    font-weight: 600;
}

.toolbox-module-stat span {
    color: #6b7280;
}

.toolbox-module-actions {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.35rem;
    margin-top: 1rem;
}

.toolbox-module-actions form {
    margin: 0;
    display: inline-flex;
}

.toolbox-action {
    height: 26px;
    padding: 0 0.45rem;
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: 5px;
    gap: 4px;
    white-space: nowrap;
}

.toolbox-action svg {
    width: 12px;
    height: 12px;
}

.toolbox-action.warning {
    border-color: #fdba74;
    color: #c2410c;
}

.toolbox-action.success {
    border-color: #86efac;
    color: #15803d;
}

.toolbox-empty {
    text-align: center;
    padding: 4rem 2rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
}

.toolbox-empty-icon {
    width: 48px;
    height: 48px;
    color: #d1d5db;
    margin-bottom: 1rem;
}

.toolbox-empty h3 {
    margin: 0 0 0.5rem;
    font-size: 1.25rem;
    color: #374151;
}

.toolbox-empty p {
    margin: 0 0 1.25rem;
    color: #6b7280;
}

.toolbox-content-body {
    margin-top: 0.35rem;
    color: #111827;
    font-weight: 400;
    line-height: 1.55;
}

.toolbox-content-body p {
    margin: 0 0 0.75rem;
}

.toolbox-content-body ul,
.toolbox-content-body ol {
    margin: 0 0 0.75rem;
    padding-left: 1.25rem;
}

/* Shifts */
.shift-stats { margin-bottom: 16px; }

.companies-filters.filters-shifts {
    grid-template-columns: minmax(180px, 1.4fr) repeat(3, minmax(130px, .8fr)) repeat(2, minmax(130px, .7fr)) 42px;
}

.companies-filters.filters-shifts input[type="date"] {
    height: 42px;
    border: 1px solid #dbe1e6;
    border-radius: 8px;
    padding: 0 10px;
    font: inherit;
}

.shift-status {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.shift-status.draft { background: #f3f4f6; color: #4b5563; }
.shift-status.pending { background: #fef3c7; color: #92400e; }
.shift-status.accepted { background: #dbeafe; color: #1e40af; }
.shift-status.started { background: #e0e7ff; color: #3730a3; }
.shift-status.return { background: #cffafe; color: #155e75; }
.shift-status.completed { background: #dcfce7; color: #166534; }
.shift-status.cancelled { background: #fee2e2; color: #991b1b; }

.company-grid label.check-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.company-grid label.check-label > input { width: auto; margin: 0; }

.company-grid > .shift-row {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.shift-row > select,
.shift-row > input { flex: 1 1 140px; width: auto; }

.company-grid label span.shift-pair {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    color: inherit;
    font-weight: 500;
}

.shift-pair input { width: 80px; }

.shift-days { display: flex; flex-wrap: wrap; gap: 14px; }

.error-list { margin: 8px 0 0 18px; padding: 0; list-style: disc; }

.empty-row { padding: 24px; text-align: center; color: var(--muted); }

.shift-notes { margin: 0; padding: 16px 18px; white-space: pre-line; }

.shift-delete { display: flex; gap: 10px; padding: 16px 18px; }

.shift-delete input {
    flex: 1;
    height: 40px;
    border: 1px solid #dbe1e6;
    border-radius: 8px;
    padding: 0 12px;
    font: inherit;
}

.field-error { display: block; padding: 0 18px 14px; color: #dc2626; }

@media (max-width: 900px) {
    .companies-filters.filters-shifts { grid-template-columns: 1fr 1fr; }
}

/* Shift view (single page) */
.shift-view { display: flex; flex-direction: column; gap: 20px; max-width: 1440px; color: var(--ui-ink); font-family: var(--ui-font); font-size: var(--ui-fs-body); font-variant-numeric: tabular-nums; }
.shift-view > * { margin-bottom: 0 !important; }

.shift-view .sv-crumbs { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: var(--ui-fs-small); color: var(--ui-muted); }
.shift-view .sv-crumbs a { color: var(--ui-muted); font-weight: 500; text-decoration: none; }
.shift-view .sv-crumbs a:hover { color: var(--ui-brand); }
.shift-view .sv-crumbs [aria-current] { color: var(--ui-ink-2); font-weight: 600; }
.shift-view .sv-crumb-sep { color: var(--ui-faint); }

.shift-view .sv-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.shift-view .sv-head-text { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.shift-view .sv-title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.shift-view .sv-title { margin: 0; font-size: var(--ui-fs-page); font-weight: 600; letter-spacing: -.02em; line-height: 1.2; color: var(--ui-ink); }
.shift-view .sv-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0; color: var(--ui-muted); font-size: var(--ui-fs-body); }
.shift-view .sv-meta-sep { color: var(--ui-faint); }
.shift-view .sv-meta-route { display: inline-flex; align-items: center; gap: 6px; min-width: 0; color: var(--ui-ink-2); font-weight: 500; overflow-wrap: anywhere; }
.shift-view .sv-meta-route i { color: var(--ui-faint); font-size: 12px; }
.shift-view .sv-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.shift-view .sv-status { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; line-height: 1.4; white-space: nowrap; }
.shift-view .sv-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.shift-view .sv-status-pending { background: #fef0c7; color: #93370d; }
.shift-view .sv-status-accepted { background: #dbeafe; color: #1e40af; }
.shift-view .sv-status-started { background: #ede9fe; color: #5b21b6; }
.shift-view .sv-status-return { background: #e0f2fe; color: #075985; }
.shift-view .sv-status-completed { background: #dcfce7; color: #166534; }
.shift-view .sv-status-cancelled { background: #fee4e2; color: #b42318; }
.shift-view .sv-status-draft { background: #f3f4f6; color: #374151; }
.shift-view .sv-flag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; background: #eaf3f7; color: var(--ui-brand-dark); font-size: 12px; font-weight: 600; }
.shift-view .sv-flag i { font-size: 11px; }
.shift-view .sv-flag.ok { background: #e3f3ea; color: #1b7f4b; }

.shift-view .sv-menu { position: relative; }
.shift-view .sv-menu-caret { font-size: 10px; transition: transform .15s; }
.shift-view .sv-menu-caret.open { transform: rotate(180deg); }
.shift-view .sv-menu-list { position: absolute; top: calc(100% + 6px); right: 0; z-index: 30; min-width: 200px; padding: 6px; background: var(--ui-surface); border: 1px solid var(--ui-line); border-radius: var(--ui-radius); box-shadow: 0 12px 28px -8px rgba(16, 24, 40, .2); }
.shift-view .sv-menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 0; border-radius: 6px; background: none; font: inherit; font-size: 13.5px; font-weight: 500; text-align: left; cursor: pointer; }
.shift-view .sv-menu-item i { width: 16px; text-align: center; }
.shift-view .sv-menu-item.warning { color: #b45309; }
.shift-view .sv-menu-item.warning:hover, .shift-view .sv-menu-item.warning:focus-visible { background: #fffbeb; outline: 0; }
.shift-view .sv-menu-item.danger { color: #dc2626; }
.shift-view .sv-menu-item.danger:hover, .shift-view .sv-menu-item.danger:focus-visible { background: #fef2f2; outline: 0; }
.shift-view .sv-menu-item { box-sizing: border-box; color: var(--ui-ink); text-decoration: none; }
.shift-view .sv-menu-item:hover, .shift-view .sv-menu-item:focus-visible { background: var(--ui-soft); color: var(--ui-ink); text-decoration: none; outline: 0; }
.shift-view .sv-menu-item.danger:hover, .shift-view .sv-menu-item.danger:focus-visible { background: #fef2f2; color: #dc2626; }
.shift-view .sv-menu-item.warning:hover, .shift-view .sv-menu-item.warning:focus-visible { background: #fffbeb; color: #b45309; }
.page-head .sv-actions .btn-brand, .page-head .sv-actions .btn-outline { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }

.shift-view .sv-alert { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 20px; padding: 12px 16px; border: 1px solid; border-left-width: 3px; border-radius: var(--ui-radius); font-size: 13.5px; }
.shift-view .sv-alert > i { margin-top: 2px; font-size: 15px; }
.shift-view .sv-alert-body { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; min-width: 0; }
.shift-view .sv-alert-body strong { font-weight: 600; }
.shift-view .sv-alert-time { color: var(--ui-muted); font-size: var(--ui-fs-small); }
.shift-view .sv-alert-reason { flex-basis: 100%; color: var(--ui-ink-2); overflow-wrap: anywhere; }
.shift-view .sv-alert-reason b { font-weight: 600; }
.shift-view .sv-alert-bad { background: #fef6f5; border-color: #fbd5d1; border-left-color: #dc2626; }
.shift-view .sv-alert-bad > i, .shift-view .sv-alert-bad strong { color: #b42318; }
.shift-view .sv-alert-info { background: #f3f8fa; border-color: #d6e6ed; border-left-color: var(--ui-brand); }
.shift-view .sv-alert-info > i, .shift-view .sv-alert-info strong { color: #17566f; }

.shift-view .sv-card { background: var(--ui-surface); border: 1px solid var(--ui-line); border-radius: var(--ui-radius); box-shadow: var(--ui-shadow); overflow: hidden; }
.shift-view .sv-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 24px; border-bottom: 1px solid var(--ui-line-soft); }
.shift-view .sv-card-head h2 { margin: 0; font-size: var(--ui-fs-section); font-weight: 600; color: var(--ui-ink); }
.shift-view .sv-card-body { padding: 20px 24px; }
.shift-view .sv-card-body + .sv-card-body { border-top: 1px solid var(--ui-line-soft); }
.shift-view .sv-muted { color: var(--ui-muted); font-size: var(--ui-fs-small); }
.shift-view .sv-link { display: inline-flex; align-items: center; gap: 6px; color: var(--ui-brand); font-size: 13px; font-weight: 600; text-decoration: none; }
.shift-view .sv-link:hover { text-decoration: underline; }
.shift-view .sv-note { margin: 12px 0 0; padding: 12px 14px; background: var(--ui-soft); border: 1px solid var(--ui-line-soft); border-radius: 8px; color: var(--ui-ink-2); font-size: 13.5px; overflow-wrap: anywhere; }

.shift-view .sv-label { font-size: var(--ui-fs-label); font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--ui-muted); }
.shift-view .sv-value { font-size: 15px; font-weight: 600; color: var(--ui-ink); overflow-wrap: anywhere; }
.shift-view .sv-value.muted { font-weight: 500; color: var(--ui-faint); }
.shift-view .sv-hint { display: flex; align-items: center; gap: 6px; font-size: var(--ui-fs-small); color: var(--ui-muted); }
.shift-view .sv-hint-inline { margin-left: 4px; font-size: 11.5px; font-weight: 500; color: var(--ui-muted); }
.shift-view .sv-mini-tag { display: inline-block; padding: 1px 7px; border-radius: 5px; background: #fff4e5; color: #9a5b00; font-size: 11px; font-weight: 700; }

.shift-view .sv-overview { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 20px; }
.shift-view .sv-overview-item { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 18px 24px; }
.shift-view .sv-overview-item + .sv-overview-item { border-left: 1px solid var(--ui-line-soft); }
.shift-view .sv-overview-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.shift-view .sv-avatar { width: 36px; height: 36px; flex: none; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--ui-brand-soft); color: #17566f; font-size: 12px; font-weight: 700; }
.shift-view .sv-avatar.sm { width: 28px; height: 28px; font-size: 11px; }

.shift-view .sv-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; align-items: start; gap: 20px; }
.shift-view .sv-main, .shift-view .sv-rail { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

.shift-view .sv-steps { display: grid; grid-template-columns: repeat(var(--steps), minmax(0, 1fr)); margin: 0; padding: 22px 24px; list-style: none; }
.shift-view .sv-step { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding-right: 10px; }
.shift-view .sv-step-track { display: flex; align-items: center; margin-bottom: 8px; }
.shift-view .sv-step-dot { width: 22px; height: 22px; flex: none; display: flex; align-items: center; justify-content: center; border-radius: 50%; border: 2px solid #d1d5db; background: var(--ui-surface); color: #fff; font-size: 10px; box-sizing: border-box; }
.shift-view .sv-step-line { flex: 1; height: 2px; margin: 0 8px; background: var(--ui-line); }
.shift-view .sv-step.done .sv-step-dot { background: var(--ui-brand); border-color: var(--ui-brand); }
.shift-view .sv-step.done .sv-step-line { background: var(--ui-brand); }
.shift-view .sv-step.cancel .sv-step-dot { background: #dc2626; border-color: #dc2626; }
.shift-view .sv-step-label { font-size: 13.5px; font-weight: 600; color: var(--ui-ink); }
.shift-view .sv-step.todo .sv-step-label { font-weight: 500; color: var(--ui-muted); }
.shift-view .sv-step.cancel .sv-step-label { color: #b42318; }
.shift-view .sv-step-meta { font-size: var(--ui-fs-label); color: var(--ui-muted); }

.shift-view .sv-route-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: stretch; }
.shift-view .sv-route { display: flex; gap: 16px; min-width: 0; }
.shift-view .sv-route-line { display: flex; flex-direction: column; align-items: center; padding-top: 4px; }
.shift-view .sv-route-start { width: 12px; height: 12px; border: 3px solid var(--ui-brand); border-radius: 50%; background: var(--ui-surface); box-sizing: content-box; }
.shift-view .sv-route-dash { flex: 1; width: 0; min-height: 40px; margin: 4px 0; border-left: 2px dashed #cbd5e1; }
.shift-view .sv-route-end { width: 14px; height: 14px; border-radius: 3px; background: #15803d; }
.shift-view .sv-route-stops { flex: 1; display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.shift-view .sv-stop { display: flex; flex-direction: column; gap: 4px; }
.shift-view .sv-stop-place { font-size: 16px; font-weight: 600; color: var(--ui-ink); overflow-wrap: anywhere; }
.shift-view .sv-stop-times { display: flex; flex-wrap: wrap; gap: 6px 32px; margin: 4px 0 2px; }
.shift-view .sv-stop-times div { display: flex; flex-direction: column; gap: 1px; }
.shift-view .sv-stop-times dt { font-size: var(--ui-fs-label); font-weight: 500; color: var(--ui-muted); }
.shift-view .sv-stop-times dd { margin: 0; font-size: 13.5px; font-weight: 500; color: var(--ui-ink-2); }

.shift-view .sv-route-panel { display: flex; flex-direction: column; gap: 16px; padding: 18px 20px; background: var(--ui-soft); border: 1px solid var(--ui-line-soft); border-radius: var(--ui-radius); }
.shift-view .sv-route-total { display: flex; flex-direction: column; gap: 2px; padding-bottom: 14px; border-bottom: 1px solid var(--ui-line); }
.shift-view .sv-route-total strong { font-size: 22px; font-weight: 700; letter-spacing: -.01em; color: var(--ui-ink); }
.shift-view .sv-route-total strong.muted { font-size: 15px; font-weight: 500; color: var(--ui-faint); }
.shift-view .sv-facts { display: flex; flex-direction: column; gap: 12px; margin: 0; }
.shift-view .sv-facts > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.shift-view .sv-facts dt { font-size: var(--ui-fs-label); font-weight: 500; color: var(--ui-muted); }
.shift-view .sv-facts dd { margin: 0; font-size: 13.5px; font-weight: 600; color: var(--ui-ink); overflow-wrap: anywhere; }
.shift-view .sv-facts dd small { display: block; font-weight: 400; color: var(--ui-muted); font-size: var(--ui-fs-label); }
.shift-view .sv-facts.inline { flex-direction: row; flex-wrap: wrap; gap: 12px 32px; margin-bottom: 4px; }

.shift-view .sv-subsection h3 { margin: 0 0 12px; font-size: 14px; font-weight: 600; color: var(--ui-ink); }
.shift-view .sv-subsection h3 small { margin-left: 6px; font-weight: 400; color: var(--ui-muted); }
.shift-view .sv-break-who { margin: 8px 0; font-weight: 600; font-size: 13.5px; }

.shift-view .sv-table { font-size: 13.5px; }
.shift-view .sv-table th { background: var(--ui-soft); color: var(--ui-muted); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; padding: 10px 14px; border-bottom: 1px solid var(--ui-line); }
.shift-view .sv-table td { padding: 12px 14px; min-width: 0; border-bottom: 1px solid var(--ui-line-soft); }
.shift-view .sv-table .num { text-align: right; white-space: nowrap; }
.shift-view .sv-table tfoot td { padding: 12px 14px; border-top: 1px solid var(--ui-line); border-bottom: 0; font-weight: 600; background: var(--ui-soft); }
.shift-view .sv-pay-extra { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 12px; font-size: 13px; color: var(--ui-muted); }
.shift-view .sv-pay-extra b { color: var(--ui-ink); }

.shift-view .sv-dl { margin: 0; padding: 4px 24px 8px; }
.shift-view .sv-dl > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--ui-line-soft); }
.shift-view .sv-dl > div:last-child { border-bottom: 0; }
.shift-view .sv-dl dt { font-size: 13px; color: var(--ui-muted); white-space: nowrap; }
.shift-view .sv-dl dd { margin: 0; font-size: 13.5px; font-weight: 500; text-align: right; color: var(--ui-ink); overflow-wrap: anywhere; }
.shift-view .sv-dl dd.muted { color: var(--ui-faint); }
.shift-view .sv-dl dd small { color: var(--ui-muted); font-weight: 400; }

.shift-view .sv-people { margin: 0; padding: 8px 24px 14px; list-style: none; }
.shift-view .sv-people li { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.shift-view .sv-people-name { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 600; overflow-wrap: anywhere; }
.shift-view .sv-pill { padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; }
.shift-view .sv-pill.ok { background: #dcfce7; color: #166534; }
.shift-view .sv-pill.pending { background: #f3f4f6; color: #374151; }
.shift-view .sv-pill.bad { background: #fee2e2; color: #991b1b; }

.shift-view .sv-activity { position: relative; display: flex; flex-direction: column; gap: 18px; margin: 0; padding: 18px 24px 20px; list-style: none; }
.shift-view .sv-activity li { position: relative; display: flex; gap: 12px; }
.shift-view .sv-activity li:not(:last-child)::after { content: ""; position: absolute; top: 30px; bottom: -16px; left: 13px; width: 1px; background: var(--ui-line); }
.shift-view .sv-activity li > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.shift-view .sv-activity-icon { width: 27px; height: 27px; flex: none; display: flex; align-items: center; justify-content: center; border-radius: 50%; font-size: 11px; }
.shift-view .sv-activity-icon.brand { background: var(--ui-brand-soft); color: #17566f; }
.shift-view .sv-activity-icon.ok { background: #dcfce7; color: #166534; }
.shift-view .sv-activity-icon.bad { background: #fee4e2; color: #b42318; }
.shift-view .sv-activity-text { font-size: 13.5px; color: var(--ui-ink-2); }
.shift-view .sv-activity-text b { color: var(--ui-ink); font-weight: 600; }
.shift-view .sv-activity-time { font-size: var(--ui-fs-label); color: var(--ui-faint); }
.shift-view .sv-activity-note { align-self: flex-start; margin-top: 4px; padding: 4px 9px; border: 1px solid var(--ui-line); border-radius: 6px; background: var(--ui-soft); color: var(--ui-ink-2); font-size: var(--ui-fs-label); overflow-wrap: anywhere; }

.shift-view .sv-hero { background: var(--ui-surface); border: 1px solid var(--ui-line); border-radius: var(--ui-radius); box-shadow: var(--ui-shadow); }
.shift-view .sv-hero-top { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 22px 24px 20px; }
.shift-view .sv-hero-id { display: flex; align-items: flex-start; gap: 16px; flex: 1 1 420px; min-width: 0; }
.shift-view .sv-back { width: 40px; height: 40px; flex: none; display: flex; align-items: center; justify-content: center; border: 1px solid var(--ui-line-strong); border-radius: var(--ui-radius-sm); background: var(--ui-surface); color: var(--ui-ink); box-sizing: border-box; }
.shift-view .sv-back:hover { background: var(--ui-soft); }
.shift-view .sv-back svg { width: 18px; height: 18px; }
.shift-view .sv-hero-text { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.shift-view .sv-hero .sv-title-row { min-height: 40px; }
.shift-view .sv-title { line-height: 40px; }
.shift-view .sv-hero-name { font-size: 15px; font-weight: 500; color: var(--ui-ink-2); overflow-wrap: anywhere; }
.shift-view .sv-hero-date { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; color: var(--ui-muted); }
.shift-view .sv-hero-date svg { width: 15px; height: 15px; }
.shift-view .sv-hero-date .sep { color: var(--ui-faint); }
.shift-view .sv-hero-date .route { color: var(--ui-ink-2); font-weight: 500; overflow-wrap: anywhere; }
.shift-view .sv-actions .btn-brand, .shift-view .sv-actions .btn-outline { height: 40px; padding: 0 18px; border-radius: var(--ui-radius-sm); font-family: var(--ui-font); font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.shift-view .sv-actions .btn-brand { background: var(--ui-brand); color: #fff; }
.shift-view .sv-actions .btn-brand:hover { background: var(--ui-brand-dark); color: #fff; }
.shift-view .sv-actions .btn-outline { border-color: var(--ui-line-strong); color: var(--ui-ink); }
.shift-view .sv-icon-btn { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; padding: 0; border: 1px solid var(--ui-line-strong); border-radius: var(--ui-radius-sm); background: var(--ui-surface); color: var(--ui-ink); cursor: pointer; }
.shift-view .sv-icon-btn:hover { background: var(--ui-soft); }
.shift-view .sv-icon-btn svg { width: 18px; height: 18px; }
.shift-view .sv-menu-list { top: 48px; min-width: 220px; border-radius: 12px; box-shadow: var(--ui-shadow-pop); }
.shift-view .sv-menu-item { color: var(--ui-ink); border-radius: 8px; }
.shift-view .sv-menu-item:hover { background: #f2f7fa; }

.shift-view .sv-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1px; background: var(--ui-line-soft); border-top: 1px solid var(--ui-line-soft); border-radius: 0 0 var(--ui-radius) var(--ui-radius); overflow: hidden; }
.shift-view .sv-strip-item { display: flex; align-items: flex-start; gap: 14px; min-width: 0; padding: 18px 24px; background: var(--ui-surface); }
.shift-view .sv-strip-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.shift-view .sv-strip-label { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ui-muted); }
.shift-view .sv-strip-value { font-size: 16px; font-weight: 700; color: var(--ui-ink); overflow-wrap: anywhere; }
.shift-view .sv-strip-value.muted { font-weight: 600; color: var(--ui-muted); }
.shift-view .sv-strip-sub { font-size: 12.5px; color: var(--ui-muted); overflow-wrap: anywhere; }
.shift-view .sv-tile { width: 44px; height: 44px; flex: none; display: flex; align-items: center; justify-content: center; border-radius: 12px; }
.shift-view .sv-tile svg { width: 21px; height: 21px; stroke-width: 1.8; }
.shift-view .sv-tile.person { border-radius: 999px; background: var(--ui-brand-soft); color: var(--ui-brand-dark); font-size: 13px; font-weight: 700; }
.shift-view .sv-tile.blue { background: #e8f0fb; color: #2f5fb3; }
.shift-view .sv-tile.amber { background: #fff1e0; color: #b35a00; }
.shift-view .sv-tile.purple { background: #eeeafb; color: #5b3fb5; }

.shift-view .sv-notice { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 16px 20px; border: 1px solid; border-radius: 12px; }
.shift-view .sv-notice-icon { width: 40px; height: 40px; flex: none; display: flex; align-items: center; justify-content: center; border-radius: var(--ui-radius-sm); }
.shift-view .sv-notice-icon svg { width: 20px; height: 20px; }
.shift-view .sv-notice-text { flex: 1 1 320px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.shift-view .sv-notice-title { font-size: 14.5px; font-weight: 700; overflow-wrap: anywhere; }
.shift-view .sv-notice-body { font-size: 13.5px; color: var(--ui-ink-2); overflow-wrap: anywhere; }
.shift-view .sv-notice-chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border: 1px solid; border-radius: 999px; background: var(--ui-surface); font-size: 12.5px; font-weight: 600; }
.shift-view .sv-notice-chip svg { width: 14px; height: 14px; }
.shift-view .sv-notice-link { display: inline-flex; align-items: center; gap: 6px; color: var(--ui-brand); font-size: 13px; font-weight: 600; text-decoration: none; }
.shift-view .sv-notice-link:hover { text-decoration: underline; }
.shift-view .sv-notice.bad { background: #fef3f2; border-color: #fecdca; }
.shift-view .sv-notice.bad .sv-notice-icon { background: #fee4e2; color: #b42318; }
.shift-view .sv-notice.bad .sv-notice-title { color: #7a271a; }
.shift-view .sv-notice.bad .sv-notice-chip { border-color: #fecdca; color: #7a271a; }
.shift-view .sv-notice.bad .sv-notice-chip svg { color: #b42318; }
.shift-view .sv-notice.warn { background: #fffaeb; border-color: #fedf89; }
.shift-view .sv-notice.warn .sv-notice-icon { background: #fef0c7; color: #b54708; }
.shift-view .sv-notice.warn .sv-notice-title { color: #7a2e0e; }
.shift-view .sv-notice.warn .sv-notice-chip { border-color: #fedf89; color: #7a2e0e; }
.shift-view .sv-notice.info { background: #f3f8fa; border-color: #d6e6ed; }
.shift-view .sv-notice.info .sv-notice-icon { background: var(--ui-brand-soft); color: var(--ui-brand-dark); }
.shift-view .sv-notice.info .sv-notice-title { color: var(--ui-brand-dark); }

.shift-view .sv-card-head h2 { font-weight: 700; }
.shift-view .sv-step-dot { width: 28px; height: 28px; font-size: 12px; border-color: #c5d3dd; }
.shift-view .sv-step.current .sv-step-dot { border: 3px solid #dc6803; }
.shift-view .sv-step.current .sv-step-label { color: #93370d; font-weight: 700; }
.shift-view .sv-step.done .sv-step-label { font-weight: 700; }
.shift-view .sv-step.cancel .sv-step-label { font-weight: 700; }
.shift-view .sv-step.cancel .sv-step-dot { background: #d92d20; border-color: #d92d20; }
.shift-view .sv-route-dash { border-left-color: #b7c8d4; }
.shift-view .sv-route-end { background: #1b7f4b; }
.shift-view .sv-stop-place { font-size: 15.5px; }
.shift-view .sv-route-panel { border-radius: var(--ui-radius-sm); }

@media (max-width: 1199px) {
    .shift-view .sv-layout { grid-template-columns: minmax(0, 1fr); }
    .shift-view .sv-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .shift-view .sv-overview-item:nth-child(3) { border-left: 0; }
    .shift-view .sv-overview-item:nth-child(n+3) { border-top: 1px solid var(--ui-line-soft); }
}

@media (max-width: 991px) {
    .shift-view .sv-route-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 767px) {
    .shift-view .sv-title { font-size: 22px; }
    .shift-view .sv-actions { width: 100%; }
    .shift-view .sv-actions > * { flex: 1 1 auto; }
    .shift-view .sv-actions .btn-outline { justify-content: center; width: 100%; }
    .shift-view .sv-overview { grid-template-columns: minmax(0, 1fr); }
    .shift-view .sv-overview-item + .sv-overview-item { border-left: 0; border-top: 1px solid var(--ui-line-soft); }
    .shift-view .sv-steps { grid-template-columns: 1fr; gap: 14px; }
    .shift-view .sv-step-line { display: none; }
    .shift-view .sv-card-head, .shift-view .sv-card-body, .shift-view .sv-steps, .shift-view .sv-overview-item, .shift-view .sv-dl, .shift-view .sv-people, .shift-view .sv-activity, .shift-view .sv-hero-top, .shift-view .sv-strip-item { padding-left: 16px; padding-right: 16px; }
    .shift-view .sv-hero-id { gap: 12px; }
    .shift-view .sv-strip { grid-template-columns: minmax(0, 1fr); }
}

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 40; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin: -24px -24px 24px; padding: 12px 32px; min-height: 63px; box-sizing: border-box; background: #fff; border-bottom: 1px solid var(--ui-line); font-family: var(--ui-font); color: var(--ui-ink); }
.content-body:has(.tracking-frame) .topbar { margin: 0; }
.topbar svg { width: 18px; height: 18px; stroke-width: 1.8; }
.topbar-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; font-size: 13px; color: var(--ui-muted); }
.topbar-crumbs a { color: var(--ui-muted); text-decoration: none; }
.topbar-crumbs a:hover { color: var(--ui-brand); }
.topbar-crumb-sep { color: var(--ui-faint); }
.topbar-crumb-current { color: var(--ui-ink); font-weight: 600; }
.topbar-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.topbar-search { display: flex; align-items: center; gap: 10px; width: 320px; max-width: 100%; height: 38px; padding: 0 12px; box-sizing: border-box; background: var(--ui-soft); border: 1px solid var(--ui-line); border-radius: 9px; color: var(--ui-muted); }
.topbar-search:focus-within { border-color: var(--ui-brand); background: #fff; }
.topbar-search svg { width: 16px; height: 16px; flex: none; stroke-width: 2; }
.topbar-search input { flex: 1; min-width: 0; padding: 0; border: 0; outline: 0; box-shadow: none; background: transparent; font: inherit; font-size: 13px; color: var(--ui-ink); }
.topbar-search input:focus { box-shadow: none; }
.topbar-pop { position: relative; }
.topbar-new { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border: 0; border-radius: 9px; background: var(--ui-brand); color: #fff; font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.topbar-new:hover { background: var(--ui-brand-dark); }
.topbar-new svg { width: 16px; height: 16px; stroke-width: 2.2; }
.topbar-caret { width: 14px !important; height: 14px !important; stroke-width: 2.2 !important; }
.topbar-icon-btn { position: relative; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; padding: 0; border: 1px solid var(--ui-line); border-radius: 9px; background: #fff; color: var(--ui-ink); cursor: pointer; }
.topbar-icon-btn:hover, .topbar-user:hover { background: var(--ui-soft); }
.topbar-count { position: absolute; top: -6px; right: -6px; padding: 2px 6px; border: 2px solid #fff; border-radius: 999px; background: #d92d20; color: #fff; font-size: 10px; font-weight: 700; line-height: 1.2; }
.topbar-user { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px 0 4px; border: 1px solid var(--ui-line); border-radius: 9px; background: #fff; font: inherit; text-align: left; cursor: pointer; color: var(--ui-muted); }
.topbar-avatar { width: 30px; height: 30px; flex: none; display: flex; align-items: center; justify-content: center; border-radius: 999px; background: var(--ui-brand); color: #fff; font-size: 11.5px; font-weight: 700; }
.topbar-avatar.lg { width: 42px; height: 42px; font-size: 14px; }
.topbar-user-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.topbar-user-name { font-size: 12.5px; font-weight: 600; color: var(--ui-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px; }
.topbar-user-role { font-size: 11px; color: var(--ui-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }
.topbar-menu { position: absolute; top: 46px; right: 0; z-index: 50; width: 250px; padding: 6px; box-sizing: border-box; background: #fff; border: 1px solid var(--ui-line); border-radius: 12px; box-shadow: var(--ui-shadow-pop); }
.topbar-menu-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; border: 0; border-radius: 9px; background: none; font: inherit; font-size: 13.5px; font-weight: 500; color: var(--ui-ink); text-align: left; text-decoration: none; cursor: pointer; }
.topbar-menu-item:hover { background: #f2f7fa; }
.topbar-menu-item > svg { color: var(--ui-muted); }
.topbar-menu-item.danger, .topbar-menu-item.danger > svg { color: #b42318; font-weight: 600; }
.topbar-menu-item.danger:hover { background: #fef3f2; }
.topbar-tile { width: 30px; height: 30px; flex: none; display: flex; align-items: center; justify-content: center; border-radius: 8px; }
.topbar-tile svg { width: 16px; height: 16px; }
.topbar-tile.tone-amber { background: #fff1e0; color: #b35a00; }
.topbar-tile.tone-green { background: #e3f3ea; color: #1b7f4b; }
.topbar-tile.tone-teal { background: #ddeef4; color: #17566f; }
.topbar-tile.tone-blue { background: #e8f0fb; color: #2f5fb3; }
.topbar-notif { width: 400px; max-width: calc(100vw - 24px); padding: 0; overflow: hidden; }
.topbar-notif-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--ui-line-soft); font-size: 15px; }
.topbar-unread { padding: 2px 9px; border-radius: 999px; background: #fee4e2; color: #b42318; font-size: 11.5px; font-weight: 700; }
.topbar-notif-row { display: flex; align-items: flex-start; gap: 12px; padding: 11px 18px; }
.topbar-notif-row + .topbar-notif-row { border-top: 1px solid var(--ui-line-soft); }
.topbar-notif-text { display: flex; flex: 1; flex-direction: column; gap: 2px; min-width: 0; }
.topbar-notif-title { font-size: 13.5px; font-weight: 600; overflow-wrap: anywhere; }
.topbar-notif-msg { font-size: 12.5px; color: var(--ui-muted); overflow-wrap: anywhere; }
.topbar-notif-time { font-size: 12px; color: var(--ui-faint); }
.topbar-dot { width: 8px; height: 8px; flex: none; margin-top: 6px; border-radius: 999px; background: var(--ui-brand); }
.topbar-notif-empty { padding: 28px 18px; text-align: center; font-size: 13px; color: var(--ui-muted); }
.topbar-user-menu { width: 280px; padding: 0; overflow: hidden; }
.topbar-user-menu > a { margin: 6px 6px 0; width: calc(100% - 12px); }
.topbar-user-head { display: flex; align-items: center; gap: 12px; padding: 16px; border-bottom: 1px solid var(--ui-line-soft); }
.topbar-user-head .topbar-user-name { font-size: 14px; font-weight: 700; }
.topbar-user-head .topbar-user-role { font-size: 12.5px; }
.topbar-menu-foot { margin: 6px 0 0; padding: 6px; border-top: 1px solid var(--ui-line-soft); }
@media (max-width: 991px) {
    .topbar { padding: 10px 16px; }
    .topbar-search { width: 220px; }
    .topbar-user-text { display: none; }
}
@media (max-width: 600px) {
    .topbar-tools { width: 100%; }
    .topbar-search { flex: 1 1 100%; width: auto; }
    .topbar-menu { right: auto; left: 0; }
    .topbar-notif { position: fixed; top: 112px; left: 12px; right: 12px; width: auto; }
}

/* Log checker */
.lc-stat-row {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
.lc-stat-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1rem .75rem;
    text-align: center;
}
.lc-stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.2;
}
.lc-stat-label {
    margin-top: .25rem;
    font-size: .8rem;
    color: #6b7280;
}
.lc-stat-value.tone-muted { color: #6c757d; }
.lc-stat-value.tone-ok { color: #16a34a; }
.lc-stat-value.tone-warn { color: #d97706; }
.lc-stat-value.tone-bad { color: #dc2626; }
.lc-stat-value.tone-info { color: #0891b2; }
.lc-stat-value.tone-flag { color: #ea580c; }
.companies-filters.filters-log-checker {
    grid-template-columns: minmax(160px, 1.1fr) minmax(150px, 1fr) minmax(140px, .8fr) minmax(140px, .8fr) auto 42px minmax(90px, auto);
}
.companies-filters.filters-log-checker input[type="date"] {
    height: 42px;
    border: 1px solid #dbe1e6;
    border-radius: 8px;
    padding: 0 10px;
    font: inherit;
    background: #fff;
}
.companies-filters.filters-log-checker .filters-log-checker-clear {
    height: 42px;
    justify-content: center;
}
.lc-flagged-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 13px;
    color: #4b5563;
    white-space: nowrap;
}
.lc-status {
    display: inline-flex;
    align-items: center;
    padding: .3rem .75rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 700;
    white-space: nowrap;
}
.lc-status.lc-pending { background: #e5e7eb; color: #374151; }
.lc-status.lc-ok { background: #d1fae5; color: #065f46; }
.lc-status.lc-warn { background: #fef3c7; color: #92400e; }
.lc-status.lc-bad { background: #fee2e2; color: #991b1b; }
.lc-status.lc-info { background: #cffafe; color: #155e75; }
.lc-flag {
    display: inline-flex;
    padding: .25rem .65rem;
    border-radius: 999px;
    background: #ffedd5;
    color: #c2410c;
    font-size: .75rem;
    font-weight: 700;
}
.lc-handoff-note {
    margin: 14px 0 0;
    color: #6b7280;
    font-size: 13px;
}
@media (max-width: 1100px) {
    .lc-stat-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    .companies-filters.filters-log-checker {
        grid-template-columns: 1fr 1fr;
    }
    .lc-stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Shift approval queue — companies page pattern */
.companies-page.sq-page {
    max-width: none;
    width: 100%;
}
.sq-page .sv-notice-icon {
    width: 40px;
    height: 40px;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}
.sq-page .sv-notice-icon svg {
    width: 20px;
    height: 20px;
}
.companies-filters.filters-approve {
    grid-template-columns: minmax(160px, 1.1fr) minmax(140px, .9fr) minmax(140px, .8fr) minmax(140px, .8fr) 42px minmax(90px, auto);
}
.companies-filters.filters-payment {
    grid-template-columns: minmax(180px, 1.2fr) minmax(150px, .9fr) minmax(150px, .9fr) 42px minmax(90px, auto);
}
.companies-filters.filters-approve input[type="date"],
.companies-filters.filters-payment input[type="date"] {
    height: 42px;
    border: 1px solid #dbe1e6;
    border-radius: 8px;
    padding: 0 10px;
    font: inherit;
    background: #fff;
}
.companies-filters.filters-approve .filters-approve-clear,
.companies-filters.filters-payment .filters-payment-clear {
    height: 42px;
    justify-content: center;
}
.sq-bulk-card {
    margin-bottom: 12px;
}
.sq-bulk-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
}
.sq-bulk-bar .text-muted {
    margin-left: 6px;
    color: #6b7280;
    font-weight: 400;
}
.companies-table tbody tr.sq-picked {
    background: #eef6f9;
}
.companies-table tfoot td {
    font-weight: 700;
    background: #f8fafc;
}
.companies-table .approve-route {
    max-width: 280px;
    color: #6b7280;
    font-size: 13px;
    overflow-wrap: anywhere;
}
.sq-pay-type {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}
.sq-pay-type.hourly { background: #dbeafe; color: #1d4ed8; }
.sq-pay-type.fixed { background: #ede9fe; color: #6d28d9; }
.sq-pay-type.daily { background: #e0e7ff; color: #3730a3; }
.sq-pay-type.other { background: #e5e7eb; color: #374151; }
.sq-approve-status {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}
.sq-approve-status.pending { background: #ffc107; color: #212529; }
.sq-approve-status.approved { background: #d1fae5; color: #065f46; }
.sq-approve-status.rejected { background: #fee2e2; color: #991b1b; }
@media (max-width: 900px) {
    .companies-filters.filters-approve,
    .companies-filters.filters-payment {
        grid-template-columns: 1fr 1fr;
    }
    .companies-filters.filters-approve button,
    .companies-filters.filters-approve .filters-approve-clear,
    .companies-filters.filters-payment button,
    .companies-filters.filters-payment .filters-payment-clear {
        grid-column: span 1;
    }
}

/* Shift queues (approve / payment) */
.sq-page .sv-title { line-height: 1.3; }
.page-head { max-width: none; margin-bottom: 20px; }
.page-head .sv-title { line-height: 1.3; }
.page-head .sv-actions i { font-size: 13px; }
.sq-page .sv-hero-text { gap: 4px; justify-content: center; min-height: 40px; }
.sq-tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 24px; border-top: 1px solid var(--ui-line-soft); }
.sq-tab { display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 14px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--ui-muted); font-size: 13.5px; font-weight: 600; text-decoration: none; }
.sq-tab:hover { color: var(--ui-ink); }
.sq-tab.active { color: var(--ui-brand); border-bottom-color: var(--ui-brand); }
.sq-tab b { min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--ui-soft); color: var(--ui-ink-2); font-size: 11.5px; text-align: center; }
.sq-tab.active b { background: var(--ui-brand-soft); color: var(--ui-brand-dark); }
.sq-tab-dot { width: 7px; height: 7px; border-radius: 50%; }
.sq-tab-dot.tone-pending { background: #dc6803; }
.sq-tab-dot.tone-completed { background: #16a34a; }
.sq-tab-dot.tone-cancelled { background: #d92d20; }
.sq-tab-dot.tone-draft { background: var(--ui-faint); }

.sq-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 16px; background: var(--ui-surface); border: 1px solid var(--ui-line); border-radius: var(--ui-radius); box-shadow: var(--ui-shadow); }
.shift-form .sq-filters .form-control { display: block; flex: 0 1 190px; width: auto; min-width: 160px; height: 40px; border-color: var(--ui-line-strong); border-radius: var(--ui-radius-sm); font-size: 13.5px; }
.shift-form .sq-filters .btn-brand, .shift-form .sq-filters .btn-outline { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; height: 40px; border-radius: var(--ui-radius-sm); font-size: 13.5px; }
.sq-filters .btn-brand { background: var(--ui-brand); }
.shift-form .sq-search { flex: 1 1 260px; display: flex; align-items: center; gap: 10px; height: 40px; margin: 0; padding: 0 12px; box-sizing: border-box; background: var(--ui-soft); border: 1px solid var(--ui-line); border-radius: var(--ui-radius-sm); color: var(--ui-muted); font-weight: 400; }
.sq-search:focus-within { background: #fff; border-color: var(--ui-brand); }
.sq-search svg { width: 16px; height: 16px; flex: none; }
.shift-form .sq-search input { flex: 1; min-width: 0; padding: 0; border: 0; outline: 0; background: transparent; box-shadow: none; font: inherit; font-size: 13.5px; color: var(--ui-ink); }

.sq-table { margin: 0; }
.sq-table th { white-space: nowrap; }
.sq-table td { vertical-align: middle; }
.sq-table tbody tr:hover { background: #f8fbfc; }
.sq-table tbody tr.sq-picked { background: #eef6f9; }
.sq-id { display: block; color: var(--ui-brand); font-weight: 700; text-decoration: none; }
.sq-id:hover { text-decoration: underline; }
.sq-sub { display: block; font-size: 12px; color: var(--ui-muted); white-space: nowrap; }
.sq-strong { font-weight: 600; color: var(--ui-ink); }
.sq-route { max-width: 280px; color: var(--ui-ink-2); overflow-wrap: anywhere; }
.sq-type { display: inline-block; padding: 3px 9px; border-radius: 6px; background: var(--ui-soft); border: 1px solid var(--ui-line); color: var(--ui-ink-2); font-size: 12px; font-weight: 600; white-space: nowrap; }
.sq-actions-col { width: 1%; }
.sq-check-col { width: 44px; }
.sq-check { width: 16px; height: 16px; accent-color: var(--ui-brand); cursor: pointer; }
.sq-row-actions { white-space: nowrap; text-align: right; }
.sq-row-actions > * + * { margin-left: 6px; }
.sq-icon { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0; vertical-align: middle; border: 1px solid var(--ui-line-strong); border-radius: 9px; background: #fff; color: var(--ui-muted); cursor: pointer; }
.sq-icon svg { width: 16px; height: 16px; }
.sq-icon:hover { background: var(--ui-soft); color: var(--ui-ink); }
.sq-icon.ok { color: #1b7f4b; border-color: #b7e0c8; }
.sq-icon.ok:hover { background: #e3f3ea; }
.sq-icon.bad { color: #b42318; border-color: #fecdca; }
.sq-icon.bad:hover { background: #fef3f2; }
.sq-pay { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; vertical-align: middle; border: 1px solid #b7e0c8; border-radius: 9px; background: #e3f3ea; color: #1b7f4b; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.sq-pay svg { width: 15px; height: 15px; }
.sq-pay:hover { background: #d3ecdd; }
.sq-table tfoot td { font-weight: 700; }
.sq-foot-label { text-align: right; color: var(--ui-muted); }
.sq-foot { padding: 12px 24px; border-top: 1px solid var(--ui-line-soft); }
.sq-foot .shift-pager, .companies-pages .shift-pager { margin: 0; }

.sq-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 56px 24px; text-align: center; }
.sq-empty-icon { width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; border-radius: 12px; background: #eef3f7; color: var(--ui-muted); }
.sq-empty-icon svg { width: 22px; height: 22px; }
.sq-empty h2 { margin: 4px 0 0; font-size: 15px; font-weight: 700; color: var(--ui-ink); }
.sq-empty p { margin: 0; max-width: 420px; font-size: 13.5px; color: var(--ui-muted); }

.sq-bulk { position: sticky; top: 76px; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 16px; background: var(--ui-ink); border-radius: var(--ui-radius); color: #fff; box-shadow: var(--ui-shadow-pop); }
.sq-bulk > span { flex: 1; font-size: 13.5px; }
.sq-bulk .btn-outline { height: 36px; background: transparent; border-color: rgba(255,255,255,.3); color: #fff; }
.sq-bulk .btn-outline:hover { background: rgba(255,255,255,.1); color: #fff; }
.sq-bulk .btn-brand { height: 36px; background: #fff; color: var(--ui-ink); }

.shift-form .sq-modal { max-width: 480px; margin-top: 8vh; padding: 0; overflow: hidden; border-radius: var(--ui-radius); font-family: var(--ui-font); box-shadow: 0 20px 50px rgba(11, 34, 51, .25); }
.shift-form .sq-modal-lg { max-width: 720px; margin-top: 4vh; }
.sq-modal-head { display: flex; align-items: flex-start; gap: 14px; padding: 20px 24px 16px; border-bottom: 1px solid var(--ui-line-soft); }
.sq-modal-head h2 { margin: 0; font-size: 16px; font-weight: 700; color: var(--ui-ink); }
.sq-modal-head p { margin: 4px 0 0; font-size: 13px; color: var(--ui-muted); }
.sq-modal-body { padding: 20px 24px; max-height: 65vh; overflow-y: auto; }
.sq-modal-body label { font-size: 13px; font-weight: 600; color: var(--ui-ink-2); }
.sq-modal-body .form-control { border-color: var(--ui-line-strong); border-radius: var(--ui-radius-sm); }
.sq-modal-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; padding: 14px 24px; background: var(--ui-soft); border-top: 1px solid var(--ui-line-soft); }
.sq-modal-foot .btn-brand, .sq-modal-foot .btn-outline { height: 40px; border-radius: var(--ui-radius-sm); font-size: 13.5px; }
.sq-modal-foot .btn-brand { background: var(--ui-brand); }
.sq-modal-foot [disabled] { opacity: .5; cursor: not-allowed; }
.sq-soon { display: inline-flex; align-items: center; gap: 6px; margin-right: auto; font-size: 12.5px; color: var(--ui-muted); }
.sq-soon svg { width: 14px; height: 14px; }
.sq-tone-ok { background: #e3f3ea; color: #1b7f4b; }
.sq-tone-bad { background: #fee4e2; color: #b42318; }
.sq-tone-brand { background: var(--ui-brand-soft); color: var(--ui-brand-dark); }
.sq-summary { margin: 0; }
.sq-summary > div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--ui-line-soft); }
.sq-summary > div:last-child { border-bottom: 0; }
.sq-summary dt { font-size: 13px; font-weight: 500; color: var(--ui-muted); }
.sq-summary dd { margin: 0; font-size: 13.5px; text-align: right; overflow-wrap: anywhere; }
.sq-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.sq-span { grid-column: 1 / -1; }
.sq-total { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 18px; padding: 14px 16px; border-radius: var(--ui-radius-sm); background: #e3f3ea; }
.sq-total div { display: flex; flex-direction: column; gap: 2px; }
.sq-total span { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: #1b7f4b; }
.sq-total b { font-size: 15px; color: var(--ui-ink); }
.sq-total strong { font-size: 22px; color: #14532d; }
.sq-amount { display: flex; flex-direction: column; gap: 2px; margin-bottom: 18px; padding: 14px 16px; border-radius: var(--ui-radius-sm); background: var(--ui-soft); border: 1px solid var(--ui-line); }
.sq-amount span { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--ui-muted); }
.sq-amount strong { font-size: 24px; color: var(--ui-ink); }
.sq-amount small { font-size: 12px; color: var(--ui-muted); }
.sq-picked-list { margin: 0 0 16px; padding: 0; list-style: none; border: 1px solid var(--ui-line); border-radius: var(--ui-radius-sm); max-height: 200px; overflow-y: auto; }
.sq-picked-list li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 14px; font-size: 13.5px; }
.sq-picked-list li + li { border-top: 1px solid var(--ui-line-soft); }
@media (max-width: 767px) {
    .sq-tabs { padding: 0 8px; overflow-x: auto; flex-wrap: nowrap; }
    .shift-form .sq-filters .form-control { flex: 1 1 140px; min-width: 0; }
    .sq-grid { grid-template-columns: minmax(0, 1fr); }
    .sq-row-actions { text-align: left; }
}

/* Flash toasts */
.toast-stack { position: fixed; top: 76px; right: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 10px; width: 360px; max-width: calc(100vw - 32px); pointer-events: none; }
.toast-card { position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 14px 40px 16px 14px; overflow: hidden; background: #fff; border: 1px solid #e5e7eb; border-left: 4px solid var(--toast-color); border-radius: 12px; box-shadow: 0 12px 28px -8px rgba(15, 23, 42, .25); pointer-events: auto; font-size: 14px; color: #1f2937; }
.toast-success { --toast-color: #16a34a; --toast-soft: #dcfce7; }
.toast-error { --toast-color: #dc2626; --toast-soft: #fee2e2; }
.toast-info { --toast-color: #27718e; --toast-soft: #e0f2f7; }
.toast-icon { width: 32px; height: 32px; flex-shrink: 0; display: grid; place-items: center; border-radius: 50%; background: var(--toast-soft); color: var(--toast-color); }
.toast-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.toast-body { min-width: 0; }
.toast-body strong { display: block; margin-bottom: 2px; font-weight: 600; color: #111827; }
.toast-body p { margin: 0; color: #4b5563; line-height: 1.4; overflow-wrap: anywhere; }
.toast-close { position: absolute; top: 8px; right: 10px; border: 0; background: none; font-size: 20px; line-height: 1; color: #9ca3af; cursor: pointer; }
.toast-close:hover { color: #374151; }
.toast-bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--toast-color); opacity: .35; transform-origin: left; animation: toast-countdown linear forwards; }
@keyframes toast-countdown { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.toast-enter, .toast-leave { transition: opacity .25s ease, transform .25s ease; }
.toast-enter-start { opacity: 0; transform: translateX(24px); }
@media (max-width: 600px) {
    .toast-stack { top: 12px; right: 16px; left: 16px; width: auto; max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
    .toast-enter, .toast-leave { transition: none; }
    .toast-bar { animation: none; }
}

/* Shift create */
.shift-form { color: #111; font-size: 14px; line-height: 1.45; }
.shift-form *, .shift-form *::before, .shift-form *::after { box-sizing: border-box; }
.shift-form .page-title { margin: 0; font-size: 30px; font-weight: 700; color: var(--brand-blue); }
.shift-form label { display: inline-block; margin-bottom: .5rem; }
.shift-form h5 { margin: 0; }
.shift-form .location-title { color: #1e3a4a; font-weight: 600; font-size: .95rem; margin: 0; }

.shift-form .row, .shift-form .form-row { display: flex; flex-wrap: wrap; }
.shift-form .row { margin: 0 -15px; }
.shift-form .row > [class*="col-"] { padding: 0 15px; }
.shift-form .form-row { margin: 0 -5px; }
.shift-form .form-row > [class*="col-"] { padding: 0 5px; }
.shift-form [class*="col-md-"] { width: 100%; }
@media (min-width: 768px) {
    .shift-form .col-md-4 { flex: 0 0 33.3333%; max-width: 33.3333%; }
    .shift-form .col-md-6 { flex: 0 0 50%; max-width: 50%; }
    .shift-form .col-md-8 { flex: 0 0 66.6667%; max-width: 66.6667%; }
    .shift-form .col-md-12 { flex: 0 0 100%; max-width: 100%; }
}
.shift-form .form-group { margin-bottom: 1rem; }

.shift-form .d-flex { display: flex; }
.shift-form .d-block { display: block; }
.shift-form .flex-wrap { flex-wrap: wrap; }
.shift-form .align-items-center { align-items: center; }
.shift-form .justify-content-between { justify-content: space-between; }
.shift-form .justify-content-end { justify-content: flex-end; }
.shift-form .ml-auto { margin-left: auto; }
.shift-form .ml-1 { margin-left: .25rem; }
.shift-form .ml-2 { margin-left: .5rem; }
.shift-form .mr-1 { margin-right: .25rem; }
.shift-form .mr-2 { margin-right: .5rem; }
.shift-form .mt-1 { margin-top: .25rem; }
.shift-form .mt-2 { margin-top: .5rem; }
.shift-form .mt-3 { margin-top: 1rem; }
.shift-form .mb-0 { margin-bottom: 0; }
.shift-form .mb-1 { margin-bottom: .25rem; }
.shift-form .mb-2 { margin-bottom: .5rem; }
.shift-form .mb-3 { margin-bottom: 1rem; }
.shift-form .py-4 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.shift-form .text-center { text-align: center; }
.shift-form .text-danger { color: #dc3545; }
.shift-form .text-success { color: #28a745; }
.shift-form .text-muted { color: var(--muted); }
.shift-form small { font-size: 80%; }
.shift-form .form-text { display: block; margin-top: .25rem; }

.shift-form .create-section-card { border: 1px solid var(--border); border-radius: 12px; margin-bottom: 12px; background: #fff; box-shadow: 0 10px 20px -18px rgba(20, 134, 160, .35); }
.shift-form .create-section-header { min-height: 52px; padding: 12px 16px; background: #fff; display: flex; align-items: center; gap: .75rem; border-radius: 12px 12px 0 0; }
.shift-form .create-section-header .icon { width: 28px; height: 28px; border-radius: 10px; display: grid; place-items: center; background: rgba(20, 134, 160, .18); color: var(--brand-blue); }
.shift-form .create-section-header .label { font-weight: 600; font-size: .98rem; letter-spacing: .1px; }
.shift-form .create-section-body { padding: 16px; border-top: 1px solid var(--border); }
.shift-form .create-section-body .form-group label { font-weight: 600; color: #334155; }

.shift-form .form-control { display: block; width: 100%; height: 42px; padding: .375rem .75rem; font: inherit; color: #495057; background: #fff; border: 1px solid var(--border); border-radius: 10px; }
.shift-form textarea.form-control { height: auto; }
.shift-form select.form-control { appearance: auto; }
.shift-form .form-control:focus { border-color: var(--brand-hover); box-shadow: 0 0 0 3px rgba(76, 156, 188, .18); outline: 0; }
.shift-form .form-control:disabled { background: #e9ecef; }
.shift-form .no-spinner::-webkit-outer-spin-button,
.shift-form .no-spinner::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.shift-form .no-spinner { -moz-appearance: textfield; }
.shift-form .duration-pair { gap: .5rem; }
.shift-form .duration-pair .form-control { max-width: 70px; }
.shift-form .duration-pair span { font-size: .875rem; color: #6b7280; }

.shift-form .btn { display: inline-flex; align-items: center; gap: .35rem; padding: .375rem .75rem; font: inherit; font-weight: 600; line-height: 1.5; border: 1px solid transparent; border-radius: 10px; background: transparent; cursor: pointer; text-decoration: none; height: auto; }
.shift-form .btn-group { display: inline-flex; }
.shift-form .trailer-type-btn { border-radius: 20px; padding: 2px 14px; font-size: .8rem; border-color: #1e3a4a; color: #1e3a4a; background: transparent; margin-right: 2px; }
.shift-form .trailer-type-btn.active { background: #1e3a4a; color: #fff; }
.shift-form .trailer-type-btn:hover:not(.active) { background: #e8edf0; color: #1e3a4a; }

.shift-form .badge { display: inline-block; padding: .25em .4em; font-size: 75%; font-weight: 700; border-radius: .25rem; }
.shift-form .badge-secondary { background: #6c757d; color: #fff; }

.shift-form .alert { position: relative; padding: .75rem 1.25rem; margin-bottom: 1rem; border: 1px solid transparent; border-radius: .25rem; }
.shift-form .alert ul { margin: .5rem 0 0; padding-left: 1.25rem; }
.shift-form .alert-danger { color: #721c24; background: #f8d7da; border-color: #f5c6cb; }
.shift-form .alert-secondary { color: #383d41; background: #e2e3e5; border-color: #d6d8db; border-left: 3px solid #6c757d; }
.shift-form .alert-info { color: #0c5460; background: #d1ecf1; border-color: #bee5eb; }

.shift-form .custom-control { position: relative; display: block; min-height: 1.5rem; padding-left: 1.5rem; }
.shift-form .custom-control-inline { display: inline-flex; margin-right: 1rem; }
.shift-form .custom-control-input { position: absolute; left: 0; top: .25rem; width: 1rem; height: 1rem; margin: 0; accent-color: var(--brand-blue); }
.shift-form .custom-control-label { margin-bottom: 0; font-weight: 400; }
.shift-form .custom-switch { padding-left: 2.25rem; }
.shift-form .custom-switch .custom-control-input { width: 1.75rem; }
.shift-form .trailer-inspection-toggle { font-size: .8rem; }
.shift-form .form-check { position: relative; display: block; padding-left: 1.25rem; }
.shift-form .form-check-input { position: absolute; margin-top: .3rem; margin-left: -1.25rem; }
.shift-form .form-check-label { margin-bottom: 0; font-weight: 400; }

.shift-form .custom-tooltip-wrapper { position: relative; display: inline-block; }
.shift-form .custom-tooltip { visibility: hidden; opacity: 0; width: 280px; background: #333; color: #fff; text-align: center; border-radius: 6px; padding: 8px 12px; position: absolute; z-index: 1000; bottom: 125%; left: 50%; transform: translateX(-50%); font-size: .813rem; line-height: 1.4; font-weight: normal; transition: opacity .2s, visibility .2s; pointer-events: none; }
.shift-form .custom-tooltip-wrapper:hover .custom-tooltip { visibility: visible; opacity: 1; }

.shift-form .payment-disabled { opacity: .6; pointer-events: none; }
.shift-form .payment-disabled .form-control { background: #f8f9fa; }

.shift-form .shift-modal { position: fixed; inset: 0; z-index: 1050; display: flex; align-items: flex-start; justify-content: center; padding: 1.75rem 1rem; background: rgba(0, 0, 0, .5); overflow-y: auto; }
.shift-form .shift-modal-dialog { width: 100%; max-width: 500px; background: #fff; border-radius: 12px; box-shadow: 0 4px 24px rgba(0, 0, 0, .15); }
.shift-form .shift-modal-dialog.modal-lg { max-width: 800px; }
.shift-form .modal-header { display: flex; align-items: center; justify-content: space-between; border-radius: 12px 12px 0 0; background: #f8fafc; border-bottom: 1px solid #e5e7eb; padding: 1.25rem 1.5rem; }
.shift-form .modal-title { font-weight: 600; font-size: 1.125rem; color: #1f2937; }
.shift-form .modal-body { padding: 1.5rem; }
.shift-form .modal-footer { display: flex; justify-content: flex-end; gap: .5rem; border-radius: 0 0 12px 12px; background: #f8fafc; border-top: 1px solid #e5e7eb; padding: 1rem 1.5rem; }
.shift-form .close { border: 0; background: none; font-size: 1.5rem; line-height: 1; opacity: .5; cursor: pointer; }

.shift-form .abp-results { max-height: 400px; overflow-y: auto; }
.shift-form .abp-item { display: flex; align-items: center; padding: 12px 14px; border: 1px solid #e5e7eb; border-radius: 10px; margin-bottom: 8px; cursor: pointer; background: #fff; }
.shift-form .abp-item:hover { border-color: #1486a0; background: rgba(20, 134, 160, .04); }
.shift-form .abp-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; margin-right: 12px; background: rgba(20, 134, 160, .13); color: #1486a0; }
.shift-form .abp-info { flex: 1; min-width: 0; }
.shift-form .abp-nickname { font-weight: 600; color: #1e3a4a; font-size: .95rem; }
.shift-form .abp-address { color: #6b7280; font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shift-form .shift-show-head { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: .75rem; margin-bottom: 1.5rem; }
.shift-form .shift-show-head .page-subtitle { margin: 0; color: var(--muted); font-size: 15px; }
.shift-form .shift-show-actions { gap: .5rem; flex-wrap: wrap; }
.shift-form .nav-pills-custom { display: inline-flex; flex-wrap: wrap; gap: 8px; background: #fff; padding: 6px; border-radius: 12px; box-shadow: 0 2px 8px rgba(0, 0, 0, .08); margin-bottom: 1.5rem; }
.shift-form .nav-pill { padding: 10px 20px; border-radius: 8px; font: inherit; font-size: 14px; font-weight: 500; color: #6b7280; background: transparent; border: 0; cursor: pointer; transition: all .3s; white-space: nowrap; }
.shift-form .nav-pill:hover { color: #1e3a4a; background: rgba(30, 58, 74, .05); }
.shift-form .nav-pill.active { color: #fff; background: #27718e; box-shadow: 0 4px 12px rgba(39, 113, 142, .3); }
.status-badge { display: inline-block; padding: .25rem .75rem; font-size: .75rem; font-weight: 600; border-radius: 9999px; text-transform: uppercase; }
.status-pending { background: #fef3c7; color: #92400e; }
.status-accepted { background: #dbeafe; color: #1e40af; }
.status-started { background: #f3e8ff; color: #6b21a8; }
.status-completed { background: #d1fae5; color: #065f46; }
.status-cancelled { background: #fee2e2; color: #991b1b; }
.status-secondary { background: #f3f4f6; color: #374151; }
.status-return { background: #e0f2fe; color: #075985; }
.status-badge { white-space: nowrap; letter-spacing: .02em; }
.shift-form .shift-table-card { margin-bottom: 1rem; overflow: hidden; }
.shift-form .shift-table-wrap { overflow-x: auto; }
.shift-form .shift-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.shift-form .shift-table th { padding: 14px 16px; background: #f8fafc; color: #334155; font-weight: 600; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.shift-form .shift-table td { padding: 14px 16px; border-bottom: 1px solid var(--border); color: #374151; vertical-align: middle; min-width: 90px; overflow-wrap: anywhere; }
.shift-form .shift-table tbody tr:hover { background: #f9fafb; }
.shift-form .shift-table tbody tr:last-child td { border-bottom: 0; }
.shift-form .shift-table .nowrap { white-space: nowrap; }
.shift-form .create-section-body label.text-muted { font-weight: 600; color: #334155; }
.shift-form .form-control-plaintext { display: block; width: 100%; margin: 0; padding: .375rem 0; color: #6b7280; }
.shift-form .shift-pre { white-space: pre-line; }
.shift-form .col-md-3 { width: 100%; }
@media (min-width: 768px) { .shift-form .col-md-3 { flex: 0 0 25%; max-width: 25%; } }
.shift-form .mb-4 { margin-bottom: 1.5rem; }
.shift-form .my-2 { margin-top: .5rem; margin-bottom: .5rem; }
.shift-form hr { border: 0; border-top: 1px solid var(--border); }
.shift-form h3, .shift-form h4 { margin: 0; font-weight: 600; }
.shift-form .small { font-size: 80%; }
.shift-form .text-uppercase { text-transform: uppercase; }
.shift-form .font-weight-bold { font-weight: 700; color: #111; }
.shift-form .badge-success { background: #28a745; color: #fff; }
.shift-form .badge-danger { background: #dc3545; color: #fff; }
.shift-form .badge-warning { background: #ffc107; color: #212529; }
.shift-form .badge-primary { background: #007bff; color: #fff; }
.shift-form .badge-brand-outline { display: inline-block; padding: .35rem .75rem; background: #fff; color: #000; border: 1.5px solid var(--brand-blue); font-size: .8rem; border-radius: 8px; }
.shift-form .alert-success { color: #155724; background: #d4edda; border-color: #c3e6cb; }
.shift-form .alert-warning { color: #856404; background: #fff3cd; border-color: #ffeeba; }
.shift-form .table-sm { width: 100%; border-collapse: collapse; }
.shift-form .table-sm th, .shift-form .table-sm td { padding: .3rem; border-top: 1px solid #dee2e6; text-align: left; }
.shift-form .table-sm thead th { border-bottom: 2px solid #dee2e6; }
.shift-form .shift-stat-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; margin-bottom: 1.5rem; }
.shift-form .shift-stat-card { display: flex; align-items: center; gap: 1rem; padding: 1.5rem; background: #fff; border-radius: 12px; box-shadow: 0 1px 2px rgba(0, 0, 0, .06); }
.shift-form .shift-stat-icon { width: 48px; height: 48px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; border-radius: .5rem; font-size: 1.4rem; }
.shift-form .shift-stat-icon.pending { background: #fef3c7; color: #f59e0b; }
.shift-form .shift-stat-icon.in-progress { background: #dbeafe; color: #3b82f6; }
.shift-form .shift-stat-icon.completed { background: #d1fae5; color: #10b981; }
.shift-form .shift-stat-label { font-size: .875rem; color: #6b7280; margin: 0 0 .25rem; }
.shift-form .shift-stat-value { font-size: 1.875rem; font-weight: 400; margin: 0; line-height: 1.2; }
.shift-form .shift-filter-card { display: grid; grid-template-columns: 3fr 2fr 2fr 2fr 1.2fr 1.2fr auto; gap: .75rem; align-items: center; padding: 1.5rem; margin-bottom: 1.5rem; background: #fff; border-radius: 12px; box-shadow: 0 1px 2px rgba(0, 0, 0, .06); }
.shift-form .shift-filter-card .btn-brand { height: 42px; }
.shift-form .shift-filter-clear { grid-column: 1 / -1; justify-self: start; height: auto !important; }
.shift-form .shift-card-link { display: block; color: inherit; text-decoration: none; }
.shift-form .shift-card { display: flex; align-items: center; gap: 1rem; padding: 1rem; margin-bottom: .75rem; background: #fff; border-radius: 12px; box-shadow: 0 1px 2px rgba(0, 0, 0, .06); cursor: pointer; transition: transform .2s, box-shadow .2s; }
.shift-form .shift-card:hover { transform: translateY(-2px); box-shadow: 0 4px 6px -1px rgba(0, 0, 0, .1), 0 2px 4px -1px rgba(0, 0, 0, .06); }
.shift-form .shift-card-link:focus-visible { outline: 2px solid var(--brand-blue); outline-offset: 2px; border-radius: 12px; }
.shift-form .shift-icon-wrapper { position: relative; width: 48px; height: 48px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; border-radius: .5rem; background: #f3f4f6; color: #6b7280; font-size: 1.3rem; }
.shift-form .recurring-badge { position: absolute; top: -4px; right: -4px; width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: #3b82f6; color: #fff; font-size: .6rem; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.shift-form .shift-info-item { flex: 1 1 0; min-width: 0; padding-right: 1rem; }
.shift-form .shift-info-item:nth-child(2), .shift-form .shift-info-item:nth-child(4) { flex: 1.5 1 0; min-width: 150px; max-width: 250px; }
.shift-form .shift-info-item:nth-child(3), .shift-form .shift-info-item:nth-child(5) { min-width: 110px; max-width: 140px; }
.shift-form .shift-info-item:nth-child(6), .shift-form .shift-info-item:nth-child(7) { flex: .8 1 0; min-width: 100px; max-width: 130px; }
.shift-form .shift-info-label { margin: 0 0 .25rem; font-size: .75rem; font-weight: 500; color: #9ca3af; text-transform: uppercase; letter-spacing: .025em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shift-form .shift-info-value { margin: 0; font-size: .875rem; font-weight: 500; color: #1f2937; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.shift-form .shift-location-text { -webkit-line-clamp: 3; }
.shift-form .shift-status-wrapper { flex-shrink: 0; margin-left: auto; min-width: 120px; display: flex; align-items: center; justify-content: flex-end; gap: .5rem; }
.shift-form .shift-task-icon { display: inline-flex; font-size: 1.05rem; }
.shift-form .shift-task-icon.task-done { color: #16a34a; }
.shift-form .shift-task-icon.task-pending { color: #c1c5cb; }
.shift-form .badge-brand { background: var(--brand-blue); color: #fff; font-weight: 500; padding: .3em .6em; }
.shift-form .py-5 { padding-top: 3rem; padding-bottom: 3rem; }
.shift-pager { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .75rem; margin-bottom: 1.5rem; }
.shift-pager-size { display: flex; align-items: center; gap: .5rem; }
.shift-pager-size select { width: 80px; height: 36px; padding: .25rem .5rem; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: #111; font: inherit; }
.shift-pager-size label, .shift-pager-count { color: #6b7280; font-size: 14px; }
.shift-pages { display: flex; gap: .35rem; flex-wrap: wrap; }
.page-btn { min-width: 36px; height: 36px; padding: 0 .6rem; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--brand-blue); font-weight: 600; text-decoration: none; }
a.page-btn:hover { background: var(--brand-blue); color: #fff; }
.page-btn.active { background: var(--brand-blue); border-color: var(--brand-blue); color: #fff; }
.page-btn.disabled { color: #c1c5cb; }

@media (max-width: 1199px) {
    .shift-form .shift-filter-card { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .shift-form .shift-card { flex-wrap: wrap; }
    .shift-form .shift-info-item,
    .shift-form .shift-info-item:nth-child(n) { flex: 1 1 calc(33% - 1rem); min-width: 140px; max-width: none; padding-right: 0; }
    .shift-form .shift-status-wrapper { flex-basis: 100%; justify-content: flex-start; margin-left: 0; }
}

@media (max-width: 767px) {
    .shift-form .shift-show-head { flex-direction: column; }
    .shift-form .shift-stat-row { grid-template-columns: 1fr; gap: .75rem; }
    .shift-form .shift-filter-card { grid-template-columns: 1fr 1fr; padding: 1rem; }
    .shift-form .shift-filter-card input[name="search"] { grid-column: 1 / -1; }
    .shift-form .shift-card { align-items: flex-start; }
    .shift-form .shift-icon-wrapper { width: 40px; height: 40px; }
    .shift-form .shift-info-item,
    .shift-form .shift-info-item:nth-child(n) { flex: 1 1 calc(50% - 1rem); min-width: 0; }
    .shift-pager { flex-direction: column; align-items: flex-start; }
    .shift-form .nav-pills-custom { display: flex; overflow-x: auto; flex-wrap: nowrap; max-width: 100%; }
}

.shift-form .abp-type-badge { padding: 3px 8px; border-radius: 6px; font-size: .75rem; font-weight: 600; color: #fff; background: #1486a0; margin-left: 8px; text-transform: capitalize; }

/* Toolbox module show (old CRM parity) */
.toolbox-show-back { margin-bottom: 12px; }
.toolbox-show-back-btn { height: 34px; padding: 0 12px; font-size: 0.8125rem; }
.toolbox-show-header {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.75rem 2rem;
    margin-bottom: 1.5rem;
}
.toolbox-show-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    margin-bottom: 0.65rem;
}
.toolbox-show-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
}
.toolbox-show-header .badge-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #d1fae5;
    color: #065f46;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.toolbox-show-header .badge-status .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #16a34a;
}
.toolbox-show-header .badge-status.inactive {
    background: #fee2e2;
    color: #991b1b;
}
.toolbox-show-header .badge-status.inactive .dot { background: #ef4444; }
.toolbox-show-desc {
    margin: 0 0 1rem;
    color: #6b7280;
    font-size: 0.95rem;
    line-height: 1.5;
}
.toolbox-show-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    color: #6b7280;
    font-size: 0.875rem;
}
.toolbox-show-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.toolbox-show-meta svg {
    width: 14px;
    height: 14px;
    color: #9ca3af;
}
.toolbox-show-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.5rem;
    margin-top: 1.15rem;
}
.toolbox-show-action {
    height: 34px;
    padding: 0 0.85rem;
    font-size: 0.8125rem;
    white-space: nowrap;
}
.toolbox-show-action svg {
    width: 14px;
    height: 14px;
}
.toolbox-show-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}
.toolbox-show-stat {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.35rem 1.25rem;
    text-align: center;
}
.toolbox-show-stat-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 0.85rem;
    border-radius: 12px;
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    display: flex;
    align-items: center;
    justify-content: center;
}
.toolbox-show-stat-icon svg {
    width: 22px;
    height: 22px;
}
.toolbox-show-stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.1;
}
.toolbox-show-stat-label {
    margin-top: 0.25rem;
    color: #6b7280;
    font-size: 0.875rem;
}
.toolbox-show-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.35rem 1.5rem;
    margin-bottom: 1.5rem;
}
.toolbox-show-card-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 1rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: #111827;
}
.toolbox-show-card-title svg {
    width: 18px;
    height: 18px;
    color: #6b7280;
}
.toolbox-show-content {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.25rem 1.35rem;
    max-height: 400px;
    overflow-y: auto;
    color: #111827;
    line-height: 1.55;
}
.toolbox-show-content p { margin: 0 0 0.75rem; }
.toolbox-show-content p:last-child { margin-bottom: 0; }
.toolbox-show-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: #9ca3af;
}
.toolbox-show-empty svg {
    width: 32px;
    height: 32px;
    margin-bottom: 0.5rem;
}
.toolbox-show-empty p { margin: 0 0 0.85rem; }
.toolbox-driver-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.95rem 0;
    border-bottom: 1px solid #e5e7eb;
}
.toolbox-driver-row:last-child { border-bottom: 0; }
.toolbox-driver-info {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
}
.toolbox-driver-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}
.toolbox-driver-name {
    font-weight: 600;
    color: #111827;
}
.toolbox-driver-email {
    font-size: 0.8125rem;
    color: #6b7280;
}
.toolbox-driver-side {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-shrink: 0;
}
.toolbox-driver-side form { margin: 0; }
.toolbox-assign-status {
    display: inline-flex;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.toolbox-assign-status.assigned {
    background: #e0e7ff;
    color: #3730a3;
}
.toolbox-assign-status.viewed {
    background: #fef3c7;
    color: #92400e;
}
.toolbox-assign-status.completed {
    background: #d1fae5;
    color: #065f46;
}
.toolbox-unassign-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid #fca5a5;
    border-radius: 6px;
    background: #fff;
    color: #dc2626;
    cursor: pointer;
}
.toolbox-unassign-btn svg {
    width: 14px;
    height: 14px;
}
.toolbox-unassign-btn:hover {
    background: #fef2f2;
}
.toolbox-assign-modal {
    position: fixed;
    inset: 0;
    z-index: 1050;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 1.75rem 1rem;
    background: rgba(0, 0, 0, 0.45);
    overflow-y: auto;
}
.toolbox-assign-dialog {
    width: 100%;
    max-width: 480px;
    margin-top: 8vh;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}
.toolbox-assign-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e5e7eb;
}
.toolbox-assign-head h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
}
.toolbox-assign-body {
    padding: 1.15rem 1.25rem;
}
.toolbox-assign-body label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.875rem;
    font-weight: 600;
}
.toolbox-assign-body select.form-control {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 0.5rem;
    font: inherit;
    background: #fff;
}
.toolbox-assign-body small {
    display: block;
    margin-top: 0.45rem;
    color: #6b7280;
    font-size: 0.75rem;
}
.toolbox-assign-foot {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.9rem 1.25rem;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 0 0 12px 12px;
}
@media (max-width: 700px) {
    .toolbox-show-stats { grid-template-columns: 1fr; }
    .toolbox-driver-row {
        flex-direction: column;
        align-items: flex-start;
    }
}
