:root {
    --brand-primary: #508aeb;
    --brand-dark: #20324d;
    --brand-surface: #f4f8ff;
    --brand-border: #d8e2f0;
}

body {
    background: linear-gradient(180deg, #eef4fb 0%, #f8fafc 100%);
    color: #243447;
}

.brand-strip {
    background: #fff;
    border-bottom: 1px solid var(--brand-border);
}

.brand-title {
    color: var(--brand-primary);
    font-size: 1.4rem;
    padding: 14px 0;
}

.navbar-custom {
    background: var(--brand-dark);
    box-shadow: 0 8px 20px rgba(32, 50, 77, 0.12);
}

.navbar-custom .navbar-toggler {
    filter: invert(1);
}

.navbar-custom .nav-link,
.navbar-custom .navbar-brand {
    color: rgba(255, 255, 255, 0.86);
}

.navbar-custom .nav-link.active,
.navbar-custom .nav-link:hover {
    color: #fff;
}

.wrapper {
    min-height: calc(100vh - 112px);
}

.metric-card,
.table-card,
.form-card,
.invoice-sheet {
    background: #fff;
    border: 1px solid var(--brand-border);
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(57, 72, 92, 0.06);
}

.metric-card {
    padding: 1.25rem;
}

.metric-label {
    color: #6a7a8c;
    font-size: 0.9rem;
}

.metric-value {
    font-size: 1.7rem;
    font-weight: 700;
}

.page-title {
    font-size: 1.45rem;
    font-weight: 700;
}

.page-subtitle {
    color: #708090;
}

.table-card,
.form-card,
.invoice-sheet {
    padding: 1.25rem;
}

.table thead th {
    background: var(--brand-surface);
    color: var(--brand-dark);
    font-weight: 600;
}

.summary-box {
    background: var(--brand-surface);
    border-radius: 12px;
    padding: 1rem;
}

.invoice-item-table input,
.invoice-item-table select,
.invoice-item-table textarea {
    min-width: 120px;
}

.rich-textarea-source {
    display: none;
}

.rich-editor-wrap {
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    background: #fff;
    overflow: hidden;
}

.rich-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
}

.rich-editor-toolbar button {
    border: 1px solid #d0d7de;
    background: #fff;
    color: #212529;
    border-radius: 0.375rem;
    min-width: 36px;
    height: 34px;
    padding: 0 10px;
    font-size: 13px;
    font-weight: 600;
}

.rich-editor-toolbar button:hover {
    background: #eef5ff;
}

.rich-editor-surface {
    min-height: 140px;
    padding: 12px 14px;
    outline: none;
}

.rich-editor-surface p:last-child,
.formatted-content p:last-child {
    margin-bottom: 0;
}

.rich-textarea-compact + .rich-editor-wrap .rich-editor-toolbar {
    gap: 4px;
    padding: 6px;
}

.rich-textarea-compact + .rich-editor-wrap .rich-editor-toolbar button {
    min-width: 30px;
    height: 28px;
    padding: 0 8px;
    font-size: 12px;
}

.rich-textarea-compact + .rich-editor-wrap .rich-editor-surface {
    min-height: 76px;
    padding: 8px 10px;
    font-size: 13px;
}

.formatted-content ul,
.formatted-content ol {
    padding-left: 1.25rem;
    margin-bottom: 0.5rem;
}
