@charset "utf-8";
/* CSS Document */

html,
body,
input,
select,
textarea,
button {
    font-family: 'Roboto', Arial, sans-serif;
}

body {
    font-size: 14px;
    font-weight: 700;
}

a {
    text-decoration: none !important;
}

.shadow-card {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 1%);
}

.reverse-table-striped tbody tr:nth-of-type(even) {
    background-color: rgba(0,0,0,.05);
}

input, select, textarea, button {
    font-size: 14px !important;
}

.overdue {
    color: red;
}

.project-container {
    margin-bottom: 0;
    padding: 0 5px;
    min-width: 378px;
}

.trip-card {
    margin-bottom: 0;
    padding: 0;
}

.no-hover-effect {
    pointer-events: none;
}

.card-header {
    background-color: #343a40;
    color: #fff;
    text-align: center;
    transition: background-color 0.3s;
}

.card-header h3, .card-header a, .card-header .card-title {
    margin: 0;
}

.card-title a {
    color: #fff;
}

.card-body {
    padding-bottom: 15px;
}

.card-title a:hover {
    color: #ddd;
}

.card-header-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.card-header-link:hover .card-header, .card-header:hover, .card-header:focus {
    background-color: #007bff;
}

.list-group-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 10px;
}

.list-group-item:nth-child(even) {
    background-color: #f7f7f7;
}

.menu-section {
    background-color: rgba(255,255,255,0.5);
}

#searchInput, #filterSelect {
    max-width: 300px;
}

.pagination .page-item .btn {
    border-radius: 0.25rem;
}

.btn-create-project {
    background-color: #343a40;
    color: white;
    transition: background-color 0.3s;
}

.btn-create-project:hover {
    background-color: #007bff;
    color: white;
}

.device-number {
    flex: 0 0 30px;
    text-align: right;
}

.device-name, .device-user {
    flex-grow: 1;
    text-align: left;
    margin-left: 10px;
}

.device-model {
    flex: 0 1 auto;
    text-align: right;
    margin-right: 5px;
}

.no-devices {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 40px;
}

#alertBox {
    position: fixed;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    width: auto;
    max-width: 80%;
}

.highlighted .card-header {
    background-color: #ffc107;
    color: #343a40;
    font-weight: 700;
}

.custom-select-style {
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    color: #495057;
    height: calc(36px);
    background-color: #fff;
}

.custom-select-style:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.custom-select-style option {
    background: #fff;
    color: #495057;
}

.table {
    width: 100%;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-radius: .25rem;
    overflow: hidden;
}

.thead-dark th {
    background-color: #343a40;
    color: white;
    text-align: center;
    border: none;
}

.table-hover tbody tr:hover {
    background-color: rgba(0,0,0,.025);
}

.table td, .table th {
    text-align: center;
    padding: .5rem;
    margin: 0;
}

.table tr {
    padding: 0;
    margin: 0;
}

.table a {
    padding: 0 5px 0 5px;
    font-size: 14px;
}

.table tbody tr.highlighted2 {
    background-image: linear-gradient(to bottom, rgba(0, 122, 253, 0.1), rgba(0, 122, 253, 0.05));
}

.btn-link {
    color: #007bff;
    text-decoration: none;
}

.btn-link:hover {
    color: #0056b3;
    text-decoration: underline;
}

.delete-trip-btn {
    position: absolute; /* Ustawia przycisk względem karty */
    top: 5px; /* Odległość od górnej krawędzi karty */
    left: 5px; /* Odległość od prawej krawędzi karty */
    scale: 75%;
}

.trip-card {
    position: relative; /* Umożliwia pozycjonowanie absolutne dla przycisku */
}

.details-table th,
.details-table td {
    text-align: left; /* Wyrównanie tekstu do lewej */
    padding-left: 15px;
}

.table tbody tr.highlighted {
    background-image: linear-gradient(to bottom, rgba(255, 200, 0, 0.5), rgba(255, 200, 0, 0.4));
}

.modal-dialog-centered {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh; /* Minimalna wysokość, aby zapewnić wyśrodkowanie na całej wysokości */
}

/* Touch-first device list used on the warehouse screen. */
:root {
    --sidebar-width: 280px;
    --bg-main: #f1f3f7;
    --card-radius: 12px;
    --row-height: 54px;
}

body {
    background: var(--bg-main);
    -webkit-tap-highlight-color: transparent;
}

.app-navbar {
    position: relative;
    min-height: 60px;
    padding: 8px 16px;
    background: #1e293b;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .18);
}

.app-navbar .navbar-nav {
    gap: 8px;
}

.app-navbar .nav-link {
    color: rgba(255, 255, 255, .86) !important;
    font-weight: 700;
}

.app-nav-link {
    display: inline-flex !important;
    align-items: center;
    gap: 9px;
    min-height: 44px;
    padding: 0 15px !important;
    border-radius: 9px;
    font-size: 15px;
    touch-action: manipulation;
}

.app-nav-link i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 7px;
    font-size: 13px;
}

.app-nav-link--trips i {
    color: #075985;
    background: #bae6fd;
}

.app-nav-link--devices i {
    color: #166534;
    background: #bbf7d0;
}

.app-nav-link--admin i {
    color: #7c2d12;
    background: #fed7aa;
}

.app-navbar .nav-link:hover,
.app-navbar .nav-link:focus {
    color: #fff !important;
    background: rgba(255, 255, 255, .08);
}

.app-navbar .navbar-brand {
    letter-spacing: .3px;
}

.app-history-controls {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-right: 10px;
}

.app-history-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    color: #dbeafe;
    background: rgba(255, 255, 255, .1);
    border: 0;
    border-radius: 9px;
    font-size: 15px !important;
    touch-action: manipulation;
}

.app-history-button:hover,
.app-history-button:focus {
    color: #fff;
    background: rgba(255, 255, 255, .16);
    outline: 0;
}

.app-clock {
    position: absolute;
    top: 50%;
    left: 50%;
    display: flex;
    align-items: baseline;
    gap: 12px;
    color: #dbeafe;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.app-clock span {
    white-space: nowrap;
}

#appClockTime {
    font-size: 22px;
    font-weight: 800;
    line-height: 1;
}

#appClockDate {
    color: #b8c8d9;
    font-size: 13px;
    font-weight: 800;
}

.login-error {
    margin-bottom: 14px;
    font-weight: 800;
}

.devices-container {
    height: calc(100vh - 60px);
    margin-top: 0 !important;
    padding: 0;
    overflow: hidden;
}

.devices-page {
    position: relative;
    display: flex;
    height: calc(100vh - 60px);
    padding: 20px 0 20px 16px;
    color: #1e293b;
    overflow: hidden;
}

.touch-sidebar {
    position: relative;
    z-index: 1;
    display: flex;
    flex: 0 0 var(--sidebar-width);
    flex-direction: column;
    width: var(--sidebar-width);
    margin-right: 8px;
    padding: 16px 12px;
    overflow-y: auto;
    background: #e8eef5;
    border: 1px solid #d7e0ea;
    border-radius: var(--card-radius);
    box-shadow: 0 1px 3px rgba(15, 23, 42, .08);
}

