:root {
    --sidebar-width: 244px;
    --sidebar-bg: #083b89;
    --sidebar-bg-dark: #042b68;
    --primary: #0d6efd;
    --surface: #ffffff;
    --page-bg: #f4f7fb;
    --border: #e4e9f2;
    --text: #101735;
    --muted: #73809a;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--page-bg);
    color: var(--text);
    font-family: "Segoe UI", Arial, sans-serif;
}

.auth-body {
    min-height: 100vh;
    background:
        linear-gradient(135deg, rgba(8, 59, 137, 0.94), rgba(13, 110, 253, 0.78)),
        url("https://images.unsplash.com/photo-1581093458791-9f3c3900df4b?auto=format&fit=crop&w=1600&q=70");
    background-size: cover;
    background-position: center;
}

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

.login-card {
    width: min(440px, 100%);
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 8px;
    box-shadow: 0 24px 70px rgba(3, 27, 78, 0.25);
    padding: 28px;
}

.login-brand {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 24px;
}

.login-brand h1 {
    font-size: 22px;
    margin: 0 0 6px;
}

.login-brand p,
.demo-account {
    color: var(--muted);
    margin: 0;
}

.demo-account {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 18px;
    font-size: 13px;
}

.app-shell {
    min-height: 100vh;
    display: flex;
}

.app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--sidebar-bg), var(--sidebar-bg-dark));
    color: #fff;
    padding: 18px 14px;
    display: flex;
    flex-direction: column;
    z-index: 1040;
    transition: transform 0.2s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 10px 24px;
}

.brand-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 2px solid rgba(255, 255, 255, 0.85);
    border-radius: 8px;
    font-size: 22px;
}

.brand-mark.large {
    color: var(--primary);
    border-color: #d9e7ff;
    background: #f4f8ff;
    flex: 0 0 auto;
}

.brand-text {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0;
}

.sidebar-nav {
    display: grid;
    gap: 6px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 46px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    border-radius: 8px;
    padding: 0 12px;
    font-weight: 600;
}

.sidebar-link i {
    font-size: 20px;
}

.sidebar-link:hover,
.sidebar-link.active {
    color: #fff;
    background: #0d6efd;
}

.sidebar-footer {
    margin-top: auto;
    display: grid;
    gap: 10px;
}

.mini-card {
    display: flex;
    gap: 10px;
    align-items: center;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 12px;
}

.mini-card i {
    font-size: 22px;
}

.mini-card strong,
.mini-card span {
    display: block;
}

.mini-card span {
    color: #9ee8c9;
    font-size: 12px;
}

.mini-card.success span {
    color: #81f7b0;
}

.app-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-width: 0;
}

.app-header {
    height: 72px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.header-title h1 {
    font-size: 22px;
    margin: 0;
    white-space: nowrap;
}

.global-search {
    position: relative;
    flex: 1;
    max-width: 640px;
}

.global-search .search-leading-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
}

.global-search input {
    width: 100%;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0 54px 0 44px;
}

.search-with-qr {
    position: relative;
}

.filter-search-control .form-control {
    padding-right: 48px;
}

.qr-scan-button {
    align-items: center;
    background: #f7fbff;
    border: 1px solid #d7e2f3;
    border-radius: 8px;
    color: #0d47a1;
    display: inline-flex;
    height: 34px;
    justify-content: center;
    padding: 0;
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
}

.qr-scan-button:hover {
    background: #eaf2ff;
    border-color: #9bb9ed;
    color: #0d6efd;
}

.qr-scan-button i {
    line-height: 1;
}

.qr-camera-box {
    background: #071126;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.qr-camera-box video {
    aspect-ratio: 4 / 3;
    display: block;
    object-fit: cover;
    width: 100%;
}

.qr-camera-frame {
    border: 2px solid rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    box-shadow: 0 0 0 999px rgba(7, 17, 38, 0.36);
    height: min(58vw, 220px);
    left: 50%;
    max-height: 70%;
    max-width: 70%;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(58vw, 220px);
}

.qr-scan-status {
    color: var(--muted);
    font-size: 13px;
    margin: 12px 0 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.icon-button,
.help-button,
.user-menu {
    min-height: 40px;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 12px;
}

.icon-button {
    width: 42px;
    padding: 0;
}

.notification-dot {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 20px;
    height: 20px;
    border-radius: 999px;
    background: #ff2d2d;
    color: #fff;
    font-size: 11px;
    display: grid;
    place-items: center;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #d9f3ef;
    color: #073b62;
    font-weight: 700;
}

.app-content {
    padding: 24px 28px 36px;
}

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

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

.page-heading h2 {
    margin: 0;
    font-size: 24px;
}

.eyebrow {
    margin: 0 0 4px;
    color: #0d6efd;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.filter-strip {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: end;
}

.filter-item {
    min-width: 190px;
}

.filter-item.wide {
    min-width: 280px;
    flex: 1;
}

.filter-item label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
    margin-bottom: 6px;
}

.kpi-grid {
    display: grid;
    gap: 14px;
}

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

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

.component-summary-card {
    background: #fff;
    border: 1px solid var(--border);
    border-left: 4px solid #0d6efd;
    border-radius: 8px;
    padding: 14px;
}

.component-summary-card span,
.component-summary-card strong {
    display: block;
}

.component-summary-card span {
    color: var(--muted);
    font-size: 13px;
}

.component-summary-card strong {
    font-size: 24px;
}

.component-summary-card.warning {
    border-left-color: #ffc107;
}

.component-summary-card.danger {
    border-left-color: #dc3545;
}

.component-summary-card.purple {
    border-left-color: #8250df;
}

.component-summary-card.green {
    border-left-color: #198754;
}

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

.summary-card {
    align-items: center;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(16, 23, 53, 0.04);
    display: flex;
    gap: 12px;
    padding: 14px;
}

.summary-icon {
    align-items: center;
    border-radius: 8px;
    display: inline-flex;
    flex: 0 0 42px;
    height: 42px;
    justify-content: center;
    width: 42px;
}

.summary-card small,
.summary-card strong {
    display: block;
}

.summary-card small {
    color: var(--muted);
    font-size: 12px;
}

.summary-card strong {
    font-size: 24px;
    line-height: 1.1;
}

.kpi-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 8px 24px rgba(16, 23, 53, 0.04);
}

