:root {
    --fcrm-bg: #f5f7fb;
    --fcrm-surface: #ffffff;
    --fcrm-surface-2: #f9fafc;
    --fcrm-border: #d9e0ea;
    --fcrm-text: #1f2937;
    --fcrm-muted: #6b7280;
    --fcrm-primary: #0f766e;
    --fcrm-primary-hover: #0b5f59;
    --fcrm-danger: #b42318;
    --fcrm-danger-hover: #8f1d14;
    --fcrm-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.fcrm-app,
.fcrm-app * {
    box-sizing: border-box;
}

.fcrm-login-wrap {
    min-height: 70vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: var(--fcrm-bg);
}

.fcrm-login-card {
    width: 100%;
    max-width: 420px;
    background: var(--fcrm-surface);
    border: 1px solid var(--fcrm-border);
    border-radius: 8px;
    padding: 28px;
    box-shadow: var(--fcrm-shadow);
}

.fcrm-brand h2,
.fcrm-topbar-title h1,
.fcrm-section-head h3,
.fcrm-section-head h4,
.fcrm-profile-head h4 {
    margin: 0;
    color: var(--fcrm-text);
}

.fcrm-brand p,
.fcrm-topbar-title p,
.fcrm-muted {
    color: var(--fcrm-muted);
    margin: 8px 0 0;
}

.fcrm-app {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    min-height: 80vh;
    background: var(--fcrm-bg);
    border: 1px solid var(--fcrm-border);
    border-radius: 8px;
    overflow: hidden;
}

.fcrm-sidebar {
    background: #16212f;
    color: #fff;
    padding: 24px 18px;
}

.fcrm-sidebar-head {
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    margin-bottom: 18px;
}

.fcrm-sidebar-head h2 {
    margin: 0 0 8px;
    font-size: 20px;
}

.fcrm-sidebar-head p {
    margin: 0;
    color: rgba(255, 255, 255, 0.72);
}

.fcrm-nav {
    display: grid;
    gap: 8px;
}

.fcrm-nav-item {
    appearance: none;
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.82);
    text-align: right;
    padding: 12px 14px;
    border-radius: 8px;
    cursor: pointer;
    font: inherit;
    transition: background 0.2s ease, color 0.2s ease;
}

.fcrm-nav-item:hover,
.fcrm-nav-item.is-active {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.fcrm-main {
    padding: 24px;
}

.fcrm-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.fcrm-panel {
    display: none;
}

.fcrm-panel.is-active {
    display: block;
}

.fcrm-section {
    background: var(--fcrm-surface);
    border: 1px solid var(--fcrm-border);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.fcrm-grid-2,
.fcrm-grid-main,
.fcrm-stats-grid {
    display: grid;
    gap: 16px;
}

.fcrm-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.fcrm-grid-main {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
}

.fcrm-stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 16px;
}

.fcrm-stat-box {
    background: var(--fcrm-surface);
    border: 1px solid var(--fcrm-border);
    border-radius: 8px;
    padding: 18px;
}

.fcrm-stat-label {
    display: block;
    color: var(--fcrm-muted);
    margin-bottom: 10px;
    font-size: 13px;
}

.fcrm-stat-box strong {
    font-size: 24px;
    color: var(--fcrm-text);
}

.fcrm-section-head,
.fcrm-profile-head,
.fcrm-topbar-actions,
.fcrm-inline-actions,
.fcrm-toolbar,
.fcrm-order-client-box,
.fcrm-payment-top,
.fcrm-payment-meta,
.fcrm-payment-extra,
.fcrm-product-search-box,
.fcrm-product-actions,
.fcrm-submit-row,
.fcrm-order-totals {
    display: flex;
    align-items: center;
    gap: 12px;
}

.fcrm-section-head,
.fcrm-profile-head,
.fcrm-toolbar,
.fcrm-order-client-box {
    justify-content: space-between;
    margin-bottom: 16px;
}

.fcrm-section-head-compact {
    margin-top: 16px;
}

.fcrm-grow {
    flex: 1;
}

.fcrm-form {
    display: grid;
    gap: 14px;
}

.fcrm-form-row {
    display: grid;
    gap: 8px;
}

.fcrm-form-row label {
    color: var(--fcrm-text);
    font-weight: 600;
    font-size: 14px;
}

.fcrm-form-row input,
.fcrm-form-row select,
.fcrm-form-row textarea,
.fcrm-toolbar input,
.fcrm-product-search-box input,
.fcrm-qty-input,
.fcrm-cart-qty {
    width: 100%;
    min-width: 0;
    border: 1px solid var(--fcrm-border);
    background: #fff;
    color: var(--fcrm-text);
    border-radius: 8px;
    padding: 11px 12px;
    font: inherit;
}

.fcrm-btn {
    appearance: none;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 10px 14px;
    cursor: pointer;
    font: inherit;
    line-height: 1.2;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.fcrm-btn-block {
    width: 100%;
    justify-content: center;
}

.fcrm-btn-primary {
    background: var(--fcrm-primary);
    color: #fff;
}

.fcrm-btn-primary:hover {
    background: var(--fcrm-primary-hover);
}

.fcrm-btn-secondary,
.fcrm-btn-light {
    background: #fff;
    color: var(--fcrm-text);
    border-color: var(--fcrm-border);
}

.fcrm-btn-danger {
    background: var(--fcrm-danger);
    color: #fff;
}

.fcrm-btn-danger:hover {
    background: var(--fcrm-danger-hover);
}

.fcrm-link-btn {
    border: 0;
    background: transparent;
    color: var(--fcrm-primary);
    cursor: pointer;
    padding: 0;
    font: inherit;
    font-weight: 600;
}

.fcrm-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.fcrm-table {
    width: 100%;
    border-collapse: collapse;
}

.fcrm-table th,
.fcrm-table td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--fcrm-border);
    text-align: right;
    vertical-align: middle;
}