.sidebar-title {
    margin-bottom: 12px;
    padding-left: 8px;
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.devices-category {
    display: flex;
    align-items: center;
    width: 100%;
    height: 46px;
    margin-bottom: 4px;
    padding: 0 12px;
    color: #334155;
    background: rgba(255, 255, 255, .68);
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 15px !important;
    font-weight: 600;
    text-align: left;
    touch-action: manipulation;
}

.devices-category i {
    width: 20px;
    margin-right: 12px;
    color: #94a3b8;
    font-size: 16px;
    text-align: center;
}

.devices-category:active,
.devices-category:focus {
    background: #fff;
    border-color: #cbd5e1;
    outline: 0;
}

.devices-category.is-active {
    color: #fff;
    background: #0284c7;
    border-color: #0284c7;
    box-shadow: 0 2px 5px rgba(2, 132, 199, .22);
}

.devices-category.is-active i {
    color: #fff;
}

.devices-main {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    min-width: 0;
    padding: 0 24px 0 16px;
    overflow: hidden;
}

.devices-toolbar {
    display: grid;
    grid-template-columns: minmax(220px, .8fr) minmax(360px, 1fr) minmax(360px, 1.35fr);
    gap: 14px;
    align-items: center;
    padding: 16px 20px;
    background: #fff;
    border-radius: var(--card-radius);
    box-shadow: 0 1px 3px rgba(15, 23, 42, .08);
}

.devices-toolbar__stats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.meta-pill {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 12px;
    color: #475569;
    background: #f1f5f9;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.meta-pill--danger {
    color: #b91c1c;
    background: #fee2e2;
}

.meta-pill--success {
    color: #15803d;
    background: #dcfce7;
}

.devices-filter-group {
    display: inline-flex;
    width: 100%;
    padding: 4px;
    background: #f1f5f9;
    border-radius: 10px;
}

.devices-filter {
    display: inline-flex;
    flex: 1 1 0;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 38px;
    color: #64748b;
    background: transparent;
    border: 0;
    border-radius: 7px;
    font-size: 14px !important;
    font-weight: 800;
    touch-action: manipulation;
    white-space: nowrap;
}

.devices-filter.is-active {
    color: #0f172a;
    background: #fff;
    box-shadow: 0 2px 4px rgba(15, 23, 42, .08);
}

.devices-filter:focus {
    outline: 0;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, .18);
}

.devices-search {
    position: relative;
}

.devices-search i {
    position: absolute;
    top: 50%;
    left: 14px;
    color: #94a3b8;
    transform: translateY(-50%);
    pointer-events: none;
}

.devices-search__input {
    width: 100%;
    height: 46px;
    padding: 8px 14px 8px 40px;
    color: #1e293b;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-size: 16px !important;
    font-weight: 600;
    outline: 0;
}

.devices-search__input:focus {
    border-color: #0284c7;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, .14);
}

.devices-table-wrap {
    flex: 1 1 auto;
    min-height: 0;
    margin-right: 5px;
    padding: 8px 16px;
    overflow-y: scroll;
    overflow-x: hidden;
    background: #fff;
    border-radius: var(--card-radius);
    box-shadow: 0 1px 3px rgba(15, 23, 42, .08);
}

.devices-table-wrap::-webkit-scrollbar,
.touch-sidebar::-webkit-scrollbar {
    width: 14px;
}

.devices-table-wrap::-webkit-scrollbar-track,
.touch-sidebar::-webkit-scrollbar-track {
    background: #f8fafc;
    border-radius: 8px;
}

.devices-table-wrap::-webkit-scrollbar-thumb,
.touch-sidebar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border: 3px solid #f8fafc;
    border-radius: 8px;
}

.devices-table-wrap::-webkit-scrollbar-thumb:active,
.touch-sidebar::-webkit-scrollbar-thumb:active {
    background: #94a3b8;
}

.devices-table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
}

.devices-table th {
    position: sticky;
    top: 0;
    z-index: 10;
    padding: 12px 8px;
    color: #64748b;
    background: #fff;
    border-bottom: 2px solid #e2e8f0;
    font-size: 13px;
    font-weight: 800;
    text-align: left;
    text-transform: uppercase;
}

.devices-row {
    height: var(--row-height);
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    transition: background-color .1s;
}

.devices-table tbody tr:nth-child(even) {
    background: #f8fafc;
}

.devices-row:active,
.devices-row:focus {
    background: #edf2f7 !important;
    outline: 0;
}

.devices-table tbody tr.is-issued {
    background: #fffbeb !important;
}

.devices-row td {
    padding: 0 8px;
    color: #1e293b;
    font-size: 16px;
    font-weight: 700;
    vertical-align: middle;
}

.col-nr {
    width: 70px;
    color: #94a3b8 !important;
    font-size: 18px !important;
    font-weight: 800 !important;
    text-align: center;
}

.col-nazwa {
    font-weight: 800 !important;
}

.col-model {
    width: 25%;
    text-align: center !important;
}

.col-termin {
    width: 220px;
    text-align: center !important;
}

.col-status {
    width: 90px;
    text-align: center !important;
}

.model-badge {
    display: inline-block;
    padding: 4px 8px;
    color: #334155;
    background: #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 800;
}

.status-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 15px;
}

.status-dot--available {
    color: #15803d;
    background: #dcfce7;
}

.status-dot--issued {
    color: #b91c1c;
    background: #fee2e2;
}

.trip-badge-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    padding: 6px 11px;
    color: #d97706;
    background: #fef3c7;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 800;
    text-decoration: none !important;
    white-space: nowrap;
}

.trip-badge-link:hover,
.trip-badge-link:focus {
    color: #92400e;
    background: #fde68a;
}

.empty-dash {
    color: #cbd5e1;
    font-weight: 600;
}

.devices-empty {
    padding: 32px !important;
    color: #64748b;
    font-size: 18px !important;
    font-weight: 700;
    text-align: center;
}

.devices-empty i {
    display: block;
    margin-bottom: 8px;
    color: #94a3b8;
    font-size: 26px;
}

@media (max-width: 1250px) {
    .devices-toolbar {
        grid-template-columns: 1fr;
    }
}

/* Device detail dashboard. */
.device-detail-container {
    height: calc(100vh - 60px);
    margin-top: 0 !important;
    padding: 0;
    overflow: hidden;
}

.device-detail-page {
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: calc(100vh - 60px);
    padding: 20px 24px;
    overflow: hidden;
    color: #1e293b;
}

.device-detail-hero,
.device-panel,
.device-history-panel {
    background: #fff;
    border-radius: var(--card-radius);
    box-shadow: 0 1px 3px rgba(15, 23, 42, .08);
}

.device-detail-hero {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 16px;
    align-items: center;
    padding: 12px 20px;
}

.device-back-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 46px;
    padding: 0 16px;
    color: #0f172a;
    background: #f1f5f9;
    border-radius: 9px;
    font-size: 15px;
    font-weight: 800;
    text-decoration: none !important;
    touch-action: manipulation;
}

