@charset "utf-8";

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Manrope', sans-serif;
    font-size: 14px;
    color: #0f172a;
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.08), transparent 26%),
        linear-gradient(180deg, #eef3f8 0%, #e8eef5 100%);
}

h1, h2, h3, h4, h5, h6,
p, label, li,
button, input, select, textarea {
    font-family: 'Manrope', sans-serif;
}

a {
    text-decoration: none;
}

.container {
    width: 100%;
    max-width: 1280px;
}

header {
    background: linear-gradient(135deg, #0f2340 0%, #14335a 55%, #102947 100%);
    color: #ffffff;
    box-shadow: 0 16px 40px rgba(15, 35, 64, 0.22);
}

.header-shell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 86px;
    padding: 14px 0;
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.ilogo {
    width: 56px;
    height: 56px;
    padding: 12px;
    border-radius: 8px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.14);
}

.brand-copy h1 {
    margin: 0;
    font-size: 32px;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.brand-copy small {
    display: block;
    margin-top: 4px;
    color: rgba(255,255,255,0.78);
    font-size: 14px;
    font-weight: 500;
}

.header-meta {
    margin-top: 6px;
    color: rgba(255,255,255,0.74);
    font-size: 12px;
    font-weight: 600;
}

.header-meta span + span:before {
    content: " • ";
    margin: 0 6px;
}

.header-side {
    display: flex;
    align-items: center;
    margin-left: auto;
}

.app-menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 8px;
    background: rgba(255,255,255,0.08);
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.app-menu-toggle:hover,
.app-menu-toggle:focus {
    background: rgba(255,255,255,0.16);
    color: #ffffff;
}

.app-menu-toggle__icon,
.app-menu-toggle__icon:before,
.app-menu-toggle__icon:after {
    display: block;
    width: 18px;
    height: 2px;
    background: #ffffff;
    content: '';
}

.app-menu-toggle__icon {
    position: relative;
}

.app-menu-toggle__icon:before {
    position: absolute;
    top: -6px;
    left: 0;
}

.app-menu-toggle__icon:after {
    position: absolute;
    top: 6px;
    left: 0;
}

.app-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.44);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 1000;
}

.app-drawer-backdrop.is-open {
    opacity: 1;
    visibility: visible;
}

.app-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 320px;
    max-width: 90vw;
    height: 100vh;
    padding: 28px 24px;
    background: #ffffff;
    box-shadow: -18px 0 40px rgba(15, 23, 42, 0.16);
    transform: translateX(100%);
    transition: transform 0.24s ease;
    z-index: 1001;
}

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

.app-drawer__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 24px;
}

.app-drawer__eyebrow {
    margin: 0 0 8px;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.app-drawer__header h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 800;
    color: #0f172a;
}

.app-drawer__close {
    border: 0;
    background: transparent;
    color: #1e293b;
    font-size: 30px;
    line-height: 1;
}

.app-drawer__link {
    display: block;
    padding: 14px 16px;
    margin-bottom: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    color: #0f172a;
    font-size: 14px;
    font-weight: 700;
}

.app-drawer__link:hover,
.app-drawer__link:focus,
.app-drawer__link.active {
    border-color: #c0d3e7;
    background: #eef5fb;
    color: #0f172a;
}

.app-drawer__note {
    margin-top: 18px;
    padding: 16px;
    border-radius: 8px;
    background: #eff6ff;
    color: #334155;
    font-size: 13px;
    line-height: 1.6;
}

body.drawer-open {
    overflow: hidden;
}

.app-page,
.setting-panel,
.sending-panel,
#paper-wrapper {
    margin-top: 22px;
    margin-bottom: 22px;
}

.alert {
    border-radius: 8px;
    border: 1px solid transparent;
}

.workspace-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 20px;
    align-items: start;
}