.kpi-icon {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 24px;
    flex: 0 0 auto;
}

.kpi-card span,
.kpi-card small {
    display: block;
}

.kpi-card span {
    font-weight: 700;
}

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

.kpi-card small {
    color: var(--muted);
    font-size: 12px;
}

.kpi-card.blue .kpi-icon {
    background: #0d6efd;
}

.kpi-card.green .kpi-icon {
    background: #18a957;
}

.kpi-card.orange .kpi-icon {
    background: #ff7a1a;
}

.kpi-card.purple .kpi-icon {
    background: #8250df;
}

.kpi-card.cyan .kpi-icon {
    background: #15aabf;
}

.dashboard-heading {
    margin-bottom: 14px;
}

.dashboard-filter {
    align-items: end;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 10px 30px rgba(16, 23, 53, 0.04);
}

.dashboard-time-filter {
    min-width: 150px;
}

.dashboard-department-filter {
    min-width: 210px;
}

.dashboard-type-filter {
    min-width: 260px;
}

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

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

.dashboard-kpi-card {
    align-items: center;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(16, 23, 53, 0.04);
    display: flex;
    gap: 14px;
    min-height: 112px;
    padding: 16px;
}

.dashboard-kpi-icon {
    align-items: center;
    border-radius: 50%;
    color: #fff;
    display: inline-flex;
    flex: 0 0 52px;
    font-size: 24px;
    height: 52px;
    justify-content: center;
    width: 52px;
}

.dashboard-kpi-card span,
.dashboard-kpi-card small,
.dashboard-kpi-card strong {
    display: block;
}

.dashboard-kpi-card span {
    font-size: 13px;
    font-weight: 700;
}

.dashboard-kpi-card strong {
    font-size: 27px;
    line-height: 1.1;
    margin: 4px 0;
}

.dashboard-kpi-card small {
    color: var(--muted);
    font-size: 12px;
}