.device-back-button:hover,
.device-back-button:focus {
    color: #075985;
    background: #e0f2fe;
}

.device-detail-title {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    min-width: 0;
    text-align: center;
}

.device-number-pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 10px;
    color: #475569;
    background: #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 800;
}

.device-detail-title h1 {
    margin: 0;
    font-size: 27px;
    font-weight: 800;
    line-height: 1.1;
    white-space: nowrap;
}

.device-hero-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    padding: 6px 10px;
    color: #64748b;
    background: #f1f5f9;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 800;
    white-space: nowrap;
}

.device-current-status {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 190px;
    min-height: 54px;
    padding: 8px 14px;
    border-radius: 12px;
}

.device-current-status > i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
}

.device-current-status strong,
.device-current-status span {
    display: block;
}

.device-current-status strong {
    font-size: 16px;
    font-weight: 800;
}

.device-current-status span {
    font-size: 13px;
    font-weight: 700;
}

.device-current-status.is-available {
    color: #166534;
    background: #dcfce7;
}

.device-current-status.is-available > i {
    background: #bbf7d0;
}

.device-current-status.is-issued {
    color: #991b1b;
    background: #fee2e2;
}

.device-current-status.is-issued > i {
    background: #fecaca;
}

.device-detail-grid {
    display: grid;
    grid-template-columns: .78fr .95fr 2fr .85fr;
    gap: 16px;
    flex: 0 0 auto;
}

.device-panel {
    min-width: 0;
    padding: 16px;
}

.device-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.device-panel__header h2 {
    margin: 0;
    color: #334155;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: .4px;
    text-transform: uppercase;
}

.device-panel__header span {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 3px 9px;
    color: #475569;
    background: #f1f5f9;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.device-info-list {
    margin: 0;
}

.device-info-list div {
    display: grid;
    grid-template-columns: 92px 1fr;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
}

.device-info-list div:last-child {
    border-bottom: 0;
}

.device-info-list dt,
.device-info-list dd {
    margin: 0;
}

.device-info-list dt {
    color: #64748b;
    font-size: 13px;
    font-weight: 800;
}

.device-info-list dd {
    font-size: 14px;
    font-weight: 800;
}

.device-accessory-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 180px;
    overflow: auto;
}

.device-accessory {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 40px;
    padding: 8px 10px;
    background: #f8fafc;
    border-radius: 8px;
}

.device-accessory strong,
.device-accessory span {
    font-size: 13px;
}

.device-accessory strong {
    font-weight: 800;
}

.device-accessory span {
    color: #64748b;
    font-weight: 700;
}

.device-metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.device-metric {
    min-height: 68px;
    padding: 10px;
    background: #f8fafc;
    border-radius: 9px;
}

.device-metric span,
.device-metric strong {
    display: block;
}

.device-metric span {
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
}

.device-metric strong {
    margin-top: 6px;
    font-size: 20px;
    font-weight: 800;
}

.device-chart-bars,
.device-user-bars {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.device-chart-row {
    display: grid;
    grid-template-columns: 56px 1fr 26px;
    align-items: center;
    gap: 8px;
}

.device-chart-row span,
.device-chart-row strong,
.device-user-row span,
.device-user-row strong {
    font-size: 12px;
    font-weight: 800;
}

.device-chart-row span {
    color: #64748b;
}

.device-chart-row strong,
.device-user-row strong {
    text-align: right;
}

.device-chart-track {
    height: 10px;
    overflow: hidden;
    background: #e2e8f0;
    border-radius: 999px;
}

.device-chart-fill {
    min-width: 6px;
    height: 100%;
    background: #0284c7;
    border-radius: 999px;
}

.device-user-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.device-user-row > div:first-child {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.device-user-row span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.device-chart-fill--user {
    background: #16a34a;
}

.device-chart-canvas {
    position: relative;
    width: 100%;
    height: 176px;
}

.device-empty-small {
    padding: 18px;
    color: #64748b;
    background: #f8fafc;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
}

.device-history-panel {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    padding: 16px;
}

.device-history-table-wrap {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
}

.device-history-table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
}

.device-history-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 12px 10px;
    color: #64748b;
    background: #fff;
    border-bottom: 2px solid #e2e8f0;
    font-size: 13px;
    font-weight: 800;
    text-align: left;
    text-transform: uppercase;
}

.device-history-table td {
    padding: 11px 10px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
    font-weight: 700;
    vertical-align: middle;
}

.device-history-table tbody tr:nth-child(even) {
    background: #f8fafc;
}

.device-history-table tbody tr.is-issued {
    background: #fffbeb;
}

.device-history-table a {
    color: #0369a1;
    font-weight: 800;
}

.history-status {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.history-status--issued {
    color: #991b1b;
    background: #fee2e2;
}

.history-status--returned {
    color: #166534;
    background: #dcfce7;
}

@media (max-width: 1400px) {
    .device-detail-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* Main trips dashboard. */
.trips-dashboard-container {
    height: calc(100vh - 60px);
    margin-top: 0 !important;
    padding: 0;
    overflow: hidden;
}

.trips-dashboard {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 14px;
    height: calc(100vh - 60px);
    padding: 18px 24px;
    overflow: hidden;
    color: #1e293b;
    background: #e6ebf2;
}

.trips-toolbar,
.trips-pagination {
    background: #eef3f8;
    border: 1px solid #d7e0ea;
    border-radius: var(--card-radius);
    box-shadow: 0 1px 3px rgba(15, 23, 42, .08);
}

.trips-toolbar {
    display: grid;
    grid-template-columns: minmax(250px, .9fr) minmax(320px, 1.2fr) minmax(330px, 1fr) auto auto auto;
    gap: 12px;
    align-items: center;
    padding: 14px 18px;
}

.trips-toolbar__summary {
    min-width: 0;
}

.trips-kicker {
    display: block;
    margin-bottom: 3px;
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .8px;
    line-height: 1;
    text-transform: uppercase;
}

.trips-toolbar h1 {
    margin: 0;
    overflow: hidden;
    color: #0f172a;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.12;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.trips-search {
    position: relative;
}

.trips-search i {
    position: absolute;
    top: 50%;
    left: 14px;
    color: #94a3b8;
    transform: translateY(-50%);
    pointer-events: none;
}

.trips-search__input {
    width: 100%;
    height: 46px;
    padding: 8px 14px 8px 40px;
    color: #1e293b;
    background: #f8fafc;
    border: 1px solid #b8c5d4;
    border-radius: 10px;
    font-size: 16px !important;
    font-weight: 600;
    outline: 0;
}

.trips-search__input:focus {
    border-color: #0284c7;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, .14);
}

.trips-filter-group {
    display: inline-flex;
    width: 100%;
    padding: 4px;
    background: #dfe7f0;
    border-radius: 10px;
}

.trips-filter,
.trips-toggle,
.trips-reset-button,
.trips-create-button,
.trips-page-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border: 0;
    border-radius: 8px;
    font-size: 14px !important;
    font-weight: 800;
    touch-action: manipulation;
    white-space: nowrap;
}

.trips-filter {
    flex: 1 1 0;
    min-width: 0;
    color: #64748b;
    background: transparent;
}

.trips-filter.is-active {
    color: #0f172a;
    background: #f8fafc;
    box-shadow: 0 2px 4px rgba(15, 23, 42, .08);
}

.trips-toggle {
    gap: 8px;
    padding: 0 14px;
    color: #475569;
    background: #dfe7f0;
}

.trips-toggle.is-active {
    color: #075985;
    background: #cfe9fb;
}

.trips-reset-button {
    gap: 8px;
    padding: 0 14px;
    color: #334155;
    background: #dfe7f0;
}

.trips-reset-button:active,
.trips-reset-button:focus {
    color: #0f172a;
    background: #cbd5e1;
    outline: 0;
}

.trips-create-button {
    gap: 8px;
    padding: 0 16px;
    color: #fff;
    background: #15803d;
}

.trips-create-button:active,
.trips-create-button:focus {
    background: #166534;
    outline: 0;
}

.trips-board {
    position: relative;
    min-height: 0;
    padding: 0 2px 0 0;
    overflow: hidden;
    overflow-x: hidden;
}

.trips-board::-webkit-scrollbar,
.trips-list.has-scroll::-webkit-scrollbar,
.trips-device-list.has-scroll::-webkit-scrollbar {
    width: 14px;
}

.trips-board::-webkit-scrollbar-track,
.trips-list.has-scroll::-webkit-scrollbar-track,
.trips-device-list.has-scroll::-webkit-scrollbar-track {
    background: #dfe7f0;
    border-radius: 8px;
}

.trips-board::-webkit-scrollbar-thumb,
.trips-list.has-scroll::-webkit-scrollbar-thumb,
.trips-device-list.has-scroll::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border: 3px solid #f8fafc;
    border-radius: 8px;
}