.workspace-main,
.workspace-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.app-card,
.preview-panel,
.history-panel,
.emailForm-panel,
.sending-panel,
.setting-panel,
#paper-wrapper {
    border: 1px solid #dfe7ef;
    border-radius: 8px;
    background: rgba(255,255,255,0.96);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

#paper-wrapper {
    padding: 20px;
}

.app-card,
.preview-panel,
.history-panel,
.emailForm-panel,
.sending-panel,
.setting-panel {
    padding: 20px;
}

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

.section-header--compact {
    margin-bottom: 16px;
}

.section-kicker {
    margin: 0 0 6px;
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.section-header h2,
.history-header h2,
.sending-panel h2,
.preview-msg h2 {
    margin: 0;
    padding: 0;
    border: 0;
    color: #0f172a;
    font-size: 20px;
    font-weight: 800;
    text-transform: none;
    letter-spacing: 0;
}

.section-subheader {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}

.section-subheader h3 {
    margin: 0;
    color: #0f172a;
    font-size: 18px;
    font-weight: 800;
}

.section-tag {
    padding: 2px 8px;
    border-radius: 4px;
    background: #e0ecff;
    color: #1d4ed8;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .3px;

}

.section-tag--client {
    background: #dcfce7;
    color: #15803d;
}

.form-group {
    margin-bottom: 18px;
}

.caption {
    display: block;
    margin-bottom: 8px;
    color: #475569;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.required {
    color: #dc2626;
}

.form-control {
    height: 46px;
    border: 1px solid #d7e0ea !important;
    background: #ffffff;
    color: #0f172a;
    font-size: 14px;
    border-radius: 8px !important;
    box-shadow: none !important;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.form-select {
    height: 46px;
    border: 1px solid #d7e0ea !important;
    background-color: #ffffff;
    color: #0f172a;
    font-size: 14px;
    border-radius: 8px !important;
    box-shadow: none !important;
    padding: 0.65rem 2.5rem 0.65rem 0.875rem;
    background-position: right 0.875rem center;
    background-size: 16px 12px;
}

textarea.form-control {
    min-height: 88px;
    padding-top: 12px;
}

#item-pnl textarea.form-control,
.item-description.form-control {
    min-height: 62px;
}

.party-card textarea.form-control {
    min-height: 72px;
}

.party-card .form-floating {
    margin-bottom: 16px;
}

.party-card .form-floating > .form-control,
.party-card .form-floating > .form-control-plaintext,
.party-card .form-floating > .form-select {
    height: 48px;
    min-height: 48px;
    padding: 1rem 0.875rem 0.375rem;
}

.party-card .form-floating > textarea.form-control {
    min-height: 88px;
    height: 88px;
    padding-top: 1.15rem;
}

.party-card .form-floating > label {
    padding: 0.8rem 0.875rem;
    color: #64748b;
    font-size: 12px;
}

.party-card .form-floating > .form-control:focus ~ label,
.party-card .form-floating > .form-control:not(:placeholder-shown) ~ label,
.party-card .form-floating > textarea.form-control:focus ~ label,
.party-card .form-floating > textarea.form-control:not(:placeholder-shown) ~ label {
    color: #475569;
    transform: scale(0.82) translateY(-0.62rem) translateX(0.08rem);
}

.form-control:focus {
    border-color: #5c8fe8 !important;
    box-shadow: 0 0 0 4px rgba(92, 143, 232, 0.12) !important;
}

.form-select:focus {
    border-color: #5c8fe8 !important;
    box-shadow: 0 0 0 4px rgba(92, 143, 232, 0.12) !important;
}

.input-group-addon {
    border: 1px solid #d7e0ea;
    background: #f8fbff;
    color: #546375;
    font-weight: 700;
    border-radius: 8px 0 0 8px;
}

.input-group .form-control {
    border-radius: 0 8px 8px 0 !important;
}

.input-group .form-control:first-child {
    border-radius: 8px 0 0 8px !important;
}

.input-group .form-control:last-child {
    border-radius: 0 8px 8px 0 !important;
}

.document-type-switch {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px;
    border: 1px solid #d9e2ec;
    border-radius: 6px;
    background: #f8fafc;
}

.document-type-btn {
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 14px;
}

.document-type-btn.active {
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.document-type-native {
    display: none;
}

.inner-cmp-pnl {
    border: 1px solid #e4ebf2;
    border-radius: 8px;
    background: #ffffff;
    padding: 20px;
    height: 100%;
}

#item-pnl {
    margin: 0 0 18px;
    border: 1px solid #e0e7ef;
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
}

#item-pnl .items-pnl-head {
    margin: 0;
    color: #425466;
    font-weight: 800;
    background: #f4f7fb;
}

#item-pnl .items-pnl-head .col {
    padding: 12px 10px;
    text-align: center;
    border-right: 1px solid #ffffff;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

#item-pnl .items-pnl-body {
    margin: 0;
}

