* {
    box-sizing: border-box;
}

body.kucrm-body,
body.kucrm-login-body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #16202a;
    background: #f4f7f6;
}

.kucrm-hidden {
    display: none !important;
}

.kucrm-app {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    min-height: 100vh;
}

.kucrm-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 20px 14px;
    color: #eef7f4;
    background: #102626;
    overflow-y: auto;
}

.kucrm-sidebar-brand,
.kucrm-topbar,
.kucrm-user-menu,
.kucrm-toolbar,
.kucrm-row-actions,
.kucrm-form-actions,
.kucrm-check {
    display: flex;
    align-items: center;
}

.kucrm-sidebar-brand {
    gap: 10px;
    min-height: 48px;
    padding: 0 8px 18px;
    font-weight: 700;
}

.kucrm-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    color: #102626;
    background: #e7c46b;
    font-weight: 800;
}

.kucrm-nav {
    display: grid;
    gap: 4px;
}

.kucrm-nav a {
    display: flex;
    min-height: 40px;
    align-items: center;
    padding: 9px 10px;
    border-radius: 8px;
    color: #cfe1dc;
    text-decoration: none;
    font-size: 14px;
}

.kucrm-nav a:hover,
.kucrm-nav a.is-active {
    color: #ffffff;
    background: #1f4441;
}

.kucrm-main {
    min-width: 0;
}

.kucrm-topbar {
    position: sticky;
    top: 0;
    z-index: 5;
    justify-content: space-between;
    gap: 16px;
    min-height: 70px;
    padding: 14px 28px;
    border-bottom: 1px solid #dce7e3;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(10px);
}

.kucrm-topbar-title {
    display: grid;
    gap: 3px;
}

.kucrm-topbar-title strong {
    font-size: 18px;
}

.kucrm-topbar-title span,
.kucrm-section-head p,
.kucrm-stat-card span,
.kucrm-feed time,
.kucrm-feed span {
    color: #64756f;
    font-size: 13px;
}

.kucrm-user-menu {
    gap: 12px;
    font-size: 14px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.kucrm-user-menu a,
.kucrm-row-actions a,
.kucrm-text-button {
    color: #0d756b;
    text-decoration: none;
}

.kucrm-top-pill {
    display: inline-flex;
    min-height: 32px;
    align-items: center;
    padding: 6px 10px;
    border-radius: 8px;
    color: #18302e !important;
    background: #edf3f0;
    white-space: nowrap;
}

.kucrm-content {
    display: grid;
    gap: 18px;
    padding: 24px 28px 42px;
}

.kucrm-section {
    display: grid;
    gap: 16px;
    padding: 20px;
    border: 1px solid #dce7e3;
    border-radius: 8px;
    background: #ffffff;
}

.kucrm-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.kucrm-section h1,
.kucrm-section h2,
.kucrm-section p {
    margin: 0;
}

.kucrm-section h1 {
    font-size: 26px;
}

.kucrm-section h2 {
    font-size: 18px;
}

.kucrm-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.kucrm-quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.kucrm-quick-card {
    display: grid;
    gap: 6px;
    min-height: 104px;
    padding: 16px;
    border: 1px solid #e4ebe8;
    border-radius: 8px;
    color: #16202a;
    background: #fbfcfa;
    text-decoration: none;
}

.kucrm-quick-card span {
    color: #64756f;
    font-size: 13px;
}

.kucrm-stat-card {
    display: grid;
    gap: 8px;
    min-height: 104px;
    padding: 16px;
    border: 1px solid #e4ebe8;
    border-radius: 8px;
    background: #fbfcfa;
}

.kucrm-stat-card strong {
    font-size: 30px;
}

.kucrm-split {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.kucrm-feed {
    display: grid;
    gap: 10px;
}

.kucrm-feed article {
    display: grid;
    gap: 4px;
    padding: 12px;
    border: 1px solid #e4ebe8;
    border-radius: 8px;
    background: #fbfcfa;
}

.kucrm-tutorial-index {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 10px;
}

.kucrm-tutorial-index a {
    display: grid;
    gap: 4px;
    min-height: 84px;
    padding: 14px;
    border: 1px solid #e4ebe8;
    border-radius: 8px;
    color: #16202a;
    background: #fbfcfa;
    text-decoration: none;
}

.kucrm-tutorial-index span,
.kucrm-tutorial-meta,
.kucrm-callout {
    color: #64756f;
    font-size: 13px;
}

.kucrm-tutorial-list,
.kucrm-tutorial-checklist {
    display: grid;
    gap: 10px;
    margin: 0;
    padding-left: 22px;
}

.kucrm-tutorial-list li,
.kucrm-tutorial-checklist li {
    padding-left: 4px;
}

.kucrm-callout {
    padding: 12px 14px;
    border: 1px solid #dce7e3;
    border-radius: 8px;
    background: #f7faf8;
}

.kucrm-toolbar {
    gap: 10px;
}

.kucrm-toolbar-wrap {
    flex-wrap: wrap;
}

.kucrm-toolbar input,
.kucrm-toolbar select {
    width: min(100%, 260px);
}

.kucrm-button,
.kucrm-icon-button,
.kucrm-row-actions button,
.kucrm-text-button {
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    font: inherit;
}

.kucrm-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 9px 14px;
    color: #18302e;
    background: #e6eeeb;
    text-decoration: none;
    white-space: nowrap;
}

.kucrm-button-primary {
    color: #ffffff;
    background: #0d756b;
}

.kucrm-text-button {
    padding: 0;
    background: transparent;
}

.kucrm-icon-button {
    display: none;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    padding: 10px;
    background: #e6eeeb;
}

.kucrm-icon-button span {
    display: block;
    width: 18px;
    height: 2px;
    margin: 3px auto;
    background: #18302e;
}

.kucrm-table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid #dce7e3;
    border-radius: 8px;
}