.trips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    grid-auto-rows: minmax(0, 1fr);
    align-items: stretch;
    gap: 14px;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.trips-project {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
    overflow: hidden;
    background: #e3ebf4;
    border: 1px solid #cbd7e4;
    border-radius: 12px;
    box-shadow: 0 2px 5px rgba(15, 23, 42, .08);
}

.trips-project--with-devices {
    background: #e9f0f8;
}

.trips-project--without-devices {
    background: #dfe7f0;
}

.trips-project__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    min-height: 66px;
    padding: 13px 14px 11px;
    color: inherit;
    background: #263449;
    border-bottom: 1px solid #1f2a3a;
    text-decoration: none !important;
}

.trips-project__header:hover,
.trips-project__header:focus {
    color: #fff;
    background: #2f4058;
}

.trips-project__header h2 {
    display: -webkit-box;
    margin: 0 0 4px;
    overflow: hidden;
    color: #fff;
    font-size: 18px;
    font-weight: 800;
    line-height: 1.14;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.trips-project__header span {
    color: #b8c8d9;
    font-size: 12px;
    font-weight: 800;
}

.trips-project-status {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    min-height: 28px;
    padding: 4px 9px;
    color: #fee2e2 !important;
    background: rgba(185, 28, 28, .38);
    border-radius: 999px;
    font-size: 12px !important;
    font-weight: 800;
}

.trips-project-status--active {
    color: #dcfce7 !important;
    background: rgba(22, 101, 52, .42);
}

.trips-list {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 0;
    min-height: 0;
    padding: 4px 10px 10px;
    overflow: hidden;
}

.trips-list.has-scroll {
    overflow-y: auto;
    padding-right: 4px;
}

.trips-trip {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    background: transparent;
    border-top: 1px solid #cbd7e4;
    border-radius: 0;
}

.trips-project--single .trips-trip {
    flex: 1 1 auto;
}

.trips-project--single .trips-trip--has-devices {
    flex: 1 1 auto;
}

.trips-trip:first-child {
    border-top: 0;
}

.trips-trip--attention {
    box-shadow: inset 4px 0 0 #f59e0b;
}

.trips-trip__header {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 54px;
    padding: 9px 7px;
    color: #0f172a;
    background: transparent;
    border-bottom: 0;
    text-decoration: none !important;
    touch-action: manipulation;
}

.trips-project--busy .trips-trip__header {
    min-height: 46px;
    padding-top: 6px;
    padding-bottom: 6px;
}

.trips-trip__header > i {
    color: #64748b;
}

.trips-trip__header strong {
    flex: 1 1 auto;
    font-size: 15px;
    font-weight: 800;
}

.trips-trip__header span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 32px;
    min-width: 46px;
    justify-content: center;
    padding: 4px 10px;
    color: #075985;
    background: #d5ebf8;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.trips-trip--empty .trips-trip__header span {
    color: #64748b;
    background: transparent;
}

.trips-device-list {
    flex: 1 1 auto;
    min-height: 0;
    margin: 0;
    padding: 0 0 9px 29px;
    overflow-y: hidden;
    list-style: none;
}

.trips-device-list.has-scroll {
    overflow-y: auto;
}

.trips-device {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) minmax(72px, .7fr);
    gap: 8px;
    align-items: center;
    min-height: 36px;
    padding: 5px 8px;
    border-radius: 6px;
    color: #1e293b;
    font-size: 13px;
    font-weight: 800;
}

.trips-device:nth-child(even) {
    background: rgba(255, 255, 255, .48);
}

.trips-device__number {
    color: #94a3b8;
}

.trips-device__name,
.trips-device__model {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.trips-device__model {
    color: #475569;
    text-align: right;
}

.trips-device--empty {
    display: flex;
    justify-content: center;
    color: #94a3b8;
    font-weight: 700;
}

.trips-project-empty,
.trips-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-size: 15px;
    font-weight: 800;
    text-align: center;
}

.trips-project-empty {
    flex: 1 1 auto;
    min-height: 120px;
}

.trips-empty {
    min-height: 360px;
    gap: 10px;
}

.trips-empty i {
    color: #94a3b8;
    font-size: 24px;
}

.trips-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    min-height: 58px;
    padding: 8px 12px;
}

.trips-page-button {
    gap: 8px;
    min-width: 150px;
    padding: 0 16px;
    color: #334155;
    background: #dfe7f0;
}

.trips-page-button:disabled {
    color: #94a3b8;
    cursor: not-allowed;
    opacity: .65;
}

.trips-page-indicator {
    color: #64748b;
    font-size: 14px;
    font-weight: 800;
}

.trips-page-indicator strong {
    color: #0f172a;
}

.trips-inline-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0;
    color: #0369a1;
    background: transparent;
    border: 0;
    font-size: 13px;
    font-weight: 800;
}

@media (max-width: 1500px) {
    .trips-toolbar {
        grid-template-columns: minmax(220px, .8fr) minmax(280px, 1fr) minmax(310px, 1fr);
    }

    .trips-toggle,
    .trips-reset-button,
    .trips-create-button {
        min-height: 40px;
    }
}

@media (max-width: 1180px) {
    .trips-toolbar {
        grid-template-columns: 1fr 1fr;
    }

    .trips-toolbar__summary {
        grid-column: 1 / -1;
    }
}

