/**
 * FakturaIhned.cz — Hlavní styly
 * Moderní, čistý, minimalistický design
 * Mobile-first přístup
 */

/* === RESET & BASE === */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Barvy */
    --color-primary: #2563eb;
    --color-primary-hover: #1d4ed8;
    --color-primary-light: #eff6ff;
    --color-success: #16a34a;
    --color-success-light: #f0fdf4;
    --color-warning: #d97706;
    --color-warning-light: #fffbeb;
    --color-danger: #dc2626;
    --color-danger-light: #fef2f2;

    --color-text: #1e293b;
    --color-text-secondary: #64748b;
    --color-text-muted: #94a3b8;
    --color-bg: #f8fafc;
    --color-white: #ffffff;
    --color-border: #e2e8f0;
    --color-border-focus: #2563eb;

    /* Typografie */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;

    /* Rozměry */
    --radius: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);

    --header-height: 60px;
    --container-max: 1200px;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--color-primary);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
}

/* === CONTAINER === */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 1rem;
}

/* === HEADER === */
.site-header {
    background: var(--color-white);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-height);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
}

.logo-link {
    text-decoration: none;
    font-size: var(--font-size-xl);
    color: var(--color-text);
}
.logo-link:hover {
    text-decoration: none;
}
.logo-text strong {
    color: var(--color-primary);
}

.main-nav {
    display: none;
    align-items: center;
    gap: 1rem;
}

.nav-link {
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    padding: 0.5rem;
    border-radius: var(--radius);
    transition: color 0.2s;
}
.nav-link:hover {
    color: var(--color-text);
    text-decoration: none;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.nav-user-email {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}
.nav-link--logout {
    color: var(--color-danger);
}

/* Mobile menu button */
.mobile-menu-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}
.mobile-menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--color-text);
    border-radius: 1px;
    transition: transform 0.2s;
}

@media (min-width: 768px) {
    .main-nav {
        display: flex;
    }
    .mobile-menu-toggle {
        display: none;
    }
}

/* Mobile nav open */
.main-nav.is-open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--color-white);
    border-bottom: 1px solid var(--color-border);
    padding: 1rem;
    box-shadow: var(--shadow-md);
}

/* === MAIN CONTENT === */
.main-content {
    flex: 1;
    padding: 1.5rem 0;
}

/* === BUTTONS === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: 500;
    line-height: 1.5;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    white-space: nowrap;
}
.btn:hover {
    text-decoration: none;
}

.btn--primary {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}
.btn--primary:hover {
    background: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
}

.btn--secondary {
    background: var(--color-white);
    color: var(--color-text);
    border-color: var(--color-border);
}
.btn--secondary:hover {
    background: var(--color-bg);
    border-color: var(--color-text-muted);
}

.btn--outline {
    background: transparent;
    color: var(--color-primary);
    border-color: var(--color-primary);
}
.btn--outline:hover {
    background: var(--color-primary-light);
}

.btn--sm {
    padding: 0.375rem 0.75rem;
    font-size: var(--font-size-xs);
}
.btn--lg {
    padding: 0.75rem 1.5rem;
    font-size: var(--font-size-base);
}
.btn--block {
    width: 100%;
}
.btn-icon {
    font-size: 1.1em;
}

.btn:disabled, .btn.is-loading {
    opacity: 0.6;
    cursor: not-allowed;
}

/* === FORM ELEMENTS === */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--color-text);
    margin-bottom: 0.375rem;
}

.required {
    color: var(--color-danger);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="url"],
input[type="tel"],
input[type="file"],
select,
textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    color: var(--color-text);
    background: var(--color-white);
    transition: border-color 0.2s, box-shadow 0.2s;
    line-height: 1.5;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--color-border-focus);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

input::placeholder,
textarea::placeholder {
    color: var(--color-text-muted);
}

textarea {
    resize: vertical;
    min-height: 80px;
}

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}

small {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

.field-message {
    display: block;
    font-size: var(--font-size-xs);
    margin-top: 0.25rem;
}
.field-message.is-error {
    color: var(--color-danger);
}
.field-message.is-success {
    color: var(--color-success);
}
.field-message.is-loading {
    color: var(--color-text-muted);
}

.input-with-btn {
    display: flex;
    gap: 0.5rem;
}
.input-with-btn input {
    flex: 1;
}

.form-group--inline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--font-size-sm);
    cursor: pointer;
}
.checkbox-label input[type="checkbox"] {
    width: auto;
    cursor: pointer;
}

/* === FORM CARD === */
.form-card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
}

.form-card__title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--color-text);
}
.form-card__desc {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    margin-bottom: 1rem;
    margin-top: -0.5rem;
}

.form-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.form-card__header .form-card__title {
    margin-bottom: 0;
}

