:root {
    color-scheme: dark;
    --background: #070b12;
    --panel: #101722;
    --panel-light: #151e2c;
    --border: #26354a;
    --text: #f4f7fb;
    --muted: #93a4ba;
    --accent: #20d6c7;
    --accent-dark: #10998f;
    --danger: #ff667d;
    --warning: #f3b64b;
    --success: #42d392;
    --offline: #8491a3;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    background:
        radial-gradient(
            circle at top left,
            rgba(32, 214, 199, 0.1),
            transparent 32rem
        ),
        var(--background);
    color: var(--text);
}

button,
input {
    font: inherit;
}

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

.login-card {
    width: min(100%, 430px);
    padding: 38px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: rgba(16, 23, 34, 0.96);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.wide-card {
    width: min(100%, 520px);
}

.brand-mark {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    margin-bottom: 26px;
    border: 1px solid rgba(32, 214, 199, 0.55);
    border-radius: 16px;
    background: rgba(32, 214, 199, 0.12);
    color: var(--accent);
    font-weight: 900;
    letter-spacing: 0.08em;
}

.eyebrow {
    margin: 0 0 6px;
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.17em;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 10px;
    font-size: clamp(2rem, 6vw, 3rem);
}

h2 {
    margin-bottom: 8px;
}

.subtitle {
    margin-bottom: 28px;
    color: var(--muted);
    line-height: 1.6;
}

label {
    display: block;
    margin: 18px 0 8px;
    color: #cbd5e1;
    font-size: 0.88rem;
    font-weight: 700;
}

input {
    width: 100%;
    padding: 14px 15px;
    border: 1px solid var(--border);
    border-radius: 10px;
    outline: none;
    background: #090f18;
    color: var(--text);
}

input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(32, 214, 199, 0.12);
}

button {
    width: 100%;
    margin-top: 24px;
    padding: 14px 18px;
    border: 0;
    border-radius: 10px;
    background: var(--accent);
    color: #031211;
    cursor: pointer;
    font-weight: 900;
}

button:hover {
    background: #44e8db;
}

.alert {
    margin-bottom: 18px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 102, 125, 0.45);
    border-radius: 10px;
    background: rgba(255, 102, 125, 0.1);
    color: #ff9aac;
}

.security-note {
    margin: 24px 0 0;
    color: var(--muted);
    font-size: 0.78rem;
    text-align: center;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 20px clamp(20px, 5vw, 64px);
    border-bottom: 1px solid var(--border);
    background: rgba(7, 11, 18, 0.9);
}

.topbar h1 {
    margin: 0;
    font-size: 1.7rem;
}

.account-area {
    display: flex;
    align-items: center;
    gap: 18px;
    text-align: right;
}

.account-area strong,
.account-area span {
    display: block;
}

.account-area span {
    color: var(--muted);
    font-size: 0.8rem;
}

.account-area form {
    margin: 0;
}

.secondary-button {
    width: auto;
    margin: 0;
    padding: 10px 14px;
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--text);
}

.dashboard-shell {
    width: min(1400px, calc(100% - 40px));
    margin: 36px auto 80px;
}

.welcome-panel,
.fleet-panel {
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(16, 23, 34, 0.94);
}

.welcome-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 28px;
}

.welcome-panel p:last-child {
    margin-bottom: 0;
    color: var(--muted);
}

.system-badge {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 14px;
    border: 1px solid rgba(66, 211, 146, 0.3);
    border-radius: 999px;
    color: var(--success);
    font-weight: 800;
}

.status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 12px var(--success);
}

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

.metric-card {
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--panel);
}

.metric-card span {
    display: block;
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
}

.metric-card strong {
    font-size: 2rem;
}

.fleet-panel {
    padding: 26px;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.coming-soon {
    color: var(--muted);
    font-size: 0.8rem;
}

.fleet-list {
    display: grid;
    gap: 12px;
}

.truck-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 18px;
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--panel-light);
}

.truck-image-placeholder {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: rgba(32, 214, 199, 0.12);
    color: var(--accent);
    font-weight: 900;
}

.truck-details h3,
.truck-details p {
    margin-bottom: 4px;
}

.truck-details p {
    color: var(--muted);
    font-size: 0.88rem;
}

.status-stack {
    text-align: right;
}

.status-pill {
    display: inline-block;
    padding: 7px 11px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 900;
}

.status-mobile {
    background: rgba(66, 211, 146, 0.15);
    color: var(--success);
}

.status-stopped {
    background: rgba(32, 214, 199, 0.14);
    color: var(--accent);
}

.status-stationary {
    background: rgba(243, 182, 75, 0.14);
    color: var(--warning);
}

.status-offline {
    background: rgba(132, 145, 163, 0.14);
    color: var(--offline);
}

.operational-status {
    display: block;
    margin-top: 7px;
    color: var(--muted);
    font-size: 0.75rem;
}

.empty-state {
    padding: 60px 20px;
    text-align: center;
}

.empty-state p {
    max-width: 520px;
    margin: 0 auto;
    color: var(--muted);
    line-height: 1.6;
}

.empty-icon {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    margin: 0 auto 18px;
    border: 1px dashed var(--accent-dark);
    border-radius: 50%;
    color: var(--accent);
    font-size: 1.7rem;
}

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

    .welcome-panel,
    .section-heading {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 560px) {
    .login-card {
        padding: 28px 22px;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .account-area {
        width: 100%;
        justify-content: space-between;
        text-align: left;
    }

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

    .truck-card {
        grid-template-columns: auto 1fr;
    }

    .status-stack {
        grid-column: 1 / -1;
        text-align: left;
    }
}

.route-action-card {
    border-color: rgba(32, 214, 199, 0.55);
    background:
        linear-gradient(
            135deg,
            rgba(32, 214, 199, 0.15),
            rgba(16, 23, 34, 0.96)
        );
}

.metric-card p {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 0.83rem;
    line-height: 1.45;
}

select,
textarea {
    width: 100%;
    padding: 14px 15px;
    border: 1px solid var(--border);
    border-radius: 10px;
    outline: none;
    background: #090f18;
    color: var(--text);
    font: inherit;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

select:focus,
textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(32, 214, 199, 0.12);
}

.nav-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--panel);
    color: var(--text);
    font-weight: 800;
    text-decoration: none;
}