/* Project detail dashboard. */
.project-detail-container {
    height: calc(100vh - 60px);
    margin-top: 0 !important;
    padding: 0;
    overflow: hidden;
}

.project-detail-page {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 14px;
    height: calc(100vh - 60px);
    padding: 18px 24px;
    overflow: hidden;
    color: #1e293b;
    background: #e6ebf2;
}

.project-message-container {
    position: fixed;
    top: 76px;
    left: 50%;
    z-index: 1050;
    width: min(620px, calc(100vw - 48px));
    transform: translateX(-50%);
}

.project-hero,
.project-trips-panel,
.project-panel {
    border: 1px solid #d7e0ea;
    border-radius: var(--card-radius);
    box-shadow: 0 1px 3px rgba(15, 23, 42, .08);
}

.project-hero {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding: 14px 18px;
    color: #fff;
    background: #263449;
    border-color: #1f2a3a;
}

.project-back-button,
.project-primary-button,
.project-secondary-button,
.project-trip-filter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    border: 0;
    border-radius: 9px;
    font-size: 14px !important;
    font-weight: 800;
    text-decoration: none !important;
    touch-action: manipulation;
    white-space: nowrap;
}

.project-back-button {
    gap: 8px;
    padding: 0 14px;
    color: #dbeafe;
    background: rgba(255, 255, 255, .1);
}

.project-back-button:hover,
.project-back-button:focus {
    color: #fff;
    background: rgba(255, 255, 255, .16);
}

.project-title-block {
    min-width: 0;
}

.project-protocol {
    display: block;
    margin-bottom: 4px;
    color: #b8c8d9;
    font-size: 13px;
    font-weight: 800;
}

.project-title-block h1 {
    margin: 0;
    overflow: hidden;
    color: #fff;
    font-size: 28px;
    font-weight: 800;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 9px;
}

.project-hero-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    padding: 4px 9px;
    color: #dbeafe;
    background: rgba(255, 255, 255, .1);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.project-hero-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.project-status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 5px 11px;
    color: #fee2e2;
    background: rgba(185, 28, 28, .38);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
}

.project-status-pill.is-active {
    color: #dcfce7;
    background: rgba(22, 101, 52, .42);
}

.project-primary-button {
    gap: 8px;
    padding: 0 16px;
    color: #fff;
    background: #15803d;
}

.project-primary-button:hover,
.project-primary-button:focus {
    color: #fff;
    background: #166534;
}

.project-primary-button--full {
    width: 100%;
}

.project-detail-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 14px;
    min-height: 0;
    overflow: hidden;
}

.project-trips-panel,
.project-panel {
    background: #eef3f8;
}

.project-trips-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.project-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border-bottom: 1px solid #d7e0ea;
}

.project-panel-header--compact {
    padding-bottom: 10px;
}

.project-panel-kicker {
    display: block;
    margin-bottom: 3px;
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .8px;
    line-height: 1;
    text-transform: uppercase;
}

.project-panel-header h2 {
    margin: 0;
    color: #0f172a;
    font-size: 19px;
    font-weight: 800;
}

.project-trip-filters {
    display: inline-flex;
    min-width: 350px;
    padding: 4px;
    background: #dfe7f0;
    border-radius: 10px;
}

.project-trip-filter {
    flex: 1 1 0;
    min-width: 0;
    min-height: 38px;
    color: #64748b;
    background: transparent;
}

.project-trip-filter.is-active {
    color: #0f172a;
    background: #f8fafc;
    box-shadow: 0 2px 4px rgba(15, 23, 42, .08);
}

.project-trip-list {
    min-height: 0;
    padding: 12px;
    overflow-y: auto;
    overflow-x: hidden;
}

.project-trip-list::-webkit-scrollbar,
.project-device-list::-webkit-scrollbar {
    width: 14px;
}

.project-trip-list::-webkit-scrollbar-track,
.project-device-list::-webkit-scrollbar-track {
    background: #dfe7f0;
    border-radius: 8px;
}

.project-trip-list::-webkit-scrollbar-thumb,
.project-device-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border: 3px solid #f8fafc;
    border-radius: 8px;
}

.project-trip {
    position: relative;
    margin-bottom: 10px;
    overflow: hidden;
    background: #e3ebf4;
    border: 1px solid #cbd7e4;
    border-radius: 10px;
}

.project-trip.has-open-devices {
    border-color: #f59e0b;
    box-shadow: inset 4px 0 0 #f59e0b;
}

.project-trip[hidden] {
    display: none !important;
}

.project-trip-header {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 54px;
    padding: 10px 54px 10px 14px;
    color: #0f172a;
    text-decoration: none !important;
    touch-action: manipulation;
}

.project-trip-header:hover,
.project-trip-header:focus {
    color: #075985;
    background: rgba(255, 255, 255, .36);
}

.project-trip-date {
    display: inline-flex;
    flex: 1 1 auto;
    align-items: center;
    gap: 9px;
    font-size: 16px;
    font-weight: 800;
}

.project-trip-date i {
    color: #64748b;
}

.project-trip-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 50px;
    min-height: 34px;
    padding: 4px 10px;
    color: #075985;
    background: #d5ebf8;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
}

.project-trip-description {
    margin: -4px 54px 9px 44px;
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
}

.project-device-list {
    max-height: 260px;
    margin: 0;
    padding: 0 12px 12px 44px;
    overflow-y: auto;
    list-style: none;
}

.project-device-row {
    display: grid;
    grid-template-columns: 58px minmax(150px, 1.2fr) minmax(90px, .8fr) minmax(120px, 1fr);
    gap: 10px;
    align-items: center;
    min-height: 38px;
    padding: 6px 10px;
    color: #1e293b;
    border-radius: 7px;
    font-size: 14px;
    font-weight: 800;
}

.project-device-row:nth-child(even) {
    background: rgba(255, 255, 255, .55);
}

.project-device-number {
    color: #94a3b8;
}

.project-device-name,
.project-device-model,
.project-device-user {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-device-model,
.project-device-user {
    color: #475569;
}

.project-device-user {
    text-align: right;
}

.project-trip-delete {
    position: absolute;
    top: 10px;
    right: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    color: #991b1b;
    background: #fee2e2;
    border: 0;
    border-radius: 999px;
}

.project-trip-delete:hover,
.project-trip-delete:focus {
    color: #fff;
    background: #b91c1c;
}

.project-empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 240px;
    color: #64748b;
    font-size: 16px;
    font-weight: 800;
}

.project-side-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.project-panel {
    overflow: hidden;
}

.project-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
}

.project-form label {
    display: block;
    margin: 0;
}

.project-form label span {
    display: block;
    margin-bottom: 5px;
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.project-form .form-control {
    min-height: 42px;
    border-color: #b8c5d4;
    border-radius: 9px;
    font-weight: 700;
}

.project-status-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    padding: 4px;
    background: #dfe7f0;
    border-radius: 10px;
}

.project-status-toggle label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    margin: 0;
    color: #64748b;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 800;
}