#item-pnl .items-pnl-body .col {
    padding: 14px 10px;
}

#item-pnl .items-pnl-body .col-sm-1,
#item-pnl .items-pnl-head .col-sm-1 {
    width: 5%;
}

#item-pnl .items-pnl-body .col-sm-2,
#item-pnl .items-pnl-head .col-sm-2 {
    width: 10%;
}

#item-pnl .items-pnl-body .col-sm-3,
#item-pnl .items-pnl-head .col-sm-3 {
    width: 12.5%;
}

#item-pnl .items-pnl-body .col-sm-6,
#item-pnl .items-pnl-head .col-sm-6 {
    width: 35%;
}

#item-pnl .items-pnl-body .col p {
    margin: 9px 0 0;
    text-align: center !important;
    font-size: 14px;
    font-weight: 700;
}

#item-pnl .items-pnl-body .col input[type] {
    text-align: center;
}

#item-pnl .items-pnl-body .col .firstCol {
    text-align: left !important;
}

#item-pnl .prc,
#item-pnl .vat,
#item-pnl .discount,
#item-pnl .amnt {
    min-width: 0;
    height: 44px;
    padding-left: 10px;
    padding-right: 10px;
}

#item-pnl .items-pnl-body .input-group-addon {
    font-size: 12px;
    padding: 6px 8px;
    min-width: 44px;
}

.items-footer-tools {
    padding-top: 10px;
}

.items-footer-tools #add {
    display: flex;
    align-items: center;
    width: 100%;
    justify-content: flex-start;
    border: 1px dashed #bfdbfe !important;
    background: #f8fbff !important;
    box-shadow: none !important;
    border-radius: 8px;
    padding: 14px 18px;
    margin: 0;
    color: #2563eb;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    opacity: 1;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.items-footer-tools #add:hover,
.items-footer-tools #add:focus {
    color: #1d4ed8;
    background: #eff6ff !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.08) !important;
    text-decoration: none;
}

.card-action-btn--link {
    border: 0;
    background: transparent;
    padding: 6px 0;
    color: #2563eb;
    box-shadow: none;
}

.card-action-btn--link:hover,
.card-action-btn--link:focus {
    background: transparent;
    color: #1d4ed8;
}

.subtotal-tools {
    display: flex;
    align-items: center;
    gap: 12px;
}

.line-index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #eef4fb;
    color: #1d4ed8;
    font-weight: 800;
}

.line-total {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-height: 40px;
}

.line-total p {
    margin: 0 !important;
    white-space: nowrap;
}

.line-total-cell {
    position: relative;
}

.line-total-cell--removable {
    padding-right: 52px !important;
}

.line-total-cell--removable .remItem {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
}

.card-action-btn {
    border: 1px solid #d2dce8;
    border-radius: 8px;
    background: #ffffff;
    color: #1d4ed8;
    font-size: 13px;
    font-weight: 700;
    padding: 10px 14px;
}