.nav-button:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.selection-panel,
.admin-section {
    margin-top: 18px;
    padding: 26px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(16, 23, 34, 0.94);
}

.form-grid {
    display: grid;
    gap: 16px;
}

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

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

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

.detail-grid article {
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel-light);
}

.detail-grid span {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.detail-grid strong {
    font-size: 1.25rem;
}

.compact-empty {
    padding: 34px 20px;
}

.admin-shell {
    width: min(1500px, calc(100% - 40px));
    margin: 28px auto 80px;
}

.admin-nav {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(7, 11, 18, 0.96);
}

.admin-nav a {
    padding: 9px 13px;
    border-radius: 9px;
    color: var(--muted);
    font-weight: 800;
    text-decoration: none;
}

.admin-nav a:hover {
    background: var(--panel-light);
    color: var(--accent);
}

.admin-editor {
    margin-top: 14px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--panel-light);
    overflow: hidden;
}

.admin-editor summary {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 18px;
    cursor: pointer;
    font-weight: 900;
}

.admin-editor[open] summary {
    border-bottom: 1px solid var(--border);
}

.admin-editor > form,
.admin-editor > .inline-action-form {
    padding: 20px;
}

.summary-status {
    color: var(--accent);
    font-size: 0.8rem;
}

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

.permission-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #090f18;
}

.permission-option input {
    width: auto;
    margin-top: 3px;
}

.permission-option span,
.permission-option strong,
.permission-option small {
    display: block;
}

.permission-option small {
    margin-top: 4px;
    color: var(--muted);
}

.help-text {
    color: var(--muted);
    line-height: 1.6;
}

.inline-action-form {
    border-top: 1px solid var(--border);
}

.danger-button {
    background: var(--danger);
    color: #210309;
}

.danger-button:hover {
    background: #ff8b9d;
}

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

@media (max-width: 700px) {
    .two-columns,
    .three-columns,
    .detail-grid,
    .permission-grid {
        grid-template-columns: 1fr;
    }

    .admin-nav {
        overflow-x: auto;
    }
}


/* RichyRoute module administration */

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

.module-heading h3 {
    margin: 0 0 8px;
}

.module-heading .help-text {
    margin: 0;
}

.module-type-badge {
    flex: 0 0 auto;
    padding: 7px 11px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #090f18;
    color: var(--accent);
    font-size: 0.76rem;
    font-weight: 900;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

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

.module-option {
    min-height: 112px;
}

.module-option input:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

.module-option:has(input:disabled) {
    border-color: rgba(32, 214, 199, 0.3);
    background: rgba(32, 214, 199, 0.04);
}

.module-order-field {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: 112px;
    margin: 0;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #090f18;
}

.module-order-field label {
    margin-bottom: 9px;
    font-weight: 800;
}

.module-order-field input {
    width: 100%;
}

.module-order-field small {
    display: block;
    margin-top: 7px;
    color: var(--muted);
}

.module-readonly {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    padding: 20px;
}

.module-readonly p {
    margin: 0;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #090f18;
}

.module-editor summary > span:first-child {
    min-width: 0;
    overflow-wrap: anywhere;
}

@media (max-width: 1150px) {
    .module-control-grid,
    .module-readonly {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .module-heading {
        flex-direction: column;
    }

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

    .module-editor summary {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* Files and Documents */

.files-panel {
    overflow: hidden;
}

.files-heading {
    margin-bottom: 20px;
}

.files-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.files-actions button {
    width: auto;
    margin: 0;
}

.file-search-form {
    margin-bottom: 20px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #090f18;
}

.file-search-primary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: end;
    gap: 12px;
}

.file-search-primary label {
    margin-top: 0;
}

.file-search-primary button {
    width: auto;
    min-width: 94px;
    margin: 0;
}

.file-filter-details {
    margin-top: 14px;
    border-top: 1px solid var(--border);
}

.file-filter-details summary {
    padding: 14px 0 0;
    color: var(--accent);
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 800;
}

.file-filter-grid {
    margin-top: 4px;
}

.file-checkbox-field {
    display: flex;
    align-items: end;
}

.file-checkbox-field label {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    margin: 18px 0 0;
    padding: 0 4px;
}

.file-checkbox-field input {
    width: auto;
    margin: 0;
}

.file-action-panel {
    margin: 18px 0;
    padding: 20px;
    border: 1px solid rgba(32, 214, 199, 0.35);
    border-radius: 14px;
    background: rgba(32, 214, 199, 0.05);
}

.file-action-panel[hidden] {
    display: none;
}

.file-panel-heading {
    align-items: flex-start;
    margin-bottom: 6px;
}

.file-panel-heading h3 {
    margin-bottom: 6px;
}

.file-panel-heading .help-text {
    margin-bottom: 0;
}

.file-action-panel form {
    max-width: 760px;
}

.file-action-panel form > button[type="submit"] {
    width: auto;
}

.file-upload-help {
    margin: 8px 0 0;
    font-size: 0.8rem;
}

.files-message {
    margin: 18px 0;
    padding: 13px 15px;
    border: 1px solid rgba(66, 211, 146, 0.45);
    border-radius: 11px;
    background: rgba(66, 211, 146, 0.1);
    color: #9aefc7;
    line-height: 1.5;
}

.files-message[data-type="error"] {
    border-color: rgba(255, 102, 125, 0.48);
    background: rgba(255, 102, 125, 0.1);
    color: #ffb2bf;
}

.folder-breadcrumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 42px;
    margin: 18px 0;
    padding: 9px 11px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: #090f18;
}

.breadcrumb-button {
    width: auto;
    margin: 0;
    padding: 6px 9px;
    border: 0;
    background: transparent;
    color: var(--accent);
    font-size: 0.84rem;
}

.breadcrumb-button:hover:not(:disabled) {
    background: rgba(32, 214, 199, 0.1);
}

.breadcrumb-button:disabled {
    color: var(--text);
    cursor: default;
    opacity: 1;
}

.breadcrumb-separator {
    color: var(--muted);
}

.files-result-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 20px 0 14px;
}

.files-result-heading h3,
.files-result-heading p {
    margin-bottom: 0;
}

.files-result-heading .secondary-button {
    flex: 0 0 auto;
}

.file-result-section-title {
    margin: 22px 0 12px;
    color: #dce6f3;
    font-size: 0.88rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

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

.folder-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 13px;
    width: 100%;
    min-height: 126px;
    margin: 0;
    padding: 17px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--panel-light);
    color: var(--text);
    text-align: left;
}