.project-status-toggle label.is-selected {
    color: #0f172a;
    background: #f8fafc;
    box-shadow: 0 2px 4px rgba(15, 23, 42, .08);
}

.project-status-toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.project-place-list {
    margin: 0;
    padding: 2px 14px 0;
}

.project-place-list div {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 10px;
    padding: 11px 0;
    border-bottom: 1px solid #d7e0ea;
}

.project-place-list div:last-child {
    border-bottom: 0;
}

.project-place-list dt,
.project-place-list dd {
    margin: 0;
}

.project-place-list dt {
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.project-place-list dd {
    overflow: hidden;
    color: #0f172a;
    font-size: 14px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-place-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 14px;
}

.project-secondary-button {
    gap: 8px;
    padding: 0 12px;
    color: #334155;
    background: #dfe7f0;
}

.project-secondary-button:hover,
.project-secondary-button:focus {
    color: #0f172a;
    background: #cbd5e1;
}

.project-secondary-button.is-disabled {
    color: #94a3b8;
    pointer-events: none;
}

.project-modal-dialog {
    max-width: 540px;
}

.project-modal-dialog--trip {
    max-width: 760px;
}

.project-modal {
    overflow: hidden;
    background: #eef3f8;
    border: 1px solid #cbd7e4;
    border-radius: 14px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .28);
}

.project-modal .modal-header {
    align-items: center;
    min-height: 78px;
    padding: 16px 20px;
    color: #fff;
    background: #263449;
    border-bottom: 1px solid #1f2a3a;
}

.project-modal .modal-title {
    margin: 0;
    color: #fff;
    font-size: 22px;
    font-weight: 800;
}

.project-modal-kicker {
    display: block;
    margin-bottom: 3px;
    color: #b8c8d9;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .8px;
    line-height: 1;
    text-transform: uppercase;
}

.project-modal .close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    margin: 0;
    padding: 0;
    color: #dbeafe;
    text-shadow: none;
    background: rgba(255, 255, 255, .1);
    border-radius: 10px;
    opacity: 1;
}

.project-modal .close:hover,
.project-modal .close:focus {
    color: #fff;
    background: rgba(255, 255, 255, .16);
}

.project-modal .modal-body {
    padding: 18px 20px;
}

.project-modal .modal-footer {
    display: grid;
    grid-template-columns: 1fr 1.35fr;
    gap: 12px;
    padding: 16px 20px 20px;
    background: #e6edf5;
    border-top: 1px solid #d7e0ea;
}

.project-trip-date-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 100px minmax(0, 1fr);
    gap: 12px;
    margin-bottom: 14px;
}

.project-modal-field {
    margin-bottom: 14px;
}

.project-modal-field label {
    display: block;
    margin: 0 0 6px;
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .4px;
    text-transform: uppercase;
}

.project-modal-field .form-control {
    min-height: 48px;
    color: #0f172a;
    background: #f8fafc;
    border: 1px solid #b8c5d4;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
}

.project-modal-field textarea.form-control {
    min-height: 96px;
    resize: vertical;
}

.project-date-stepper {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 48px;
    gap: 6px;
}

.project-date-stepper button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    color: #334155;
    background: #dfe7f0;
    border: 0;
    border-radius: 10px;
    font-size: 24px;
    font-weight: 800;
    touch-action: manipulation;
}

.project-date-stepper button:active,
.project-date-stepper button:focus {
    color: #0f172a;
    background: #cbd5e1;
    outline: 0;
}

.project-days-input {
    text-align: center;
}

.project-modal-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 0 16px;
    border: 0;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 800;
    touch-action: manipulation;
}

.project-modal-button--primary {
    color: #fff;
    background: #15803d;
}

.project-modal-button--primary:hover,
.project-modal-button--primary:focus {
    color: #fff;
    background: #166534;
}

.project-modal-button--secondary {
    color: #334155;
    background: #dfe7f0;
}

.project-modal-button--secondary:hover,
.project-modal-button--secondary:focus {
    color: #0f172a;
    background: #cbd5e1;
}

.project-modal-button:disabled,
.project-modal-button.is-loading {
    cursor: wait;
    opacity: .72;
}

.project-modal-button.is-disabled {
    pointer-events: none;
    opacity: .48;
}

.device-status-modal-body {
    color: #1e293b;
}

.device-status-summary {
    display: grid;
    gap: 8px;
    margin-bottom: 14px;
    padding: 14px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 10px;
}

.device-status-warning,
.device-status-ok {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    width: fit-content;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
}

.device-status-warning {
    color: #7c2d12;
    background: #fed7aa;
}

.device-status-ok {
    color: #166534;
    background: #dcfce7;
}

.device-status-project {
    color: #0f172a;
    font-size: 18px;
    font-weight: 800;
}

.device-status-protocol {
    color: #64748b;
    font-size: 13px;
    font-weight: 800;
}

.device-status-list {
    display: grid;
    gap: 8px;
    margin: 0;
}

.device-status-list div {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
}

.device-status-list dt {
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .5px;
    text-transform: uppercase;
}

.device-status-list dd {
    margin: 0;
    color: #0f172a;
    font-weight: 800;
}

.device-status-empty {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px;
    color: #475569;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-weight: 800;
}

@media (max-width: 1350px) {
    .project-detail-main {
        grid-template-columns: minmax(0, 1fr) 330px;
    }

    .project-device-row {
        grid-template-columns: 54px minmax(130px, 1fr) minmax(80px, .7fr);
    }

    .project-device-user {
        display: none;
    }
}

/* Trip detail workspace. */
.trip-detail-container {
    height: calc(100vh - 60px);
    margin-top: 0 !important;
    padding: 0;
    overflow: hidden;
}

.trip-detail-page {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 14px;
    height: calc(100vh - 60px);
    padding: 18px 24px;
    overflow: hidden;
    color: #1e293b;
    background: #e6ebf2;
}

.trip-alert-box {
    position: fixed !important;
    top: 76px !important;
    left: 50% !important;
    z-index: 1060 !important;
    width: min(620px, calc(100vw - 48px)) !important;
    max-width: none !important;
    transform: translateX(-50%) !important;
}

.trip-hero,
.trip-panel,
.trip-category-panel {
    border: 1px solid #d7e0ea;
    border-radius: var(--card-radius);
    box-shadow: 0 1px 3px rgba(15, 23, 42, .08);
}

.trip-hero {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding: 14px 18px;
    color: #fff;
    background: #263449;
    border-color: #1f2a3a;
}

.trip-back-button,
.trip-focus-button,
.trip-action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    border: 0;
    border-radius: 9px;
    font-size: 14px !important;
    font-weight: 800;
    text-decoration: none !important;
    touch-action: manipulation;
    white-space: nowrap;
}

.trip-back-button,
.trip-focus-button {
    gap: 8px;
    padding: 0 14px;
    color: #dbeafe;
    background: rgba(255, 255, 255, .1);
}

.trip-back-button:hover,
.trip-back-button:focus,
.trip-focus-button:hover,
.trip-focus-button:focus {
    color: #fff;
    background: rgba(255, 255, 255, .16);
}