.dashboard-blue {
    border-color: #bfdbfe;
    background: linear-gradient(135deg, #fff, #f4f8ff);
}

.dashboard-blue .dashboard-kpi-icon {
    background: #0d6efd;
}

.dashboard-blue strong {
    color: #0d6efd;
}

.dashboard-green {
    border-color: #bbf7d0;
    background: linear-gradient(135deg, #fff, #f3fff7);
}

.dashboard-green .dashboard-kpi-icon {
    background: #18a957;
}

.dashboard-green strong {
    color: #16a34a;
}

.dashboard-orange {
    border-color: #fed7aa;
    background: linear-gradient(135deg, #fff, #fff7ed);
}

.dashboard-orange .dashboard-kpi-icon {
    background: #f97316;
}

.dashboard-orange strong {
    color: #ea580c;
}

.dashboard-purple {
    border-color: #ddd6fe;
    background: linear-gradient(135deg, #fff, #faf7ff);
}

.dashboard-purple .dashboard-kpi-icon {
    background: #8b5cf6;
}

.dashboard-purple strong {
    color: #7c3aed;
}

.dashboard-yellow {
    border-color: #fde68a;
    background: linear-gradient(135deg, #fff, #fffbeb);
}

.dashboard-yellow .dashboard-kpi-icon {
    background: #f2b705;
}

.dashboard-yellow strong {
    color: #d99a00;
}

.dashboard-cyan {
    border-color: #a5f3fc;
    background: linear-gradient(135deg, #fff, #f0fdff);
}

.dashboard-cyan .dashboard-kpi-icon {
    background: #10b6c8;
}

.dashboard-cyan strong {
    color: #0891a8;
}

.dashboard-chart-grid,
.dashboard-middle-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: 1fr 1.35fr 1.2fr;
    margin-bottom: 14px;
}

.dashboard-bottom-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: minmax(320px, 1.05fr) minmax(260px, 0.72fr) minmax(300px, 0.92fr) minmax(440px, 1.35fr);
}

.dashboard-panel {
    min-width: 0;
    padding: 14px;
}

.dashboard-panel .panel-header {
    min-height: 30px;
}

.dashboard-panel .panel-header h3 {
    align-items: center;
    display: inline-flex;
    gap: 8px;
    line-height: 1.2;
}

.dashboard-panel .panel-header a {
    color: #0d6efd;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.dashboard-span-2 {
    grid-column: span 2;
}

.dashboard-donut-layout {
    align-items: center;
    display: grid;
    gap: 18px;
    grid-template-columns: 170px minmax(0, 1fr);
    min-height: 178px;
}

.dashboard-donut {
    align-items: center;
    aspect-ratio: 1;
    background: var(--donut-bg);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    min-width: 0;
    width: 158px;
}

.dashboard-donut-small {
    margin: 0 auto 12px;
    width: 138px;
}

.dashboard-donut-hole {
    align-items: center;
    background: #fff;
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px #eef2f7;
    display: flex;
    flex-direction: column;
    height: 92px;
    justify-content: center;
    width: 92px;
}

.dashboard-donut-small .dashboard-donut-hole {
    height: 84px;
    width: 84px;
}

.dashboard-donut-hole strong {
    font-size: 24px;
    line-height: 1.1;
}

.dashboard-donut-hole span {
    color: var(--muted);
    font-size: 12px;
}

.dashboard-legend {
    display: grid;
    gap: 10px;
    min-width: 0;
}

.dashboard-legend.compact {
    gap: 8px;
}

.dashboard-legend-row {
    align-items: center;
    display: grid;
    gap: 8px;
    grid-template-columns: 10px minmax(0, 1fr) auto;
    min-width: 0;
}

.dashboard-legend-row i {
    border-radius: 50%;
    display: inline-block;
    height: 10px;
    width: 10px;
}

.dashboard-legend-row span {
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-legend-row strong {
    font-size: 13px;
    white-space: nowrap;
}

.dashboard-bars {
    align-items: end;
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(6, minmax(72px, 1fr));
    min-height: 210px;
    overflow-x: auto;
    padding: 8px 2px 0;
}

.dashboard-bar-item {
    align-items: center;
    display: grid;
    gap: 6px;
    grid-template-rows: 22px 140px 34px;
    min-width: 72px;
    text-align: center;
}

.dashboard-bar-item span {
    color: #0d47a1;
    font-size: 13px;
    font-weight: 800;
}

.dashboard-bar-track {
    align-items: end;
    background: repeating-linear-gradient(to top, #eef2f8 0 1px, transparent 1px 34px);
    border-bottom: 1px solid #cbd5e1;
    display: flex;
    height: 140px;
    justify-content: center;
    width: 100%;
}

.dashboard-bar {
    border-radius: 6px 6px 0 0;
    min-height: 8px;
    transition: height 0.2s ease;
    width: 36px;
}

.dashboard-bar-item small {
    color: #475569;
    font-size: 11px;
    line-height: 1.2;
}

.dashboard-component-metrics {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    min-height: 126px;
}

.dashboard-component-metric {
    background: #f8fbff;
    border: 1px solid #e3ebf8;
    border-radius: 8px;
    display: grid;
    gap: 4px;
    padding: 14px;
}

.dashboard-component-metric i {
    font-size: 22px;
}

.dashboard-component-metric span,
.dashboard-component-metric small {
    color: var(--muted);
    font-size: 12px;
}

.dashboard-component-metric strong {
    color: #0d6efd;
    font-size: 24px;
    line-height: 1.1;
}

.dashboard-table {
    font-size: 13px;
    margin: 0;
}

.dashboard-table thead th {
    background: #f3f7ff;
    color: #0f316e;
    font-size: 12px;
    white-space: nowrap;
}

.dashboard-table td {
    vertical-align: middle;
}

.dashboard-table td strong,
.dashboard-table td small {
    display: block;
}

.dashboard-table td small {
    color: var(--muted);
}

.dashboard-schedule-list,
.dashboard-notification-list {
    display: grid;
    gap: 8px;
}

.dashboard-schedule-row,
.dashboard-notification-row {
    align-items: center;
    border-bottom: 1px solid #edf2f7;
    color: var(--text);
    display: grid;
    gap: 10px;
    min-height: 44px;
    padding: 7px 0;
    text-decoration: none;
}

.dashboard-schedule-row {
    grid-template-columns: 78px 86px minmax(0, 1fr) minmax(110px, 0.7fr);
}

.dashboard-schedule-row:hover,
.dashboard-notification-row:hover {
    color: #0d6efd;
}

.dashboard-schedule-row time,
.dashboard-notification-row time {
    color: #0d6efd;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.dashboard-schedule-row strong,
.dashboard-notification-row strong {
    display: block;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-schedule-row small,
.dashboard-notification-row small {
    color: var(--muted);
    display: block;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-work-chip {
    background: #eaf2ff;
    border: 1px solid #cfe0ff;
    border-radius: 8px;
    color: #0d6efd;
    display: inline-flex;
    font-size: 11px;
    font-weight: 800;
    justify-content: center;
    min-width: 78px;
    padding: 4px 7px;
    white-space: nowrap;
}

.dashboard-work-status {
    min-height: 218px;
}

.dashboard-notification-row {
    grid-template-columns: 22px minmax(0, 1fr) 76px;
}

.dashboard-notification-row > i {
    font-size: 15px;
    text-align: center;
}

.dashboard-notice-danger > i {
    color: #dc3545;
}

.dashboard-notice-warning > i {
    color: #f59f00;
}

.dashboard-notice-info > i,
.dashboard-notice-primary > i {
    color: #0d6efd;
}

.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.8fr);
    gap: 14px;
    margin-top: 14px;
}

.panel {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 18px;
    box-shadow: 0 8px 24px rgba(16, 23, 53, 0.04);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    margin-bottom: 12px;
}

.panel-header h3 {
    font-size: 16px;
    margin: 0;
}

.panel-title-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.device-list-toolbar {
    align-items: center;
    border-bottom: 1px solid var(--border);
    margin: -2px -2px 12px;
    padding: 0 0 14px;
}

.device-toolbar-main {
    align-items: center;
    display: flex;
    flex: 1;
    flex-wrap: wrap;
    gap: 10px;
}

.device-toolbar-main h3 {
    font-size: 18px;
    margin-right: 10px;
}

.device-toolbar-main .btn,
.device-print-tools .form-select {
    min-height: 38px;
}

.device-toolbar-main form {
    margin: 0;
}

.device-print-tools {
    align-items: center;
    display: inline-flex;
    gap: 8px;
}

.device-print-tools .form-select {
    min-width: 210px;
}

.device-print-tools .btn {
    align-items: center;
    display: inline-flex;
    gap: 6px;
    justify-content: center;
    min-width: 108px;
    white-space: nowrap;
}

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

.master-data-card {
    align-items: flex-start;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(16, 23, 53, 0.04);
    color: var(--text);
    display: grid;
    gap: 12px;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    min-height: 126px;
    padding: 16px;
    text-decoration: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.master-data-card:hover {
    border-color: #b8cff7;
    box-shadow: 0 12px 28px rgba(16, 23, 53, 0.08);
    color: var(--text);
    transform: translateY(-1px);
}

.master-data-icon {
    align-items: center;
    background: #eef4ff;
    border-radius: 8px;
    color: #0d6efd;
    display: inline-flex;
    font-size: 22px;
    height: 44px;
    justify-content: center;
    width: 44px;
}

.master-data-card-body strong,
.master-data-card-body small {
    display: block;
}

.master-data-card-body strong {
    font-size: 16px;
    margin-bottom: 6px;
}

.master-data-card-body small {
    color: var(--muted);
    line-height: 1.45;
}

.master-data-count {
    align-items: center;
    background: #f5f8fd;
    border: 1px solid #dbe6f7;
    border-radius: 999px;
    color: #173b71;
    display: inline-flex;
    font-size: 13px;
    font-weight: 700;
    justify-content: center;
    min-width: 34px;
    padding: 4px 10px;
}

.master-data-table td {
    vertical-align: middle;
}

.muted {
    color: var(--muted);
    font-size: 13px;
}

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

.status-list div {
    display: flex;
    gap: 10px;
    align-items: center;
}

.permission-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.permission-cloud span {
    border: 1px solid #dbe6f7;
    background: #f7fbff;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    color: #173b71;
}

.user-admin-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

.filter-strip.compact {
    margin-bottom: 0;
}

.user-admin-table td {
    vertical-align: middle;
}

.user-permission-all {
    align-items: center;
    display: inline-flex;
    gap: 8px;
    margin: 0;
}

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

.permission-module {
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.permission-module header {
    align-items: center;
    background: #f5f8fd;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    padding: 10px 12px;
}

.permission-module header label {
    font-weight: 700;
    margin: 0;
}

.permission-module header small {
    color: var(--muted);
}

.permission-list {
    display: grid;
    gap: 8px;
    padding: 12px;
}

.permission-item {
    align-items: flex-start;
    display: grid;
    gap: 8px;
    grid-template-columns: 18px minmax(0, 1fr);
    margin: 0;
}

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

.permission-item small {
    color: var(--muted);
    font-size: 12px;
}

.empty-panel {
    min-height: 320px;
    display: grid;
    place-items: center;
    text-align: center;
    align-content: center;
}

.empty-panel i {
    font-size: 46px;
    margin-bottom: 12px;
}

.table thead th {
    color: #173b71;
    background: #f5f8fd;
    font-size: 13px;
}

.select-col {
    width: 42px;
}

.device-table td {
    vertical-align: middle;
}

.device-name {
    display: flex;
    gap: 10px;
    align-items: center;
    min-width: 260px;
}

.device-name img,
.device-thumb {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    object-fit: cover;
    background: #eef4ff;
    display: grid;
    place-items: center;
    color: #0d6efd;
    flex: 0 0 auto;
}

.device-name strong,
.device-name small {
    display: block;
}

.device-name small {
    color: var(--muted);
}

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

.pagination-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
    margin-top: 14px;
}

.module-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.module-tabs a {
    align-items: center;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: #33476b;
    display: inline-flex;
    font-weight: 700;
    gap: 8px;
    min-height: 38px;
    padding: 0 12px;
    text-decoration: none;
}

.module-tabs a:hover,
.module-tabs a.active {
    background: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
}

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

.license-kpi-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 22px rgba(13, 39, 85, 0.05);
    min-height: 118px;
    padding: 14px;
}

.license-kpi-card i {
    align-items: center;
    background: #eef4ff;
    border-radius: 8px;
    color: #0d6efd;
    display: flex;
    font-size: 20px;
    height: 38px;
    justify-content: center;
    margin-bottom: 10px;
    width: 38px;
}

.license-kpi-card span,
.license-kpi-card strong {
    display: block;
}

.license-kpi-card span {
    color: var(--muted);
    font-size: 12px;
}

.license-kpi-card strong {
    font-size: 24px;
    line-height: 1.15;
}

.license-kpi-card.success i {
    background: #eaf8f0;
    color: #179b5b;
}

.license-kpi-card.warning i {
    background: #fff6df;
    color: #d88b00;
}

.license-kpi-card.danger i {
    background: #fff0f0;
    color: #dc3545;
}

.license-kpi-card.info i {
    background: #eaf7ff;
    color: #0aa2c0;
}

.license-kpi-card.dark i,
.license-kpi-card.secondary i {
    background: #f0f3f8;
    color: #66758d;
}

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

.license-bar-row {
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) auto;
}

.license-bar-row div {
    background: #eef3fb;
    border-radius: 999px;
    grid-column: 1 / -1;
    height: 8px;
    overflow: hidden;
}

.license-bar-row em {
    background: #0d6efd;
    display: block;
    height: 100%;
}

.license-status-grid,
.license-check-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.license-check-grid .form-check {
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    gap: 8px;
    margin: 0;
    min-height: 38px;
    padding: 0 10px;
}

.license-table {
    min-width: 1180px;
}

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

.license-assignment-actions form {
    align-items: center;
    display: inline-flex;
    gap: 6px;
    margin: 0;
}

.license-assignment-actions .form-select {
    max-width: 240px;
    min-width: 180px;
}

.device-combobox-picker {
    min-width: 0;
    position: relative;
}

.device-combobox-picker-sm {
    min-width: 300px;
}

.device-combobox-native-select {
    display: none;
}

.license-assignment-actions .device-combobox-picker {
    max-width: 380px;
    width: 340px;
}

.license-assignment-actions [data-device-combobox-feedback] {
    white-space: normal;
}

.ajax-device-picker {
    min-width: 0;
    position: relative;
}

.ajax-device-picker-sm {
    min-width: 320px;
}

.ajax-device-results {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.16);
    left: 0;
    max-height: 300px;
    overflow-y: auto;
    padding: 6px;
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    z-index: 30;
}

.ajax-device-option {
    background: transparent;
    border: 0;
    border-radius: 6px;
    display: grid;
    gap: 2px;
    padding: 8px 10px;
    text-align: left;
    width: 100%;
}

.ajax-device-option:hover,
.ajax-device-option.is-active {
    background: #edf4ff;
}

.ajax-device-option strong {
    color: var(--text);
    font-size: 13px;
}

.ajax-device-option span,
.ajax-device-empty {
    color: var(--muted);
    font-size: 12px;
}

.ajax-device-empty {
    padding: 10px;
}

.license-assignment-actions .ajax-device-picker {
    max-width: 420px;
    width: 360px;
}

.license-assignment-actions [data-ajax-device-feedback] {
    max-width: 420px;
    white-space: normal;
}

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

.history-summary-card {
    background: linear-gradient(135deg, #ffffff, #f4f8ff);
    border: 1px solid #dce8fb;
    border-radius: 8px;
    box-shadow: 0 8px 22px rgba(13, 39, 85, 0.06);
    padding: 16px;
}

.history-summary-card span,
.history-summary-card small {
    color: var(--muted);
    display: block;
    font-size: 13px;
}

.history-summary-card strong {
    color: #0d6efd;
    display: block;
    font-size: 28px;
    line-height: 1.15;
    margin: 7px 0 4px;
}

.history-summary-card.success {
    background: linear-gradient(135deg, #ffffff, #f0fff7);
    border-color: #d4f3e2;
}

.history-summary-card.success strong {
    color: #16a765;
}

.history-summary-card.warning {
    background: linear-gradient(135deg, #ffffff, #fff9ed);
    border-color: #f8e3b9;
}

.history-summary-card.warning strong {
    color: #e39a07;
}

.history-summary-card.purple {
    background: linear-gradient(135deg, #ffffff, #f7f2ff);
    border-color: #e5d8ff;
}

.history-summary-card.purple strong {
    color: #7c3aed;
}

.history-filter {
    align-items: end;
}

.history-filter .filter-item.wide {
    min-width: 320px;
}

.history-filter .filter-item.compact {
    min-width: 150px;
}

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

.history-main-panel,
.history-account-panel {
    min-width: 0;
}

.history-table {
    min-width: 1180px;
}

.history-table th:nth-child(1) {
    width: 140px;
}

.history-table th:nth-child(2) {
    width: 220px;
}

.history-table th:nth-child(3) {
    width: 170px;
}

.history-table th:nth-child(4) {
    width: 270px;
}

.history-table th:nth-child(6) {
    width: 190px;
}

.history-time strong,
.history-time small {
    display: block;
}

.history-time small {
    color: var(--muted);
    font-size: 12px;
}

.history-document-link,
.history-document-muted {
    align-items: flex-start;
    display: inline-flex;
    gap: 8px;
    line-height: 1.35;
    min-width: 0;
}

.history-document-link {
    color: #0d6efd;
    font-weight: 700;
    text-decoration: none;
}

.history-document-link:hover {
    text-decoration: underline;
}

.history-document-muted {
    color: var(--muted);
}

.history-change-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.history-change-list span {
    background: #f4f8ff;
    border: 1px solid #e2ebfb;
    border-radius: 8px;
    color: #33476b;
    display: inline-block;
    font-size: 12px;
    line-height: 1.35;
    padding: 4px 8px;
    width: fit-content;
}

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

.history-account-row {
    align-items: center;
    background: #f8fbff;
    border: 1px solid var(--border);
    border-radius: 8px;
    display: grid;
    gap: 10px;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    padding: 10px;
}

.history-account-row a,
.history-account-row strong {
    color: var(--text);
    font-weight: 700;
    text-decoration: none;
}

.history-account-row a:hover {
    color: #0d6efd;
}

.history-account-row small {
    color: var(--muted);
    display: block;
    font-size: 12px;
}

.history-account-avatar {
    align-items: center;
    aspect-ratio: 1;
    background: #eef4ff;
    border-radius: 8px;
    color: #0d6efd;
    display: flex;
    justify-content: center;
}

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

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    position: sticky;
    bottom: 0;
    background: rgba(244, 247, 251, 0.94);
    border-top: 1px solid var(--border);
    padding: 14px 0 0;
    backdrop-filter: blur(8px);
}

.device-edit-actions {
    margin-top: 14px;
}

.import-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
}

.import-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.import-summary span {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f7fbff;
    padding: 10px 14px;
}

.device-profile {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 14px;
    margin-bottom: 14px;
}

.component-profile {
    display: grid;
    gap: 14px;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.75fr);
}

.component-hero {
    align-items: center;
    display: flex;
    gap: 18px;
}

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

.component-icon {
    align-items: center;
    aspect-ratio: 1;
    background: #eef4ff;
    border-radius: 8px;
    color: #0d6efd;
    display: flex;
    flex: 0 0 86px;
    font-size: 38px;
    justify-content: center;
}

.component-hero h3 {
    font-size: 28px;
    margin: 8px 0 4px;
}

.component-hero p {
    color: var(--muted);
    margin-bottom: 12px;
}

.component-stock-line {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.component-stock-line span {
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--muted);
    padding: 6px 10px;
}

.stock-pill {
    background: #eaf8f0;
    border: 1px solid #b7e2c7;
    border-radius: 999px;
    color: #137a3b;
    display: inline-block;
    font-weight: 700;
    min-width: 80px;
    padding: 4px 10px;
    text-align: center;
}

.stock-pill.low {
    background: #fff8e1;
    border-color: #ffe08a;
    color: #9a6700;
}

.stock-pill.out {
    background: #ffecec;
    border-color: #ffc2c2;
    color: #b42318;
}

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

.component-tracking-guide {
    margin-top: 14px;
}

.tracking-guide-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tracking-guide-grid > div {
    border-left: 3px solid #0d6efd;
    padding-left: 14px;
}

.tracking-guide-grid > div:nth-child(2) {
    border-left-color: #198754;
}

.tracking-guide-grid h4 {
    font-size: 15px;
    margin-bottom: 8px;
}

.tracking-guide-grid p {
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 8px;
}

.device-hero {
    display: flex;
    gap: 18px;
    align-items: center;
}

.device-photo {
    width: 180px;
    aspect-ratio: 4 / 3;
    border-radius: 8px;
    background: #eef4ff;
    display: grid;
    place-items: center;
    overflow: hidden;
    flex: 0 0 auto;
}

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

.device-photo i {
    color: #0d6efd;
    font-size: 52px;
}

.device-hero-info h3 {
    font-size: 26px;
    margin: 8px 0 4px;
}

.device-hero-info p {
    color: var(--muted);
    margin-bottom: 14px;
}

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

.meta-grid div {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
    background: #fbfdff;
}

.meta-grid span,
.meta-grid strong {
    display: block;
}

.meta-grid span {
    color: var(--muted);
    font-size: 12px;
}

.meta-grid strong {
    font-size: 13px;
}

.code-panel {
    display: grid;
    place-items: center;
    gap: 12px;
}

.qr-box img {
    width: 170px;
    height: 170px;
}

.barcode-box {
    width: 100%;
    text-align: center;
}

.barcode-box svg {
    max-width: 100%;
}

.info-list {
    display: grid;
    gap: 10px;
    margin: 0;
}

.info-list div {
    display: grid;
    grid-template-columns: 170px minmax(0, 1fr);
    gap: 12px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
}

.info-list div:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.info-list dt {
    color: var(--muted);
    font-weight: 600;
}

.info-list dd {
    margin: 0;
    font-weight: 600;
}

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

.document-upload {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.document-upload .form-select {
    width: 150px;
}

.document-upload .form-control {
    width: 240px;
}

.document-panel-header {
    align-items: flex-start;
}

.document-table {
    min-width: 940px;
}

.document-type-cell {
    min-width: 190px;
}

.document-replace-input {
    width: 210px;
}

.document-row-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.timeline {
    display: grid;
    gap: 12px;
}

.timeline-item {
    border-left: 3px solid #0d6efd;
    padding-left: 12px;
}

.timeline-item strong,
.timeline-item span {
    display: block;
}

.timeline-item span,
.timeline-item p {
    color: var(--muted);
    margin: 0;
}

.history-placeholders {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.history-placeholders span {
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 8px 12px;
    background: #f7fbff;
    color: #173b71;
}

.danger-zone {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-color: #ffd4d4;
}

.danger-zone h3 {
    color: #b42318;
    font-size: 16px;
    margin: 0 0 4px;
}

.danger-zone p {
    margin: 0;
    color: var(--muted);
}

.settings-database-tools {
    display: block;
}

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

.settings-tool-card {
    align-content: start;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    display: grid;
    gap: 12px;
    min-width: 0;
    padding: 16px;
}

.settings-tool-card h4 {
    font-size: 16px;
    margin: 0 0 6px;
}

.settings-tool-card p {
    color: var(--muted);
    margin: 0;
}

.print-label {
    min-height: 100vh;
    display: grid;
    place-items: center;
    align-content: center;
    padding: 24px;
}

.label-card {
    width: 340px;
    border: 1px solid #111;
    border-radius: 8px;
    padding: 18px;
    text-align: center;
    background: #fff;
}

.label-card h1 {
    font-size: 26px;
    margin: 0;
}

.label-card p {
    min-height: 42px;
    margin: 8px 0 12px;
}

.qr-single-card {
    width: 9cm;
    min-height: 11cm;
}

.label-device-name {
    font-weight: 700;
}

.label-device-position {
    color: var(--text);
    font-size: 13px;
    min-height: 0 !important;
}

.label-qr {
    width: 190px;
    height: 190px;
}

.label-barcode svg {
    width: 100%;
    max-height: 72px;
}

.print-toolbar {
    align-items: center;
    background: #fff;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 24px;
}

.print-toolbar h1 {
    font-size: 22px;
    margin: 0 0 4px;
}

.print-toolbar p {
    color: var(--muted);
    margin: 0;
}

.print-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.print-labels {
    background: #e9eef7;
    min-height: 100vh;
    overflow: auto;
    padding: 18px;
}

.label-sheet {
    background: #fff;
    box-shadow: 0 10px 36px rgba(16, 23, 53, 0.12);
    display: grid;
    gap: 0.25cm 0.3cm;
    margin: 0 auto;
    padding: 1cm 1.2cm;
}

.labels-template-tomy-a4 .label-sheet {
    grid-auto-rows: 3cm;
    grid-template-columns: repeat(3, 6cm);
    min-height: 29.7cm;
    width: 21cm;
}

.labels-template-printer-3col .label-sheet {
    grid-auto-rows: 3cm;
    grid-template-columns: repeat(3, 6cm);
    min-height: 100vh;
    width: 20cm;
}

.asset-label {
    align-items: center;
    border: 1px dashed #aab6ca;
    display: grid;
    gap: 0.15cm;
    grid-template-columns: minmax(0, 1fr) 1.7cm;
    height: 3cm;
    overflow: hidden;
    padding: 0.22cm 0.25cm;
    width: 6cm;
}

.asset-label-main {
    min-width: 0;
}

.asset-label strong,
.asset-label span,
.asset-label small {
    display: block;
    line-height: 1.18;
    overflow: hidden;
}

.asset-label strong {
    color: #0d47a1;
    font-size: 12px;
}

.asset-label span {
    color: var(--text);
    font-size: 10.5px;
    font-weight: 700;
    max-height: 1.2cm;
}

.asset-label small {
    color: var(--muted);
    font-size: 8.5px;
    max-height: 0.72cm;
}

.asset-label img {
    height: 1.65cm;
    width: 1.65cm;
}

.work-order-print {
    background: #e9eef7;
    min-height: 100vh;
    overflow: auto;
    padding: 18px;
    width: 100vw;
}

.work-order-sheet {
    background: #fff;
    box-shadow: 0 10px 36px rgba(16, 23, 53, 0.12);
    color: #111827;
    margin: 0 auto;
    min-height: 29.7cm;
    padding: 1.2cm;
    width: 21cm;
}

.work-order-header {
    align-items: flex-start;
    border-bottom: 2px solid #111827;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 14px;
}

.work-order-header strong,
.work-order-header span {
    display: block;
}

.work-order-header span,
.work-order-code span,
.work-order-meta span,
.work-order-info-grid span,
.work-order-totals span,
.work-order-signatures span {
    color: #5f6b7a;
    font-size: 12px;
}

.work-order-code {
    text-align: right;
}

.work-order-code strong {
    color: #0d47a1;
    font-size: 18px;
}

.work-order-sheet h1 {
    font-size: 24px;
    margin: 18px 0;
    text-align: center;
}

.work-order-meta,
.work-order-info-grid {
    display: grid;
    gap: 8px;
}

.work-order-meta {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 16px;
}

.work-order-meta div,
.work-order-info-grid div,
.work-order-totals div {
    border: 1px solid #d9e1ec;
    padding: 8px 10px;
}

.work-order-meta strong,
.work-order-info-grid strong,
.work-order-totals strong {
    display: block;
    font-size: 13px;
    margin-top: 2px;
}

.work-order-block {
    margin-top: 14px;
}

.work-order-block h2 {
    background: #eef4ff;
    border-left: 4px solid #0d6efd;
    font-size: 15px;
    margin: 0 0 8px;
    padding: 8px 10px;
}

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

.work-order-description {
    border: 1px solid #d9e1ec;
    margin: 0;
    min-height: 58px;
    padding: 10px;
}

.work-order-table {
    border-collapse: collapse;
    font-size: 12px;
    width: 100%;
}

.work-order-table th,
.work-order-table td {
    border: 1px solid #cfd8e6;
    padding: 6px;
    vertical-align: top;
}

.work-order-table th {
    background: #f4f7fb;
    font-weight: 700;
}

.work-order-table small {
    color: #5f6b7a;
    display: block;
    margin-top: 2px;
}

.work-order-totals {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-left: auto;
    margin-top: 14px;
    width: 58%;
}

.work-order-totals strong {
    font-size: 15px;
    text-align: right;
}

.work-order-signatures {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 32px;
    text-align: center;
}

.work-order-signatures div {
    min-height: 90px;
}

.work-order-signatures strong,
.work-order-signatures span {
    display: block;
}

.incident-text-block {
    border-top: 1px solid var(--border);
    margin-top: 14px;
    padding-top: 12px;
}

.incident-text-block strong {
    display: block;
    margin-bottom: 6px;
}

.incident-text-block p {
    margin: 0;
}

.incident-attachments {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.incident-attachment {
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    display: grid;
    gap: 10px;
    grid-template-columns: 70px minmax(0, 1fr) auto;
    padding: 10px;
}

.incident-attachment.readonly {
    color: inherit;
    grid-template-columns: 78px minmax(0, 1fr);
    text-decoration: none;
}

.incident-attachment img {
    aspect-ratio: 1;
    border-radius: 8px;
    object-fit: cover;
    width: 70px;
}

.incident-attachment strong,
.incident-attachment small,
.incident-attachment span {
    display: block;
}

.incident-attachment small,
.incident-attachment span {
    color: var(--muted);
    font-size: 12px;
}

.incident-action-table textarea {
    min-width: 220px;
}

.incident-device-preview {
    background: #f8fbff;
    border: 1px dashed #cbd7ea;
    border-radius: 8px;
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    min-height: 0;
    padding: 10px 12px;
}

.incident-device-preview:empty {
    display: none;
}

.incident-device-preview span,
.incident-device-preview strong {
    display: block;
}

.incident-device-preview span {
    color: var(--text);
    font-size: 13px;
}

.incident-device-preview strong {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.incident-print {
    background: #e9eef7;
    min-height: 100vh;
    overflow: auto;
    padding: 18px;
    width: 100vw;
}

.incident-sheet {
    background: #fff;
    box-shadow: 0 10px 36px rgba(16, 23, 53, 0.12);
    color: #111827;
    margin: 0 auto;
    min-height: 29.7cm;
    padding: 1.5cm;
    width: 21cm;
}

.incident-sheet h1 {
    font-size: 22px;
    font-weight: 800;
    margin: 0 0 8px;
    text-align: center;
}

.incident-subtitle {
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 18px;
    text-align: center;
}

.incident-sheet h2 {
    font-size: 15px;
    font-weight: 800;
    margin: 16px 0 8px;
}

.incident-print-table {
    border-collapse: collapse;
    font-size: 12px;
    width: 100%;
}

.incident-print-table th,
.incident-print-table td {
    border: 1px solid #111827;
    padding: 7px 8px;
    vertical-align: top;
}

.incident-print-table th {
    font-weight: 700;
    text-align: left;
    width: 27%;
}

.incident-paragraph {
    border: 1px solid #111827;
    font-size: 12px;
    margin: 0;
    min-height: 58px;
    padding: 8px;
}

.incident-print-images {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.incident-print-images img {
    border: 1px solid #cfd8e6;
    height: 84px;
    object-fit: cover;
    width: 112px;
}

.incident-date-line {
    font-style: italic;
    margin: 18px 0 0 auto;
    text-align: center;
    width: 42%;
}

.incident-signatures {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 20px;
    text-align: center;
}

.incident-signatures div {
    min-height: 112px;
}

.incident-signatures strong,
.incident-signatures span,
.incident-signatures em {
    display: block;
}

.incident-signatures em {
    font-style: normal;
    font-weight: 700;
    margin-top: 58px;
}

.incident-recipients {
    font-size: 12px;
    margin-top: 18px;
}

.incident-recipients strong,
.incident-recipients span {
    display: block;
}

.transfer-device-current {
    color: var(--muted);
    display: grid;
    font-size: 12px;
    gap: 4px;
    min-height: 38px;
}

.transfer-device-picker {
    min-width: 360px;
    position: relative;
}

.transfer-device-native-select {
    display: none;
}

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

.maintenance-help-grid div {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px;
}

.maintenance-help-grid strong {
    display: block;
    margin-bottom: 6px;
}

.maintenance-help-grid p {
    color: var(--muted);
    margin: 0;
}

.maintenance-month-table,
.maintenance-report-table {
    font-size: 13px;
}

.maintenance-month-table th,
.maintenance-month-table td,
.maintenance-report-table th,
.maintenance-report-table td {
    vertical-align: middle;
}

.maintenance-print {
    background: #e9eef7;
    min-height: 100vh;
    overflow: auto;
    padding: 18px;
}

.maintenance-plan-sheet {
    background: #fff;
    box-shadow: 0 10px 36px rgba(16, 23, 53, 0.12);
    color: #111827;
    margin: 0 auto;
    min-height: 21cm;
    padding: 1cm;
    page: maintenance-landscape;
    width: 29.7cm;
}

.maintenance-form-code {
    font-size: 11px;
    text-align: right;
}

.maintenance-plan-sheet h1,
.maintenance-report-title {
    font-size: 18px;
    font-weight: 800;
    margin: 4px 0 8px;
    text-align: center;
    text-transform: uppercase;
}

.maintenance-subtitle {
    font-size: 13px;
    margin: 0 0 10px;
    text-align: center;
}

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

.maintenance-report-table th,
.maintenance-report-table td {
    border: 1px solid #334155;
    font-size: 10px;
    line-height: 1.25;
    padding: 4px 5px;
}

.maintenance-report-table th {
    background: #eef2f7;
    font-weight: 700;
    text-align: center;
}

.maintenance-group-row td {
    background: #f8fafc;
    font-weight: 700;
}

.maintenance-signatures {
    margin-top: 22px;
}

.transfer-device-picker [data-transfer-search-count]:empty {
    display: none;
}

.transfer-device-current strong {
    color: var(--text);
    font-size: 13px;
}

.transfer-device-current span {
    display: block;
}

.transfer-print {
    background: #e9eef7;
    min-height: 100vh;
    overflow: auto;
    padding: 18px;
    width: 100vw;
}

.transfer-sheet {
    background: #fff;
    box-shadow: 0 10px 36px rgba(16, 23, 53, 0.12);
    color: #111827;
    margin: 0 auto;
    min-height: 29.7cm;
    padding: 1.45cm;
    width: 21cm;
}

.transfer-print-heading {
    align-items: flex-start;
    display: flex;
    font-size: 12px;
    justify-content: space-between;
    margin-bottom: 20px;
}

.transfer-print-heading strong,
.transfer-print-heading span {
    display: block;
}

.transfer-print-heading div:last-child {
    text-align: right;
}

.transfer-sheet h1 {
    font-size: 21px;
    font-weight: 800;
    margin: 0 0 8px;
    text-align: center;
}

.transfer-subtitle {
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 12px;
    text-align: center;
}

.transfer-date-line {
    font-style: italic;
    margin: 0 0 16px auto;
    text-align: center;
    width: 42%;
}

.transfer-sheet h2 {
    font-size: 15px;
    font-weight: 800;
    margin: 16px 0 8px;
}

.transfer-info-table,
.transfer-items-table {
    border-collapse: collapse;
    font-size: 12px;
    width: 100%;
}

.transfer-info-table th,
.transfer-info-table td,
.transfer-items-table th,
.transfer-items-table td {
    border: 1px solid #111827;
    padding: 7px 8px;
    vertical-align: top;
}

.transfer-info-table th {
    background: #f4f6fb;
    font-weight: 700;
    text-align: left;
    width: 20%;
}

.transfer-items-table th {
    background: #f4f6fb;
    font-weight: 800;
}

.transfer-signatures {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 28px;
    text-align: center;
}

.transfer-signatures div {
    min-height: 116px;
}

.transfer-signatures strong,
.transfer-signatures span,
.transfer-signatures em {
    display: block;
}

.transfer-signatures strong {
    font-size: 12px;
}

.transfer-signatures span {
    font-size: 11px;
}

.transfer-signatures em {
    font-style: normal;
    font-weight: 700;
    margin-top: 58px;
}

@media print {
    @page {
        margin: 0;
        size: A4;
    }

    @page maintenance-landscape {
        margin: 0;
        size: A4 landscape;
    }

    .no-print {
        display: none !important;
    }

    .app-sidebar,
    .app-header,
    .dashboard-filter,
    .sidebar-footer {
        display: none !important;
    }

    .app-main {
        margin-left: 0 !important;
    }

    .app-content {
        padding: 0 !important;
    }

    .dashboard-page {
        background: #fff;
    }

    .dashboard-kpi-card,
    .dashboard-panel {
        box-shadow: none;
        break-inside: avoid;
    }

    .auth-body {
        background: #fff;
    }

    body,
    .print-labels,
    .work-order-print,
    .incident-print,
    .transfer-print,
    .maintenance-print {
        background: #fff;
    }

    .print-labels,
    .work-order-print,
    .incident-print,
    .transfer-print,
    .maintenance-print {
        min-height: auto;
        padding: 0;
    }

    .label-sheet,
    .work-order-sheet,
    .incident-sheet,
    .transfer-sheet,
    .maintenance-plan-sheet {
        box-shadow: none;
        margin: 0;
        page-break-after: always;
    }

    .label-sheet,
    .work-order-sheet,
    .incident-sheet,
    .transfer-sheet {
        min-height: 29.7cm;
    }

    .maintenance-plan-sheet {
        min-height: 21cm;
        width: 29.7cm;
    }

    .labels-template-printer-3col .label-sheet {
        min-height: 29.7cm;
        width: 21cm;
    }

    .login-card,
    .label-card {
        box-shadow: none;
    }
}

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

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

    .dashboard-chart-grid,
    .dashboard-middle-grid,
    .dashboard-bottom-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-span-2 {
        grid-column: span 1;
    }

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

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

    .maintenance-help-grid {
        grid-template-columns: 1fr;
    }

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

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

    .component-summary-grid,
    .history-summary-grid,
    .permission-matrix,
    .summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .device-profile,
    .component-profile,
    .detail-grid {
        grid-template-columns: 1fr;
    }

    .component-operation-grid {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 991px) {
    .dashboard-donut-layout {
        grid-template-columns: 150px minmax(0, 1fr);
    }

    .dashboard-donut {
        width: 142px;
    }

    .app-sidebar {
        transform: translateX(-100%);
    }

    .app-sidebar.open {
        transform: translateX(0);
    }

    .app-main {
        margin-left: 0;
    }

    .header-title h1,
    .help-button span,
    .user-name {
        display: none;
    }

    .device-list-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .device-toolbar-main,
    .device-print-tools {
        width: 100%;
    }

    .device-print-tools .form-select {
        flex: 1;
    }
}

@media (max-width: 640px) {
    .dashboard-kpi-grid,
    .license-kpi-grid,
    .dashboard-chart-grid,
    .dashboard-middle-grid,
    .dashboard-bottom-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-filter-actions,
    .dashboard-filter-actions .btn {
        width: 100%;
    }

    .dashboard-donut-layout {
        grid-template-columns: 1fr;
        justify-items: center;
    }

    .dashboard-legend {
        width: 100%;
    }

    .dashboard-bars {
        grid-template-columns: repeat(6, minmax(68px, 1fr));
    }

    .dashboard-schedule-row {
        align-items: flex-start;
        grid-template-columns: 74px minmax(0, 1fr);
    }

    .dashboard-schedule-row .dashboard-work-chip,
    .dashboard-schedule-row small {
        grid-column: 2;
    }

    .dashboard-notification-row {
        grid-template-columns: 22px minmax(0, 1fr);
    }

    .dashboard-notification-row time {
        grid-column: 2;
    }

    .app-header {
        padding: 0 14px;
    }

    .global-search {
        display: none;
    }

    .app-content {
        padding: 18px 14px 28px;
    }

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

    .device-toolbar-main .btn,
    .device-toolbar-main form,
    .device-toolbar-main form .btn,
    .device-print-tools,
    .device-print-tools .btn {
        width: 100%;
    }

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

    .master-data-grid {
        grid-template-columns: 1fr;
    }

    .component-summary-grid,
    .history-summary-grid,
    .permission-matrix,
    .settings-tool-grid,
    .summary-grid {
        grid-template-columns: 1fr;
    }

    .incident-attachment,
    .incident-attachment.readonly {
        grid-template-columns: 58px minmax(0, 1fr);
    }

    .incident-attachment form {
        grid-column: 1 / -1;
    }

    .incident-attachment img {
        width: 58px;
    }

    .tracking-guide-grid {
        grid-template-columns: 1fr;
    }

    .filter-item {
        min-width: 100%;
    }

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

    .device-photo {
        width: 100%;
    }

    .meta-grid,
    .info-list div {
        grid-template-columns: 1fr;
    }

    .document-upload,
    .document-upload .form-control,
    .document-upload .form-select {
        width: 100%;
    }

    .document-replace-input {
        width: 100%;
    }

    .document-row-actions {
        justify-content: flex-start;
    }

    .license-assignment-actions,
    .license-assignment-actions form,
    .license-assignment-actions .form-select,
    .license-assignment-actions .device-combobox-picker,
    .license-assignment-actions .ajax-device-picker {
        width: 100%;
    }

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