.folder-card:hover {
    border-color: var(--accent);
    background: rgba(32, 214, 199, 0.09);
}

.folder-card:focus-visible,
.file-folder-link:focus-visible,
.file-download-button:focus-visible,
.breadcrumb-button:focus-visible {
    outline: 3px solid rgba(32, 214, 199, 0.3);
    outline-offset: 2px;
}

.folder-card-icon {
    width: 42px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: rgba(32, 214, 199, 0.13);
    color: var(--accent);
    font-size: 1.25rem;
}

.folder-card-body,
.folder-card-name,
.folder-card-description,
.folder-card-metadata {
    display: block;
    min-width: 0;
}

.folder-card-name {
    overflow: hidden;
    margin-bottom: 6px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.folder-card-description {
    display: -webkit-box;
    min-height: 2.8em;
    overflow: hidden;
    color: var(--muted);
    font-size: 0.83rem;
    font-weight: 500;
    line-height: 1.4;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.folder-card-metadata {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 11px;
}

.folder-updated,
.file-metadata-item {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 600;
}

.file-badge,
.file-tag {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 4px 8px;
    overflow: hidden;
    border: 1px solid rgba(32, 214, 199, 0.27);
    border-radius: 999px;
    background: rgba(32, 214, 199, 0.08);
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-list {
    display: grid;
    gap: 10px;
}

.file-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--panel-light);
}

.file-row:hover {
    border-color: rgba(32, 214, 199, 0.5);
}

.file-type-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(32, 214, 199, 0.28);
    border-radius: 11px;
    background: rgba(32, 214, 199, 0.09);
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.04em;
}

.file-row-details {
    min-width: 0;
}