/* === FORM ROWS === */
.form-row--two-cols {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}
.form-row--two-cols-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.form-row--three-cols {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 768px) {
    .form-row--two-cols {
        grid-template-columns: 1fr 1fr;
    }
    .form-row--three-cols {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

/* === INVOICE PAGE LAYOUT === */
.invoice-page {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    gap: 1.5rem;
}

.invoice-form-container {
    flex: 1;
    min-width: 0;
}

/* === INVOICE TYPE TABS === */
.form-topbar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem 1.5rem;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

@media (min-width: 768px) {
    .form-topbar {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.invoice-type-tabs {
    display: flex;
    gap: 0.25rem;
    background: var(--color-bg);
    border-radius: var(--radius);
    padding: 0.25rem;
}

.type-tab {
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.type-tab:hover {
    color: var(--color-text);
}
.type-tab.active {
    background: var(--color-white);
    color: var(--color-primary);
    box-shadow: var(--shadow-sm);
}

/* === VAT TOGGLE === */
.vat-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.toggle-label {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--color-text);
}
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-border);
    border-radius: 24px;
    transition: 0.3s;
}
.toggle-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}
.toggle-switch input:checked + .toggle-slider {
    background: var(--color-primary);
}
.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

/* VAT fields visibility */
.vat-field {
    display: none;
}
body.is-vat-payer .vat-field {
    display: block;
}
/* pro tabulku taky */
body.is-vat-payer .items-input-table .vat-field,
body.is-vat-payer .items-input-table td.vat-field {
    display: table-cell;
}

/* === ITEMS TABLE === */
.items-table-wrapper {
    overflow-x: auto;
    margin-bottom: 1rem;
}

.items-input-table {
    width: 100%;
    border-collapse: collapse;
}

.items-input-table th {
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.75rem 0.5rem;
    text-align: left;
    border-bottom: 2px solid var(--color-border);
    white-space: nowrap;
}

.items-input-table td {
    padding: 0.5rem 0.25rem;
    vertical-align: top;
}

.items-input-table input,
.items-input-table select {
    font-size: var(--font-size-sm);
    padding: 0.5rem;
}

.col-desc { min-width: 200px; }
.col-qty { width: 90px; }
.col-unit { width: 90px; }
.col-price { width: 110px; }
.col-vat { width: 80px; }
.col-total { width: 100px; text-align: right; }
.col-action { width: 40px; text-align: center; }

.line-total {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-text);
    white-space: nowrap;
}

.btn-remove-item {
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius);
    transition: color 0.2s;
    line-height: 1;
}
.btn-remove-item:hover {
    color: var(--color-danger);
}

#addItemBtn {
    margin-top: 0.5rem;
}

/* === INVOICE SUMMARY === */
.invoice-summary {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 2px solid var(--color-border);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
}

.summary-row {
    display: flex;
    align-items: center;
    gap: 2rem;
    min-width: 280px;
    justify-content: space-between;
}

.summary-label {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

.summary-value {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--color-text);
    min-width: 120px;
    text-align: right;
}

.summary-row--total {
    padding-top: 0.5rem;
    border-top: 1px solid var(--color-border);
}
.summary-row--total .summary-label {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--color-text);
}
.summary-row--total .summary-value {
    font-size: var(--font-size-2xl);
    color: var(--color-primary);
}

/* === COLLAPSIBLE SECTIONS === */
.form-card--collapsible {
    padding: 0;
}
.collapse-toggle {
    width: 100%;
    padding: 1rem 1.5rem;
    border: none;
    background: none;
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    color: var(--color-primary);
    cursor: pointer;
    text-align: left;
    font-weight: 500;
}
.collapse-toggle:hover {
    background: var(--color-primary-light);
}
.collapse-content {
    display: none;
    padding: 0 1.5rem 1.5rem;
}
.collapse-content.is-open {
    display: block;
}

/* === FORM ACTIONS === */
.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    position: sticky;
    bottom: 0;
    z-index: 10;
}

@media (max-width: 767px) {
    .form-actions {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        border-radius: 0;
        margin: 0;
        box-shadow: var(--shadow-lg);
        justify-content: center;
    }
    .form-actions .btn--lg {
        flex: 1;
        min-width: 0;
        padding: 0.625rem 0.75rem;
        font-size: var(--font-size-sm);
    }
}

/* === PREVIEW PANEL === */
.invoice-preview-panel {
    display: none;
    width: 420px;
    flex-shrink: 0;
    position: sticky;
    top: calc(var(--header-height) + 1.5rem);
    max-height: calc(100vh - var(--header-height) - 3rem);
    overflow-y: auto;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.preview-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--color-border);
}
.preview-header h3 {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.preview-content {
    padding: 1rem;
    font-size: 0.65rem;
    line-height: 1.4;
}

.preview-placeholder {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--color-text-muted);
}

@media (min-width: 1280px) {
    .invoice-preview-panel {
        display: block;
    }
}

/* Mobile preview button */
.btn-preview-mobile {
    display: none;
    position: fixed;
    bottom: 80px;
    right: 1rem;
    padding: 0.75rem 1.25rem;
    background: var(--color-text);
    color: white;
    border: none;
    border-radius: 50px;
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: 500;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    z-index: 20;
}

@media (max-width: 1279px) {
    .btn-preview-mobile {
        display: block;
    }
}
@media (min-width: 1280px) {
    .btn-preview-mobile {
        display: none;
    }
}