.trip-title-block {
    min-width: 0;
}

.trip-project-label {
    display: block;
    margin-bottom: 4px;
    color: #b8c8d9;
    font-size: 13px;
    font-weight: 800;
}

.trip-title-block h1 {
    margin: 0;
    overflow: hidden;
    color: #fff;
    font-size: 28px;
    font-weight: 800;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.trip-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 9px;
}

.trip-hero-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    padding: 4px 9px;
    color: #dbeafe;
    background: rgba(255, 255, 255, .1);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.trip-hero-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.trip-focus-button--secondary {
    color: #dbeafe;
    background: rgba(255, 255, 255, .1);
    border-color: rgba(255, 255, 255, .18);
}

.trip-focus-button--secondary:hover {
    color: #fff;
    background: rgba(255, 255, 255, .16);
}

.trip-status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 5px 11px;
    color: #fee2e2;
    background: rgba(185, 28, 28, .38);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
}

.trip-status-pill.is-active {
    color: #dcfce7;
    background: rgba(22, 101, 52, .42);
}

.project-modal-dialog--wide {
    width: calc(100vw - 96px);
    max-width: 1180px;
    margin: 20px auto;
}

#tripHistoryModal {
    overflow: hidden !important;
}

#tripHistoryModal .project-modal {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    max-height: calc(100vh - 40px);
}

#tripHistoryModal .modal-header {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(320px, 460px) 42px;
    gap: 14px;
}

#tripHistoryModal .modal-body {
    min-height: 0;
    overflow: hidden;
    padding: 16px 18px;
}

#tripHistoryModal .modal-footer {
    grid-template-columns: minmax(220px, 320px);
    justify-content: end;
}

.trip-history-search {
    position: relative;
    align-self: center;
}

.trip-history-search i {
    position: absolute;
    top: 50%;
    left: 14px;
    color: #93a4b8;
    transform: translateY(-50%);
}

.trip-history-search input {
    width: 100%;
    min-height: 44px;
    padding: 0 14px 0 40px;
    color: #0f172a;
    background: #f8fafc;
    border: 1px solid #9fb0c4;
    border-radius: 10px;
    font-weight: 800;
    outline: none;
}

.trip-history-search input:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, .18);
}

.trip-history-list {
    display: grid;
    gap: 8px;
    max-height: 100%;
    overflow-y: auto;
    padding-right: 6px;
}

.trip-history-row {
    display: grid;
    grid-template-columns: 82px minmax(280px, 1.45fr) minmax(190px, .95fr) minmax(230px, 1fr) 118px;
    align-items: center;
    gap: 14px;
    min-height: 62px;
    padding: 11px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    color: #0f172a;
    font-size: 14px;
    font-weight: 800;
}

.trip-history-row--head {
    position: sticky;
    top: 0;
    z-index: 2;
    min-height: 38px;
    padding-top: 8px;
    padding-bottom: 8px;
    color: #64748b;
    background: #e6edf5;
    border-color: #d7e0ea;
    font-size: 12px;
    letter-spacing: .6px;
    text-transform: uppercase;
}

.trip-history-row.is-active {
    background: #ecfdf5;
    border-color: #bbf7d0;
}

.trip-history-number {
    color: #94a3b8;
}

.trip-history-device {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.trip-history-device strong,
.trip-history-device small,
.trip-history-user,
.trip-history-dates {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.trip-history-device small {
    color: #475569;
    font-size: 13px;
    font-weight: 800;
}

.trip-history-dates {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #475569;
}

.trip-history-status {
    justify-self: end;
    min-width: 88px;
    padding: 5px 9px;
    color: #166534;
    background: #dcfce7;
    border-radius: 999px;
    text-align: center;
    font-size: 12px;
}

.trip-history-status.is-returned {
    color: #475569;
    background: #e2e8f0;
}

.trip-history-empty {
    display: grid;
    place-items: center;
    gap: 8px;
    min-height: 180px;
    color: #64748b;
    font-weight: 800;
}

.trip-workspace {
    display: grid;
    grid-template-columns: 330px minmax(430px, .95fr) minmax(640px, 1.35fr);
    gap: 14px;
    min-height: 0;
    overflow: hidden;
}

.trip-panel,
.trip-category-panel {
    position: relative;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background: #eef3f8;
}

.trip-category-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    padding: 14px 12px;
    background: #dce6ef;
}

.trip-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
}

.trip-selected-panel {
    grid-template-rows: auto minmax(0, 1fr) auto;
}

.trip-panel-heading,
.trip-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.trip-panel-heading {
    padding: 0 4px 12px;
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .8px;
    text-transform: uppercase;
}

.trip-panel-heading strong,
.trip-count-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    min-height: 28px;
    padding: 3px 9px;
    color: #075985;
    background: #d5ebf8;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.trip-panel-header {
    padding: 14px 16px;
    border-bottom: 1px solid #d7e0ea;
}

.trip-panel-kicker {
    display: block;
    margin-bottom: 3px;
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .8px;
    line-height: 1;
    text-transform: uppercase;
}

.trip-panel-header h2 {
    margin: 0;
    color: #0f172a;
    font-size: 19px;
    font-weight: 800;
}

.trip-category-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    align-content: start;
    min-height: 0;
    overflow: hidden;
}

.trip-category-button {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 38px;
    margin-bottom: 0;
    padding: 6px 9px;
    color: #334155;
    background: rgba(255, 255, 255, .68);
    border: 1px solid transparent;
    border-radius: 9px;
    font-size: 12px !important;
    font-weight: 800;
    text-align: left;
    touch-action: manipulation;
    overflow: hidden;
}

.trip-category-button i {
    flex: 0 0 18px;
    width: 18px;
    color: #94a3b8;
    font-size: 12px;
    text-align: center;
}

.trip-category-button {
    text-overflow: ellipsis;
    white-space: nowrap;
}

.trip-category-button[data-category="all"] {
    grid-column: 1 / -1;
    min-height: 42px;
    font-size: 14px !important;
}

.trip-category-button--wide {
    grid-column: 1 / -1;
    order: 10;
}

.trip-category-button.is-active {
    color: #fff;
    background: #0284c7;
    border-color: #0284c7;
    box-shadow: 0 2px 5px rgba(2, 132, 199, .22);
}

.trip-category-button.is-active i {
    color: #fff;
}

.trip-available-panel {
    background: #e8f3ef;
    border-color: #c9ded6;
}

.trip-available-panel .trip-panel-header {
    background: #dbeee6;
    border-bottom-color: #c9ded6;
}

.trip-available-panel .trip-panel-kicker {
    color: #047857;
}

.trip-selected-panel {
    background: #eef2fb;
    border-color: #cbd7ea;
}

.trip-selected-panel .trip-panel-header {
    background: #e1e8f6;
    border-bottom-color: #cbd7ea;
}

.trip-selected-panel .trip-panel-kicker {
    color: #1d4ed8;
}

.trip-selected-panel .trip-count-pill {
    color: #1e3a8a;
    background: #c7d2fe;
}