.card-action-btn--ghost {
    color: #0f172a;
}

.card-action-btn:hover,
.card-action-btn:focus {
    background: #eef4fb;
    color: #1d4ed8;
}

.remItem,
.remTax {
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid #d7e0ea;
    border-radius: 8px;
    background: #ffffff;
    color: #0f172a;
}

.remItem:hover,
.remItem:focus,
.remTax:hover,
.remTax:focus {
    background: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
}

.totals-wrap {
    margin-top: 8px;
}

.tax-tools {
    padding-top: 10px;
}

.tax-add-btn {
    display: inline-flex;
    font-size: 12px;
    border: 0px;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    color: #0f172a;
    font-weight: 800;
    opacity: 0.78;
}

.tax-add-btn:hover,
.tax-add-btn:focus {
    opacity: 1;
    color: #0f172a;
    background: transparent;
}

#tax-row {
    margin-bottom: 12px;
}

.tax-entry {
    margin: 10px 0 0;
    display: grid;
    grid-template-columns: 42px minmax(120px, 1fr) minmax(140px, 1fr);
    gap: 10px;
    align-items: center;
}

.tax-entry > [class*="col"] {
    width: auto;
    padding: 0;
}

.tax-entry .input-group {
    flex-wrap: nowrap;
}

.tax-entry__remove {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 8px;
    border: 1px solid #d7e0ea;
    color: #475569;
    line-height: 1;
    font-size: 18px;
}

.totals-subtotal-row {
    padding: 10px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
}

.subtotalCap {
    margin: 0;
    font-size: 14px;
    line-height: 32px;
    color: #0f172a;
    text-align: right;
}

.subtotal-tools .subtotalCap {
    text-align: left;
}

.subtotalCap span {
    font-weight: 700;
}

.lightMode {
    font-weight: 700 !important;
}

