.cah-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 240px));
    gap: 34px;
    justify-content: center;
    max-width: 1120px;
    margin: 84px auto;
}

.cah-module-tile {
    align-items: center;
    background: #1594d2;
    border-radius: 8px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.28);
    color: #fff;
    display: flex;
    flex-direction: row;
    gap: 10px;
    justify-content: center;
    min-height: 170px;
    padding: 24px;
    text-align: center;
    text-decoration: none;
    transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.cah-module-tile:hover,
.cah-module-tile:focus {
    background: #117db4;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.26);
    color: #fff;
    transform: translateY(-2px);
}

.cah-module-tile .dashicons {
    font-size: 32px;
    height: 32px;
    width: 32px;
}

.cah-module-tile strong {
    font-size: 22px;
    letter-spacing: 0;
}

.cah-module-tile small {
    display: none;
}

.cah-table {
    border-collapse: collapse;
    margin-top: 18px;
    width: 100%;
}

.cah-table th,
.cah-table td {
    border-bottom: 1px solid #dcdcde;
    padding: 10px;
    text-align: left;
}

.cah-form-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    max-width: 980px;
}

.cah-form-grid label {
    display: flex;
    flex-direction: column;
    font-weight: 600;
    gap: 6px;
}


.cah-form-grid input,
.cah-form-grid select,
.cah-form-grid textarea {
    max-width: 100%;
}

.cah-table code {
    background: #f6f7f7;
    border-radius: 4px;
    padding: 2px 5px;
}

.cah-app {
    min-height: 520px;
}

.cah-app-view {
    display: none;
}

.cah-app-view.is-active {
    display: block;
}

.cah-module-toolbar {
    align-items: center;
    display: flex;
    justify-content: flex-start;
    margin: 18px auto 8px;
    max-width: 1120px;
}

.cah-module-view > .wrap {
    margin-left: auto;
    margin-right: auto;
    max-width: 1120px;
}

.cah-storage-notice {
    margin-left: auto;
    margin-right: auto;
    max-width: 1120px;
}

.cah-module-settings-table .dashicons {
    vertical-align: middle;
}

/* Frontend shortcode fallback/reset: Avada ja teema stiilid ei tohi moodulivaadet tekstilingiks lõhkuda. */
.cah-app *,
.cah-app *::before,
.cah-app *::after {
    box-sizing: border-box;
}

.cah-app a.cah-module-tile,
.cah-app a.cah-module-tile:visited {
    color: #fff;
    text-decoration: none;
}

.cah-app .cah-dashboard-grid {
    width: 100%;
}

.cah-app .cah-module-tile strong,
.cah-app .cah-module-tile small,
.cah-app .cah-module-tile span {
    line-height: 1.2;
}


.cah-helper-online .cah-server-list {
    display: none;
}

.cah-page-title {
    align-items: center;
    display: flex;
    gap: 10px;
}

.cah-info-badge {
    align-items: center;
    background: #eef6fb;
    border: 1px solid #1594d2;
    border-radius: 50%;
    color: #117db4;
    cursor: help;
    display: inline-flex;
    font-size: 14px;
    font-weight: 700;
    height: 22px;
    justify-content: center;
    line-height: 1;
    position: relative;
    width: 22px;
}