.fcrm-table th {
    color: var(--fcrm-muted);
    font-weight: 700;
    background: var(--fcrm-surface-2);
}

.fcrm-table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.fcrm-empty-row td,
.fcrm-empty-state,
.fcrm-loading {
    text-align: center;
    color: var(--fcrm-muted);
    padding: 24px 12px;
}

.fcrm-message {
    display: none;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 16px;
    border: 1px solid transparent;
}

.fcrm-message.is-success {
    display: block;
    color: #0f5132;
    background: #d1e7dd;
    border-color: #badbcc;
}

.fcrm-message.is-error {
    display: block;
    color: #842029;
    background: #f8d7da;
    border-color: #f5c2c7;
}

.fcrm-message.is-info {
    display: block;
    color: #055160;
    background: #cff4fc;
    border-color: #b6effb;
}

.fcrm-client-profile {
    display: grid;
    gap: 16px;
}

.fcrm-profile-card {
    border: 1px solid var(--fcrm-border);
    border-radius: 8px;
    padding: 18px;
    background: var(--fcrm-surface-2);
}

.fcrm-profile-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.fcrm-profile-address {
    grid-column: 1 / -1;
}

.fcrm-list-compact {
    display: grid;
    gap: 10px;
}

.fcrm-list-item {
    width: 100%;
    text-align: right;
    border: 1px solid var(--fcrm-border);
    border-radius: 8px;
    background: #fff;
    padding: 12px;
    display: grid;
    gap: 6px;
    color: var(--fcrm-text);
}

button.fcrm-list-item {
    cursor: pointer;
}

.fcrm-order-summary-mini {
    display: grid;
    gap: 12px;
}

.fcrm-order-client-box {
    border: 1px solid var(--fcrm-border);
    border-radius: 8px;
    padding: 14px;
    background: var(--fcrm-surface-2);
}

.fcrm-product-results {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.fcrm-product-card,
.fcrm-payment-card {
    border: 1px solid var(--fcrm-border);
    border-radius: 8px;
    padding: 14px;
    background: #fff;
}

.fcrm-product-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.fcrm-product-info {
    display: grid;
    gap: 6px;
}

.fcrm-product-info span,
.fcrm-payment-meta span,
.fcrm-payment-extra span {
    color: var(--fcrm-muted);
    font-size: 13px;
}

.fcrm-product-actions {
    min-width: 190px;
    justify-content: flex-end;
}

.fcrm-qty-input,
.fcrm-cart-qty {
    width: 84px;
}

.fcrm-order-totals {
    justify-content: space-between;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--fcrm-border);
}

.fcrm-order-totals div {
    display: grid;
    gap: 6px;
}

.fcrm-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 70px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #ecfdf5;
    color: #065f46;
    font-size: 12px;
    font-weight: 700;
}

.fcrm-modal[hidden] {
    display: none;
}

.fcrm-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
}

.fcrm-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.48);
}

.fcrm-modal-dialog {
    position: relative;
    z-index: 2;
    width: min(680px, calc(100vw - 24px));
    margin: 48px auto;
    background: #fff;
    border-radius: 8px;
    border: 1px solid var(--fcrm-border);
    box-shadow: var(--fcrm-shadow);
    padding: 20px;
}

.fcrm-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.fcrm-modal-close {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--fcrm-muted);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

@media (max-width: 1080px) {
    .fcrm-app {
        grid-template-columns: 220px minmax(0, 1fr);
    }

    .fcrm-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .fcrm-grid-main,
    .fcrm-grid-2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .fcrm-app {
        grid-template-columns: 1fr;
    }

    .fcrm-sidebar {
        padding: 16px;
    }

    .fcrm-main {
        padding: 16px;
    }

    .fcrm-topbar,
    .fcrm-section-head,
    .fcrm-toolbar,
    .fcrm-order-client-box,
    .fcrm-product-card,
    .fcrm-product-actions,
    .fcrm-payment-top,
    .fcrm-payment-meta,
    .fcrm-payment-extra {
        flex-direction: column;
        align-items: stretch;
    }

    .fcrm-stats-grid,
    .fcrm-profile-grid {
        grid-template-columns: 1fr;
    }

    .fcrm-nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .fcrm-nav-item {
        text-align: center;
    }

    .fcrm-table th,
    .fcrm-table td {
        white-space: nowrap;
    }
}