/* === CONTACT SELECT === */
.contact-select {
    max-width: 200px;
    font-size: var(--font-size-xs);
    padding: 0.375rem 0.625rem;
}

/* === MODALS === */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.modal-overlay.is-open {
    display: flex;
}

.modal {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
}
.modal--sm {
    max-width: 400px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--color-border);
}
.modal-header h3 {
    font-size: var(--font-size-lg);
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
}
.modal-close:hover {
    color: var(--color-text);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--color-border);
}

.email-copy-input {
    max-width: 200px;
}

.cta-benefits ul {
    list-style: none;
    margin-top: 1rem;
}
.cta-benefits li {
    padding: 0.375rem 0;
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}
.cta-benefits li::before {
    content: '✓ ';
    color: var(--color-success);
    font-weight: 700;
}

/* === ALERTS === */
.alert {
    padding: 0.875rem 1.25rem;
    border-radius: var(--radius);
    font-size: var(--font-size-sm);
    margin-bottom: 1rem;
}
.alert--error {
    background: var(--color-danger-light);
    color: var(--color-danger);
    border: 1px solid #fecaca;
}
.alert--success {
    background: var(--color-success-light);
    color: var(--color-success);
    border: 1px solid #bbf7d0;
}
.alert--warning {
    background: var(--color-warning-light);
    color: var(--color-warning);
    border: 1px solid #fde68a;
}

/* === AUTH PAGES === */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 3rem;
}

.auth-card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow);
}

.auth-title {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-align: center;
}
.auth-subtitle {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-footer {
    text-align: center;
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    margin-top: 1.5rem;
}

.link-forgot {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}
.link-forgot:hover {
    color: var(--color-primary);
}

/* === DASHBOARD === */
.page-title {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.stats-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
@media (min-width: 768px) {
    .stats-row {
        grid-template-columns: repeat(3, 1fr);
    }
}

.stat-card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow-sm);
}
.stat-value {
    display: block;
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--color-text);
}
.stat-label {
    display: block;
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    margin-top: 0.25rem;
}
.stat-card--warning .stat-value { color: var(--color-warning); }
.stat-card--danger .stat-value { color: var(--color-danger); }

.dashboard-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 0.25rem;
}
.filter-tab {
    padding: 0.375rem 0.75rem;
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    border-radius: 6px;
    transition: all 0.2s;
}
.filter-tab:hover {
    text-decoration: none;
    color: var(--color-text);
}
.filter-tab.active {
    background: var(--color-primary);
    color: white;
}

/* === DATA TABLE === */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.data-table th {
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.875rem 1rem;
    text-align: left;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
}

.data-table td {
    padding: 0.875rem 1rem;
    font-size: var(--font-size-sm);
    border-bottom: 1px solid var(--color-border);
}
.data-table tr:last-child td {
    border-bottom: none;
}

.cell-number {
    font-weight: 600;
}
.cell-amount {
    font-weight: 600;
    white-space: nowrap;
}

.cell-actions {
    display: flex;
    gap: 0.75rem;
    white-space: nowrap;
}

.action-link {
    font-size: var(--font-size-xs);
    font-weight: 500;
    color: var(--color-primary);
}
.action-link--success { color: var(--color-success); }
.action-link--danger { color: var(--color-danger); }

/* === BADGES === */
.badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    border-radius: 50px;
    font-size: var(--font-size-xs);
    font-weight: 600;
}
.badge--gray { background: #f1f5f9; color: #475569; }
.badge--blue { background: #eff6ff; color: #2563eb; }
.badge--green { background: #f0fdf4; color: #16a34a; }
.badge--red { background: #fef2f2; color: #dc2626; }
.badge--dark { background: #1e293b; color: white; }

/* === EMPTY STATE === */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
}
.empty-state p {
    font-size: var(--font-size-base);
    color: var(--color-text-secondary);
    margin-bottom: 1.5rem;
}

/* === SETTINGS === */
.settings-page {
    max-width: 800px;
}
.settings-form {
    margin-bottom: 1.5rem;
}
.current-logo {
    margin-bottom: 1rem;
}
.logo-preview {
    max-width: 200px;
    max-height: 80px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 0.5rem;
}

/* === FOOTER === */
.site-footer {
    margin-top: auto;
    background: var(--color-white);
    border-top: 1px solid var(--color-border);
    padding: 2rem 0;
}

.footer-inner {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    text-align: center;
}
@media (min-width: 768px) {
    .footer-inner {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }
}

.footer-brand {
    font-size: var(--font-size-lg);
    color: var(--color-text);
}
.footer-brand strong {
    color: var(--color-primary);
}
.footer-desc {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    margin-top: 0.25rem;
}
.footer-right {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

/* === LOADING SPINNER === */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* === PRINT STYLES === */
@media print {
    .site-header,
    .site-footer,
    .form-topbar,
    .form-actions,
    .btn-preview-mobile,
    .modal-overlay,
    .invoice-form-container {
        display: none !important;
    }
    .invoice-preview-panel {
        display: block !important;
        width: 100% !important;
        position: static !important;
        max-height: none !important;
        border: none !important;
        box-shadow: none !important;
    }
    body {
        background: white;
    }
}