.file-row-name {
    overflow: hidden;
    margin-bottom: 4px;
    font-size: 1rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-row-description {
    display: -webkit-box;
    overflow: hidden;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 0.83rem;
    line-height: 1.4;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.file-row-metadata {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px 11px;
}

.file-folder-link {
    width: auto;
    margin: 0;
    padding: 3px 0;
    border: 0;
    background: transparent;
    color: var(--accent);
    font-size: 0.76rem;
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.file-folder-link:hover {
    background: transparent;
    color: #5df2e6;
}

.file-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 9px;
}

.file-tag {
    border-color: var(--border);
    background: #090f18;
    color: #cbd5e1;
    font-weight: 700;
}

.file-row-actions {
    display: flex;
    align-items: center;
}

.file-download-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 9px 13px;
    border: 1px solid rgba(32, 214, 199, 0.45);
    border-radius: 9px;
    background: rgba(32, 214, 199, 0.12);
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 900;
    text-decoration: none;
}

.file-download-button:hover {
    background: rgba(32, 214, 199, 0.2);
}

.files-empty-state {
    margin-top: 16px;
    border: 1px dashed var(--border);
    border-radius: 14px;
    background: rgba(9, 15, 24, 0.55);
}

.files-panel[aria-busy="true"] .folder-grid,
.files-panel[aria-busy="true"] .file-list {
    opacity: 0.58;
    pointer-events: none;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

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

@media (max-width: 760px) {
    .file-search-primary {
        grid-template-columns: 1fr 1fr;
    }

    .file-search-field {
        grid-column: 1 / -1;
    }

    .file-search-primary button {
        width: 100%;
    }

    .file-row {
        grid-template-columns: auto minmax(0, 1fr);
        align-items: start;
    }

    .file-row-actions {
        grid-column: 1 / -1;
    }

    .file-download-button {
        width: 100%;
    }
}

@media (max-width: 560px) {
    .files-panel,
    .file-action-panel,
    .file-search-form {
        padding: 16px;
    }

    .files-actions,
    .files-actions button,
    .folder-grid {
        width: 100%;
    }

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

    .files-result-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .files-result-heading .secondary-button {
        width: 100%;
    }

    .file-row {
        grid-template-columns: 1fr;
    }

    .file-type-icon {
        width: 42px;
        height: 42px;
    }

    .file-row-name {
        white-space: normal;
        overflow-wrap: anywhere;
    }
}

/* Shared application sidebar */
.app-layout { min-height: 100vh; padding-left: 280px; transition: padding-left .2s ease; }
.app-content { min-width: 0; padding-top: 1px; }
.app-sidebar { position: fixed; inset: 0 auto 0 0; z-index: 50; width: 280px; display: flex; flex-direction: column; border-right: 1px solid var(--border); background: rgba(9, 15, 24, .98); box-shadow: 18px 0 50px rgba(0,0,0,.22); transition: width .2s ease, transform .2s ease; }
.sidebar-brand { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.sidebar-brand > a, .mobile-app-header > a { min-width: 0; display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; }
.sidebar-brand-mark { width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; border: 1px solid rgba(32,214,199,.55); border-radius: 12px; background: rgba(32,214,199,.12); color: var(--accent); font-size: .82rem; font-weight: 900; letter-spacing: .08em; }
.sidebar-brand-copy { min-width: 0; display: grid; }
.sidebar-brand-copy strong { font-size: 1rem; }
.sidebar-brand-copy small, .sidebar-user-copy small { overflow: hidden; color: var(--muted); font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-icon-button { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); color: var(--text); font-size: 1.25rem; }
.sidebar-nav { flex: 1 1 auto; overflow-y: auto; padding: 12px; }
.sidebar-section-label { margin: 18px 10px 7px; color: #6f829b; font-size: .65rem; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.sidebar-link { width: 100%; min-height: 43px; display: flex; align-items: center; gap: 12px; margin: 2px 0; padding: 9px 11px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: #cbd6e4; text-decoration: none; font-size: .9rem; font-weight: 700; text-align: left; }
a.sidebar-link:hover, button.sidebar-link:hover { border-color: var(--border); background: var(--panel-light); color: var(--text); }
.sidebar-link.is-active { border-color: rgba(32,214,199,.28); background: rgba(32,214,199,.12); color: var(--accent); }
.sidebar-link.is-disabled { cursor: not-allowed; opacity: .48; }
.sidebar-icon { width: 22px; flex: 0 0 22px; text-align: center; font-size: 1.05rem; }
.sidebar-link-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-badge { margin-left: auto; padding: 2px 6px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); font-size: .58rem; text-transform: uppercase; }
.sidebar-account { flex: 0 0 auto; padding: 14px 12px; border-top: 1px solid var(--border); background: rgba(7,11,18,.75); }
.sidebar-user-row { display: flex; align-items: center; gap: 11px; padding: 0 6px 12px; }
.sidebar-avatar { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; border-radius: 50%; background: linear-gradient(135deg, var(--accent-dark), var(--accent)); color: #031211; font-weight: 900; }
.sidebar-user-copy { min-width: 0; display: grid; }
.sidebar-user-copy strong { overflow: hidden; font-size: .86rem; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-status-label { margin: 0 6px 5px; color: var(--muted); font-size: .7rem; }
.sidebar-status-select { width: calc(100% - 12px); margin: 0 6px; padding: 9px 10px; border: 1px solid var(--border); border-radius: 9px; background: #090f18; color: var(--text); }
.sidebar-status-message { min-height: 16px; margin: 4px 7px 0; color: var(--success); font-size: .68rem; }
.sidebar-status-message.is-error { color: var(--danger); }
.sidebar-account-links { margin-top: 4px; }
.sidebar-account-links form { margin: 0; }
.sidebar-logout { cursor: pointer; }
.mobile-app-header { display: none; }
.sidebar-backdrop { position: fixed; inset: 0; z-index: 45; background: rgba(0,0,0,.62); backdrop-filter: blur(2px); }
body.sidebar-collapsed .app-layout { padding-left: 82px; }
body.sidebar-collapsed .app-sidebar { width: 82px; }
body.sidebar-collapsed .sidebar-brand-copy, body.sidebar-collapsed .sidebar-link-text, body.sidebar-collapsed .sidebar-section-label, body.sidebar-collapsed .sidebar-user-copy, body.sidebar-collapsed .sidebar-status-label, body.sidebar-collapsed .sidebar-status-select, body.sidebar-collapsed .sidebar-status-message, body.sidebar-collapsed .sidebar-badge { display: none; }
body.sidebar-collapsed .sidebar-brand { justify-content: center; padding-inline: 8px; }
body.sidebar-collapsed .sidebar-brand > a { display: none; }
body.sidebar-collapsed .sidebar-link { justify-content: center; padding-inline: 8px; }
body.sidebar-collapsed .sidebar-user-row { justify-content: center; padding-inline: 0; }
body.sidebar-collapsed #sidebar-collapse { transform: rotate(180deg); }

@media (max-width: 860px) {
    .desktop-only { display: none !important; }
    .app-layout, body.sidebar-collapsed .app-layout { padding-left: 0; padding-top: 62px; }
    .app-sidebar, body.sidebar-collapsed .app-sidebar { width: min(86vw, 310px); transform: translateX(-105%); }
    body.sidebar-mobile-open .app-sidebar { transform: translateX(0); }
    .mobile-app-header { position: fixed; inset: 0 0 auto 0; z-index: 40; height: 62px; display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--border); background: rgba(7,11,18,.96); backdrop-filter: blur(12px); }
    .mobile-app-header .sidebar-brand-mark { width: 36px; height: 36px; flex-basis: 36px; border-radius: 10px; }
    body.sidebar-mobile-open { overflow: hidden; }
    body.sidebar-collapsed .sidebar-brand-copy, body.sidebar-collapsed .sidebar-link-text, body.sidebar-collapsed .sidebar-section-label, body.sidebar-collapsed .sidebar-user-copy, body.sidebar-collapsed .sidebar-status-label, body.sidebar-collapsed .sidebar-status-select, body.sidebar-collapsed .sidebar-status-message, body.sidebar-collapsed .sidebar-badge { display: initial; }
    body.sidebar-collapsed .sidebar-section-label { display: block; }
    body.sidebar-collapsed .sidebar-brand > a { display: flex; }
    body.sidebar-collapsed .sidebar-link { justify-content: flex-start; padding-inline: 11px; }
    body.sidebar-collapsed .sidebar-user-row { justify-content: flex-start; padding-inline: 6px; }
    .dashboard-shell, .admin-shell { width: min(100% - 24px, 1400px); margin-top: 20px; }
}

/* Equipment archive and deletion lifecycle */
.equipment-count {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 7px 11px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--panel-light);
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    white-space: nowrap;
}

.equipment-archive-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 34px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.equipment-archive-heading h3 {
    margin: 0;
}

.archived-equipment {
    border-style: dashed;
    background: rgba(9, 15, 24, 0.72);
}

.equipment-readonly {
    display: grid;
    gap: 7px;
    padding: 20px;
    color: var(--muted);
}

.equipment-readonly strong {
    color: var(--text);
}

.equipment-action-form,
.permanent-delete-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
}

.equipment-action-form p,
.permanent-delete-form p {
    margin: 5px 0 0;
}

.equipment-action-form button,
.permanent-delete-form button {
    width: auto;
    margin: 0;
}

.permanent-delete-form {
    grid-template-columns: minmax(0, 1fr) minmax(180px, 260px) auto;
    background: rgba(255, 98, 122, 0.045);
}

.permanent-delete-form input {
    margin: 0;
}

.permanent-delete-form code {
    color: var(--danger);
    font-weight: 900;
}

@media (max-width: 820px) {
    .equipment-action-form,
    .permanent-delete-form {
        grid-template-columns: 1fr;
    }

    .equipment-action-form button,
    .permanent-delete-form button,
    .permanent-delete-form input {
        width: 100%;
    }
}

/* Unified equipment profiles */
.equipment-shell {
    padding-bottom: 56px;
}

.equipment-metrics .maintenance-overdue strong,
.maintenance-overdue strong,
.maintenance-overdue .maintenance-state {
    color: var(--danger);
}

.equipment-metrics .maintenance-soon strong,
.maintenance-soon strong,
.maintenance-due_soon .maintenance-state {
    color: var(--warning, #f0b34a);
}

.equipment-filter-grid,
.equipment-form-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    align-items: end;
}

.equipment-filter-actions,
.equipment-hero-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.equipment-filter-actions button,
.equipment-filter-actions .secondary-button,
.equipment-hero-actions .secondary-button {
    width: auto;
    margin: 0;
}

.full-width {
    grid-column: 1 / -1;
}

.equipment-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
}

.equipment-profile-card,
.maintenance-schedule-card {
    display: grid;
    gap: 14px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--panel-light);
}

.equipment-profile-card.is-archived {
    opacity: .82;
    border-style: dashed;
}

.equipment-card-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.equipment-card-heading h3,
.equipment-card-heading p {
    margin: 4px 0 0;
}

.equipment-type-badge,
.status-pill,
.maintenance-state {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 5px 9px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--muted);
    font-size: .72rem;
    font-weight: 850;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.status-available { color: #7fe4aa; }
.status-in_service { color: #73c9ff; }
.status-maintenance { color: #f0b34a; }
.status-out_of_service,
.status-retired { color: var(--danger); }

.equipment-card-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.equipment-card-facts span {
    padding: 6px 9px;
    border-radius: 10px;
    background: rgba(255,255,255,.035);
    color: var(--muted);
    font-size: .78rem;
}

.equipment-tag-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.equipment-removable-tag {
    gap: 5px;
}

.equipment-removable-tag form {
    display: inline;
    margin: 0;
}

.equipment-removable-tag button {
    width: auto;
    min-height: 0;
    margin: 0;
    padding: 0 2px;
    border: 0;
    background: transparent;
    color: inherit;
    line-height: 1;
}

.muted-copy {
    color: var(--muted);
    font-size: .84rem;
}

.equipment-profile-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr);
    gap: 20px;
}

.equipment-primary-photo img,
.equipment-photo-grid img {
    display: block;
    width: 100%;
    object-fit: cover;
    border-radius: 14px;
    background: #0a1018;
}

.equipment-primary-photo img {
    min-height: 280px;
    max-height: 430px;
}

.inline-equipment-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) auto;
    align-items: end;
    gap: 14px;
    margin-top: 18px;
}