.kucrm-table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
    font-size: 14px;
}

.kucrm-table th,
.kucrm-table td {
    padding: 12px;
    border-bottom: 1px solid #e4ebe8;
    text-align: left;
    vertical-align: top;
}

.kucrm-table th {
    color: #52645f;
    background: #f7faf8;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.kucrm-row-actions {
    gap: 10px;
}

.kucrm-row-actions form {
    margin: 0;
}

.kucrm-row-actions button,
.kucrm-table td form button {
    padding: 0;
    color: #b64242;
    background: transparent;
}

.kucrm-pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.kucrm-pagination a {
    min-width: 34px;
    padding: 7px 10px;
    border-radius: 8px;
    color: #18302e;
    background: #e6eeeb;
    text-align: center;
    text-decoration: none;
}

.kucrm-pagination a.is-active {
    color: #ffffff;
    background: #0d756b;
}

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

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

.kucrm-field {
    display: grid;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
}

.kucrm-field input,
.kucrm-field textarea,
.kucrm-field select,
.kucrm-toolbar input,
.kucrm-toolbar select,
.kucrm-login-form input {
    min-height: 40px;
    width: 100%;
    border: 1px solid #cddbd6;
    border-radius: 8px;
    padding: 9px 10px;
    color: #16202a;
    background: #ffffff;
    font: inherit;
}

.kucrm-field textarea {
    min-height: 112px;
    resize: vertical;
}

.kucrm-form-actions {
    justify-content: flex-end;
}

.kucrm-check {
    gap: 8px;
    font-size: 14px;
}

.kucrm-check-compact {
    margin-top: 8px;
    font-weight: 400;
}

.kucrm-alert {
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 14px;
}

.kucrm-alert-success {
    color: #16453f;
    background: #dff3ec;
}

.kucrm-alert-error {
    color: #6b2424;
    background: #f9e2df;
}

.kucrm-login-screen {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
    min-height: 100vh;
}

.kucrm-login-brand {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
    justify-content: center;
    padding: 8vw;
    color: #ffffff;
    background: #102626;
}

.kucrm-login-brand .kucrm-mark {
    margin-bottom: 32px;
}

.kucrm-login-brand p {
    margin: 0 0 10px;
    color: #e7c46b;
    font-weight: 700;
}

.kucrm-login-brand h1 {
    max-width: 760px;
    margin: 0;
    font-size: 72px;
    line-height: 1;
}

.kucrm-login-panel {
    display: grid;
    align-content: center;
    gap: 16px;
    padding: 48px;
    background: #ffffff;
}

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

.kucrm-login-form label:not(.kucrm-check) {
    display: grid;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
}

@media (max-width: 920px) {
    .kucrm-app {
        grid-template-columns: 1fr;
    }

    .kucrm-sidebar {
        position: fixed;
        z-index: 20;
        width: 260px;
        transform: translateX(-100%);
        transition: transform 160ms ease;
    }

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

    .kucrm-icon-button {
        display: inline-block;
    }

    .kucrm-split,
    .kucrm-form-grid,
    .kucrm-login-screen {
        grid-template-columns: 1fr;
    }

    .kucrm-login-brand {
        min-height: 42vh;
    }

    .kucrm-login-brand h1 {
        font-size: 52px;
    }
}

@media (max-width: 640px) {
    .kucrm-content,
    .kucrm-topbar,
    .kucrm-login-panel,
    .kucrm-login-brand {
        padding: 18px;
    }

    .kucrm-section-head,
    .kucrm-topbar {
        flex-wrap: wrap;
    }

    .kucrm-login-brand h1 {
        font-size: 40px;
    }

    .kucrm-toolbar input,
    .kucrm-toolbar select,
    .kucrm-toolbar .kucrm-button {
        width: 100%;
    }
}