.cah-info-tooltip {
    background: #1d2327;
    border-radius: 6px;
    bottom: calc(100% + 8px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
    color: #fff;
    display: none;
    font-size: 13px;
    font-weight: 400;
    left: 50%;
    line-height: 1.4;
    max-width: 360px;
    min-width: 280px;
    padding: 10px 12px;
    position: absolute;
    transform: translateX(-50%);
    white-space: normal;
    z-index: 20;
}

.cah-info-badge:hover .cah-info-tooltip,
.cah-info-badge:focus .cah-info-tooltip {
    display: block;
}

/* v0.4.8 modern app shell */
.cah-app {
    --cah-primary: #1594d2;
    --cah-primary-dark: #0f6fa3;
    --cah-text: #152536;
    --cah-muted: #64748b;
    --cah-border: rgba(15, 23, 42, 0.10);
    --cah-card: rgba(255, 255, 255, 0.94);
    background:
        radial-gradient(circle at 18% 0%, rgba(21, 148, 210, 0.18), transparent 30%),
        linear-gradient(180deg, #f8fbff 0%, #eef5fb 100%);
    border: 1px solid rgba(21, 148, 210, 0.12);
    border-radius: 28px;
    color: var(--cah-text);
    margin: 24px auto;
    max-width: 1240px;
    min-height: 620px;
    overflow: hidden;
    padding: clamp(18px, 3vw, 34px);
    position: relative;
}

.cah-app .notice {
    border: 0;
    border-radius: 16px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
    margin-bottom: 18px;
    padding: 2px 14px;
}

.cah-app .notice p {
    color: var(--cah-text);
    margin: 12px 0;
}

.cah-dashboard-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin: 34px auto;
}

.cah-module-tile {
    align-items: flex-start;
    background:
        linear-gradient(145deg, rgba(21, 148, 210, 0.98), rgba(15, 111, 163, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 24px;
    box-shadow: 0 18px 44px rgba(15, 111, 163, 0.22);
    flex-direction: column;
    justify-content: space-between;
    min-height: 172px;
    overflow: hidden;
    position: relative;
}

.cah-module-tile::after {
    background: rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    content: '';
    height: 110px;
    position: absolute;
    right: -34px;
    top: -34px;
    width: 110px;
}

.cah-module-tile:hover,
.cah-module-tile:focus {
    background:
        linear-gradient(145deg, rgba(25, 160, 225, 1), rgba(15, 111, 163, 1));
    box-shadow: 0 24px 54px rgba(15, 111, 163, 0.30);
    transform: translateY(-4px);
}

.cah-module-tile .dashicons {
    align-items: center;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 18px;
    display: inline-flex;
    font-size: 30px;
    height: 54px;
    justify-content: center;
    position: relative;
    width: 54px;
    z-index: 1;
}

.cah-module-tile strong {
    font-size: 24px;
    margin-top: 16px;
    position: relative;
    z-index: 1;
}

.cah-module-tile small {
    color: rgba(255, 255, 255, 0.82);
    display: block;
    font-size: 13px;
    line-height: 1.4;
    margin-top: 8px;
    position: relative;
    z-index: 1;
}

.cah-module-toolbar {
    max-width: 1160px;
}

.cah-module-toolbar .button,
.cah-app .button {
    border-radius: 999px;
    font-weight: 700;
}

.cah-module-view > .wrap {
    background: var(--cah-card);
    border: 1px solid var(--cah-border);
    border-radius: 26px;
    box-shadow: 0 20px 54px rgba(15, 23, 42, 0.08);
    max-width: 1160px;
    padding: clamp(18px, 3vw, 30px);
}

.cah-module-view h1,
.cah-page-title {
    color: var(--cah-text);
    font-size: clamp(28px, 4vw, 42px);
    letter-spacing: -0.04em;
    margin-bottom: 8px;
}

.cah-module-view .wrap > p {
    color: var(--cah-muted);
    font-size: 15px;
    max-width: 860px;
}

.cah-app form[data-cah-helper-form] {
    background: #fff;
    border: 1px solid var(--cah-border);
    border-radius: 22px;
    box-shadow: 0 12px 34px rgba(15, 23, 42, 0.06);
    margin: 18px 0 26px;
    padding: 22px;
}

.cah-form-grid {
    gap: 16px;
    max-width: none;
}

.cah-form-grid label {
    color: var(--cah-text);
    font-size: 13px;
    letter-spacing: -0.01em;
}

.cah-form-grid input,
.cah-form-grid select,
.cah-form-grid textarea {
    background: #f8fafc;
    border: 1px solid rgba(100, 116, 139, 0.26);
    border-radius: 14px;
    box-shadow: none;
    color: var(--cah-text);
    min-height: 42px;
    padding: 8px 12px;
    width: 100%;
}

.cah-form-grid input:focus,
.cah-form-grid select:focus,
.cah-form-grid textarea:focus {
    background: #fff;
    border-color: var(--cah-primary);
    box-shadow: 0 0 0 4px rgba(21, 148, 210, 0.14);
    outline: none;
}

.cah-table {
    background: #fff;
    border: 1px solid var(--cah-border);
    border-radius: 18px;
    border-spacing: 0;
    border-collapse: separate;
    box-shadow: 0 12px 34px rgba(15, 23, 42, 0.05);
    overflow: hidden;
}

.cah-table th {
    background: #f8fafc;
    color: #475569;
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.cah-table th,
.cah-table td {
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    padding: 14px 16px;
    vertical-align: middle;
}

.cah-table tbody tr:hover td {
    background: #f8fbff;
}

.cah-table tbody tr:last-child td {
    border-bottom: 0;
}

.cah-section-head {
    align-items: center;
    display: flex;
    gap: 10px;
    justify-content: space-between;
    margin-top: 22px;
}

.cah-section-head h2 {
    margin: 0;
}

.cah-pill {
    background: rgba(21, 148, 210, 0.10);
    border: 1px solid rgba(21, 148, 210, 0.18);
    border-radius: 999px;
    color: var(--cah-primary-dark);
    font-size: 12px;
    font-weight: 800;
    padding: 6px 10px;
}

.cah-empty {
    background: #fff;
    border: 1px dashed rgba(100, 116, 139, 0.32);
    border-radius: 18px;
    color: var(--cah-muted);
    padding: 18px;
}

.cah-row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
    text-align: right;
    white-space: nowrap;
}

.cah-button-primary,
.cah-app .button-primary {
    background: var(--cah-primary) !important;
    border-color: var(--cah-primary) !important;
    color: #fff !important;
}

.cah-button-secondary {
    background: #f8fafc !important;
    border-color: rgba(100, 116, 139, 0.28) !important;
    color: var(--cah-text) !important;
}

.cah-button-danger {
    background: #fff !important;
    border-color: rgba(180, 35, 24, 0.45) !important;
    color: #b42318 !important;
}

.cah-button-danger:hover,
.cah-button-danger:focus {
    background: #fff1f0 !important;
    border-color: #b42318 !important;
    color: #8f1d14 !important;
}

.cah-attachment-upload {
    align-items: center;
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(220px, 1fr) minmax(180px, 280px) auto;
    margin: 10px 0 14px;
}

.cah-attachment-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.cah-attachment-card {
    background: #fff;
    border: 1px solid rgba(100, 116, 139, 0.22);
    border-radius: 8px;
    margin: 0;
    overflow: hidden;
}

.cah-attachment-card img {
    aspect-ratio: 4 / 3;
    background: #f1f5f9;
    display: block;
    object-fit: cover;
    width: 100%;
}

.cah-attachment-card figcaption {
    display: grid;
    gap: 2px;
    padding: 8px;
}

.cah-attachment-card figcaption strong,
.cah-attachment-card figcaption small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cah-attachment-card > .button {
    margin: 0 8px 8px;
}

.cah-modal[hidden] {
    display: none !important;
}

.cah-modal.is-open {
    align-items: center;
    display: flex;
    inset: 0;
    justify-content: center;
    padding: 20px;
    position: fixed;
    z-index: 100000;
}

.cah-modal-backdrop {
    background: rgba(15, 23, 42, 0.52);
    backdrop-filter: blur(8px);
    inset: 0;
    position: absolute;
}

.cah-modal-panel {
    background: #fff;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 26px;
    box-shadow: 0 34px 90px rgba(15, 23, 42, 0.34);
    max-height: min(92vh, 860px);
    max-width: 820px;
    overflow: auto;
    padding: 24px;
    position: relative;
    width: min(820px, 96vw);
}

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

.cah-modal-header h2 {
    font-size: 28px;
    letter-spacing: -0.03em;
    margin: 0;
}

.cah-eyebrow {
    color: var(--cah-primary-dark);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    margin: 0 0 4px;
    text-transform: uppercase;
}

.cah-icon-button {
    align-items: center;
    background: #f1f5f9;
    border: 0;
    border-radius: 999px;
    color: var(--cah-text);
    cursor: pointer;
    display: inline-flex;
    font-size: 26px;
    font-weight: 400;
    height: 42px;
    justify-content: center;
    line-height: 1;
    width: 42px;
}

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

.cah-form-grid-modal label:nth-last-child(-n+2) {
    grid-column: 1 / -1;
}

.cah-form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 18px;
}

@media (max-width: 720px) {
    .cah-form-grid-modal {
        grid-template-columns: 1fr;
    }

    .cah-table {
        display: block;
        overflow-x: auto;
    }
}

.cah-two-column {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 18px 0 24px;
}

.cah-card {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 22px;
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.08);
    padding: 18px;
}

.cah-card h2 {
    margin-top: 0;
}

.cah-section-head-spaced {
    margin-top: 28px;
}

.cah-stock-low td {
    background: rgba(251, 191, 36, 0.12);
}

@media (max-width: 980px) {
    .cah-two-column {
        grid-template-columns: 1fr;
    }
}

/* v0.4.10 sober UI override: vähem suhkruvatti, rohkem tööriista tunnet */
.cah-app {
    --cah-primary: #1366ae;
    --cah-primary-dark: #0f4f86;
    --cah-text: #17212b;
    --cah-muted: #5f6b7a;
    --cah-border: #d9e1ea;
    --cah-card: #ffffff;
    background: #f5f7fa;
    border: 1px solid #dbe3ec;
    border-radius: 14px;
    box-shadow: none;
    padding: clamp(16px, 2.2vw, 26px);
}

.cah-app .notice {
    border-left: 4px solid #1366ae;
    border-radius: 8px;
    box-shadow: none;
    padding: 0 12px;
}

.cah-dashboard-grid {
    gap: 14px;
    margin: 26px auto;
}

.cah-module-tile,
.cah-module-tile:hover,
.cah-module-tile:focus {
    background: #ffffff;
    border: 1px solid #d8e1eb;
    border-left: 5px solid #1366ae;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(15, 35, 55, 0.08);
    color: #17212b !important;
    min-height: 132px;
    padding: 18px;
    transform: none;
}

.cah-module-tile:hover,
.cah-module-tile:focus {
    border-color: #b8c7d8;
    border-left-color: #0f4f86;
    box-shadow: 0 6px 18px rgba(15, 35, 55, 0.12);
}

.cah-module-tile::after {
    display: none;
}

.cah-module-tile .dashicons {
    background: #eef5fb;
    border-radius: 10px;
    color: #1366ae;
    font-size: 26px;
    height: 46px;
    width: 46px;
}

.cah-module-tile strong {
    color: #17212b;
    font-size: 21px;
    margin-top: 12px;
}

.cah-module-tile small {
    color: #5f6b7a;
    font-size: 13px;
}

.cah-module-view > .wrap,
.cah-app form[data-cah-helper-form],
.cah-card,
.cah-table,
.cah-modal-panel {
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(15, 35, 55, 0.06);
}

.cah-module-view h1,
.cah-page-title {
    font-size: clamp(26px, 3vw, 34px);
    letter-spacing: -0.02em;
}

.cah-form-grid input,
.cah-form-grid select,
.cah-form-grid textarea {
    background: #ffffff;
    border-radius: 8px;
    min-height: 40px;
}

.cah-app .button,
.cah-module-toolbar .button,
.cah-button-primary,
.cah-app .button-primary,
.cah-button-secondary {
    border-radius: 8px !important;
}

.cah-pill {
    background: #eef3f8;
    border-color: #d3deea;
    border-radius: 8px;
    color: #314255;
}

.cah-table th {
    background: #eef3f8;
    color: #314255;
}

.cah-table tbody tr:hover td {
    background: #f7fafc;
}

.cah-info-badge {
    background: #f4f7fa;
    border-color: #c9d6e4;
    color: #1366ae;
}

.cah-muted {
    color: var(--cah-muted, #5f6b7a);
}

.cah-pill-warn {
    background: #fff4d6;
    border-color: #f0d28a;
    color: #725100;
}

.cah-status {
    display: inline-flex;
    align-items: center;
    border: 1px solid #d3deea;
    border-radius: 999px;
    padding: 3px 9px;
    font-size: 12px;
    background: #f6f8fb;
    color: #314255;
    white-space: nowrap;
}

.cah-status-open,
.cah-status-in_progress {
    background: #eef5fb;
    border-color: #bdd7ee;
    color: #0f4f86;
}

.cah-status-waiting_parts,
.cah-status-waiting_client {
    background: #fff4d6;
    border-color: #f0d28a;
    color: #725100;
}

.cah-status-done,
.cah-status-closed {
    background: #eef8f0;
    border-color: #bfdfc8;
    color: #1e6b36;
}

.cah-modal-panel-wide {
    width: min(1180px, calc(100vw - 32px));
    max-height: calc(100vh - 64px);
    overflow: auto;
}

.cah-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px;
    margin-top: 14px;
}

.cah-detail-grid-four {
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.cah-card-compact {
    padding: 16px;
}

.cah-card-compact h3 {
    margin: 0 0 12px;
    font-size: 16px;
}

.cah-device-history {
    margin-top: 16px;
}

.cah-history-row {
    border-top: 1px solid #e5ebf2;
    padding: 10px 0;
}

.cah-history-row:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.cah-history-row strong,
.cah-history-row span,
.cah-history-row small {
    display: block;
}

.cah-history-row strong {
    color: #17212b;
}

.cah-history-row span,
.cah-history-row small,
.cah-history-row p {
    color: #5f6b7a;
    font-size: 13px;
    margin: 2px 0 0;
}

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

@media (max-width: 760px) {
    .cah-span-2 {
        grid-column: auto;
    }
}

.cah-detail-list {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 8px 14px;
    margin: 0;
}

.cah-detail-list dt {
    color: #5f6b7a;
    font-size: 13px;
}

.cah-detail-list dd {
    margin: 0;
    color: #17212b;
    font-weight: 500;
    overflow-wrap: anywhere;
}

.cah-license-key-box {
    width: 100%;
    box-sizing: border-box;
    font-family: Consolas, Monaco, monospace;
    font-size: 14px;
    line-height: 1.5;
    border: 1px solid #cfd8e3;
    border-radius: 6px;
    background: #f8fafc;
    color: #17212b;
    padding: 10px 12px;
    resize: vertical;
}

.cah-status-license-ok {
    background: #eef8f0;
    border-color: #bfdfc8;
    color: #1e6b36;
}

.cah-status-license-warning {
    background: #fff4d6;
    border-color: #f0d28a;
    color: #725100;
}

.cah-status-license-expired {
    background: #fdecec;
    border-color: #f1b9b9;
    color: #9b1c1c;
}

.cah-status-license-unknown {
    background: #f6f8fb;
    border-color: #d3deea;
    color: #314255;
}

/* v0.5.3 compact canvas workflow override */
.cah-app {
    --cah-primary: #1366ae;
    --cah-primary-dark: #0d4d84;
    --cah-text: #182330;
    --cah-muted: #617083;
    --cah-border: #d7e0ea;
    background: #f6f8fb;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.42;
    max-width: 1180px;
    min-height: 500px;
    padding: 14px;
}

.cah-app .wrap,
.cah-module-view > .wrap {
    max-width: 1140px;
    padding: 16px;
}

.cah-module-view h1,
.cah-page-title {
    font-size: 24px !important;
    line-height: 1.18;
    margin: 0 0 8px;
}

.cah-module-view h2,
.cah-section-head h2,
.cah-card h2 {
    font-size: 18px;
    line-height: 1.2;
}

.cah-card h3,
.cah-card-compact h3 {
    font-size: 15px;
    line-height: 1.2;
    margin: 0 0 9px;
}

.cah-module-view .wrap > p,
.cah-app p,
.cah-table,
.cah-form-grid label {
    font-size: 13px;
}

.cah-dashboard-grid {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px;
    margin: 18px auto;
}

.cah-module-tile,
.cah-module-tile:hover,
.cah-module-tile:focus {
    min-height: 96px;
    padding: 12px;
    border-radius: 8px;
    border-left-width: 4px;
}

.cah-module-tile .dashicons {
    height: 36px;
    width: 36px;
    font-size: 22px;
    border-radius: 8px;
}

.cah-module-tile strong {
    font-size: 17px;
    margin-top: 8px;
}

.cah-module-tile small {
    font-size: 12px;
    line-height: 1.3;
}

.cah-app form[data-cah-helper-form],
.cah-card,
.cah-module-view > .wrap,
.cah-table,
.cah-modal-panel {
    border-radius: 8px;
    box-shadow: 0 1px 5px rgba(15, 35, 55, 0.06);
}

.cah-app form[data-cah-helper-form],
.cah-card {
    padding: 12px;
    margin: 12px 0 16px;
}

.cah-form-grid {
    gap: 9px 12px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

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

.cah-form-grid-tight {
    gap: 8px 10px;
}

.cah-form-grid label {
    gap: 4px;
}

.cah-form-grid input,
.cah-form-grid select,
.cah-form-grid textarea {
    border-radius: 6px;
    font-size: 13px;
    min-height: 32px;
    padding: 5px 8px;
}

.cah-form-grid textarea {
    min-height: 58px;
}

.cah-form-actions {
    margin-top: 10px;
}

.cah-app .button,
.cah-module-toolbar .button,
.cah-button-primary,
.cah-app .button-primary,
.cah-button-secondary {
    border-radius: 6px !important;
    font-size: 13px !important;
    min-height: 30px;
    line-height: 28px;
    padding: 0 10px !important;
}

.cah-button-small {
    font-size: 12px !important;
    min-height: 26px !important;
    line-height: 24px !important;
    padding: 0 8px !important;
}

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

.cah-table th {
    font-size: 11px;
}

.cah-section-head {
    margin-top: 14px;
}

.cah-pill,
.cah-status {
    border-radius: 6px;
    font-size: 11px;
    padding: 3px 7px;
}

.cah-modal.is-open {
    align-items: flex-start;
    padding: 56px 18px 18px;
}

.cah-modal-backdrop {
    background: rgba(20, 28, 38, 0.46);
    backdrop-filter: blur(3px);
}

.cah-modal-panel {
    border-radius: 10px;
    max-height: calc(100vh - 82px);
    padding: 14px;
}

.cah-modal-panel-wide {
    width: min(1040px, calc(100vw - 44px));
}

.cah-modal-panel-maintenance {
    width: min(760px, calc(100vw - 44px));
}

.cah-modal-header {
    gap: 10px;
    margin-bottom: 10px;
    padding-bottom: 9px;
    border-bottom: 1px solid #e5ebf2;
}

.cah-modal-header h2,
.cah-modal-header [data-cah-device-modal-title] {
    font-size: 22px !important;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.cah-modal-subtitle {
    color: #617083;
    margin: 3px 0 0;
    font-size: 12px;
}

.cah-eyebrow {
    font-size: 10px;
    margin-bottom: 2px;
}

.cah-icon-button {
    height: 34px;
    width: 34px;
    font-size: 22px;
}

.cah-detail-grid {
    grid-template-columns: minmax(300px, 0.95fr) minmax(320px, 1.05fr);
    gap: 10px;
    margin-top: 10px;
}

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

.cah-card-compact {
    padding: 11px;
}

.cah-device-history {
    margin-top: 10px;
}

.cah-history-row {
    padding: 7px 0;
}

.cah-history-row strong {
    font-size: 13px;
}

.cah-history-row span,
.cah-history-row small,
.cah-history-row p {
    font-size: 12px;
    line-height: 1.3;
}

.cah-history-row-action {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.cah-history-row-action > div {
    min-width: 0;
}

.cah-history-row-action .button {
    flex: 0 0 auto;
}

@media (max-width: 900px) {
    .cah-detail-grid,
    .cah-detail-grid-four,
    .cah-form-grid-modal {
        grid-template-columns: 1fr;
    }

    .cah-modal.is-open {
        padding: 18px 10px;
    }

    .cah-modal-panel,
    .cah-modal-panel-wide,
    .cah-modal-panel-maintenance {
        width: calc(100vw - 20px);
        max-height: calc(100vh - 36px);
    }
}

/* v0.5.6 FHD workspace and compact shared header */
.cah-app-hero {
    align-items: center;
    background: linear-gradient(135deg, #0f5f92 0%, #1987c7 58%, #22a38c 100%);
    border-radius: 8px;
    color: #fff;
    display: flex;
    gap: 22px;
    justify-content: space-between;
    margin: 0 0 14px;
    min-height: 104px;
    padding: 18px 22px;
}

.cah-app-hero h1 {
    color: #fff !important;
    font-size: 28px !important;
    font-weight: 750;
    letter-spacing: 0;
    line-height: 1.1;
    margin: 0 0 5px !important;
}

.cah-app-hero p {
    color: rgba(255, 255, 255, 0.86) !important;
    font-size: 13px;
    line-height: 1.35;
    margin: 0 !important;
    max-width: 760px;
}

.cah-app-hero__eyebrow {
    color: rgba(255, 255, 255, 0.72) !important;
    font-size: 11px !important;
    font-weight: 800;
    letter-spacing: 0 !important;
    margin: 0 0 4px !important;
    text-transform: uppercase;
}

.cah-app-hero__meta {
    align-items: center;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 8px;
    display: grid;
    grid-template-columns: auto auto;
    min-width: 152px;
    padding: 11px 14px;
}

.cah-app-hero__meta span {
    color: rgba(255, 255, 255, 0.82);
    font-size: 11px;
    grid-column: 1 / -1;
    margin-bottom: 3px;
}

.cah-app-hero__meta strong {
    color: #fff;
    font-size: 30px;
    line-height: 1;
}

.cah-app-hero__meta small {
    align-self: end;
    color: rgba(255, 255, 255, 0.82);
    font-size: 12px;
    margin: 0 0 2px 6px;
}

@media (min-width: 1180px) {
    .cah-app {
        max-width: min(1760px, calc(100vw - 72px));
        border-radius: 16px;
        padding: 24px;
    }

    .cah-app .wrap,
    .cah-module-toolbar,
    .cah-module-view > .wrap,
    .cah-storage-notice {
        max-width: none;
        width: 100%;
    }

    .cah-dashboard-grid {
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
        gap: 18px;
        justify-content: stretch;
        margin: 22px 0 0;
        max-width: none;
        width: 100%;
    }

    .cah-module-tile,
    .cah-module-tile:hover,
    .cah-module-tile:focus {
        align-items: flex-start;
        flex-direction: column;
        justify-content: space-between;
        min-height: 162px;
        padding: 22px;
        text-align: left;
    }

    .cah-module-tile small {
        display: block;
        max-width: 340px;
    }

    .cah-app form[data-cah-helper-form],
    .cah-card {
        max-width: none;
    }

    .cah-form-grid {
        grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    }

    .cah-table {
        min-width: 980px;
    }
}

@media (max-width: 760px) {
    .cah-app-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .cah-app-hero__meta {
        width: 100%;
    }
}