.trip-search,
.trip-scanner {
    position: relative;
}

.trip-search {
    width: min(360px, 48%);
}

.trip-selected-tools {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    min-width: 360px;
}

.trip-search i,
.trip-scanner i {
    position: absolute;
    top: 50%;
    left: 14px;
    color: #64748b;
    transform: translateY(-50%);
    pointer-events: none;
}

.trip-search input,
.trip-scanner input {
    width: 100%;
    min-height: 46px;
    padding: 8px 14px 8px 40px;
    color: #0f172a;
    background: #f8fafc;
    border: 1px solid #b8c5d4;
    border-radius: 10px;
    font-size: 16px !important;
    font-weight: 700;
    outline: 0;
}

.trip-available-panel .trip-search input {
    background: #f7fffb;
    border-color: #9fc9b9;
}

.trip-selected-panel .trip-scanner input {
    background: #f8fbff;
    border-color: #9fb6d8;
}

.trip-search input:focus,
.trip-scanner input:focus,
.trip-form .form-control:focus {
    border-color: #0284c7;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, .14);
}

.trip-scanner {
    flex: 1 1 360px;
    max-width: 520px;
}

.trip-device-list {
    min-height: 0;
    padding: 12px 14px;
    overflow-y: auto;
    overflow-x: hidden;
}

.trip-device-list--selected {
    padding-top: 0;
}

.trip-device-list::-webkit-scrollbar,
.trip-category-list::-webkit-scrollbar {
    width: 14px;
}

.trip-device-list::-webkit-scrollbar-track,
.trip-category-list::-webkit-scrollbar-track {
    background: #dfe7f0;
    border-radius: 8px;
}

.trip-device-list::-webkit-scrollbar-thumb,
.trip-category-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border: 3px solid #f8fafc;
    border-radius: 8px;
}

.trip-device-row {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr) minmax(82px, .75fr);
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 44px;
    margin-bottom: 6px;
    padding: 7px 10px;
    color: #1e293b;
    background: rgba(255, 255, 255, .66);
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 14px !important;
    font-weight: 800;
    text-align: left;
    touch-action: manipulation;
}

.trip-available-panel .trip-device-row {
    background: rgba(247, 255, 251, .82);
}

.trip-available-panel .trip-device-row:nth-child(even) {
    background: rgba(228, 244, 237, .88);
}

.trip-selected-panel .trip-device-row {
    background: rgba(248, 251, 255, .9);
}

.trip-selected-panel .trip-device-row:nth-child(even) {
    background: rgba(225, 232, 246, .95);
}

.trip-device-row:nth-child(even) {
    background: rgba(255, 255, 255, .42);
}

.trip-device-row--button:hover,
.trip-device-row--button:focus {
    color: #075985;
    background: #fff;
    border-color: #bae6fd;
    outline: 0;
}

.trip-device-row--button.is-overdue {
    grid-template-columns: 58px minmax(0, 1fr) minmax(82px, .75fr) 42px;
    background: #fffbeb !important;
    border-color: #fcd34d;
    box-shadow: inset 4px 0 0 #f59e0b;
}

.trip-device-info-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    color: #92400e;
    background: #fde68a;
    border: 1px solid #f59e0b;
    border-radius: 999px;
    font-size: 15px;
    justify-self: end;
    touch-action: manipulation;
}

.trip-device-info-button:hover,
.trip-device-info-button:focus {
    color: #78350f;
    background: #fcd34d;
    outline: 0;
}

.trip-device-row--selected {
    grid-template-columns: 58px minmax(120px, 1fr) minmax(84px, .7fr) minmax(92px, .8fr) 30px;
    cursor: pointer;
}

.trip-device-row--selected.is-overdue {
    grid-template-columns: 58px minmax(120px, 1fr) minmax(84px, .7fr) minmax(92px, .8fr) 66px;
    background: #fffbeb !important;
    border-color: #fcd34d;
    box-shadow: inset 4px 0 0 #f59e0b;
}

.trip-device-row--temporary {
    background: #dbeafe !important;
    border-color: #93c5fd;
    box-shadow: inset 4px 0 0 #3b82f6;
}

.trip-device-number {
    color: #94a3b8;
}

.trip-device-name,
.trip-device-model,
.trip-device-user {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.trip-device-model,
.trip-device-user {
    color: #475569;
    text-align: right;
}

.trip-device-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
    color: #64748b;
}

.trip-empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 160px;
    padding: 20px;
    color: #64748b;
    font-size: 15px;
    font-weight: 800;
}

.trip-empty-state i {
    color: #94a3b8;
    font-size: 22px;
}

.trip-available-panel .trip-empty-state,
.trip-selected-panel .trip-empty-state {
    position: absolute;
    right: 14px;
    left: 14px;
    min-height: 0;
}

.trip-available-panel .trip-empty-state {
    top: 92px;
    bottom: 14px;
}

.trip-selected-panel .trip-empty-state {
    top: 82px;
    bottom: 78px;
}

.trip-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 14px 16px;
    border-top: 1px solid #d7e0ea;
}

.trip-actions .trip-action-button:only-child {
    grid-column: 1 / -1;
}

.trip-action-button {
    gap: 8px;
    padding: 0 14px;
}

.trip-action-button--primary {
    color: #fff;
    background: #15803d;
}

.trip-action-button--primary:hover,
.trip-action-button--primary:focus {
    color: #fff;
    background: #166534;
}

.trip-action-button--danger {
    color: #991b1b;
    background: #fee2e2;
}

.trip-action-button--danger:hover,
.trip-action-button--danger:focus {
    color: #fff;
    background: #b91c1c;
}

.trip-action-button--full {
    width: 100%;
}

.trip-action-button:disabled,
.trip-action-button.is-loading {
    cursor: wait;
    opacity: .62;
}

.trip-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
    padding: 14px;
    overflow-y: auto;
}

.trip-form--modal {
    display: block;
    min-height: 0;
    padding: 0;
    overflow: visible;
}

.trip-edit-date-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.trip-status-toggle--modal {
    margin-top: 2px;
}

.trip-form label {
    display: block;
    margin: 0;
}

.trip-form label span {
    display: block;
    margin-bottom: 5px;
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.trip-form .form-control {
    min-height: 42px;
    color: #0f172a;
    background: #f8fafc;
    border-color: #b8c5d4;
    border-radius: 9px;
    font-weight: 700;
}

.trip-form textarea.form-control {
    min-height: 96px;
    resize: vertical;
}

.trip-status-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    padding: 4px;
    background: #dfe7f0;
    border-radius: 10px;
}

.trip-status-toggle label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    margin: 0;
    color: #64748b;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 800;
}

.trip-status-toggle label.is-selected {
    color: #0f172a;
    background: #f8fafc;
    box-shadow: 0 2px 4px rgba(15, 23, 42, .08);
}

.trip-status-toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

@media (max-width: 1500px) {
    .trip-workspace {
        grid-template-columns: 300px minmax(360px, .9fr) minmax(520px, 1.3fr);
    }

    .trip-search {
        width: min(300px, 46%);
    }
}