.inline-equipment-form button {
    width: auto;
    margin: 0;
}

.equipment-file-columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 24px;
    margin-top: 20px;
}

.equipment-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
}

.equipment-photo-grid article,
.equipment-document-list article,
.equipment-history-list article {
    display: grid;
    gap: 8px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255,255,255,.025);
}

.equipment-photo-grid img {
    aspect-ratio: 4 / 3;
}

.equipment-photo-grid span,
.equipment-document-list span,
.equipment-history-list span {
    color: var(--muted);
    font-size: .78rem;
}

.equipment-document-list,
.equipment-history-list,
.maintenance-schedule-list {
    display: grid;
    gap: 12px;
}

.equipment-document-list article {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
}

.equipment-document-list article > div {
    display: grid;
    gap: 5px;
}

.equipment-document-list article > div:last-child {
    display: flex;
    gap: 8px;
}

.equipment-document-list form,
.maintenance-schedule-card form {
    margin: 0;
}

.maintenance-schedule-card.maintenance-overdue {
    border-color: rgba(255, 98, 122, .55);
}

.maintenance-schedule-card.maintenance-due_soon {
    border-color: rgba(240, 179, 74, .55);
}

.maintenance-schedule-card details {
    border-top: 1px solid var(--border);
    padding-top: 12px;
}

.danger-zone {
    border-color: rgba(255, 98, 122, .35);
}

@media (max-width: 980px) {
    .equipment-filter-grid,
    .equipment-form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .equipment-profile-grid,
    .equipment-file-columns {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .equipment-filter-grid,
    .equipment-form-grid,
    .inline-equipment-form {
        grid-template-columns: 1fr;
    }

    .full-width {
        grid-column: auto;
    }

    .equipment-card-heading,
    .equipment-document-list article {
        grid-template-columns: 1fr;
        flex-direction: column;
    }

    .equipment-document-list article > div:last-child {
        flex-wrap: wrap;
    }
}

/* Configurable dashboard widgets */
.dashboard-welcome-panel {
    align-items: center;
}

.dashboard-welcome-actions,
.dashboard-customizer-actions,
.dashboard-widget-controls,
.dashboard-hidden-widget-list {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.dashboard-welcome-actions {
    justify-content: flex-end;
}

.dashboard-welcome-actions button,
.dashboard-customizer-actions button,
.dashboard-widget-controls button,
.dashboard-hidden-widget-list button {
    width: auto;
    margin: 0;
}

.dashboard-customizer {
    display: grid;
    gap: 16px;
    padding: 22px;
    border: 1px solid rgba(32, 214, 199, .35);
    border-radius: 18px;
    background: rgba(32, 214, 199, .07);
}

.dashboard-customizer[hidden] {
    display: none;
}

.dashboard-layout-message {
    min-height: 22px;
    margin: 0;
    color: var(--success);
    font-weight: 700;
}

.dashboard-layout-message.is-error {
    color: var(--danger);
}

.dashboard-hidden-widgets {
    display: grid;
    gap: 9px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.dashboard-widget-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 18px;
    align-items: start;
}

.dashboard-widget {
    grid-column: span 6;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--panel);
    box-shadow: 0 18px 45px rgba(0, 0, 0, .16);
}

.dashboard-widget[hidden] {
    display: none;
}

.dashboard-widget-small {
    grid-column: span 3;
}

.dashboard-widget-medium {
    grid-column: span 6;
}

.dashboard-widget-large {
    grid-column: span 9;
}

.dashboard-widget-full {
    grid-column: 1 / -1;
}

.dashboard-widget-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--border);
}

.dashboard-widget-header h2,
.dashboard-widget-header p {
    margin: 0;
}

.dashboard-widget-header h2 {
    margin-top: 3px;
    font-size: 1.05rem;
}

.dashboard-widget-controls {
    display: none;
    justify-content: flex-end;
}

.is-customizing .dashboard-widget-controls {
    display: flex;
}