.totalbill-row {
    background: linear-gradient(135deg, #133868 0%, #0f294c 100%);
    padding: 14px 16px;
    text-align: left;
    overflow: hidden;
    color: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(15, 41, 76, 0.18);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.totalbill-row h1 {
    margin: 0;
    font-size: 16px;
    line-height: 1;
    text-transform: uppercase;
    font-weight: 800;
}

.totalbill-row > [class*="col-"] {
    width: auto;
    flex: 0 0 auto;
}

.totalbill-row > [class*="col-"]:last-child {
    margin-left: auto;
    text-align: right;
}

.preview-card .summary-badge,
.summary-badge {
    padding: 6px 10px;
    border-radius: 8px;
    background: #eaf7ef;
    color: #15803d;
    font-size: 12px;
    font-weight: 700;
}

.invoice-preview__sheet {
    padding: 18px;
    border-radius: 8px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid #e1e9f2;
}

.invoice-preview__accent {
    height: 6px;
    margin: -18px -18px 18px;
    border-radius: 8px 8px 0 0;
    background: #003399;
}

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

.invoice-preview__type {
    display: inline-block;
    margin-bottom: 8px;
    color: #4b5d73;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.invoice-preview__meta strong {
    display: block;
    font-size: 16px;
    line-height: 1.2;
    color: #0f172a;
}

.invoice-preview__logo {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 92px;
    width: 92px !important;
    height: 92px !important;
    border-radius: 8px;
    border: 1px dashed #c7d5e4;
    background: #f8fafc;
    color: #7b8794;
    font-size: 12px;
    font-weight: 700;
    background-size: contain !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
}

.invoice-preview__logo.has-image {
    border-style: solid;
    background-color: #ffffff;
}

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

.invoice-preview__block {
    padding: 10px 12px;
    border-radius: 8px;
    background: #f8fbff;
}

.invoice-preview__block--wide {
    grid-column: 1 / -1;
}

.summary-card__label {
    display: block;
    margin-bottom: 4px;
    color: #748295;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.invoice-preview__block strong,
.summary-card__total strong {
    color: #102a43;
    font-size: 12px;
}

.summary-card__total {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #dde5ee;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.summary-card__total span:first-child {
    color: #425466;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

.logo-uploader input[type="file"] {
    display: none;
}

.logo-uploader__target {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 150px;
    border: 1px dashed #c9d4df;
    border-radius: 8px;
    background: #f8fbff;
    text-align: center;
    cursor: pointer;
    color: #64748b;
}

.logo-uploader__target strong {
    color: #0f172a;
}

.logo-uploader__icon {
    font-size: 24px;
}

.accent-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.accent-swatch {
    width: 32px;
    height: 32px;
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 0;
    cursor: pointer;
}

.accent-swatch.is-active {
    border-color: #0f172a;
}

.accent-swatch--custom {
    position: relative;
    overflow: hidden;
    border-radius: 999px;
    border-color: #ffffff;
    background: conic-gradient(#ff0033, #ff8a00, #ffd600, #00c853, #00b0ff, #7c4dff, #e040fb, #ff0033);
    box-shadow: 0 0 0 1px #cbd5e1;
}

.accent-swatch--custom .accent-swatch__fill {
    display: none;
}

.accent-swatch--custom::after {
    content: "";
    position: absolute;
    inset: 7px;
    border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, 0.92);
    background: transparent;
    pointer-events: none;
}

.accent-swatch--custom.is-active,
.accent-swatch--custom:focus-visible {
    box-shadow: 0 0 0 2px #0f172a, 0 0 0 5px rgba(59, 130, 246, 0.25);
}

.accent-swatch--custom .pcr-button {
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 999px;
    background: transparent !important;
    box-shadow: none !important;
}

.accent-swatch--custom .pcr-button::before,
.accent-swatch--custom .pcr-button::after {
    display: none !important;
}

.sidebar-divider {
    height: 1px;
    margin: 6px 0 18px;
    background: #e2e8f0;
}

.sidebar-help {
    margin: -4px 0 0;
    color: #64748b;
    font-size: 13px;
    line-height: 1.6;
}

.notes-box {
    margin-top: 16px;
}

.action-panel__header p {
    max-width: 540px;
    margin: 8px 0 0;
    color: #64748b;
    line-height: 1.6;
}

.action-panel__header h2 {
    font-size: 17px;
    font-weight: 800;
}

.action-panel__controls {
    display: grid;
    grid-template-columns: 1fr minmax(420px, 520px);
    gap: 18px;
    align-items: end;
}

.draft-status {
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
}

.draft-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.draft-btn {
    min-width: 110px;
    height: 40px;
    border-radius: 8px;
    border: 1px solid #d7e0ea;
    background: #ffffff;
    color: #0f172a;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 0 12px;
}

.draft-btn:hover,
.draft-btn:focus {
    background: #eef4fb;
    color: #0f172a;
}

#clearDraftBtn {
    border: 1px solid #fca5a5;
    color: #dc2626;
}

#clearDraftBtn:hover {
    background: #fef2f2;
}

.action-panel__buttons .form-group {
    margin-bottom: 0;
}

.action-panel__buttons {
    margin-left: 0;
    margin-right: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.action-panel__buttons > [class*="col-"] {
    float: none;
    width: auto;
    padding-left: 0;
    padding-right: 0;
    flex: 0 0 180px;
    max-width: 180px;
}

.sub-btn {
    height: 50px;
    width: 100%;
    min-width: 180px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.2;
    text-transform: none;
    border: 0;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sub-btn--primary {
    background: linear-gradient(135deg, #153e75 0%, #0f2b4c 100%);
    color: #ffffff;
}

.sub-btn--primary:hover,
.sub-btn--primary:focus {
    background: linear-gradient(135deg, #1a4b8d 0%, #123459 100%);
    color: #ffffff;
}

.sub-btn--secondary {
    background: #ffffff;
    color: #0f172a;
    border: 1px solid #c9d5e3;
    box-shadow: none;
}

.sub-btn--secondary:hover,
.sub-btn--secondary:focus {
    background: #f8fbff;
    color: #0f172a;
}

footer {
    margin-top: 30px;
    padding: 20px 0;
    background: linear-gradient(135deg, #0f2340 0%, #14335a 55%, #102947 100%);
    color: #ffffff;
}

footer p {
    margin: 0;
    font-size: 13px;
}

footer p a {
    color: #ffffff;
}

.history-header p,
.sending-panel h4,
.preview-panel p,
.preview-msg p,
.app-card p {
    color: #64748b;
}

.history-table {
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
}

.history-table thead th {
    border-bottom: 1px solid #dbe4ed;
    color: #0f172a;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.history-table tbody tr + tr {
    border-top: 1px solid #edf2f7;
}

.history-subtle {
    color: #64748b;
    font-size: 12px;
    margin-top: 4px;
}

.history-status {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 8px;
    background: #eef4fb;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.status-emailed {
    background-color: #dcfce7;
    color: #15803d;
}

.status-generated,
.status-prepared,
.status-email_pending {
    background-color: #dbeafe;
    color: #1d4ed8;
}

.preview-panel {
    padding: 18px;
}

.preview-msg-pnl {
    background-color: #f4f7fb;
    padding: 12px;
    border-radius: 8px;
}

.preview-msg {
    background-color: #ffffff;
    padding: 0 0 16px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.preview-msg h2 {
    font-size: 16px;
    padding: 14px;
    background-color: #f8fafc;
}

.preview-msg p {
    margin: 0 14px 8px;
    font-size: 13px;
    line-height: 1.7;
}

input.error,
textarea.error,
select.error {
    border-color: #dc2626 !important;
}

label.error {
    display: none !important;
}

@media (max-width: 1100px) {
    .workspace-grid {
        grid-template-columns: 1fr;
    }

    .workspace-sidebar {
        order: -1;
    }
}

@media (max-width: 991px) {
    .header-shell {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-side {
        margin-left: 0;
    }

    .action-panel__controls {
        grid-template-columns: 1fr;
    }

    .action-panel__buttons {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .invoice-preview__grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    .container,
    .app-page {
        padding-left: 12px;
        padding-right: 12px;
    }

    .header-shell {
        min-height: auto;
    }

    .brand-copy h1 {
        font-size: 28px;
    }

    .header-meta span {
        display: inline;
    }

    .app-card,
    .preview-panel,
    .history-panel,
    .emailForm-panel,
    .sending-panel,
    .setting-panel,
    #paper-wrapper {
        padding: 16px;
    }

    .section-header {
        flex-direction: column;
    }

    .document-type-switch {
        width: 100%;
        justify-content: space-between;
        padding: 3px;
    }

    .invoice-preview__hero {
        flex-direction: column;
    }

    .invoice-preview__logo {
        width: 100% !important;
    }

    .draft-tools {
        flex-direction: column;
    }

    .draft-btn {
        width: 100%;
    }

    .action-panel__buttons > [class*="col-"] {
        flex: 1 1 100%;
        max-width: 100%;
    }

    .sub-btn {
        min-width: 0;
    }

    footer .d-flex {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

/* Compactness pass */
.app-card,
.preview-panel,
.history-panel,
.emailForm-panel,
.sending-panel,
.setting-panel {
    padding: 18px;
}

.section-header {
    margin-bottom: 16px;
}

.section-kicker {
    font-size: 10px;
    margin-bottom: 4px;
}

.section-header h2,
.history-header h2,
.sending-panel h2,
.preview-msg h2 {
    font-size: 17px;
    line-height: 1.2;
}

.section-subheader h3 {
    font-size: 15px;
}

.form-group {
    margin-bottom: 16px;
}

.caption {
    font-size: 11px;
    margin-bottom: 7px;
}

.form-control {
    height: 42px;
    font-size: 13px;
}

.form-select {
    height: 42px;
    font-size: 13px;
    padding-right: 2.25rem;
    background-position: right 0.75rem center;
    background-size: 14px 10px;
}

textarea.form-control {
    min-height: 80px;
    padding-top: 10px;
}

.party-card textarea.form-control {
    min-height: 72px;
}

#item-pnl textarea.form-control,
.item-description.form-control {
    min-height: 54px;
}

.document-type-btn {
    font-size: 11px;
    padding: 6px 14px;
}

#item-pnl .items-pnl-head .col {
    padding: 10px 8px;
    font-size: 11px;
}

#item-pnl .items-pnl-body .col {
    padding: 12px 8px;
}

#item-pnl .line-index {
    font-size: 12px;
}

#item-pnl .prc,
#item-pnl .vat,
#item-pnl .discount,
#item-pnl .amnt {
    height: 40px;
    padding-left: 8px;
    padding-right: 8px;
}

#item-pnl .items-pnl-body .input-group-addon {
    min-width: 38px;
    padding-left: 6px;
    padding-right: 6px;
    font-size: 11px;
}

#add.card-action-btn--link {
    font-size: 13px;
    line-height: 1;
    font-weight: 500;
}

.card-action-btn--link {
    padding: 4px 0;
}

.subtotalCap {
    font-size: 13px;
    line-height: 28px;
}

.summary-badge,
.section-tag {
    font-size: 11px;
}

.logo-uploader__target strong,
.logo-uploader__target span {
    font-size: 12px;
}

.accent-swatch {
    width: 28px;
    height: 28px;
}

.accent-swatch--custom {
    width: 30px;
    height: 30px;
}

.accent-swatch--custom::after {
    font-size: 11px;
}

.draft-btn {
    min-width: 104px;
    height: 36px;
    font-size: 11px;
    padding: 0 10px;
}

.sub-btn {
    height: 48px;
    font-size: 13px;
}

.flatpickr-calendar {
    border-radius: 8px;
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.14);
    font-size: 12px;
    width: auto;
    min-width: 0;
    padding: 4px;
}

.flatpickr-months .flatpickr-month,
.flatpickr-current-month {
    height: 34px;
}

.flatpickr-current-month {
    padding-top: 4px;
    font-size: 11px;
}

.flatpickr-weekdays {
    height: 24px;
}

.flatpickr-weekday {
    font-size: 10px;
    font-weight: 700;
}

.flatpickr-day {
    height: 30px;
    line-height: 30px;
    max-width: 30px;
    font-size: 11px;
}

.flatpickr-monthDropdown-months,
.flatpickr-current-month input.cur-year,
.numInputWrapper span {
    font-size: 11px;
}

.flatpickr-rContainer,
.flatpickr-days,
.dayContainer {
    width: auto !important;
    min-width: 0;
}

.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
    padding: 4px;
}

.party-card .form-floating {
    margin-bottom: 16px;
}

.party-card .form-floating > .form-control,
.party-card .form-floating > .form-control-plaintext,
.party-card .form-floating > .form-select {
    height: 48px;
    min-height: 48px;
    padding: 1rem 0.875rem 0.375rem;
}

.party-card .form-floating > textarea.form-control {
    min-height: 88px;
    height: 88px;
    padding-top: 1.15rem;
}

.party-card .form-floating > label {
    padding: 0.8rem 0.875rem;
    color: #64748b;
    font-size: 12px;
}

.party-card .form-floating > .form-control:focus ~ label,
.party-card .form-floating > .form-control:not(:placeholder-shown) ~ label,
.party-card .form-floating > textarea.form-control:focus ~ label,
.party-card .form-floating > textarea.form-control:not(:placeholder-shown) ~ label {
    color: #475569;
    transform: scale(0.82) translateY(-0.62rem) translateX(0.08rem);
}