.is-customizing .dashboard-widget {
    outline: 1px dashed rgba(32, 214, 199, .35);
    cursor: grab;
}

.is-customizing .dashboard-widget:active {
    cursor: grabbing;
}

.dashboard-widget.is-dragging {
    opacity: .45;
    transform: scale(.99);
}

.dashboard-drag-handle,
.dashboard-size-control {
    min-height: 34px;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--panel-light);
    color: var(--text);
    font-size: .72rem;
}

.dashboard-drag-handle {
    width: 36px !important;
    padding: 0;
    font-size: 1rem;
}

.dashboard-mandatory-badge,
.dashboard-critical-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 8px;
    border: 1px solid rgba(255, 98, 122, .4);
    border-radius: 999px;
    color: var(--danger);
    font-size: .67rem;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.dashboard-widget-body {
    display: grid;
    gap: 16px;
    padding: 20px;
}

.widget-intro {
    margin: 0;
    color: var(--muted);
}

.dashboard-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.dashboard-stat-grid > div {
    display: grid;
    gap: 5px;
    padding: 13px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255, 255, 255, .025);
}

.dashboard-stat-grid span,
.dashboard-alert-summary span {
    color: var(--muted);
    font-size: .72rem;
}

.dashboard-stat-grid strong,
.dashboard-alert-summary strong {
    font-size: 1.28rem;
}

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

.dashboard-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: rgba(255, 255, 255, .02);
    color: var(--text);
    text-decoration: none;
}

.dashboard-list-item:hover {
    border-color: rgba(32, 214, 199, .35);
    background: var(--panel-light);
}

.dashboard-list-item > span:first-child {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.dashboard-list-item strong,
.dashboard-list-item small {
    overflow-wrap: anywhere;
}

.dashboard-list-item small,
.dashboard-list-item time {
    color: var(--muted);
    font-size: .72rem;
}

.dashboard-list-item.alert-item {
    border-color: rgba(255, 98, 122, .32);
}

.dashboard-list-item.warning-item {
    border-color: rgba(240, 179, 74, .35);
}

.compact-list {
    gap: 7px;
}

.widget-empty-state {
    display: grid;
    gap: 5px;
    min-height: 98px;
    place-content: center;
    padding: 18px;
    border: 1px dashed var(--border);
    border-radius: 12px;
    color: var(--muted);
    text-align: center;
}

.widget-empty-state strong {
    color: var(--text);
}

.dashboard-alert-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.dashboard-alert-summary > div {
    display: grid;
    gap: 4px;
    padding: 13px;
    border: 1px solid rgba(255, 98, 122, .28);
    border-radius: 12px;
    background: rgba(255, 98, 122, .05);
}

.dashboard-quick-actions {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.dashboard-quick-actions a,
.widget-link {
    display: grid;
    min-height: 48px;
    place-items: center;
    padding: 11px 13px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--panel-light);
    color: var(--text);
    font-weight: 800;
    text-align: center;
    text-decoration: none;
}

.dashboard-quick-actions a:hover,
.widget-link:hover {
    border-color: rgba(32, 214, 199, .4);
    color: var(--accent);
}

.dashboard-company-role-grid {
    display: grid;
    gap: 14px;
}

.dashboard-role-widget-table {
    width: 100%;
    border-collapse: collapse;
}

.dashboard-role-widget-table th,
.dashboard-role-widget-table td {
    padding: 10px 9px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}

.dashboard-role-widget-table th {
    color: var(--muted);
    font-size: .68rem;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.dashboard-role-widget-table input[type="number"],
.dashboard-role-widget-table select {
    min-width: 92px;
    padding: 8px;
}

.dashboard-role-widget-title {
    display: grid;
    gap: 3px;
}

.dashboard-role-widget-title small {
    color: var(--muted);
}

@media (max-width: 1100px) {
    .dashboard-widget-small,
    .dashboard-widget-medium {
        grid-column: span 6;
    }

    .dashboard-widget-large {
        grid-column: 1 / -1;
    }
}

@media (max-width: 760px) {
    .dashboard-widget-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-widget,
    .dashboard-widget-small,
    .dashboard-widget-medium,
    .dashboard-widget-large,
    .dashboard-widget-full {
        grid-column: 1;
    }

    .dashboard-welcome-actions,
    .dashboard-widget-header {
        align-items: stretch;
        flex-direction: column;
    }

    .dashboard-widget-controls {
        justify-content: flex-start;
    }

    .dashboard-stat-grid,
    .dashboard-alert-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-role-widget-table,
    .dashboard-role-widget-table tbody,
    .dashboard-role-widget-table tr,
    .dashboard-role-widget-table td {
        display: block;
        width: 100%;
    }

    .dashboard-role-widget-table thead {
        display: none;
    }

    .dashboard-role-widget-table tr {
        margin-bottom: 12px;
        padding: 10px;
        border: 1px solid var(--border);
        border-radius: 12px;
    }

    .dashboard-role-widget-table td {
        border: 0;
        padding: 6px 0;
    }
}

/* Account profile and settings */
.account-shell {
    display: grid;
    gap: 18px;
}

.account-hero {
    align-items: flex-start;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 18px;
}

.account-hero-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
}

.account-hero-actions .secondary-button {
    min-width: 180px;
    text-align: center;
    white-space: nowrap;
}

.account-form {
    display: grid;
    gap: 18px;
}

.account-panel {
    display: grid;
    gap: 18px;
}

.account-notice {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    font-weight: 700;
}

.account-notice.is-success {
    background: rgba(43, 133, 99, .12);
    border-color: rgba(43, 133, 99, .35);
}

.account-notice.is-error {
    background: rgba(181, 53, 53, .10);
    border-color: rgba(181, 53, 53, .35);
}

.account-profile-photo-row {
    align-items: center;
    display: flex;
    gap: 18px;
}

.account-profile-photo {
    align-items: center;
    background: var(--surface-soft, #eef2f7);
    border: 1px solid var(--border);
    border-radius: 24px;
    display: flex;
    flex: 0 0 112px;
    height: 112px;
    justify-content: center;
    overflow: hidden;
    width: 112px;
}

.account-profile-photo img {
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.account-profile-photo span {
    font-size: 2.25rem;
    font-weight: 800;
}

.account-photo-controls {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.checkbox-row {
    align-items: center;
    display: flex;
    gap: 8px;
}

.account-toggle-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.account-toggle {
    align-items: flex-start;
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    gap: 12px;
    margin: 0;
    min-width: 0;
    padding: 14px;
}

.account-toggle input[type="checkbox"] {
    flex: 0 0 auto;
    height: 18px;
    margin: 3px 0 0;
    padding: 0;
    width: 18px;
}

.account-toggle span {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.account-toggle strong,
.account-toggle small {
    overflow-wrap: normal;
    word-break: normal;
}

.account-toggle small,
.account-channel-row small {
    color: var(--muted);
    font-weight: 400;
    line-height: 1.35;
}

.standalone-toggle {
    max-width: 760px;
}

.account-channel-grid {
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.account-channel-heading,
.account-channel-row {
    align-items: center;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(0, 1fr) 88px 88px;
    padding: 12px 14px;
}

.account-channel-heading {
    background: var(--surface-soft, #eef2f7);
    font-size: .82rem;
    font-weight: 800;
    text-transform: uppercase;
}

.account-channel-row + .account-channel-row {
    border-top: 1px solid var(--border);
}

.account-channel-row > span:first-child {
    display: grid;
    gap: 3px;
}

.account-channel-row label,
.account-channel-heading span:not(:first-child) {
    justify-self: center;
}

.compact-account-grid {
    max-width: 560px;
}

.account-save-bar {
    align-items: center;
    background: var(--surface, #fff);
    border: 1px solid var(--border);
    border-radius: 14px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    position: sticky;
    bottom: 12px;
    z-index: 5;
}

.account-save-bar span {
    color: var(--muted);
    font-size: .9rem;
}

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

@media (max-width: 760px) {
    .account-hero,
    .account-profile-photo-row,
    .account-save-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .account-toggle-grid {
        grid-template-columns: 1fr;
    }

    .account-channel-heading,
    .account-channel-row {
        grid-template-columns: minmax(0, 1fr) 64px 64px;
        padding: 10px;
    }

    .account-save-bar {
        position: static;
    }
}


/* Live staff presence, geozones and telemetry */
.staff-status-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
    width: 100%;
}

.staff-status-metric {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.staff-status-label {
    color: var(--muted);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .03em;
    line-height: 1.2;
    text-align: center;
    text-transform: uppercase;
}

.staff-status-count-box {
    align-items: center;
    background: rgba(255, 255, 255, .025);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex;
    justify-content: center;
    min-height: 54px;
    padding: 10px;
}

.staff-status-count-box strong {
    font-size: 1.35rem;
}

.geofence-shell {
    display: grid;
    gap: 18px;
}

.geofence-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px;
}

.geofence-alert-grid {
    align-items: end;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.inline-action-row {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.inline-action-row form {
    margin: 0;
}

.telemetry-secret {
    display: grid;
    gap: 8px;
}

.telemetry-key {
    display: block;
    overflow-wrap: anywhere;
    padding: 10px;
    background: rgba(0, 0, 0, .22);
    border-radius: 8px;
}

.danger-button {
    border-color: rgba(181, 53, 53, .45) !important;
}

.circle-zone-field[hidden],
.polygon-zone-field[hidden] {
    display: none !important;
}

@media (max-width: 1100px) {
   .staff-status-metrics {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
   .staff-status-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .geofence-alert-grid {
        grid-template-columns: 1fr;
    }

    .account-hero-actions .secondary-button {
        width: 100%;
    }
}

.equipment-status-stack {
    align-items: flex-end;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* RichyRoute Navigation Map v1 */

.richyroute-navigation {
    display: grid;
    gap: 1rem;
}

.navigation-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.navigation-toolbar h3 {
    margin: 0.2rem 0 0;
}

.navigation-intro {
    margin-bottom: 0;
}

.navigation-status {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 0.75rem;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 999px;
    white-space: nowrap;
    font-size: 0.86rem;
    font-weight: 700;
}

.navigation-status-dot {
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 50%;
    background: #64748b;
    box-shadow: 0 0 0.55rem rgba(100, 116, 139, 0.7);
}

.navigation-status[data-state="pending"]
.navigation-status-dot {
    background: #f59e0b;
    box-shadow: 0 0 0.7rem rgba(245, 158, 11, 0.9);
    animation: richyroute-gps-pulse 1.2s infinite;
}

.navigation-status[data-state="live"]
.navigation-status-dot {
    background: #22c55e;
    box-shadow: 0 0 0.75rem rgba(34, 197, 94, 0.95);
}

.navigation-status[data-state="error"]
.navigation-status-dot {
    background: #ef4444;
    box-shadow: 0 0 0.65rem rgba(239, 68, 68, 0.9);
}

.navigation-profile-grid,
.navigation-live-grid {
    display: grid;
    grid-template-columns:
        repeat(auto-fit, minmax(135px, 1fr));
    gap: 0.75rem;
}

.navigation-profile-grid > div,
.navigation-live-grid > div {
    padding: 0.8rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 0.75rem;
    background: rgba(15, 23, 42, 0.35);
}

.navigation-profile-grid span,
.navigation-live-grid span {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.76rem;
    opacity: 0.72;
}

.navigation-profile-grid strong,
.navigation-live-grid strong {
    font-size: 0.98rem;
}

.navigation-map-shell {
    position: relative;
    min-height: 420px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.26);
    border-radius: 0.9rem;
    background: #111827;
}

#richyroute-map {
    width: 100%;
    height: 420px;
}

.navigation-map-message {
    position: absolute;
    z-index: 4;
    left: 50%;
    bottom: 1rem;
    width: min(90%, 520px);
    transform: translateX(-50%);
    padding: 0.75rem 1rem;
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 0.75rem;
    background: rgba(15, 23, 42, 0.92);
    color: #f8fafc;
    text-align: center;
    backdrop-filter: blur(8px);
}

.richyroute-position-marker {
    width: 1.35rem;
    height: 1.35rem;
    border: 0.22rem solid #ffffff;
    border-radius: 50%;
    background: #2563eb;
    box-shadow:
        0 0 0 0.42rem rgba(37, 99, 235, 0.28),
        0 0 1rem rgba(37, 99, 235, 0.9);
}

.navigation-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.navigation-message {
    margin: 0;
}

@keyframes richyroute-gps-pulse {
    0%,
    100% {
        opacity: 0.55;
        transform: scale(0.9);
    }

    50% {
        opacity: 1;
        transform: scale(1.15);
    }
}

@media (max-width: 700px) {
    .navigation-toolbar {
        display: grid;
    }

    .navigation-status {
        justify-self: start;
    }

    .navigation-map-shell,
    #richyroute-map {
        min-height: 340px;
        height: 340px;
    }
}

/* RichyRoute Live Location v1 */

.live-location-body {
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(
            circle at top left,
            rgba(37, 99, 235, 0.14),
            transparent 32rem
        ),
        #07111f;
    color: #e5edf8;
}

.live-location-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.25rem 1.5rem;
    border-bottom:
        1px solid rgba(148, 163, 184, 0.18);
    background: rgba(7, 17, 31, 0.95);
}

.live-location-header h1 {
    margin: 0.15rem 0;
}

.live-location-header p {
    margin: 0;
}

.live-location-header-actions,
.live-location-map-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.live-location-layout {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr) minmax(290px, 370px);
    gap: 1rem;
    min-height: calc(100vh - 116px);
    padding: 1rem;
}

.live-location-map-panel,
.live-location-list-panel {
    overflow: hidden;
    border:
        1px solid rgba(148, 163, 184, 0.2);
    border-radius: 1rem;
    background: rgba(15, 23, 42, 0.82);
    box-shadow:
        0 1rem 3rem rgba(0, 0, 0, 0.25);
}

.live-location-map-panel {
    position: relative;
    display: grid;
    grid-template-rows: auto minmax(520px, 1fr);
}

.live-location-map-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1rem;
    border-bottom:
        1px solid rgba(148, 163, 184, 0.16);
}

.live-location-map-toolbar > div:first-child {
    display: grid;
    gap: 0.2rem;
}

#live-location-updated {
    font-size: 0.82rem;
    opacity: 0.68;
}

#live-location-map {
    width: 100%;
    min-height: 520px;
}

.live-location-list-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
}

.live-location-list-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    border-bottom:
        1px solid rgba(148, 163, 184, 0.16);
}

.live-location-list-heading h2 {
    margin: 0.15rem 0 0;
}

#live-location-count {
    min-width: 2.2rem;
    padding: 0.35rem 0.55rem;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.2);
    text-align: center;
    font-weight: 800;
}

.live-location-unit-list {
    display: grid;
    align-content: start;
    gap: 0.65rem;
    overflow-y: auto;
    padding: 0.75rem;
}

.live-location-unit-card {
    display: grid;
    gap: 0.55rem;
    width: 100%;
    padding: 0.85rem;
    border:
        1px solid rgba(148, 163, 184, 0.18);
    border-left-width: 0.3rem;
    border-radius: 0.8rem;
    background: rgba(30, 41, 59, 0.72);
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.live-location-unit-card:hover:not(:disabled) {
    transform: translateY(-1px);
    border-color: rgba(96, 165, 250, 0.72);
}

.live-location-unit-card:disabled {
    cursor: default;
    opacity: 0.7;
}

.live-location-unit-card-header,
.live-location-unit-metrics {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
}

.live-location-unit-card p {
    margin: 0;
    font-size: 0.86rem;
    opacity: 0.76;
}

.live-location-unit-metrics {
    justify-content: flex-start;
    flex-wrap: wrap;
}

.live-location-unit-metrics span {
    padding: 0.25rem 0.45rem;
    border-radius: 0.45rem;
    background: rgba(15, 23, 42, 0.82);
    font-size: 0.74rem;
}

.live-location-state-badge {
    padding: 0.25rem 0.45rem;
    border-radius: 999px;
    background: rgba(100, 116, 139, 0.22);
    font-size: 0.72rem;
    font-weight: 800;
}

.live-location-unit-card.is-mobile {
    border-left-color: #22c55e;
}

.live-location-unit-card.is-stationary {
    border-left-color: #3b82f6;
}

.live-location-unit-card.is-stopped {
    border-left-color: #f59e0b;
}

.live-location-unit-card.is-offline {
    border-left-color: #ef4444;
}

.live-location-unit-card.is-unknown {
    border-left-color: #64748b;
}

.live-location-marker {
    display: grid;
    place-items: center;
    min-width: 3.3rem;
    height: 2rem;
    padding: 0 0.55rem;
    border: 0.16rem solid #f8fafc;
    border-radius: 0.65rem 0.65rem 0.65rem 0;
    transform: rotate(-45deg);
    background: #64748b;
    color: #fff;
    box-shadow:
        0 0.45rem 1rem rgba(0, 0, 0, 0.42);
    cursor: pointer;
}

.live-location-marker span {
    transform: rotate(45deg);
    font-size: 0.68rem;
    font-weight: 900;
    white-space: nowrap;
}

.live-location-marker.is-mobile {
    background: #16a34a;
}

.live-location-marker.is-stationary {
    background: #2563eb;
}

.live-location-marker.is-stopped {
    background: #d97706;
}

.live-location-marker.is-offline {
    background: #dc2626;
}

.live-location-popup {
    display: grid;
    gap: 0.25rem;
    color: #0f172a;
}

.live-location-popup span {
    font-size: 0.8rem;
}

.live-location-empty {
    padding: 1rem;
    border:
        1px dashed rgba(148, 163, 184, 0.3);
    border-radius: 0.75rem;
    text-align: center;
    opacity: 0.72;
}

@media (max-width: 900px) {
    .live-location-header {
        align-items: flex-start;
        display: grid;
    }

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

    .live-location-list-panel {
        max-height: 460px;
    }

    .live-location-map-panel {
        grid-template-rows:
            auto minmax(430px, 60vh);
    }

    #live-location-map {
        min-height: 430px;
    }
}

@media (max-width: 620px) {
    .live-location-header,
    .live-location-layout {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .live-location-map-toolbar {
        align-items: flex-start;
        display: grid;
    }

    .live-location-map-actions {
        width: 100%;
    }
}

