/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: #333;
    overflow-x: hidden;
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: all 0.3s ease;
}

.nav-container {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

/* Logo left; nav links + language + mobile controls grouped on the right */
.nav-right-cluster {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    flex-shrink: 0;
    min-width: 0;
}

.nav-right-cluster .language-selector {
    margin-left: 0;
}

/* Pilns platums kā .selected-language (left:auto+right:0 sarauž līdz karogiem) */
.nav-right-cluster .language-selector .custom-language-dropdown {
    display: inline-block;
    vertical-align: middle;
}

.nav-right-cluster .language-selector .language-options {
    left: 0;
    right: 0;
    width: 100%;
    min-width: 100%;
    box-sizing: border-box;
}

/* Guest desktop: Cenas · Kontakti | valoda | Reģistrēties · Autorizēties */
.nav-guest-cluster {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.nav-guest-cluster .nav-menu {
    margin-left: 0;
}

.nav-menu-guest-links,
.nav-menu-guest-auth {
    gap: 15px;
}

/* Ielogots: mobilajā otra valodas instance (pirmā ir .nav-menu, kas tiek paslēpts) */
.language-nav-logged-mobile {
    display: none !important;
    align-items: center;
}

@media (max-width: 1000px) {
    .nav-container.logged-in-option .language-nav-logged-mobile {
        display: flex !important;
    }
    .nav-container.logged-in-option .mobile-user-controls .user-avatar {
        display: none !important;
    }
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
    font-weight: 700;
    color: #0B1E3F;
    cursor: pointer;
    transition: color 0.3s ease;
}

.nav-logo:hover {
    color: #4a2270;
}

.nav-logo i {
    font-size: 28px;
}

.nav-logo-img {
    height: 35px;
    width: auto;
    object-fit: contain;
    margin-left:0px;
}

/* Desktop: full logo; mobile: icon only (switched in @media below) */
.nav-logo-mobile {
    display: none;
}

/* Language Selector next to logo */
.language-selector .custom-language-dropdown {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.language-selector .selected-language {
    background: transparent;
    border: 1px solid rgba(100, 116, 139, 0.3);
    border-radius: 8px;
    padding: 9px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 72px;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}

.language-selector .selected-language:hover {
    border-color: rgba(100, 116, 139, 0.5);
}

.language-selector .flag-icon {
    width: 25px;
    height: 20px;
    border-radius: 2px;
    object-fit: cover;
}

.language-selector .dropdown-arrow {
    margin-left: auto;
    font-size: 12px;
    color: #64748b;
    transition: transform 0.2s ease;
}

.language-selector .custom-language-dropdown.active .dropdown-arrow {
    transform: rotate(180deg);
}

.language-selector .language-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    min-width: 100%;
    box-sizing: border-box;
    background: #ffffff;
    border: 1px solid rgba(100, 116, 139, 0.2);
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: none;
    margin-top: 4px;
}

.language-selector .custom-language-dropdown.active .language-options {
    display: block;
}

.language-selector .language-option {
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
    height: 40px;
}

.language-selector .language-option:hover {
    background-color: rgba(100, 116, 139, 0.1);
}

.language-selector .language-option:first-child {
    border-radius: 8px 8px 0 0;
}

.language-selector .language-option:last-child {
    border-radius: 0 0 8px 8px;
}

.language-selector .language-option:only-child {
    border-radius: 8px;
}

/* Company Selector Styles - Match Language Selector Exactly */
.company-selector {
    position: relative;
    display: flex;
    align-items: center;
    margin-right:-5px;
}


.company-selector .custom-company-dropdown {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.company-selector .selected-company {
    background: transparent;
    border: 1px solid rgba(100, 116, 139, 0.3);
    border-radius: 8px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 60px;
    transition: border-color 0.2s ease;
}

.company-selector .selected-company:hover {
    border-color: rgba(100, 116, 139, 0.5);
}

.company-selector .company-name-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
}

.company-selector .dropdown-arrow {
    margin-left: auto;
    font-size: 12px;
    color: #64748b;
    transition: transform 0.2s ease;
}

.company-selector .custom-company-dropdown.active .dropdown-arrow {
    transform: rotate(180deg);
}

.company-selector .company-options {
    position: absolute;
    top: 100%;
    left: 0;
    background: #ffffff;
    border: 1px solid rgba(100, 116, 139, 0.2);
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: none;
    margin-top: 4px;
    min-width: 150px;
    width: max-content;
}

.company-selector .custom-company-dropdown.active .company-options {
    display: block;
}

.company-selector .company-option {
    padding: 0 12px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    cursor: pointer;
    transition: background-color 0.2s ease;
    height: 40px;
    font-size: 12px;
    width: 100%;
    box-sizing: border-box;
}

.company-selector .company-option:hover {
    background-color: rgba(100, 116, 139, 0.1);
}

.company-selector .company-option.active {
    background-color: rgba(59, 130, 246, 0.1);
}

.company-selector .company-option.add-new-company {
    border-top: 1px solid rgba(100, 116, 139, 0.2);
    margin-top: 4px;
    padding-top: 0;
    font-weight:normal;
    color:#666;
}

.company-selector .company-option:first-child {
    border-radius: 8px 8px 0 0;
}

.company-selector .company-option:last-child {
    border-radius: 0 0 8px 8px;
}

.company-selector .company-option:only-child {
    border-radius: 8px;
}

/* Nav notifications bell (between company selector and avatar) */
.nav-notifications-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    margin-right: 8px;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    color: #64748b;
    transition: color 0.2s ease, background-color 0.2s ease;
}
.nav-notifications-wrap:hover {
    color: #0B1E3F;
    background-color: rgba(37, 99, 235, 0.08);
}
.nav-notifications-icon {
    font-size: 18px;
}
.nav-notifications-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    font-size: 10px;
    font-weight: 600;
    line-height: 16px;
    text-align: center;
    color: #fff;
    background: #ef4444;
    border-radius: 8px;
}
.nav-notifications-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 6px;
    width: 320px;
    max-height: 360px;
    background: #fff;
    border: 1px solid rgba(100, 116, 139, 0.2);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    z-index: 10001;
    display: none;
    overflow: hidden;
}
.nav-notifications-dropdown.active {
    display: flex;
    flex-direction: column;
}
.nav-notifications-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 14px;
    font-weight: 600;
    font-size: 14px;
    color: #1e293b;
    border-bottom: 1px solid #e2e8f0;
}
.nav-notifications-title {
    flex: 1;
}
.nav-notifications-mark-all {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, background 0.2s;
}
.nav-notifications-mark-all:hover:not(:disabled) {
    color: #16a34a;
    background: rgba(22, 163, 74, 0.1);
}
.nav-notifications-mark-all:disabled {
    opacity: 0.5;
    cursor: default;
    background: transparent !important;
    color: #64748b;
}
.nav-notifications-mark-all:disabled:hover {
    background: transparent !important;
    color: #64748b;
}
.nav-notifications-mark-all i {
    font-size: 14px;
}
.nav-notifications-admin-links {
    border-bottom: 1px solid #e2e8f0;
}
.nav-notifications-admin-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    text-decoration: none;
    color: #0B1E3F;
    font-size: 13px;
    font-weight: 600;
}
.nav-notifications-admin-link:hover {
    background: rgba(37, 99, 235, 0.06);
}
.nav-notifications-admin-link i {
    color: #2563eb;
    font-size: 14px;
}

/* Site trainings drag & drop */
.site-training-page .training-row-draggable.training-dragging { opacity: 0.6; background: #f3f4f6; }
.site-training-page .training-row-draggable.training-drag-over-before { box-shadow: 0 -4px 0 0 #3b82f6; }
.site-training-page .training-row-draggable.training-drag-over-after { box-shadow: 0 4px 0 0 #3b82f6; }
.site-training-page .training-drag-handle-cell { cursor: grab; text-align: center; color: #64748b; width: 42px; }
.site-training-page .training-drag-handle-cell:active { cursor: grabbing; }
.site-training-page .training-drag-handle i { font-size: 14px; }
.nav-notifications-list {
    overflow-y: auto;
    max-height: 280px;
}
.nav-notification-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 13px;
    color: #334155;
}
.nav-notification-item:last-child {
    border-bottom: none;
}
.nav-notification-message {
    flex: 1;
    word-break: break-word;
}

/* Invoice notification card: Rēķins + number left, status + amount right */
.nav-notification-invoice .nav-notification-message {
    min-width: 0;
}
.nav-notification-invoice-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
}
.nav-notification-invoice-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.nav-notification-invoice-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: #64748b;
    font-weight: 600;
}
.nav-notification-invoice-number {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    word-break: break-all;
}
.nav-notification-invoice-client {
    font-size: 11px;
    font-weight: 500;
    color: #64748b;
    line-height: 1.35;
    margin-top: 2px;
    word-break: break-word;
}
.nav-notification-invoice-right {
    flex-shrink: 0;
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: flex-end;
}
.nav-notification-invoice-status {
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.nav-notification-invoice-status--paid {
    color: #16a34a;
}
.nav-notification-invoice-status--partial {
    color: #ca8a04;
}
.nav-notification-invoice-amount-line {
    font-size: 11px;
    color: #64748b;
    font-weight: 500;
}
.nav-notification-invoice-amount--remaining {
    color: #94a3b8;
}

.nav-notification-mark-seen {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
}
.nav-notification-mark-seen:hover {
    color: #16a34a;
    background: rgba(22, 163, 74, 0.1);
}
.nav-notifications-empty {
    padding: 16px 14px;
    font-size: 13px;
    color: #64748b;
    text-align: center;
}
.nav-notifications-mobile .nav-notifications-dropdown {
    right: 0;
    left: auto;
}

/* Nav notifications – mobile */
@media (max-width: 768px) {
    .nav-notifications-mobile.nav-notifications-wrap {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
        margin-left: 4px;
        margin-right: 4px;
    }
    .nav-notifications-mobile .nav-notifications-icon {
        font-size: 20px;
    }
    .nav-notifications-mobile .nav-notifications-dropdown {
        position: fixed;
        top: calc(56px + env(safe-area-inset-top, 0px));
        left: max(12px, env(safe-area-inset-left));
        right: max(12px, env(safe-area-inset-right));
        width: auto;
        max-width: none;
        max-height: min(360px, 70vh);
        margin-top: 0;
        border-radius: 12px;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
        z-index: 10002;
    }
    .nav-notifications-mobile .nav-notifications-header {
        padding: 14px 16px;
        font-size: 15px;
    }
    .nav-notifications-mobile .nav-notifications-list {
        max-height: min(280px, 55vh);
        -webkit-overflow-scrolling: touch;
    }
    .nav-notifications-mobile .nav-notification-item {
        padding: 14px 16px;
        font-size: 14px;
        min-height: 48px;
    }
    .nav-notifications-mobile .nav-notification-invoice-number {
        font-size: 14px;
    }
    .nav-notifications-mobile .nav-notification-invoice-status {
        font-size: 13px;
    }
    .nav-notifications-mobile .nav-notification-mark-seen {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
    }
    .nav-notifications-mobile .nav-notifications-empty {
        padding: 20px 16px;
        font-size: 14px;
    }
    .nav-notifications-mobile .nav-notifications-dropdown.active {
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    }
}

/* Hide logo section when adding new company */
.add-new-company-mode .logo-upload-section,
.add-new-company-mode #logoUploadSection,
body.add-new-company-mode .logo-upload-section,
body.add-new-company-mode #logoUploadSection {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}

/* Also hide logo upload area and file input */
.add-new-company-mode #logoUploadArea,
.add-new-company-mode #logoFileInput,
body.add-new-company-mode #logoUploadArea,
body.add-new-company-mode #logoFileInput {
    display: none !important;
    visibility: hidden !important;
}


@media (max-width: 768px) {
    .company-selector {
        position: relative;
        margin-right:0;
    }
    .company-selector .selected-company {
        padding: 7px 12px;
    }
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: auto;
}

.nav-link {
    text-decoration: none;
    color: #64748b;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: #0B1E3F;
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-danger, .btn-success {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-size: 14px;
}

.btn-primary {
    background: linear-gradient(135deg, #0B1E3F, #4a2270);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #4a2270, #4a2270);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.3);
}

.btn-primary:disabled,
#save_invoice_button:disabled {
    background: #9ca3af !important;
    color: #ffffff !important;
    cursor: not-allowed !important;
    opacity: 0.6;
    transform: none !important;
    box-shadow: none !important;
}

.btn-primary:disabled:hover,
#save_invoice_button:disabled:hover {
    background: #9ca3af !important;
    transform: none !important;
    box-shadow: none !important;
}

/* Disabled buttons: cursor not-allowed */
button:disabled,
.btn-icon:disabled,
.btn-icon.disabled,
input[type="submit"]:disabled,
input[type="button"]:disabled {
    cursor: not-allowed !important;
}

.btn-secondary {
    background: white;
    color: #0B1E3F;
    border: 2px solid #0B1E3F;
}

.btn-secondary:hover {
    background: #0B1E3F;
    color: white;
    transform: translateY(-2px);
}

/* Icon-only buttons - hide text by default, show on hover */
.btn-icon-only {
    position: relative;
    min-width: auto;
    padding: 10px 12px !important;
    padding-right:8px !important;
    overflow: hidden;
}

.btn-icon-only .btn-text {
    display: inline-block;
    margin-left: 0;
    max-width: 0;
    opacity: 0;
    white-space: nowrap;
    transform: translateX(10px);
    transition: max-width 0.3s ease, margin-left 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
    overflow: hidden;
}

.btn-icon-only:hover {
    padding: 8px 16px !important;
    transform: none !important; /* Override default btn-secondary:hover transform - only on hover */
}

/* Icon-only without .btn-text: center icon, no hover expansion, only tooltip */
.btn-icon-only:not(:has(.btn-text)) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px !important;
}
.btn-icon-only:not(:has(.btn-text)):hover {
    padding: 10px !important;
}

.btn-icon-only:hover .btn-text {
    max-width: 200px;
    margin-left: 8px;
    opacity: 1;
    transform: translateX(0);
}

/* On smaller screens, keep text hidden even on hover and maintain fixed padding */
@media (max-width: 768px) {
    .btn-icon-only {
        padding: 10px 12px !important;
        padding-right:8px !important;
    }
    
    .btn-icon-only:hover {
        padding: 10px 12px !important;
        padding-right:8px !important;
    }
    
    .btn-icon-only:hover .btn-text {
        max-width: 0;
        margin-left: 0;
        opacity: 0;
        transform: translateX(10px);
    }
}

.btn-large {
    padding: 16px 32px;
    font-size: 16px;
}

/* Hero Section */
.hero {
    padding: 120px 0 80px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 24px;
    color: #1e293b;
}

.highlight {
    background: linear-gradient(135deg, #0B1E3F, #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    font-size: 1.25rem;
    color: #64748b;
    margin-bottom: 32px;
    line-height: 1.6;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    margin-bottom: 48px;
}

.hero-stats {
    text-align: center;
}

.stat {
    text-align: center;
    display: inline-block;
    margin:0 20px;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: #0B1E3F;
}

.stat-label {
    font-size: 0.875rem;
    color: #64748b;
    font-weight: 500;
}

/* Invoice Preview - A4 Paper Size with invoice.php styling */
.invoice-preview {
    background: white;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    /* A4 dimensions: 210mm × 297mm (ratio 1:1.414) */
    width: 100%;
    max-width: 420px; /* Scaled down for display */
    aspect-ratio: 210 / 297; /* A4 ratio */
    padding: 20px 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 
                0 2px 4px rgba(0, 0, 0, 0.06),
                0 0 0 1px rgba(0, 0, 0, 0.05);
    transform: rotate(3deg);
    transition: transform 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.08);
    position: relative;
    font-size: 10px;
    line-height: 1.4;
    color: #1a202c;
}

.invoice-preview::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, 
        rgba(0, 0, 0, 0.02) 0%,
        transparent 50%,
        rgba(0, 0, 0, 0.02) 100%);
    pointer-events: none;
}

.invoice-preview:hover {
    transform: rotate(0deg) scale(1.02);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.15), 
                0 4px 6px rgba(0, 0, 0, 0.1),
                0 0 0 1px rgba(0, 0, 0, 0.1);
}

/* Invoice Header - matching invoice.php */
.invoice-preview .invoice-header {
    width: 100%;
    margin-bottom: 10px;
    border-bottom: 2px solid #e5e7eb;
    position: relative;
    padding-bottom: 8px;
}

.invoice-preview .invoice-title-section {
    float: left;
    width: 50%;
}

.invoice-preview .invoice-title-section h1 {
    font-size: 24px;
    color: #111827;
    margin: 0 0 4px 0;
    font-weight: 700;
}

.invoice-preview .invoice-number {
    margin-top: -2px;
}

.invoice-preview .invoice-number .invoice-meta-label {
    font-size: 6px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.invoice-preview .invoice-number .invoice-meta-value {
    font-size: 9px;
    font-weight: 600;
    color: #111827;
}

.invoice-preview .invoice-meta {
    float: right;
    text-align: right;
    width: 45%;
    padding-top: 8px;
}

.invoice-preview .invoice-header::after {
    content: '';
    display: table;
    clear: both;
}

.invoice-preview .invoice-meta-item {
    margin-bottom: 4px;
}

.invoice-preview .invoice-meta-label {
    font-size: 6px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.invoice-preview .invoice-meta-value {
    font-size: 9px;
    font-weight: 600;
    color: #111827;
}

/* Invoice Parties - matching invoice.php */
.invoice-preview .invoice-parties {
    width: 100%;
    margin-bottom: 12px;
    display: table;
    table-layout: fixed;
}

.invoice-preview .invoice-party {
    display: table-cell;
    width: 50%;
    padding: 8px;
    background: #f9fafb;
    border-radius: 4px;
    vertical-align: top;
}

.invoice-preview .invoice-party:first-child {
    padding-right: 6px;
}

.invoice-preview .invoice-party:last-child {
    padding-left: 6px;
}

.invoice-preview .invoice-party-label {
    font-size: 6px;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 3px;
}

.invoice-preview .invoice-party-name {
    font-size: 10px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 2px;
}

.invoice-preview .invoice-party-info {
    font-size: 8px;
    color: #4b5563;
    line-height: 1.6;
    margin-bottom: 2px;
}

.invoice-preview .invoice-party-info:last-child {
    margin-bottom: 0;
}

/* Invoice Items Table - matching invoice.php */
.invoice-preview .invoice-items-table-wrapper {
    width: 100%;
    margin-bottom: 12px;
}

.invoice-preview .invoice-items-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 7px;
}

.invoice-preview .invoice-items-table thead {
    background: #f9fafb;
}

.invoice-preview .invoice-items-table th {
    text-align: left;
    padding: 3px 2px;
    font-size: 6px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.invoice-preview .invoice-items-table th:nth-child(2),
.invoice-preview .invoice-items-table th:nth-child(3),
.invoice-preview .invoice-items-table th:nth-child(6) {
    text-align: center;
}

.invoice-preview .invoice-items-table th:nth-child(4),
.invoice-preview .invoice-items-table th:nth-child(5),
.invoice-preview .invoice-items-table th:last-child {
    text-align: right;
}

.invoice-preview .invoice-items-table .text-center {
    text-align: center;
}

.invoice-preview .invoice-items-table .text-right {
    text-align: right;
}

.invoice-preview .invoice-items-table td {
    padding: 4px 2px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 8px;
    color: #111827;
}

.invoice-preview .invoice-items-table tbody tr:last-child td {
    border-bottom: none;
}

.invoice-preview .item-name {
    color: #111827;
    font-weight: 500;
}

.invoice-preview .item-qty,
.invoice-preview .item-unit,
.invoice-preview .item-vat {
    text-align: center;
}

.invoice-preview .item-price,
.invoice-preview .item-discount,
.invoice-preview .item-total {
    text-align: right;
    font-weight: 600;
}

/* Invoice Summary - matching invoice.php */
.invoice-preview .invoice-summary {
    margin-left: auto;
    width: 180px;
    background: #f9fafb;
    padding: 8px 12px;
    margin-bottom: 0;
}

.invoice-preview .summary-row {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
    font-size: 8px;
    color: #4b5563;
}

.invoice-preview .summary-label {
    text-align: left;
}

.invoice-preview .summary-value {
    text-align: right;
    font-weight: 500;
}

.invoice-preview .summary-row.summary-total {
    border-top: 1px solid #e5e7eb;
    font-size: 11px;
    font-weight: 700;
    color: #111827;
    padding-top: 6px;
    margin-top: 4px;
}

/* Invoice Amount in Words - matching invoice.php */
.invoice-preview .invoice-summary {
    position: relative;
}

.invoice-preview .invoice-amount-words {
    position: absolute;
    left: 0;
    bottom: 15px;
    margin-bottom: 0;
    z-index: 10;
    text-align: left;
    width:40%;
}

.invoice-preview .amount-words-title {
    font-size: 6px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 3px;
    font-weight: 600;
}

.invoice-preview .amount-words-body {
    font-size: 5px;
    color: #111827;
    font-weight: 500;
    font-style: italic;
}

/* Invoice Footer - matching invoice.php */
.invoice-preview .invoice-footer {
    padding-top: 8px;
    border-top: 1px solid #e5e7eb;
    margin-top: 8px;
}

.invoice-preview .invoice-footer-row {
    margin-bottom: 4px;
    font-size: 7px;
    color: #6b7280;
    line-height: 1.4;
}

.invoice-preview .invoice-footer-row p {
    margin: 0;
}

/* Features Section */
.features {
    padding: 100px 0;
    background: white;
}

.section-header {
    text-align: center;
    margin-bottom: 64px;
}

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 16px;
}

.section-header p {
    font-size: 1.125rem;
    color: #64748b;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 32px;
}

.feature-card {
    background: white;
    padding: 32px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.1);
    border-color: #0B1E3F;
}

.feature-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #0B1E3F, #7c3aed);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

.feature-icon i {
    font-size: 24px;
    color: white;
}

.feature-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 12px;
}

.feature-card p {
    color: #64748b;
    line-height: 1.6;
}

/* Demo Section */
.demo {
    padding: 100px 0;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.demo-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.demo-text h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 24px;
}

.demo-text p {
    font-size: 1.125rem;
    color: #64748b;
    margin-bottom: 32px;
}

.demo-features {
    list-style: none;
    margin-bottom: 32px;
}

.demo-features li {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    color: #64748b;
}

.demo-features i {
    color: #10b981;
    font-size: 16px;
}

.demo-video {
    display: flex;
    justify-content: center;
}

.video-placeholder {
    width: 100%;
    height: 300px;
    background: linear-gradient(135deg, #0B1E3F, #7c3aed);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.video-placeholder:hover {
    transform: scale(1.02);
}

.video-placeholder i {
    font-size: 4rem;
    margin-bottom: 16px;
}

.video-placeholder p {
    font-size: 1.25rem;
    font-weight: 600;
}

/* Pricing Section */
.pricing {
    padding: 100px 0;
    background: white;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
    margin-top: 64px;
}

.pricing-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 40px 32px;
    text-align: center;
    position: relative;
    transition: all 0.3s ease;
}

.pricing-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.1);
}

.pricing-card.featured {
    border-color: #0B1E3F;
    transform: scale(1.05);
}

.pricing-card.featured:hover {
    transform: scale(1.05) translateY(-8px);
}

.pricing-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #0B1E3F, #7c3aed);
    color: white;
    padding: 8px 24px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

.pricing-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 16px;
}

.price {
    margin-bottom: 32px;
}

.currency {
    font-size: 1.5rem;
    font-weight: 600;
    color: #64748b;
    vertical-align: top;
}

.amount {
    font-size: 3rem;
    font-weight: 700;
    color: #0B1E3F;
}

.period {
    font-size: 1rem;
    color: #64748b;
    font-weight: 500;
}

.pricing-features {
    list-style: none;
    margin-bottom: 32px;
}

.pricing-features li {
    display: flex;
    align-items: left;
    text-align:left;
    gap: 12px;
    margin-bottom: 12px;
    color: #64748b;
}

.pricing-features i {
    color: #10b981;
    font-size: 16px;
}

/* Contact Section */
.contact {
    padding: 100px 0;
    background: white;
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    margin-top: 64px;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.contact-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #0B1E3F, #7c3aed);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.contact-icon i {
    font-size: 20px;
}

.contact-details h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
}

.contact-details p {
    color: #64748b;
    line-height: 1.6;
}

.contact-form {
    background: #f8fafc;
    padding: 40px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: #1e293b;
    font-size: 0.875rem;
}

.form-group input,
.form-group textarea {
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #0B1E3F;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Validation states */
.form-group input.valid {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.form-group input.valid:focus {
    border-color: #059669;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

.form-group input.invalid {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-group input.invalid:focus {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

/* Testimonials Section */
.testimonials {
    padding: 100px 0;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 32px;
    margin-top: 64px;
}

.testimonial-card {
    background: white;
    padding: 32px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.testimonial-card:hover {
    transform: translateY(-4px);
}

.testimonial-content {
    margin-bottom: 24px;
}

.testimonial-content p {
    font-size: 1.125rem;
    color: #64748b;
    line-height: 1.6;
    font-style: italic;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 16px;
}

.author-avatar {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #0B1E3F, #7c3aed);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.author-info h4 {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
}

.author-info span {
    color: #64748b;
    font-size: 0.875rem;
}

/* About Us Section */
.about {
    padding: 120px 0;
    background: #fafbfc;
}

.about-content {
    margin-top: 80px;
    display: flex;
    flex-direction: column;
    gap: 80px;
}

.about-main {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.about-description {
    font-size: 1.125rem;
    color: #64748b;
    line-height: 1.9;
    margin-bottom: 64px;
    font-weight: 400;
    letter-spacing: -0.01em;
}

.about-mission,
.about-vision {
    margin-top: 56px;
    text-align: left;
    background: white;
    padding: 40px;
    border-radius: 16px;
    border: 1px solid #e8ecf0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.about-mission:hover,
.about-vision:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    border-color: #d1d9e0;
}

.about-mission h3,
.about-vision h3 {
    font-size: 1.375rem;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.about-mission p,
.about-vision p {
    font-size: 1rem;
    color: #475569;
    line-height: 1.75;
    font-weight: 400;
    letter-spacing: -0.01em;
}

.about-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-top: 0;
}

.about-item {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 32px;
    background: white;
    border: 1px solid #e8ecf0;
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.about-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, #0B1E3F, #7c3aed);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.about-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    border-color: #d1d9e0;
}

.about-item:hover::before {
    transform: scaleX(1);
}

.about-item-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #0B1E3F 0%, #0B1E3F 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.about-item:hover .about-item-icon {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.about-item-icon i {
    font-size: 20px;
}

.about-item-content {
    flex: 1;
}

.about-item-content h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 10px;
    letter-spacing: -0.01em;
    line-height: 1.4;
}

.about-item-content p {
    color: #64748b;
    line-height: 1.7;
    font-size: 0.9375rem;
    font-weight: 400;
    letter-spacing: -0.01em;
    margin: 0;
}

/* Footer */
.footer {
    background: #1e293b;
    color: white;
    padding: 60px 0 20px;
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    box-sizing: border-box;
    margin-top: auto;
    flex-shrink: 0;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
    font-weight: 700;
    color: #0B1E3F;
    margin-bottom: 16px;
}

.footer-logo i {
    font-size: 28px;
}

.footer-logo-img {
    height: 35px;
    width: auto;
    object-fit: contain;
}

.footer-section p {
    color: #94a3b8;
    margin-bottom: 24px;
    line-height: 1.6;
}

.footer-section h4 {
    font-weight: 600;
    margin-bottom: 20px;
    color: white;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 12px;
}

.footer-section ul li a {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: #0B1E3F;
}

.social-links {
    display: flex;
    gap: 16px;
}

.social-links a {
    width: 40px;
    height: 40px;
    background: #334155;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

.social-links a::after {
    content: attr(data-title);
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

.social-links a::before {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-bottom-color: #1e293b;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1001;
}

.social-links a:hover::after,
.social-links a:hover::before {
    opacity: 1;
}

.social-links a:hover {
    background: #0B1E3F;
    color: white;
}

.social-links a img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    filter: brightness(0) saturate(100%) invert(58%) sepia(8%) saturate(1352%) hue-rotate(182deg) brightness(96%) contrast(88%);
    transition: filter 0.3s ease;
}

.social-links a:hover img {
    filter: brightness(0) saturate(100%) invert(100%);
}

.footer-bottom {
    border-top: 1px solid #334155;
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #94a3b8;
}

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-links a {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #0B1E3F;
}

.mobile-menu {
    position: fixed;
    right: 0;
    top: 70px;
    width: 100%;
    max-width: 100%;
    max-height: calc(100vh - 70px);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.06);
    padding: 20px 0;
    z-index: 999;
    transition: all 0.3s ease;
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.mobile-menu.active {
    transform: translateX(0) !important;
    opacity: 1 !important;
    pointer-events: all !important;
}

.mobile-menu-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 12px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    min-height: 0;
}

/* Custom scrollbar styling for mobile menu */
.mobile-menu-content::-webkit-scrollbar {
    width: 6px;
}

.mobile-menu-content::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 10px;
}

.mobile-menu-content::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.mobile-menu-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

.mobile-menu .nav-link,
.mobile-menu .side-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #475569;
    text-decoration: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.mobile-menu .nav-link:hover,
.mobile-menu .side-menu-item:hover {
    background: rgba(37, 99, 235, 0.08);
    color: #0B1E3F;
}

.mobile-menu .nav-link i,
.mobile-menu .side-menu-item i {
    font-size: 16px;
    width: 20px;
    text-align: center;
    color: #64748b;
}

.mobile-menu .nav-link:hover i,
.mobile-menu .side-menu-item:hover i {
    color: #0B1E3F;
}

.mobile-menu .nav-link span,
.mobile-menu .side-menu-item span {
    flex: 1;
}

.mobile-menu .nav-link:last-child {
    border-bottom: none;
}

.user-info-nav {
    display: flex;
    align-items: center;
}

.user-name-nav {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-secondary:hover {
    background: #e5e7eb;
    color: #111827;
    border-color: #9ca3af;
}

/* Mobile User Info */
.mobile-user-info {
    padding: 0 20px 16px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    margin-bottom: 12px;
}

.user-name-mobile {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    display: block;
    margin-bottom: 4px;
}

.user-email-mobile {
    font-size: 12px;
    color: #94a3b8;
    display: block;
}

.mobile-menu-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 8px -32px;
}

/* Company selector inside right side mobile menu */
.mobile-menu-company-selector-wrap {
    padding: 8px 0 12px;
    margin: 0 -4px;
}
.mobile-menu .company-selector-in-menu {
    display: flex;
    align-items: center;
    width: 100%;
    margin: 0;
}
.mobile-menu .company-selector-in-menu .custom-company-dropdown {
    width: 100%;
}
.mobile-menu .company-selector-in-menu .selected-company {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 16px;
    font-size: 14px;
    border-radius: 10px;
    border-color: rgba(100, 116, 139, 0.25);
    background: rgba(248, 250, 252, 0.8);
}
.mobile-menu .company-selector-in-menu .company-name-text {
    font-size: 14px;
    max-width: none;
}
.mobile-menu .company-selector-in-menu .company-options {
    left: 12px;
    right: 12px;
    width: auto;
    min-width: 0;
    max-height: 60vh;
    overflow-y: auto;
    margin-top: 6px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    z-index: 1001;
}
.mobile-menu .company-selector-in-menu .company-option {
    padding: 12px 16px;
    height: auto;
    min-height: 44px;
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .pricing-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1000px) {
    .nav-menu {
        display: none !important;
    }
    /* Keep nav-menu hidden on mobile even when logged in (use mobile controls + burger) */
    .nav-menu.logged-in {
        display: none !important;
    }

    .nav-right-cluster .mobile-menu-toggle {
        position: relative !important;
        right: auto !important;
        top: auto !important;
        transform: none !important;
    }

    .nav-right-cluster .mobile-user-controls {
        position: relative !important;
        right: auto !important;
        display: flex;
    }

    .mobile-menu-toggle {
        display: flex !important;
        padding: 4px;
        margin-left: 0;
    }
    
    /* Force mobile menu to show when active */
    .mobile-menu.active {
        transform: translateX(0) !important;
        opacity: 1 !important;
        pointer-events: all !important;
    }
    
    .mobile-menu .nav-link,
    .mobile-menu .btn-primary,
    .mobile-menu .btn-secondary {
        padding: 15px 20px;
        font-size: 16px;
    }
}

@media (max-width: 768px) {
    /* nav-logo: on mobile show icon, hide full logo (logged-in only has .nav-logo-mobile) */
    .nav-logo-desktop {
        display: none !important;
    }
    .nav-logo-mobile {
        display: block !important;
    }
    /* Guest (not logged in): full logo-dark on mobile — no compact favicon row */
    .nav-guest-mobile-full .nav-logo-desktop {
        display: block !important;
    }
    .nav-guest-mobile-full .nav-logo-mobile {
        display: none !important;
    }
    
    /* Language selector mobile styling */
    .nav-right-cluster .language-selector {
        margin-left: 0;
    }
    
    .language-selector .selected-language {
        padding: 10px 15px;
        min-width: 50px;
    }
    
    .language-selector .flag-icon {
        width: 18px;
        height: 13px;
    }
    
    .language-selector .dropdown-arrow {
        font-size: 10px;
    }
    
    .language-selector .language-option {
        height: 35px;
    }
        
    /* User menu responsive */
    .user-menu-nav {
        flex-direction: column;
        gap: 0.5rem;
        align-items: stretch;
    }
    
    .user-info-nav {
        justify-content: center;
        margin-bottom: 0.5rem;
    }
    
    .btn-secondary {
        width: 100%;
        justify-content: center;
    }
    
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .hero-stats {
        justify-content: center;
    }
    
    /* Invoice Preview - Full width and no rotation on mobile */
    .invoice-preview {
        max-width: 100%;
        width: 100%;
        transform: none !important;
        padding: 15px 12px;
    }
    
    .invoice-preview .amount-words-body {
        font-size: 5px;
    }
        
    .invoice-preview:hover {
        transform: none !important;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 
                    0 2px 4px rgba(0, 0, 0, 0.06),
                    0 0 0 1px rgba(0, 0, 0, 0.05);
    }
    
    /* Invoice Preview - Keep desktop layout on mobile, just adjust spacing */
    .invoice-preview .invoice-title-section {
        width: 48% !important;
        text-align:left;
    }
    
    .invoice-preview .invoice-meta {
        width: 48% !important;
    }
    
    /* Invoice Preview - Parties keep side-by-side but adjust padding */
    .invoice-preview .invoice-parties {
        display: table !important;
    }
    
    .invoice-preview .invoice-party {
        display: table-cell !important;
        width: 50% !important;
        padding: 6px !important;
        text-align:left;
    }
    
    .invoice-preview .invoice-party:first-child {
        padding-right: 4px !important;
    }
    
    .invoice-preview .invoice-party:last-child {
        padding-left: 4px !important;
    }
    
    .demo-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .pricing-grid {
        grid-template-columns: 1fr;
    }
    
    .pricing-card.featured {
        transform: none;
    }
    
    .pricing-card.featured:hover {
        transform: translateY(-8px);
    }
    
    .testimonials-grid {
        grid-template-columns: 1fr;
    }
    
    .contact-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .contact-form {
        padding: 32px;
    }
    
    .about {
        padding: 80px 0;
    }
    
    .about-content {
        gap: 60px;
        margin-top: 60px;
    }
    
    .about-main {
        text-align: left;
    }
    
    .about-description {
        text-align: center;
        margin-bottom: 48px;
    }
    
    .about-items {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .about-item {
        padding: 28px;
    }
    
    .about-mission,
    .about-vision {
        padding: 32px;
        margin-top: 40px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 16px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }
    
    .hero {
        padding: 100px 0 60px;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .section-header h2 {
        font-size: 2rem;
    }
    
    .demo-text h2 {
        font-size: 2rem;
    }
}

/* Authentication Pages */
.auth-page {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
}

.auth-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: calc(100vh - 70px);
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
    gap: 40px;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
}
.auth-container.single {
    grid-template-columns: 1fr;
}

.auth-card {
    background: white;
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.1);
    max-width: 500px;
    margin: 0 auto;
    width: 100%;
    position: relative;
}

.auth-header {
    text-align: center;
}

.auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 28px;
    font-weight: 700;
    color: #0B1E3F;
    margin-bottom: 14px;
}

.auth-logo i {
    font-size: 32px;
}

.auth-logo-img {
    height: 40px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
    display: block;
}

.auth-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 6px;
}

.auth-header p {
    color: #64748b;
    font-size: 1rem;
    line-height: 1.6;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-group i {
    position: absolute;
    left: 16px;
    color: #64748b;
    z-index: 1;
    pointer-events: none;
}

.input-group input {
    width: 100%;
    padding: 12px 16px 12px 48px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
    box-sizing: border-box;
}

.input-group input:focus {
    outline: none;
    border-color: #0B1E3F;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* 2FA code (login): kā parasts lauks, viegli izcelts */
.input-group input.input-2fa-code {
    font-size: 1rem;
    font-family: inherit;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-align: left;
    background-color: #f8fafc;
    border-color: #cbd5e1;
}
.input-group input.input-2fa-code:focus {
    background-color: #fff;
    border-color: #0B1E3F;
}
.input-group input.input-2fa-code::placeholder {
    letter-spacing: 0.06em;
    color: #94a3b8;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 8px;
    z-index: 2;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 4px;
}

.password-toggle:hover {
    color: #0B1E3F;
    background: rgba(37, 99, 235, 0.05);
}

.password-toggle i {
    font-size: 16px;
    pointer-events: none;
}

.password-strength {
    margin-top: 8px;
}

.strength-bar {
    width: 100%;
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 4px;
}

.strength-fill {
    height: 100%;
    width: 0%;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.strength-text {
    font-size: 0.875rem;
    font-weight: 500;
    color: #64748b;
}

.signup-password-suggested-hint {
    display: block;
    margin-top: 8px;
    color: #64748b;
    font-size: 0.8125rem;
    line-height: 1.4;
}

.signup-suggest-password {
    display: inline-block;
    margin-top: 6px;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    font: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    color: #0B1E3F;
    text-decoration: none;
}

.signup-suggest-password:hover {
    text-decoration: underline;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 8px 0;
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 0.875rem;
    color: #64748b;
}

.checkbox-container input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #e2e8f0;
    border-radius: 4px;
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-container input[type="checkbox"]:checked + .checkmark {
    background: #0B1E3F;
    border-color: #0B1E3F;
}

.checkbox-container input[type="checkbox"]:checked + .checkmark::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.forgot-link {
    color: #0B1E3F;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.forgot-link:hover {
    color: #4a2270;
}

.terms-link {
    color: #0B1E3F;
    text-decoration: none;
    font-weight: 500;
}

.terms-link:hover {
    text-decoration: underline;
}

.btn-full {
    width: 100%;
}

.auth-divider {
    position: relative;
    text-align: center;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e2e8f0;
}

.auth-divider span {
    background: white;
    padding: 0 16px;
    color: #64748b;
    font-size: 0.875rem;
    position: relative;
    z-index: 1;
}

.social-login {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 24px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    color: #64748b;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.875rem;
}

.btn-social:hover {
    border-color: #0B1E3F;
    color: #0B1E3F;
    transform: translateY(-2px);
}

.btn-google:hover {
    border-color: #db4437;
    color: #db4437;
}

.btn-microsoft:hover {
    border-color: #00a4ef;
    color: #00a4ef;
}

.auth-footer {
    text-align: center;
    margin-top: 5px;
}

.auth-footer p {
    color: #64748b;
    font-size: 0.875rem;
}

.auth-link {
    color: #0B1E3F;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.auth-link:hover {
    color: #4a2270;
    text-decoration: underline;
}

/* Auth Sidebar */
.auth-sidebar {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.sidebar-content {
    max-width: 500px;
}

.sidebar-content h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 16px;
    line-height: 1.2;
}

.sidebar-content p {
    font-size: 1.125rem;
    color: #64748b;
    margin-bottom: 32px;
    line-height: 1.6;
}

.feature-list {
    margin-bottom: 40px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    color: #64748b;
}

.feature-item i {
    color: #0B1E3F;
    font-size: 18px;
    width: 20px;
}

.pricing-highlight {
    background: linear-gradient(135deg, #0B1E3F, #7c3aed);
    color: white;
    padding: 24px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 32px;
}

.pricing-highlight h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.pricing-highlight p {
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    font-size: 0.875rem;
}

.testimonial {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.testimonial p {
    font-style: italic;
    color: #64748b;
    margin-bottom: 16px;
    line-height: 1.6;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 12px;
}

.author-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #0B1E3F, #7c3aed);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.author-info h4 {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 2px;
    font-size: 0.875rem;
}

.author-info span {
    color: #64748b;
    font-size: 0.75rem;
}

/* Help Steps */
.help-steps {
    margin-bottom: 32px;
}

.step-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
}

.step-number {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #0B1E3F, #7c3aed);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.step-content h4 {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
    font-size: 1rem;
}

.step-content p {
    color: #64748b;
    font-size: 0.875rem;
    line-height: 1.5;
    margin: 0;
}

.security-info {
    background: #f8fafc;
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 32px;
}

.security-info h3 {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 16px;
    font-size: 1.125rem;
}

.security-info ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.security-info li {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    color: #64748b;
    font-size: 0.875rem;
}

.security-info li i {
    color: #10b981;
    font-size: 14px;
}

.contact-support {
    text-align: center;
}

.contact-support h3 {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
    font-size: 1.125rem;
}

.contact-support p {
    color: #64748b;
    font-size: 0.875rem;
    margin-bottom: 16px;
}

/* Success Message */
.success-message {
    text-align: center;
    padding: 40px 0;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #10b981, #059669);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    color: white;
}

.success-icon i {
    font-size: 32px;
}

.success-message h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 12px;
}

.success-message p {
    color: #64748b;
    margin-bottom: 32px;
    line-height: 1.6;
}

.success-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
}

/* Auth Page Responsive */
@media (max-width: 1024px) {
    .auth-container {
        grid-template-columns: 1fr;
        padding: 30px 20px;
        gap: 30px;
        min-height: auto;
    }
    
    .auth-sidebar {
        order: -1;
        padding: 20px;
    }
    
    .auth-card {
        max-width: 600px;
        padding: 40px;
    }
}

@media (max-width: 768px) {
    .auth-page {
        min-height: 100vh;
        padding-top: 70px; /* Account for fixed navbar */
    }
    
    .auth-container {
        grid-template-columns: 1fr;
        padding: 20px 16px;
        gap: 20px;
        min-height: calc(100vh - 70px);
        align-items: flex-start;
        padding-top: 20px;
    }
    
    .auth-card {
        padding: 32px 24px;
        margin: 0;
        max-width: 100%;
        border-radius: 12px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        width: 100%;
        box-sizing: border-box;
    }
    
    .auth-sidebar {
        display: none;
    }
    
    .auth-header {
        margin-bottom: 16px;
    }
    
    .auth-header h1 {
        font-size: 1.75rem;
        margin-bottom: 8px;
    }
    
    .auth-header p {
        font-size: 0.95rem;
        line-height: 1.5;
    }
    
    .auth-logo {
        font-size: 24px;
        margin-bottom: 20px;
    }
    
    .auth-logo i {
        font-size: 28px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .form-group label {
        font-size: 0.9rem;
        margin-bottom: 6px;
    }
    
    .input-group input {
        padding: 14px 50px 14px 48px;
        font-size: 16px; /* Prevents zoom on iOS */
        border-radius: 8px;
        width: 100%;
        box-sizing: border-box;
    }
    
    .input-group i {
        left: 16px;
        font-size: 16px;
    }
    
    .password-toggle {
        right: 14px;
        padding: 10px;
        width: 36px;
        height: 36px;
    }
    
    .password-toggle i {
        font-size: 16px;
    }
    
    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        margin: 20px 0;
    }
    
    .checkbox-container {
        font-size: 0.9rem;
    }
    
    .checkmark {
        width: 20px;
        height: 20px;
    }
    
    .btn-primary.btn-large,
    .btn-secondary.btn-large {
        padding: 16px 24px;
        font-size: 16px;
        width: 100%;
        margin: 8px 0;
    }
    
    .auth-divider {
        margin: 24px 0;
    }
    
    .auth-divider span {
        font-size: 0.9rem;
        padding: 0 16px;
    }
    
    .social-login {
        gap: 12px;
    }
    
    .btn-social {
        padding: 14px 20px;
        font-size: 0.9rem;
        width: 100%;
    }
    
    .auth-footer {
        margin-top: 24px;
        text-align: center;
    }
    
    .auth-footer p {
        font-size: 0.9rem;
        margin: 0;
    }
    
    .success-actions {
        flex-direction: column;
        gap: 12px;
    }
    
    .success-actions .btn-primary,
    .success-actions .btn-secondary {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .auth-container {
        padding: 16px 12px;
        gap: 16px;
        padding-top: 16px;
    }
    
    .auth-card {
        padding: 15px;
        border-radius: 8px;
    }
    
    .auth-header h1 {
        font-size: 1.5rem;
        margin-bottom: 6px;
    }
    
    .auth-header p {
        font-size: 0.9rem;
    }
    
    .auth-logo {
        font-size: 22px;
        margin-bottom: 16px;
    }
    
    .auth-logo i {
        font-size: 26px;
    }
    
    .form-group label {
        font-size: 0.85rem;
        margin-bottom: 4px;
    }
    
    .input-group input {
        padding: 12px 48px 12px 44px;
        font-size: 16px;
        border-radius: 6px;
    }
    
    .input-group i {
        left: 14px;
        font-size: 14px;
    }
    
    .password-toggle {
        right: 12px;
        padding: 8px;
        width: 32px;
        height: 32px;
    }
    
    .password-toggle i {
        font-size: 14px;
    }
    
    .btn-primary.btn-large,
    .btn-secondary.btn-large {
        padding: 14px 20px;
        font-size: 15px;
        border-radius: 6px;
    }
    
    .btn-social {
        padding: 12px 16px;
        font-size: 0.85rem;
        border-radius: 6px;
    }
    
    .auth-divider {
        margin: 20px 0;
    }
    
    .auth-divider span {
        font-size: 0.8rem;
        padding: 0 12px;
    }
    
    .checkbox-container {
        font-size: 0.8rem;
    }
    
    .checkmark {
        width: 18px;
        height: 18px;
    }
    
    .checkbox-container input[type="checkbox"]:checked + .checkmark::after {
        left: 5px;
        top: 1px;
        width: 5px;
        height: 9px;
    }
    
    .forgot-link {
        font-size: 0.8rem;
    }
    
    .auth-footer p {
        font-size: 0.85rem;
    }
    
    .auth-link {
        font-size: 0.85rem;
    }
}

/* Failed Login Attempts Counter */
.failed-attempts-counter {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #dc2626;
    font-size: 0.875rem;
    margin-bottom: 16px;
    font-weight: 500;
}

.failed-attempts-counter i {
    font-size: 1rem;
    color: #dc2626;
}

/* Lockout Overlay and Modal */
.lockout-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Blur effect for auth container when locked */
.auth-container.locked {
    filter: blur(4px);
    pointer-events: none;
    opacity: 0.7;
    transition: filter 0.3s ease, opacity 0.3s ease;
}

.lockout-modal {
    background: white;
    border-radius: 16px;
    padding: 40px;
    max-width: 450px;
    width: 100%;
    text-align: center;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.lockout-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    background: #fee2e2;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lockout-icon i {
    font-size: 36px;
    color: #dc2626;
}

.lockout-modal h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 12px;
}

.lockout-modal p {
    color: #64748b;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 24px;
}

.lockout-timer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 12px;
    margin: 24px 0;
}

.lockout-timer i {
    font-size: 24px;
    color: #0B1E3F;
}

.lockout-timer span {
    font-size: 2rem;
    font-weight: 700;
    color: #0B1E3F;
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
}

.lockout-message {
    color: #64748b;
    font-size: 0.875rem;
    margin-top: 16px;
}

@media (max-width: 768px) {
    .lockout-modal {
        padding: 32px 24px;
        max-width: 100%;
    }
    
    .lockout-icon {
        width: 70px;
        height: 70px;
        margin-bottom: 20px;
    }
    
    .lockout-icon i {
        font-size: 32px;
    }
    
    .lockout-modal h2 {
        font-size: 1.25rem;
    }
    
    .lockout-timer {
        padding: 16px;
    }
    
    .lockout-timer i {
        font-size: 20px;
    }
    
    .lockout-timer span {
        font-size: 1.75rem;
    }
    
    .failed-attempts-counter {
        font-size: 0.8rem;
        padding: 10px 14px;
    }
}

@media (max-width: 480px) {
    .lockout-modal {
        padding: 24px 20px;
    }
    
    .lockout-icon {
        width: 60px;
        height: 60px;
        margin-bottom: 16px;
    }
    
    .lockout-icon i {
        font-size: 28px;
    }
    
    .lockout-modal h2 {
        font-size: 1.125rem;
    }
    
    .lockout-timer span {
        font-size: 1.5rem;
    }
    
    .failed-attempts-counter {
        font-size: 0.75rem;
        padding: 8px 12px;
    }
    
    .success-message {
        padding: 30px 0;
    }
    
    .success-icon {
        width: 60px;
        height: 60px;
        margin-bottom: 20px;
    }
    
    .success-icon i {
        font-size: 24px;
    }
    
    .success-message h3 {
        font-size: 1.25rem;
        margin-bottom: 8px;
    }
    
    .success-message p {
        font-size: 0.9rem;
        margin-bottom: 24px;
    }
}

@media (max-width: 360px) {
    .auth-container {
        padding: 12px 8px;
        gap: 12px;
    }
    
    .auth-card {
        padding: 20px 16px;
    }
    
    .auth-header h1 {
        font-size: 1.25rem;
    }
    
    .auth-header p {
        font-size: 0.85rem;
    }
    
    .auth-logo {
        font-size: 20px;
        margin-bottom: 12px;
    }
    
    .auth-logo i {
        font-size: 24px;
    }
    
    .input-group input {
        padding: 10px 40px 10px 40px;
        font-size: 16px;
    }
    
    .input-group i {
        left: 12px;
        font-size: 12px;
    }
    
    .password-toggle {
        right: 10px;
        padding: 6px;
        width: 28px;
        height: 28px;
    }
    
    .password-toggle i {
        font-size: 12px;
    }
    
    .btn-primary.btn-large,
    .btn-secondary.btn-large {
        padding: 12px 16px;
        font-size: 14px;
    }
}

/* Dashboard Styles */
.dashboard-page {
    background: #f8fafc;
}

.dashboard-nav {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.dashboard-nav .nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.dashboard-nav .nav-menu {
    display: flex;
    align-items: center;
    gap: 32px;
}

.dashboard-nav .nav-link {
    color: #64748b;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.dashboard-nav .nav-link:hover,
.dashboard-nav .nav-link.active {
    color: #0B1E3F;
    background: rgba(37, 99, 235, 0.1);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: #e2e8f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
}

.user-info {
    display: flex;
    flex-direction: column;
}

/* Hide user-info on mobile when user is logged in */
@media (max-width: 768px) {
    .user-info.logged-in {
        display: none !important;
    }
}

.user-name {
    font-weight: 600;
    color: #1e293b;
    font-size: 14px;
}

.user-email {
    color: #64748b;
    font-size: 12px;
    margin-top: -5px;
}

/* Email under name in company_users table */
.user-info .user-email.user-info-meta {
    margin-top: 2px;
    font-size: 12px;
    color: #64748b;
}

/* Site Users: e-pasta saīsināšana ar "..." un tooltip ar pilno e-pastu */
.site-users-page .user-info .user-email.user-email-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    max-width: 100%;
    color: #6b7280;
    font-size: 0.875rem;
    margin-top: 4px;
}
.site-users-page .user-info {
    min-width: 0;
}
/* Company users: tikai lietotāja grupas (lomas) nosaukums zem e-pasta mobilā (2. un 3. kolonna slēptas) */
.company-users-mobile-role {
    display: none;
}
@media (max-width: 768px) {
    .company-users-page table.services-table#usersTable .company-users-mobile-role {
        display: block;
        margin-top: 4px;
        font-size: 12px;
        color: #64748b;
    }
}

/* Status under role in company_users table – tāpat kā e-pasts: mazi pelēki burti */
.role-status-cell {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}
.role-status-cell .role-cell-status {
    display: block;
    margin-top: -7px;
    font-size: 12px;
    color: #64748b;
    font-weight: 400;
    background: none !important;
    padding: 0 !important;
    border-radius: 0;
}
.role-badge-clickable {
    cursor: pointer;
    border: none;
    font: inherit;
    text-align: left;
    background: inherit;
}
.role-badge-clickable:hover {
    text-decoration: underline;
}

.company-name {
    font-size: 12px;
}

.user-dropdown {
    position: relative;
}

.dropdown-toggle {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.2s ease;
}

.dropdown-toggle:hover {
    color: #0B1E3F;
}

.dropdown-menu {
    position: absolute;
    top: 150%;
    right: 0;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 10000;
    display: block;
}

.dropdown-menu.show {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    display: block !important;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #64748b;
    text-decoration: none;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background: #f8fafc;
    color: #0B1E3F;
}

/* Profile dropdown item with email - display name and email on separate lines */
.dropdown-item-with-email {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
}

.dropdown-item-with-email i {
    flex-shrink: 0;
    align-self: center;
}

.dropdown-item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.dropdown-item-content > span {
    line-height: 1.4;
}

.dropdown-item-content .email {
    display: block;
    font-size: 11px;
    color: #94a3b8;
    margin-top: 2px;
    line-height: 1.3;
}

.dropdown-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 8px -10px;
}

.dashboard-main {
    padding: 32px 0;
    margin-top: 70px;
}

/* Client insolvency notice: tikai content platums (kā .dashboard-container), nav pilnekrāna josla */
.insolvency-client-banner {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    z-index: 999;
    padding: 0 24px;
    box-sizing: border-box;
    background: transparent;
    border: none;
    box-shadow: none;
}
.insolvency-client-banner-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-sizing: border-box;
    background: linear-gradient(90deg, #fff7ed 0%, #ffedd5 100%);
    border: 1px solid #fdba74;
    border-top: none;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 4px 12px rgba(234, 88, 12, 0.1);
}
.insolvency-client-banner-icon {
    color: #ea580c;
    font-size: 1.1rem;
    line-height: 1.4;
    flex-shrink: 0;
    margin-top: 2px;
}
.insolvency-client-banner-text {
    flex: 1;
    min-width: 0;
    font-size: 0.9rem;
    line-height: 1.45;
    color: #7c2d12;
}
.insolvency-client-banner-title {
    display: block;
    margin-bottom: 4px;
    font-weight: 700;
    color: #9a3412;
}
.insolvency-client-banner-list {
    margin: 0;
    padding-left: 1.15rem;
}
.insolvency-client-banner-list li {
    margin: 2px 0;
}
.insolvency-client-banner-close {
    flex-shrink: 0;
    border: none;
    background: transparent;
    color: #9a3412;
    cursor: pointer;
    padding: 6px 8px;
    margin: -4px -6px 0 0;
    border-radius: 6px;
    line-height: 1;
    font-size: 1rem;
    opacity: 0.85;
}
.insolvency-client-banner-close:hover {
    background: rgba(154, 52, 18, 0.12);
    opacity: 1;
}

body.has-insolvency-client-banner .dashboard-main {
    margin-top: calc(70px + var(--insolvency-banner-height, 56px));
}

body.has-insolvency-client-banner .blog-container {
    margin-top: calc(70px + var(--insolvency-banner-height, 56px));
}

@media (max-width: 768px) {
    .insolvency-client-banner {
        padding: 0 16px;
    }
    .insolvency-client-banner-inner {
        padding: 8px 12px;
        gap: 8px;
    }
    .insolvency-client-banner-text {
        font-size: 0.85rem;
    }
    body.has-insolvency-client-banner .auth-page {
        padding-top: calc(70px + var(--insolvency-banner-height, 56px));
    }
    body.has-insolvency-client-banner .blog-container {
        margin-top: calc(70px + var(--insolvency-banner-height, 56px));
    }
}

/* Ienākošo rēķinu lapas brīdinājums par kavētu / tuvojošos termiņu (zem topnav) */
.incoming-due-banner {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    z-index: 998;
    padding: 0 24px;
    box-sizing: border-box;
    background: transparent;
    border: none;
    box-shadow: none;
}
body.has-insolvency-client-banner .incoming-due-banner {
    top: calc(70px + var(--insolvency-banner-height, 56px));
}
.incoming-due-banner-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-sizing: border-box;
    background: linear-gradient(90deg, #eff6ff 0%, #e0f2fe 100%);
    border: 1px solid #7dd3fc;
    border-top: none;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.12);
}
.incoming-due-banner-icon {
    color: #0369a1;
    font-size: 1.1rem;
    line-height: 1.4;
    flex-shrink: 0;
    margin-top: 2px;
}
.incoming-due-banner-text {
    flex: 1;
    min-width: 0;
    font-size: 0.9rem;
    line-height: 1.45;
    color: #0c4a6e;
}
.incoming-due-banner-title {
    display: block;
    margin-bottom: 6px;
    font-weight: 700;
    color: #075985;
}
.incoming-due-banner-summary {
    margin: 0 0 10px 0;
    font-size: 0.88rem;
    line-height: 1.45;
}
.incoming-due-banner-list {
    margin: 0;
    padding-left: 1.15rem;
}
.incoming-due-banner-li {
    margin: 3px 0;
}
.incoming-due-banner-table-wrap {
    overflow-x: auto;
    margin: 0 0 10px 0;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}
.incoming-due-banner-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.65);
    border-radius: 8px;
    overflow: hidden;
}
.incoming-due-banner-table th,
.incoming-due-banner-table td {
    padding: 6px 8px;
    text-align: left;
    border-bottom: 1px solid rgba(7, 89, 133, 0.15);
    vertical-align: top;
}
.incoming-due-banner-table th {
    font-weight: 600;
    color: #075985;
    background: rgba(255, 255, 255, 0.9);
}
.incoming-due-banner-tr--overdue td {
    color: #7f1d1d;
}
.incoming-due-banner-tr--upcoming td {
    color: #7c2d12;
}
.incoming-due-banner-link-wrap {
    margin: 0;
    font-size: 0.85rem;
}
.incoming-due-banner-link {
    font-weight: 600;
    color: #0369a1;
    text-decoration: underline;
}
.incoming-due-banner-link:hover {
    color: #0c4a6e;
}
.incoming-due-banner-li--overdue {
    color: #991b1b;
    font-weight: 600;
}
.incoming-due-banner-li--upcoming {
    color: #9a3412;
    font-weight: 500;
}
.incoming-due-banner-close {
    flex-shrink: 0;
    border: none;
    background: transparent;
    color: #075985;
    cursor: pointer;
    padding: 6px 8px;
    margin: -4px -6px 0 0;
    border-radius: 6px;
    line-height: 1;
    font-size: 1rem;
    opacity: 0.85;
}
.incoming-due-banner-close:hover {
    background: rgba(7, 89, 133, 0.12);
    opacity: 1;
}

body.has-incoming-due-banner .dashboard-main {
    margin-top: calc(70px + var(--incoming-due-banner-height, 56px));
}
body.has-insolvency-client-banner.has-incoming-due-banner .dashboard-main {
    margin-top: calc(70px + var(--insolvency-banner-height, 56px) + var(--incoming-due-banner-height, 56px));
}

@media (max-width: 768px) {
    .incoming-due-banner {
        padding: 0 16px;
    }
    .incoming-due-banner-inner {
        padding: 8px 12px;
        gap: 8px;
    }
    .incoming-due-banner-text {
        font-size: 0.85rem;
    }
}

.dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.welcome-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    background: white;
    padding: 32px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.welcome-content h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
}

.welcome-content p {
    color: #64748b;
    font-size: 1.1rem;
}

.welcome-actions .btn-primary {
    padding: 12px 24px;
    font-size: 16px;
}

.stats-section {
    margin-bottom: 22px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    align-items: stretch;
}

.stat-card {
    background: white;
    padding: 16px;
    padding-bottom: 38px; /* room for .stat-content at bottom */
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    position: relative;
    min-height: 100px;
}

/* Create Invoice Button - matches stat-card dimensions */
.create-invoice-btn {
    color: white !important;
    background: #0B1E3F !important;
    padding: 16px;
    padding-bottom: 10px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border: none;
    width: 100%;
    font-size: 1.3rem;
    white-space: nowrap;
    cursor: pointer;
    position: relative;
}


.create-invoice-btn:active {
    transform: translateY(2px);
}

.stat-revenue-info {
    position: absolute;
    top: 16px;
    right: 16px;
    text-align: right;
}
.stat-revenue-info h3 {
font-size:16px;
}
.stat-revenue-info #totalRevenueVat, .stat-revenue-info #pendingRevenueVat, .stat-revenue-info #automaticFutureRevenueVat, .stat-revenue-info #totalRevenueVatMonth, .stat-revenue-info #totalRevenueVatYear,
.stat-revenue-info .stat-revenue-sub,
.stat-revenue-info .stat-revenue-sum {
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 400;
    margin-top: 2px;
}

.stat-icon-number-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    background: rgba(37, 99, 235, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0B1E3F;
    font-size: 20px;
    flex-shrink: 0;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    line-height: 1;
}

.stat-content {
    position: absolute;
    bottom: 16px;
    left: 16px;
    display: flex;
    flex-direction: column;
    margin: 0;
    align-self: flex-start;
}

#activeClientsCard .stat-content {
    position: absolute;
    bottom: 16px;
    left: 16px;
    margin: 0;
}

#activeClientsCard .stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #1e293b;
}

#activeClientsCard .stat-number .total-clients,
.stat-card .stat-number .total-clients {
    font-size: 0.96rem;
    color: #cbd5e1;
    font-weight: 400;
}

#automaticFutureInvoicesCard .stat-content {
    margin-top: 5px;
}

.stat-content h3 {
    font-size: 2rem;
    font-weight: 700;
    color: #1e293b;
}

.stat-content p {
    color: #64748b;
    font-size: 14px;
    margin: 0;
    margin-top: 3px;
}


.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
}

.view-all {
    color: #0B1E3F;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.view-all:hover {
    color: #4a2270;
}

.activity-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 1.5rem;
    align-items: start;
}

/* Lai rēķinu saraksta kolonna neizplestos, kad ielādējas rēķini – fiksēta 1fr platuma daļa */
.activity-content {
    min-width: 0;
}
.stats-cards-container {
    min-width: 0;
}

/* Stats Cards Container */
.stats-cards-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-height: 300px;
    height: auto;
    overflow: visible;
    align-items: stretch; /* Ensure children can grow to their full height */
}

.stats-info-card,
.stats-chart-card,
.stats-calendar-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

/* Two-column layout for info card and calendar; stacks when width < 230px + 230px + gap */
.stats-info-and-calendar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1.5rem;
    flex-shrink: 0;
    align-items: stretch; /* Stretch cards to same height */
}

.stats-info-card {
    flex-shrink: 0;
    flex-grow: 0;
    display: flex;
    flex-direction: column;
    height: 100%; /* Fill grid cell */
    width: 100%;
    min-width: 230px;
    max-width: 100%;
}

.stats-calendar-card {
    display: flex;
    flex-direction: column;
    height: 100%; /* Fill grid cell */
    min-width: 230px;
}

.stats-chart-card {
    flex: 0 1 auto; /* Don't grow, but can shrink if needed */
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: visible;
    padding-bottom: 0.5rem; /* Add padding to prevent chart from being cut off */
    align-self: stretch; /* Allow card to take full width and height */
}

.stats-info-card h3,
.stats-chart-card h3,
.stats-calendar-card h3 {
    margin: 0 0 1.5rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #111827;
    flex-shrink: 0;
}

/* Calendar Styles */
.calendar-container {
    display: flex;
    flex-direction: column;
    height: auto; /* Size to content */
    min-height: auto; /* Remove min-height constraint */
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.calendar-nav-btn {
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    transition: all 0.2s ease;
    color: #374151;
}

.calendar-nav-btn:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
}

.calendar-nav-btn:active {
    transform: scale(0.95);
}

.calendar-month-year {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
}

.calendar-weekday {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    padding: 0.5rem 0;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.25rem;
    /* Removed flex: 1 to allow content-based sizing */
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    color: #374151;
    cursor: default;
    border-radius: 6px;
    transition: all 0.2s ease;
    background: #f9fafb;
    border: 1px solid transparent;
}

.calendar-day:hover {
    background: #f3f4f6;
}

/* Sunday styling - red */
.calendar-day.sunday {
    color: #dc2626;
    font-weight: 600;
}

.calendar-day.sunday:not(.today):not(.has-holiday) {
    background: #fee2e2;
}

.calendar-day.sunday:hover:not(.today):not(.has-holiday) {
    background: #fecaca;
}

/* Saturday styling - dark gray */
.calendar-day.saturday {
    color: #544f4f;
    font-weight: 500;
}

.calendar-day.saturday:not(.today):not(.has-holiday) {
    background: #f3f4f6;
    color: #544f4f;
}

.calendar-day.saturday:hover:not(.today):not(.has-holiday) {
    background: #e5e7eb;
}

.calendar-day.other-month {
    color: #d1d5db;
    background: #ffffff;
}

.calendar-day.today {
    background: #0B1E3F;
    color: white;
    font-weight: 600;
    border-color: #4a2270;
}

/* Public holiday (brīvdiena) — same red family as site-holiday, not shortened yellow */
.calendar-day.has-holiday {
    background: #fee2e2;
    border-color: #ef4444;
    color: #dc2626;
    font-weight: 600;
    position: relative;
}

.calendar-day.has-holiday:hover {
    background: #fecaca;
    border-color: #dc2626;
    z-index: 10;
}

.calendar-day.today.has-holiday {
    background: #991b1b;
    border-color: #7f1d1d;
    color: white;
}

.calendar-day.today.has-holiday::after {
    background: #fca5a5;
}

/* Shortened day styling (day before holiday) */
.calendar-day.shortened-day {
    border: 1px solid #f59e0b !important;
    background-color: #fef3c7 !important;
    color: #d97706 !important;
}

.calendar-day.shortened-day:hover {
    background-color: #fde68a !important;
    border-color: #f59e0b !important;
}

/* Sunday today styling */
.calendar-day.today.sunday {
    background: #dc2626;
    border-color: #b91c1c;
    color: white;
}

.calendar-day.today.sunday.has-holiday {
    background: #991b1b;
    border-color: #7f1d1d;
}

/* Saturday today styling */
.calendar-day.today.saturday {
    background: #0B1E3F;
    border-color: #4a2270;
    color: white;
}

/* Tooltip for holidays */
.calendar-day.has-holiday {
    cursor: help;
}

/* Calendar Footer - Work Days and Hours */
.calendar-footer {
    margin-top: 10px;
    margin-bottom:-10px;
    padding-top: 5px;
    border-top: 1px solid #e5e7eb;
    text-align: center;
}

.calendar-work-info {
    font-size: 0.875rem;
    color: #666;
}

.calendar-work-info span {
    font-weight: 500;
}

/* Work Day Calendar - Full Year (3 months per row) - Modern Design */
.work-day-calendar-section {
    padding: 1.5rem 0 2rem;
}

.work-day-calendar-year-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    padding: 0.75rem 1rem;
}

.work-day-calendar-year-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    letter-spacing: -0.02em;
    min-width: 4rem;
    text-align: center;
}

.work-day-year-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    color: #475569;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.work-day-year-btn:hover {
    background: #0B1E3F;
    border-color: #0B1E3F;
    color: #fff;
    box-shadow: 0 4px 12px rgba(37,99,235,0.25);
    transform: translateY(-1px);
}

.work-day-year-btn:active {
    transform: translateY(0);
}

.work-day-calendar-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    max-width: 1100px;
    margin: 0 auto;
}

.work-day-month-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.work-day-month-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);
    border-color: #cbd5e1;
}

.work-day-month-header {
    font-size: 0.95rem;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 0.5rem;
    text-align: center;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #f1f5f9;
}

.work-day-details {
    display: flex;
    flex-direction: column;
    font-size: 0.75rem;
    color: #475569;
    font-weight: 500;
    margin-top: 0.5rem;
}

.work-day-detail {
    line-height: 1.6;
}

.work-day-month-footer {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 0.25rem;
    margin-top: 0.35rem;
}

.work-day-special-list {
    flex: 1;
    margin-right: auto;
}

.work-day-more-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 0;
    cursor: pointer;
    color: #64748b;
    font-size: 0.75rem;
    border-radius: 8px;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.work-day-more-btn:hover {
    color: #0B1E3F;
    background: #eff6ff;
    border-color: #93c5fd;
}

.work-day-special {
    display: block;
    font-size: 0.7rem;
    color: #64748b;
    line-height: 1.5;
    margin-top: 0.2rem;
}

.work-day-special-date {
    font-weight: 700;
    color: #0f172a;
}

.work-day-calendar-wrap {
    width: 100%;
}

.work-day-weekdays .calendar-weekday {
    font-size: 0.65rem;
    font-weight: 600;
    color: #64748b;
    padding: 0.25rem 0;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.work-day-days .calendar-day {
    font-size: 0.75rem;
    font-weight: 500;
    aspect-ratio: 1;
    min-height: 24px;
    border-radius: 6px;
    transition: transform 0.15s ease;
}

.work-day-days .calendar-day:not(.other-month):hover {
    transform: scale(1.05);
}

.work-day-calendar-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
}

/* Work day calendar – refined day cell styling */
body.work-day-calendar-page .work-day-days .calendar-day.sunday:not(.today):not(.has-holiday):not(.site-holiday) {
    background: #fef2f2;
    color: #dc2626;
}

body.work-day-calendar-page .work-day-days .calendar-day.saturday:not(.today):not(.has-holiday):not(.site-holiday) {
    background: #f8fafc;
    color: #64748b;
}

body.work-day-calendar-page .work-day-days .calendar-day.site-working-day {
    border-radius: 6px;
}

body.work-day-calendar-page .work-day-days .calendar-day.site-holiday {
    border-radius: 6px;
}

body.work-day-calendar-page .work-day-days .calendar-day.shortened-day {
    border-radius: 6px;
}

@media (max-width: 900px) {
    .work-day-calendar-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

@media (max-width: 600px) {
    .work-day-calendar-year-nav {
        gap: 1rem;
        padding: 0.5rem 0.75rem;
    }
    .work-day-calendar-year-title {
        font-size: 1.25rem;
    }
    .work-day-year-btn {
        width: 36px;
        height: 36px;
    }
    .work-day-calendar-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    .work-day-month-card {
        padding: 0.75rem;
    }
}

body.work-day-calendar-page .dashboard-main {
    padding: 8px 0;
    margin-top: 60px;
}

body.work-day-calendar-page .dashboard-container {
    padding: 0 12px;
}

/* E-Invoice Viewer Page */
.e-invoice-viewer-section {
    padding: 1rem 0 2rem;
    max-width: 900px;
    margin: 0 auto;
}

.e-invoice-viewer-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 1.5rem;
}

.e-invoice-drop-zone {
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    background-color: #f9fafb;
    cursor: pointer;
    transition: all 0.3s ease;
}

.e-invoice-drop-zone:hover {
    border-color: #9ca3af;
    background-color: #f3f4f6;
}

.e-invoice-drop-icon {
    font-size: 48px;
    color: #9ca3af;
    margin-bottom: 16px;
    display: block;
}

.e-invoice-drop-title {
    font-size: 18px;
    color: #111827;
    margin-bottom: 12px;
    font-weight: 600;
}

.e-invoice-drop-text {
    font-size: 16px;
    color: #374151;
    margin-bottom: 8px;
}

.e-invoice-drop-hint {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 16px;
}

.e-invoice-drop-formats {
    font-size: 12px;
    color: #9ca3af;
}

.e-invoice-viewer-content {
    margin-top: 1.5rem;
}

.e-invoice-display {
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 24px;
    max-height: 70vh;
    overflow-y: auto;
}

.e-invoice-actions {
    margin-top: 16px;
    text-align: center;
}

.e-invoice-error {
    padding: 16px;
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #991b1b;
    margin-top: 16px;
}

body.e-invoice-viewer-page .dashboard-main {
    padding: 8px 0;
    margin-top: 60px;
}

body.e-invoice-viewer-page .dashboard-container {
    padding: 0 12px;
}

/* Salary Calculator Page */
.salary-calculator-section {
    padding: 1rem 0 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.salary-calculator-main-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 1.5rem;
}

.salary-calculator-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.salary-calculator-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

@media (max-width: 768px) {
    .salary-calculator-row {
        grid-template-columns: 1fr;
    }
}

.salary-calculator-inputs {
    padding: 24px;
}

.salary-calc-field {
    margin-bottom: 1rem;
}

.salary-calc-field label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.25rem;
}

.salary-calc-field input[type="number"],
.salary-calc-field input[type="text"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
}

.salary-calc-checkbox .checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.salary-calc-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

.salary-calc-radio-label {
    margin-bottom: 0.5rem !important;
}

.salary-calc-radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.salary-calc-radio-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 400;
}

.salary-calc-btn {
    margin-top: 1rem;
    padding: 10px 24px;
    background: #0B1E3F;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
}

.salary-calc-btn:hover {
    background: #4a2270;
}

.salary-calculator-results {
    background: #eff6ff;
    padding: 24px;
}

.salary-results-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 1rem;
}

.salary-result-main {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 1rem;
}

.salary-result-main .salary-result-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #111827;
}

.salary-results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.salary-results-table td {
    padding: 6px 12px 6px 0;
    vertical-align: top;
}

.salary-results-table td:first-child {
    color: #374151;
}

.salary-results-table td:nth-child(2) {
    text-align: center;
    color: #6b7280;
}

.salary-results-table td:nth-child(3) {
    text-align: right;
    font-weight: 500;
    color: #111827;
}

.salary-results-table .salary-result-total-row td {
    padding-top: 1rem;
    border-top: 1px solid #bfdbfe;
    font-weight: 600;
}

.salary-results-table .salary-result-total-row td:nth-child(2),
.salary-results-table .salary-result-total-row td:last-child {
    text-align: right;
    font-size: 1.25rem;
    font-weight: 700;
}

.salary-calculator-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.salary-info-block {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.salary-info-block i {
    color: #6b7280;
    flex-shrink: 0;
}

.salary-info-block p {
    margin: 0;
    font-size: 0.875rem;
    color: #4b5563;
    line-height: 1.5;
}

body.salary-calculator-page .dashboard-main {
    padding: 8px 0;
    margin-top: 60px;
}

body.salary-calculator-page .dashboard-container {
    padding: 0 12px;
}

/* Progress Bars */
.progress-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.progress-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.progress-label {
    position: relative;
    width:100%;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

.progress-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: #0B1E3F;
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #0B1E3F 0%, #0B1E3F 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Chart Container */
.chart-container {
    position: relative;
    flex: 0 0 300px; /* Don't grow/shrink, use explicit height of 350px */
    width: 100%;
    min-height: 300px; /* Ensure minimum height */
    max-height: 300px; /* Ensure maximum height */
    overflow: visible;
    padding-bottom: 1rem; /* Add padding to prevent bottom labels from being cut off */
    height: 300px !important; /* Set fixed height - reduced by 30% from 500px */
}

/* Responsive Stats Cards */
@media (max-width: 768px) {
    .activity-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stats-cards-container {
        gap: 1rem;
    }
    
    .stats-info-and-calendar {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stats-info-card,
    .stats-chart-card,
    .stats-calendar-card {
        padding: 1rem;
    }
    
    .chart-container {
        height: 350px; /* Increased for mobile - approximately 150% taller */
    }
}

.activity-content {
    background: white;
    padding: 1.5rem;
    padding-top: 1rem;
    padding-right: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    min-height: 300px;
    /* Height will be set by JavaScript to match stats-cards-container */
}

.activity-content.expanded {
    height: 600px;
    max-height: 600px;
}

/* Keep stats-cards-container at minimum height - don't expand it when activity-content expands */
/* This prevents the revenue chart from growing when showing more invoices */
.activity-content.expanded ~ .stats-cards-container {
    min-height: 300px;
    height: auto;
    max-height: none;
    overflow: visible;
}

.activity-content.scrollable {
    padding-right: 0.3rem; /* 10px - approximately half of 1.5rem (24px) */
}

.activity-content.expanded:not(.scrollable) {
    padding-right: 1.5rem;
}

.show-more-btn {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    color: #374151;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.show-more-btn:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
    color: #1f2937;
}

.show-more-btn i {
    transition: transform 0.3s ease;
    font-size: 0.75rem;
}

.activity-content.expanded .show-more-btn i {
    transform: rotate(180deg);
}

.activity-content h3 {
    flex-shrink: 0;
    margin-bottom: 1rem;
}

#pendingInvoicesList {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

#pendingInvoicesList:has(.empty-state) {
    align-items: center;
    justify-content: center;
    overflow-y: visible;
}

/* Dashboard aktivitāšu kolonna: kompaktāks tukšais stāvoklis, lai nav vertikālā scrollbar */
#pendingInvoicesList .empty-state {
    text-align: center;
    padding: 20px 16px 16px;
    max-width: 100%;
    box-sizing: border-box;
}

#pendingInvoicesList .empty-state .empty-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 12px;
    font-size: 22px;
    line-height: 56px;
}

#pendingInvoicesList .empty-state h3 {
    font-size: 1.125rem;
    margin-bottom: 6px;
}

#pendingInvoicesList .empty-state p {
    font-size: 0.875rem;
    margin-bottom: 14px;
    line-height: 1.35;
}

.empty-state {
    text-align: center;
    padding: 48px 24px;
}

.empty-icon {
    width: 80px;
    height: 80px;
    background: rgba(37, 99, 235, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    color: #0B1E3F;
    font-size: 32px;
    position: relative;
    line-height: 80px;
}

.empty-icon i {
    display: inline-block;
    margin: 0;
    padding: 0;
    line-height: 1;
    vertical-align: middle;
}

.empty-icon i.fa-check-circle {
    display: inline-block;
    margin: 0;
    padding: 0;
    line-height: 1;
    vertical-align: middle;
}

.empty-state h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
}

.empty-state p {
    color: #64748b;
    margin-bottom: 24px;
}


.mobile-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
    margin: 16px 0;
}

.user-details {
    display: flex;
    flex-direction: column;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .dashboard-nav .nav-menu {
        display: none;
    }
    
    /* Show dashboard nav-menu on mobile when user is logged in */
    .dashboard-nav .nav-menu.logged-in {
        display: flex;
    }
    
    .dashboard-nav .mobile-menu-toggle {
        display: block;
    }
    
    .welcome-section {
        flex-direction: column;
        gap: 24px;
        text-align: center;
    }
    
    .welcome-content h1 {
        font-size: 1.5rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .stat-content h3 {
        font-size: 1.5rem;
    }
    
}

@media (max-width: 580px) {
    .dashboard-container {
        padding: 0 16px;
    }
    
    .welcome-section {
        padding: 24px 16px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    
    .section-header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
}

/* Logout Message Styles */
.logout-message {
    margin-bottom: 20px;
}

.alert {
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert-success i {
    color: #16a34a;
}

.alert-info {
    background: #dbeafe;
    color: #4a2270;
    border: 1px solid #93c5fd;
}

.alert-info i {
    color: #0B1E3F;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

.alert-warning i {
    color: #d97706;
}

.alert-error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.alert-error i {
    color: #dc2626;
}

/* 2FA Settings Styles */
.qr-code-container {
    text-align: center;
    margin: 20px 0;
}

.qr-code-container img {
    max-width: 250px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px;
    background: white;
}

.qr-code-container code {
    background: #f3f4f6;
    padding: 8px 12px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 14px;
    display: inline-block;
    margin-top: 15px;
}

.verification-code-input {
    text-align: left;
    font-size: 1rem;
    letter-spacing: 0.06em;
    font-family: inherit;
    font-weight: 500;
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background-color: #f8fafc;
    box-sizing: border-box;
}

.verification-code-input:focus {
    outline: none;
    border-color: #0B1E3F;
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.two-fa-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: 8px;
    background: #f9fafb;
}

.backup-codes {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    margin: 10px 0;
}

.backup-codes-title {
    font-weight: 600;
    margin-bottom: 10px;
    color: #374151;
}

.backup-codes-list {
    font-family: monospace;
    font-size: 14px;
    line-height: 1.8;
    color: #1f2937;
}

.backup-codes-warning {
    font-size: 12px;
    color: #6b7280;
    margin-top: 10px;
}

/* Languages Page Styles */
.languages-page {
    background: #f8fafc;
}


.btn-action {
    background: #f8fafc;
    color: #374151;
    border: 1px solid #e2e8f0;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
}

.btn-action:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

.btn-add {
    background: #ecfdf5;
    color: #059669;
    border-color: #10b981;
}

.btn-add:hover {
    background: #d1fae5;
    border-color: #059669;
    color: #047857;
}

.btn-settings {
    background: #faf5ff;
    color: #7c3aed;
    border-color: #8b5cf6;
}

.btn-settings:hover {
    background: #f3e8ff;
    border-color: #7c3aed;
    color: #6d28d9;
}

.btn-export {
    background: #fffbeb;
    color: #d97706;
    border-color: #f59e0b;
}

.btn-export:hover {
    background: #fef3c7;
    border-color: #d97706;
    color: #b45309;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e2e8f0;
}

.header-content h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
}

.header-content p {
    color: #64748b;
    font-size: 1rem;
}

.admin-badge {
    background: #dc2626;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-left: 12px;
}

.stats-section {
    margin-bottom: 22px;
}

.languages-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.table-container {
    overflow-x: auto;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.table-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.table-header .filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 300px;
}

.table-header .filter-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin: 0;
}

.table-header .filter-group input {
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    transition: border-color 0.2s ease;
}

.table-header .filter-group input:focus {
    outline: none;
    border-color: #0B1E3F;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.table-actions {
    display: flex;
    gap: 12px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.data-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #374151;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.data-table td {
    color: #374151;
}

.data-table tr:hover {
    background: #f8fafc;
}

.loading-row {
    text-align: center;
    padding: 40px;
}

.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #64748b;
}

.loading-spinner i {
    animation: spin 1s linear infinite;
}

.loading-spinner span {
    animation: none;
}

/* Loading state for translations.php, site_seo.php, site_calendar.php, landing_page.php */
.loading-state {
    text-align: center;
    padding: 40px;
}

.loading-state p {
    color: #6b7280;
    font-size: 0.875rem;
    margin: 16px 0 0 0;
}

/* CSS spinner version of loading-spinner (used in translations.php style) */
.loading-state .loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f4f6;
    border-top: 4px solid #0B1E3F;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.status-badge {
    padding: 2px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-badge.active {
    background: #dcfce7;
    color: #166534;
}

.status-badge.inactive {
    background: #fee2e2;
    color: #991b1b;
}

.default-badge {
    background: #fef3c7;
    color: #92400e;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.action-buttons {
    display: flex;
    gap: 8px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.75rem;
}

.btn-icon {
    background: #f8fafc;
    color: #374151;
    border: 1px solid #e2e8f0;
    padding: 8px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.btn-icon:hover {
    transform: translateY(-1px);
}

.btn-edit {
    background: #eff6ff;
    color: #0B1E3F;
    border-color: #0B1E3F;
}

.btn-edit:hover {
    background: #dbeafe;
    border-color: #0B1E3F;
    color: #4a2270;
}

.btn-delete {
    background: #fef2f2;
    color: #ef4444;
    border-color: #f87171;
}

.btn-delete:hover {
    background: #fee2e2;
    border-color: #ef4444;
    color: #dc2626;
}

.btn-toggle {
    background: #fef3c7;
    color: #d97706;
    border-color: #f59e0b;
}

.btn-toggle:hover {
    background: #fde68a;
    border-color: #d97706;
    color: #b45309;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(239, 68, 68, 0.3);
    color: white;
}

/* Modal Styles */
.modal {
    display: none !important;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal.show,
.modal.active {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

/* Ziņojuma modāls virs citiem (piem., rēķina numura modāla first_invoice / validation) */
#validationMessageModal.modal.active,
#validationMessageModal.modal.show {
    z-index: 10050;
}

#increaseCreditLimitModal.modal.active,
#increaseCreditLimitModal.modal.show {
    z-index: 10080;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    margin: auto;
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 24px 0;
    border-bottom: 1px solid #e2e8f0;
}

.modal-header h3,
.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #64748b;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #f1f5f9;
    color: #374151;
}

.modal-body {
    padding: 0 24px 24px 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 24px;
    border-top: 1px solid #e2e8f0;
    margin-top: 24px;
}

.partial-clear-summary {
    margin-bottom: 20px;
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.4;
}

.partial-clear-summary p + p {
    margin-top: 6px;
}

.partial-clear-btn {
    background: none;
    border: none;
    color: #0B1E3F;
    cursor: pointer;
    font-size: 0.8rem;
    margin-left:5px;
    padding: 0;
}

.partial-clear-btn:hover {
    color: #4a2270;
    text-decoration: underline;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
    font-size: 0.875rem;
    margin-top:7px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.875rem;
    transition: border-color 0.2s ease;
    background: white;
}

.form-group input#password.landing,.form-group input#email.landing,.form-group input#confirm.landing,.form-group input#confirmPassword.landing,.form-group input#firstName.landing,.form-group input#lastName.landing {
padding-left: 38px;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #0B1E3F;
}

/* Validation states for dashboard/settings forms */
.form-group input.valid {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.form-group input.valid:focus {
    border-color: #059669 !important;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

.form-group input.invalid {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-group input.invalid:focus {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

.form-group select option {
    padding: 8px 12px;
    background: white;
    color: #374151;
}

.form-group select:disabled {
    background: #f8fafc;
    color: #9ca3af;
    cursor: not-allowed;
    opacity: 0.7;
}

.form-group select:disabled:hover {
    border-color: #e2e8f0;
}

/* Ensure date input has same padding as other inputs */
.form-group input[type="date"] {
    padding: 10px 16px !important;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-weight: 500;
    color: #374151;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.delete-info {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 16px;
    margin-top: 16px;
    color: #991b1b;
}

/* Mobile Responsive for Languages */
@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }

    .table-header {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }

    .data-table {
        font-size: 0.875rem;
    }

    .data-table th,
    .data-table td {
        padding: 8px 12px;
    }

    .modal-content {
        width: 95%;
        margin: 20px;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 16px;
    }
}

/* Flag Image Styles */
.language-name {
    display: flex;
    align-items: center;
    gap: 8px;
}

.language-name-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.language-name-line {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.language-name-cell .language-name {
    font-weight: 500;
}

.language-code-sub {
    font-size: 0.8rem;
    color: #64748b;
}

.language-code-flag-line {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
}

.language-flag-inline .flag-display-image {
    display: inline-block;
}

.language-flag-cell {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.language-flag-cell .flag-display-image {
    display: inline-block;
}

.flag-image {
    width: 16px;
    height: 12px;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.flag-display-image {
    width: 24px;
    height: 18px;
    border-radius: 3px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.language-code {
    font-family: 'Courier New', monospace;
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.flag-display {
    font-size: 1.2rem;
}

.flag-emoji,
.flag-display-emoji {
    font-size: 1.2rem;
}

/* Translations Page Styles */
.translations-page {
    background: #f8fafc;
}

.translations-page .table-container .data-table {
    table-layout: fixed;
    width: 100%;
}

.translations-page .table-container .data-table th:nth-child(1),
.translations-page .table-container .data-table .translation-key-cell {
    width: 28%;
    max-width: 28%;
    overflow: hidden;
}

.translations-page .table-container .data-table .translation-key-cell .translation-key {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.translations-page .table-container .data-table th:nth-child(3),
.translations-page .table-container .data-table td:nth-child(3) {
    width: 92px;
    min-width: 92px;
    max-width: 92px;
    white-space: nowrap;
    padding-left: 8px;
    padding-right: 8px;
    box-sizing: border-box;
    overflow: hidden;
}

.translations-page .table-container .data-table td:nth-child(3) .action-buttons {
    display: inline-flex;
    flex-wrap: nowrap;
    gap: 4px;
    max-width: 100%;
}

.filters-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.filters-container {
    display: flex;
    align-items: end;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 200px;
}

.filter-group label {
    font-weight: 500;
    color: #374151;
    font-size: 0.9rem;
}

.filter-group select,
.filter-group input {
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: border-color 0.2s ease;
}

.filter-group select:focus,
.filter-group input:focus {
    outline: none;
    border-color: #0B1E3F;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.translation-key {
    font-family: 'Courier New', monospace;
    background: #f1f5f9;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #475569;
}

.translation-value {
    max-width: 300px;
    word-wrap: break-word;
    line-height: 1.4;
}

.translation-value:empty::before {
    content: "(empty)";
    color: #9ca3af;
    font-style: italic;
}

/* Languages page - smaller badges (10% reduction) */
.languages-page .default-badge {
    font-size: 0.675rem;
    padding: 3px 10px;
    border-radius: 16px;
}

.languages-page .status-badge {
    font-size: 0.675rem;
    padding: 2px 10px;
    border-radius: 16px;
}

/* Languages page - Actions column minimal width, no overflow */
.languages-page .table-container .data-table th:nth-child(2),
.languages-page .table-container .data-table td:nth-child(2) {
    width: 1%;
    min-width: 110px;
    white-space: nowrap;
    padding-left: 10px;
    padding-right: 10px;
}

.languages-page .table-container .data-table td:nth-child(2) .action-buttons {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
}

@media (max-width: 768px) {
    .filters-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        min-width: auto;
    }
    
    .translation-value {
        max-width: 200px;
    }
}

/* Footer Language Selector */
.custom-language-dropdown {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.selected-language {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 60px;
    transition: border-color 0.2s ease;
}

.selected-language:hover {
    border-color: rgba(255, 255, 255, 0.5);
}

.flag-icon {
    width: 20px;
    height: 15px;
    border-radius: 2px;
    object-fit: cover;
}

.dropdown-arrow {
    margin-left: auto;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    transition: transform 0.2s ease;
}

.custom-language-dropdown.active .dropdown-arrow {
    transform: rotate(180deg);
}

.language-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #1f2937;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    display: none;
    margin-top: 4px;
}

.custom-language-dropdown.active .language-options {
    display: block;
}

.language-option {
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
    height: 40px;
}

.language-option:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.language-option:first-child {
    border-radius: 8px 8px 0 0;
}

.language-option:last-child {
    border-radius: 0 0 8px 8px;
}

.language-option:only-child {
    border-radius: 8px;
}

/* Footer Language Selector Responsive */
@media (max-width: 768px) {
    .selected-language {
        padding: 6px 10px;
        min-width: 50px;
    }
    
    .flag-icon {
        width: 18px;
        height: 13px;
    }
    
    .dropdown-arrow {
        font-size: 10px;
    }
    
    .language-option {
        height: 35px;
    }
}

.header-actions {
    margin: 20px 0;
    display: flex;
    gap: 12px;
}

/* Ensure button text is visible in header actions */
.header-actions .btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.header-actions .btn-primary i {
    display: inline-block;
}

/* Ensure modal title is visible */
#modalTitle {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Toast Notifications – above modals (modals use 10000–10004) */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 16px 24px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    z-index: 10100;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
    max-width: 400px;
    word-wrap: break-word;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-success {
    border-left: 4px solid #10b981;
}

.toast-success::before {
    content: "\2713";
    display: inline-block;
    margin-right: 8px;
    color: #10b981;
    font-weight: bold;
}

.toast-error {
    border-left: 4px solid #ef4444;
}

.toast-error::before {
    content: "\2717";
    display: inline-block;
    margin-right: 8px;
    color: #ef4444;
    font-weight: bold;
}

.toast-info {
    border-left: 4px solid #0B1E3F;
}

.toast-info::before {
    content: "\2139";
    display: inline-block;
    margin-right: 8px;
    color: #0B1E3F;
    font-weight: bold;
}

/* Responsive Toast */
@media (max-width: 768px) {
    .toast {
        right: 10px;
        left: 10px;
        max-width: calc(100% - 20px);
        transform: translateY(100px);
    }
    
    .toast.show {
        transform: translateY(0);
    }
}

/* Checkbox Wrapper Styles */
.checkbox-wrapper {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    margin-bottom: 8px;
}

.custom-checkbox {
    width: 20px;
    height: 20px;
    min-width: 20px;
    max-width: 20px;
    cursor: pointer;
    accent-color: #0B1E3F;
    flex-shrink: 0;
    flex-basis: 20px;
}

.checkbox-label {
    cursor: pointer;
    margin: 0;
    font-weight: 500;
    font-size: 16px;
    color: #333;
    display: flex;
    align-items: center;
    line-height: 1;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.active,
.modal.show {
    display: flex !important;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.modal-content {
    background: #fff;
    border-radius: 12px;
    max-width: 700px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 10001;
}

.modal-content.modal-large {
    width: 95%;
}

/* Create contract modal – platāks, lai pakalpojumu rindās labi redzētu cenu un mērvienību */
#createContractModal .modal-content {
    max-width: 900px;
}

/* Invoice Preview Modal – platums fiksēts, augstums pēc satura (auto) */
#previewInvoiceModal .modal-content {
    width: 90%;
    max-width: 700px;
    height: auto;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 0;
}

#previewInvoiceModal .modal-header {
    flex-shrink: 0;
    padding: 16px 24px;
    border-bottom: 1px solid #e5e7eb;
    min-height: 60px;
}

#previewInvoiceModal .modal-body {
    flex: 0 1 auto;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 0;
    background: #f5f7fa;
    min-height: 0;
}

/* Noklusējums: PDF priekšskatījumam (ja lieto PDF) */
#previewInvoiceModal #preview_invoice_frame {
    width: 100%;
    height: 1122px;
    max-height: calc(90vh - 100px);
    border: none;
    flex: none;
    background: #f5f7fa;
}

/* Augstums pēc satura – tikai platumu definējam, augstumu iestata JS pēc iframe satura */
#previewInvoiceModal.preview-modal-auto-height #preview_invoice_frame {
    height: auto;
    min-height: 200px;
    max-height: calc(90vh - 100px);
}

/* Contract Preview Modal Specific Styles */
#previewContractModal .modal-content {
    width: 90%;
    max-width: 700px;
    height: 90vh;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 0;
}

#previewContractModal .modal-header {
    flex-shrink: 0;
    padding: 16px 24px;
    border-bottom: 1px solid #e5e7eb;
    min-height: 60px;
}

#previewContractModal .modal-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 0;
    background: #f5f7fa;
    min-height: 0;
}

#previewContractModal #preview_contract_frame {
    width: 100%;
    height: 100%;
    border: none;
    flex: 1;
    min-height: 0;
    background: #f5f7fa;
}

/* Quick Insert Buttons */
.quick-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
    width: 100%;
}

.quick-label {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

.quick-btn {
    padding: 4px 12px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 12px;
    font-family: 'Courier New', monospace;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-btn:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
    color: #1e293b;
}

.quick-btn:active {
    background: #cbd5e1;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6b7280;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #f3f4f6;
    color: #374151;
}

.modal-body {
    padding: 24px;
}

/* Invoice Filter Buttons */
.invoice-filters-wrapper {
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    flex-wrap: wrap;
}

.invoice-filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    flex: 1;
    align-items: flex-end;
}

/* Status + Client on one row (client to the right of status) */
.invoice-filters-status-client {
    flex-wrap: nowrap;
}
.invoice-filters-status-client .filter-client-wrapper {
    min-width: 200px;
    flex: 1;
    max-width: 320px;
}

.invoice-filters .form-group {
    margin: 0;
    min-width: 180px;
}

.invoice-filters .form-group label {
    margin-bottom: -8px;
    font-size: 0.8rem;
    font-weight: 500;
}

.invoice-filters .form-group select {
    padding: 10px 12px;
    font-size: 0.875rem;
}

.invoice-filters .form-group input {
    padding: 10px 12px;
    font-size: 0.875rem;
}

.btn-filter {
    padding: 10px 20px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    color: #64748b;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-filter:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #475569;
}

.btn-filter-active,
.btn-filter.btn-filter-active {
    background: linear-gradient(135deg, #0B1E3F, #4a2270);
    color: white;
    border-color: #4a2270;
}

.btn-filter-active:hover,
.btn-filter.btn-filter-active:hover {
    background: linear-gradient(135deg, #4a2270, #4a2270);
    border-color: #4a2270;
}

/* Date Filter Section */
.invoice-date-filters {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-end;
    min-width: 300px;
}

.date-filter-link {
    color: #0B1E3F;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 4px 0;
    transition: all 0.2s ease;
    white-space: nowrap;
    cursor: pointer;
}

.date-filter-link:hover {
    color: #4a2270;
    text-decoration: underline;
}

.date-filter-link.active {
    color: #4a2270;
    font-weight: 600;
    text-decoration: underline;
}

.btn-filter-date {
    padding: 10px 16px;
    font-size: 13px;
    white-space: nowrap;
}

.date-range-inputs {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.date-range-inputs .form-group {
    margin: 0;
    min-width: 150px;
}

.date-range-inputs .form-group label {
    margin-bottom: -8px;
    font-size: 0.8rem;
    font-weight: 500;
}

.date-range-inputs .form-group input {
    padding: 10px 12px;
    font-size: 0.875rem;
}

.date-range-inputs .btn-primary {
    padding: 10px 20px;
    font-size: 0.875rem;
    min-height: 44px;
    box-sizing: border-box;
    white-space: nowrap;
}

/* Row for client filter indicator: between status/client and manual reminder, left-aligned */
.invoice-filters-indicator-row {
    margin-top: -5px;
    margin-bottom: -10px;
    display: flex;
    justify-content: flex-start;
}

/* Bottom row: manual reminder (left) + period links (right) on same level */
.invoice-filters-bottom-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

/* Period links below date inputs */
.date-range-links {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: -5px;
}

/* Rēķinu lapas responsivitāte – vidēji šaurs ekrāns */
@media (max-width: 992px) {
    .company-invoices-page .header-actions,
    .header-actions {
        flex-wrap: wrap;
        gap: 12px;
    }
    .company-invoices-page .header-actions > div:first-child,
    .header-actions > div:first-child {
        flex: 1 1 auto;
    }
    .company-invoices-page .header-actions > div:last-child,
    .header-actions > div:last-child {
        flex: 0 0 auto;
    }
    .invoice-filters-wrapper {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }
    .invoice-filters-status-client {
        flex-wrap: wrap;
    }
    .invoice-filters-status-client .form-group {
        min-width: 0;
        flex: 1 1 140px;
    }
    .invoice-filters-status-client .filter-client-wrapper {
        max-width: none;
        min-width: 0;
        flex: 1 1 200px;
    }
    .invoice-date-filters {
        min-width: 0;
        width: 100%;
        align-items: stretch;
    }
    .date-range-inputs {
        flex-wrap: wrap;
    }
    .date-range-inputs .form-group {
        min-width: 0;
        flex: 1 1 120px;
    }
    .invoice-filters-bottom-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        margin-top: 0 !important;
    }
    .date-range-links {
        flex-wrap: wrap;
    }
    .manual-reminder-indicator {
        max-width: 100%;
        min-width: 0;
    }
}

@media (max-width: 768px) {
    .invoice-filters-wrapper {
        flex-direction: column;
        gap: 16px;
    }
    
    .invoice-filters-status-client {
        flex-wrap: wrap;
    }
    .invoice-filters-status-client .form-group {
        min-width: 0;
        width: 100%;
        flex: 1 1 100%;
    }
    .invoice-filters-status-client .filter-client-wrapper {
        max-width: none;
        width: 100%;
    }
    
    .invoice-date-filters {
        width: 100%;
        align-items: stretch;
        min-width: 0;
    }
    
    .date-range-inputs {
        width: 100%;
        flex-direction: column;
    }
    
    .date-range-inputs .form-group {
        width: 100%;
        min-width: 0;
    }
    
    .date-range-inputs .btn-primary {
        width: 100%;
    }
    
    .invoice-filters-bottom-row {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .header-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .header-actions > div:last-child {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }
    /* Rēķini: mobilā turpinām rindu (Izveidot Rēķinu + "..." blakus) */
    .company-invoices-page .header-actions {
        flex-direction: row !important;
        align-items: center;
    }
    .company-invoices-page .header-actions > div:first-child {
        flex: 1 1 auto;
        min-width: 0;
    }
    .company-invoices-page .header-actions > div:last-child {
        flex: 0 0 auto;
    }
}

/* Rēķini: mobilā – slēpt 3 ikonu pogas, rādīt vienu "..." un modālu ar opcijām */
@media (max-width: 768px) {
    .company-invoices-page .invoices-header-actions-desktop,
    .invoices-header-actions-desktop {
        display: none !important;
    }
    .company-invoices-page .invoices-header-actions-mobile-trigger,
    .invoices-header-actions-mobile-trigger {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
        padding: 0 !important;
        flex-shrink: 0;
        border-radius: 6px;
    }
    /* Mobilā: "Izveidot Rēķinu" un "..." vienā rindā; Izveidot Rēķinu aizpilda atlikušo platumu */
    .company-invoices-page .header-actions {
        flex-direction: row !important;
        align-items: center;
        gap: 10px;
    }
    .company-invoices-page .header-actions > div:first-child {
        flex: 1 1 auto;
        min-width: 0;
    }
    .company-invoices-page .header-actions .btn-primary {
        width: 100%;
        justify-content: center;
    }
    .company-invoices-page .header-actions > div:last-child.invoices-header-actions-right {
        flex: 0 0 auto;
    }
}

/* Rēķinu nosūtīšanas žurnāla modālis */
.invoice-send-journal-modal-content {
    max-width: 720px;
    width: 92vw;
}
.invoice-send-journal-subtitle {
    margin-bottom: 12px;
}
.invoice-send-journal-table th,
.invoice-send-journal-table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: top;
}
.invoice-send-journal-table th {
    font-weight: 600;
    color: #374151;
    background: #f9fafb;
}
.invoice-send-journal-meta {
    color: #6b7280;
    font-size: 12px;
    font-weight: normal;
}
.invoice-send-journal-loading,
.invoice-send-journal-empty {
    padding: 16px 0;
    color: #6b7280;
}
.invoice-send-journal-fallback-notice {
    display: none;
    margin: 0 0 12px;
    padding: 10px 12px;
    font-size: 13px;
    line-height: 1.45;
    color: #4b5563;
    background: #f3f4f6;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.sent-date-with-journal-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.sent-date-with-journal-inline .sent-date-text {
    min-width: 0;
}
.invoice-send-journal-trigger {
    cursor: pointer;
    flex-shrink: 0;
}
.invoice-send-journal-trigger:focus-visible {
    outline: 2px solid var(--primary-color, #0B1E3F);
    outline-offset: 2px;
    border-radius: 4px;
}

@media (min-width: 769px) {
    .company-invoices-page .invoices-header-actions-mobile-trigger,
    .invoices-header-actions-mobile-trigger {
        display: none !important;
    }
}

/* Modāls: Augšupielādēt / Importēt / Eksportēt opcijas */
.company-invoices-page .header-actions,
.company-invoices-page .finance-menu-nav,
.company-invoices-page .invoices-header-actions-desktop,
.company-invoices-page .invoices-export-dropdown {
    overflow: visible;
}

.invoices-export-dropdown {
    position: relative;
    display: inline-flex;
}

.invoices-export-dropdown > summary {
    list-style: none;
    cursor: pointer;
}

.invoices-export-dropdown > summary::-webkit-details-marker {
    display: none;
}

.invoices-export-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 10050;
    min-width: 220px;
    margin: 0;
    padding: 4px 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.invoices-export-dropdown:not([open]) .invoices-export-dropdown-menu {
    display: none;
}

.invoices-export-dropdown[open] .invoices-export-dropdown-menu {
    display: block;
}

.invoices-export-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    font: inherit;
    color: #64748b;
}

.invoices-export-dropdown-item:hover {
    background: #f8fafc;
    color: #0B1E3F;
}

.invoices-header-actions-modal-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.invoices-header-actions-modal-options .invoices-header-action-option {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    justify-content: flex-start;
    padding: 12px 16px;
    text-align: left;
}
.invoices-header-actions-modal-options .invoices-header-action-option i {
    font-size: 1.1rem;
    opacity: 0.9;
}
#invoicesHeaderActionsModal .modal-content {
    max-width: 360px;
}

/* Finance module start menu – aligned with system header-actions */
.company-users-submenu {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 16px;
    margin-bottom: 16px;
}
.company-users-submenu .header-actions {
    display: inline-flex;
}
.finance-start-menu {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
    flex-wrap: wrap;
}
.finance-start-menu .header-actions {
    display: inline-flex;
}
/* Apakšizvēlne vienā rindā; zem tās – rīku rinda (poga kreisajā, papildu darbības labajā) */
.finance-start-menu--stacked {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
}
.finance-start-menu--stacked .finance-menu-nav {
    width: 100%;
}
.finance-start-menu--stacked > .header-actions {
    display: flex;
    width: 100%;
    margin: 0;
    justify-content: flex-start;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
}
.finance-start-menu--stacked.finance-start-menu--toolbar-split > .header-actions {
    justify-content: space-between;
    align-items: center;
}
.finance-menu-nav {
    display: flex;
    gap: 4px;
}
.finance-menu-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    color: #64748b;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 8px;
    transition: color 0.2s, background 0.2s;
}
.finance-menu-link:hover {
    color: #1e293b;
    background: #f1f5f9;
}
.finance-menu-link.active {
    color: #0B1E3F;
    background: #eff6ff;
}

/* Abonementu apakšlapas – submenu pogas: paceltas / uzkrītošas */
.company-subscriptions-page .company-users-submenu .finance-menu-nav,
.company-pricing-plan-page .company-users-submenu .finance-menu-nav,
.paid-modules-page .company-users-submenu .finance-menu-nav {
    gap: 10px;
    flex-wrap: wrap;
}
.company-subscriptions-page .company-users-submenu .finance-menu-link,
.company-pricing-plan-page .company-users-submenu .finance-menu-link,
.paid-modules-page .company-users-submenu .finance-menu-link {
    background: #ffffff;
    color: #475569;
    border: 1px solid #e2e8f0;
    font-weight: 600;
    padding: 10px 16px;
    border-radius: 10px;
    box-shadow:
        0 2px 5px rgba(15, 23, 42, 0.08),
        0 1px 2px rgba(15, 23, 42, 0.04);
    transition:
        color 0.2s,
        background 0.2s,
        border-color 0.2s,
        box-shadow 0.2s,
        transform 0.2s;
}
.company-subscriptions-page .company-users-submenu .finance-menu-link:hover,
.company-pricing-plan-page .company-users-submenu .finance-menu-link:hover,
.paid-modules-page .company-users-submenu .finance-menu-link:hover {
    color: #0f172a;
    background: #ffffff;
    border-color: #cbd5e1;
    box-shadow:
        0 8px 18px rgba(15, 23, 42, 0.12),
        0 2px 6px rgba(15, 23, 42, 0.06);
    transform: translateY(-2px);
}
.company-subscriptions-page .company-users-submenu .finance-menu-link.active,
.company-pricing-plan-page .company-users-submenu .finance-menu-link.active,
.paid-modules-page .company-users-submenu .finance-menu-link.active {
    color: #0b1e3f;
    background: #eff6ff;
    border-color: #93c5fd;
    box-shadow:
        0 5px 14px rgba(11, 30, 63, 0.15),
        0 2px 5px rgba(37, 99, 235, 0.12);
    transform: translateY(-1px);
}
.finance-start-menu .btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
/* Augšupielādēt bankas datus – bez animācijas, ikona centrā */
#financeUploadBtn {
    justify-content: center;
    min-width: 44px;
    padding: 10px 12px !important;
}
#financeUploadBtn:hover {
    transform: none !important;
    box-shadow: none !important;
}

/* Ienākošie rēķini – josla un pogas */
.incoming-invoices-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid #e2e8f0;
    flex-wrap: wrap;
}
.incoming-invoices-bar-status {
    margin: 0;
    color: #475569;
    font-size: 0.95rem;
}
.incoming-invoices-bar-status i {
    margin-right: 6px;
    color: #64748b;
}
.incoming-invoices-bar .header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}
.incoming-invoices-daily-report-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-right: 4px;
}
.incoming-invoices-daily-report-label {
    font-size: 0.875rem;
    color: #475569;
    max-width: 200px;
    line-height: 1.25;
}
.incoming-invoices-daily-report-switch.switch {
    flex-shrink: 0;
}
@media (max-width: 640px) {
    .incoming-invoices-daily-report-label {
        max-width: 140px;
    }
}
.incoming-invoices-bar .btn-icon-only {
    min-width: 44px;
    padding: 10px 12px !important;
    justify-content: center;
}
.incoming-invoices-bar .btn-icon-only:hover {
    transform: none !important;
    box-shadow: none !important;
}
.header-content-incoming-invoices {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.header-content-incoming-invoices-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.header-content-incoming-invoices-title-row h1 {
    margin: 0;
}
.header-content-incoming-invoices-desc {
    margin: 0;
    color: #64748b;
}
.incoming-invoices-list-header-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.incoming-invoices-list-header-btns {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.incoming-invoices-payment-modal-content {
    max-width: 520px;
}
.incoming-invoices-select-col {
    width: 44px;
    text-align: center;
    vertical-align: middle;
}
.incoming-invoices-select-col-empty {
    min-width: 44px;
    width: 44px;
}
.incoming-invoices-select-col .incoming-invoices-select-all,
.incoming-invoice-row-cb {
    width: 18px;
    height: 18px;
    cursor: pointer;
    vertical-align: middle;
}
.header-content-incoming-invoices .incoming-invoices-limit-progress {
    flex-shrink: 0;
    min-width: 144px;
    max-width: 320px;
}
/* Noliktavas ierobežojuma progress (tāpat kā ienākošie rēķini) */
.header-content-warehouse .header-content-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.header-content-warehouse .header-content-title-row h1 {
    margin: 0;
}
.header-content-warehouse-desc {
    margin: 0;
    color: #64748b;
}
.company-payroll-personnel-page .payroll-placeholder-msg {
    margin: 24px 0;
    color: #64748b;
    font-size: 0.95rem;
}
.company-payroll-personnel-page .payroll-profession-hint-footer {
    margin: 8px 0 0;
    font-size: 0.8125rem;
    line-height: 1.45;
    color: #64748b;
}
.company-payroll-personnel-page .payroll-profession-hint-footer a {
    color: #0B1E3F;
    text-decoration: underline;
    font-weight: 500;
}
.company-payroll-personnel-page .payroll-profession-hint-footer a:hover {
    color: #1e3a5f;
}
.company-payroll-personnel-page .payroll-profession-hint-sep {
    margin: 0 6px;
    color: #94a3b8;
}
.company-payroll-personnel-page .payroll-position-hint-wrap .logistics-hint-dropdown {
    z-index: 10060;
}

.company-payroll-personnel-page a.finance-menu-link.disabled {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
}
.header-content-warehouse .payroll-limit-progress {
    flex-shrink: 0;
    min-width: 144px;
    max-width: 320px;
}
.header-content-warehouse .warehouse-limit-progress {
    flex-shrink: 0;
    min-width: 144px;
    max-width: 320px;
}
@media (max-width: 768px) {
    .header-content-incoming-invoices-title-row {
        flex-direction: column;
        align-items: flex-start;
    }
    .header-content-incoming-invoices .incoming-invoices-limit-progress {
        width: 100%;
        max-width: none;
    }
    .header-content-warehouse .header-content-title-row {
        flex-direction: column;
        align-items: flex-start;
    }
    .header-content-warehouse .warehouse-limit-progress,
    .header-content-warehouse .payroll-limit-progress {
        width: 100%;
        max-width: none;
    }
}
/* Loģistikas modulis: h1 pa kreisi, progress pa labi */
.header-content-logistics .header-content-logistics-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.header-content-logistics .header-content-logistics-title-row h1 {
    margin: 0;
}
.header-content-logistics-desc {
    margin: 0;
    color: #64748b;
}
.header-content-logistics .logistics-limit-progress {
    flex-shrink: 0;
    min-width: 144px;
    max-width: 320px;
}
.logistics-progress-bars-wrap {
    margin-bottom: 16px;
    padding: 14px 16px 28px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}
.logistics-progress-bars-inner {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.logistics-progress-bars-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.logistics-progress-bars-title-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.logistics-progress-dashboard-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 4px;
    margin: -4px;
    font-size: 0.75rem;
    color: #475569;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}
.logistics-progress-dashboard-toggle input {
    margin: 0;
    cursor: pointer;
    width: 1.05rem;
    height: 1.05rem;
}
.dashboard-logistics-progress-chart-card .logistics-progress-bars-wrap {
    margin: 0;
    border: none;
    padding: 0 0 28px;
    background: transparent;
}
.dashboard-logistics-progress-chart-card .logistics-progress-bars-inner {
    gap: 10px;
}
.logistics-progress-bars-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: #0f172a;
}
.logistics-progress-bars-period {
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 600;
}
.logistics-progress-item-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 6px;
    font-size: 0.8rem;
}
.logistics-progress-item-label-col {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
    min-width: 0;
}
.logistics-progress-item-label-main {
    color: #334155;
    font-weight: 600;
    line-height: 1.35;
}
.logistics-progress-item-products {
    display: block;
    color: #64748b;
    font-weight: 500;
    font-size: 0.72rem;
    line-height: 1.35;
    word-break: break-word;
}
.logistics-progress-item-label {
    color: #334155;
    font-weight: 600;
    line-height: 1.35;
    flex: 1;
    min-width: 0;
}
.logistics-progress-item-stats {
    color: #64748b;
    white-space: nowrap;
    flex-shrink: 0;
}
.logistics-progress-item-pct-sep {
    font-weight: 400;
    color: #94a3b8;
}
.logistics-progress-item-pct {
    font-weight: 700;
    color: #334155;
}
.logistics-progress-bar-fill--over {
    background: linear-gradient(90deg, #22c55e, #16a34a);
}
.logistics-progress-bar-track {
    height: 10px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}
.logistics-progress-bar-fill {
    border-radius: 999px;
    background: linear-gradient(90deg, #3b82f6, #2563eb);
    min-width: 0;
}
.logistics-progress-view-hint {
    font-size: 0.9rem;
    color: #64748b;
    margin: 0 0 16px;
    line-height: 1.5;
    max-width: 52rem;
}
.logistics-hint-wrap {
    position: relative;
}
.logistics-hint-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    margin-top: 4px;
    max-height: 220px;
    overflow-y: auto;
    z-index: 10050;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
}
.logistics-hint-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s;
}
.logistics-hint-item:last-child {
    border-bottom: none;
}
.logistics-hint-item:hover {
    background: #f8fafc;
}
.logistics-hint-item--muted {
    cursor: default;
    color: #64748b;
    font-size: 0.875rem;
}
.logistics-hint-item-name {
    font-weight: 500;
    color: #334155;
}
.logistics-hint-item-meta {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 2px;
}
.logistics-product-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}
.logistics-product-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px 4px 10px;
    background: #e0f2fe;
    border: 1px solid #7dd3fc;
    border-radius: 999px;
    font-size: 0.8rem;
    color: #0c4a6e;
    max-width: 100%;
}
.logistics-product-badge-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 220px;
}
.logistics-product-badge-x {
    border: none;
    background: transparent;
    color: #0369a1;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    border-radius: 4px;
}
.logistics-product-badge-x:hover {
    background: rgba(3, 105, 161, 0.12);
}
.logistics-progress-products-cell {
    max-width: 280px;
    font-size: 0.875rem;
    line-height: 1.4;
    color: #475569;
}

.logistics-list-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.logistics-list-toolbar-title {
    margin-right: auto;
    font-weight: 600;
    font-size: 0.95rem;
    color: #334155;
}
.logistics-archive-btn i {
    margin-right: 6px;
    opacity: 0.9;
}
.logistics-status-delivered-badge {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}
.logistics-doc-date {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 2px;
}
.logistics-trip-meta-line {
    margin-top: 3px;
    line-height: 1.35;
}
.logistics-trip-meta-k {
    font-weight: 600;
    color: #475569;
    margin-right: 4px;
}
.logistics-doc-status {
    margin-top: 6px;
}
.logistics-status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0.02em;
}
.logistics-status-waiting-carrier {
    background: #fed7aa;
    color: #9a3412;
}
.logistics-status-on-the-way {
    background: #ede9fe;
    color: #5b21b6;
    border: 1px solid #c4b5fd;
}
.logistics-clickable {
    cursor: pointer;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px;
    transition: color 0.15s ease;
}
.logistics-clickable:hover {
    color: var(--landing-primary, #0B1E3F);
}
@media (max-width: 768px) {
    .header-content-logistics .header-content-logistics-title-row {
        flex-direction: column;
        align-items: flex-start;
    }
    .header-content-logistics .logistics-limit-progress {
        width: 100%;
        max-width: none;
    }
}
.incoming-invoices-connected .incoming-invoices-reenter-password-wrap {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}
.incoming-invoices-connected .incoming-invoices-sync-status,
.incoming-invoices-connected .incoming-invoices-sync-error {
    margin-top: 12px;
}
.incoming-invoices-connected .incoming-invoices-sync-error.alert {
    margin-bottom: 0;
}
.incoming-invoices-reenter-verify-error {
    margin-top: 12px;
    margin-left: auto;
    max-width: 320px;
    padding: 10px 14px;
    background: #fef2f2 !important;
    color: #b91c1c !important;
    border: 1px solid #fecaca;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: right;
}
.incoming-invoices-reenter-step2 {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}
#incomingInvoicesReenterModal .input-group input,
#incomingInvoicesSetupCard .input-group input {
    padding-right: 48px;
}
.input-group-no-icon input {
    padding-left: 12px;
}

/* Ienākošie rēķini – pilnekrāna ielāde: lapas centrā, sistēmas krāsa, fons blur */
.incoming-invoices-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
}
.incoming-invoices-loading-overlay[aria-hidden="false"] {
    display: flex;
}
.incoming-invoices-loading-overlay .incoming-invoices-loading-spinner {
    background: #fff;
    padding: 40px 48px;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}
.incoming-invoices-loading-overlay .spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e2e8f0;
    border-top-color: #0B1E3F;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
.incoming-invoices-loading-overlay .loading-text {
    color: #0B1E3F;
    font-weight: 600;
    font-size: 1rem;
    margin: 0;
}
body.incoming-invoices-page-loading .dashboard-main {
    filter: blur(4px);
    pointer-events: none;
}
.incoming-invoices-date-cell {
    white-space: nowrap;
}
.incoming-invoices-time {
    display: block;
    font-size: 0.85em;
    color: var(--text-muted, #666);
    margin-top: 2px;
}
.incoming-invoices-issuer,
.incoming-invoices-recipient {
    display: block;
    font-size: 0.7em;
    color: var(--text-muted, #666);
    margin-top: 2px;
}
.incoming-invoices-recipient {
    margin-top: 3px;
}
.incoming-invoices-actions-col {
    width: auto;
    max-width: min(320px, 36vw);
    white-space: normal;
    vertical-align: top;
}
.incoming-invoices-actions-btns {
    white-space: nowrap;
    text-align: right;
    margin-bottom: 4px;
}
.incoming-invoices-view-btn,
.incoming-invoices-paid-btn,
.incoming-invoices-delete-btn {
    padding: 6px 10px;
}
.incoming-invoices-actions-col .btn-icon-only {
    margin: 0 2px;
}
.incoming-invoices-actions-payment-meta {
    margin-top: 6px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color, #e2e8f0);
    font-size: 0.78em;
    line-height: 1.45;
    color: var(--text-muted, #64748b);
    text-align: left;
    word-break: break-word;
}
.incoming-invoices-paid-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 8px;
    font-size: 0.8em;
    background: var(--success-bg, #e8f5e9);
    color: var(--success-fg, #2e7d32);
    border-radius: 4px;
}
.incoming-invoices-row-paid {
    opacity: 0.85;
}
.incoming-invoices-amount-paid-struck {
    text-decoration: line-through;
}
.incoming-invoices-amount-payment-meta {
    margin-top: 6px;
    font-size: 0.78em;
    line-height: 1.4;
    color: var(--text-muted, #64748b);
    text-align: left;
}
.incoming-invoices-pay-meta-line {
    display: block;
    word-break: break-all;
}
.incoming-invoices-pay-meta-k {
    font-weight: 600;
    margin-right: 4px;
    color: var(--text-secondary, #475569);
}
.incoming-invoices-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 0.5rem;
}
.incoming-invoices-list-header h2 {
    margin: 0;
}
.incoming-invoices-total-tr {
    border-top: 1px solid var(--border-color, #e2e8f0);
}
.incoming-invoices-total-tr td {
    padding-top: 10px;
    vertical-align: middle;
}
#incomingInvoicesEmailsTable tbody tr:last-child td {
    border-bottom: none;
}
.incoming-invoices-total-tr .incoming-invoices-amount-col {
    font-weight: 600;
}
.incoming-invoices-view-modal-content {
    max-width: 560px;
}
.incoming-invoices-view-sender,
.incoming-invoices-view-time {
    margin-bottom: 0.75em;
}
.incoming-invoices-view-body-wrap {
    margin-top: 0.5em;
}
.incoming-invoices-view-body {
    margin-top: 0.25em;
    padding: 10px;
    background: var(--bg-muted, #f5f5f5);
    border-radius: 6px;
    max-height: 320px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.9em;
}
#incomingInvoicesPdfModal .modal-content.incoming-invoices-pdf-modal-content {
    max-width: 710px;
    max-height: calc(90vh + 10px);
    overflow: hidden;
}
.incoming-invoices-pdf-modal-content .incoming-invoices-pdf-iframe-wrap {
    min-height: calc(70vh + 10px);
    margin: 0 -1rem -1rem;
    overflow: hidden;
}
.incoming-invoices-pdf-iframe-wrap iframe {
    width: 100%;
    height: calc(70vh + 10px);
    border: 0;
    display: block;
}
.incoming-invoices-due-days {
    display: block;
    font-size: 0.85em;
    margin-top: 2px;
}
.incoming-invoices-due-future {
    color: #0d7d3d;
}
.incoming-invoices-due-today {
    color: #c25a00;
}
.incoming-invoices-due-overdue {
    color: #b32d2e;
}
.incoming-invoices-row-paid .incoming-invoices-actions-col {
    opacity: 0.85;
}

/* Horizontālā ritināšana: labā kolonna (Test PDF, PDF, Apskate u.tml.) paliek fiksēta labajā malā */
#incomingInvoicesEmailsTable th.incoming-invoices-actions-col,
#incomingInvoicesEmailsTable td.incoming-invoices-actions-col {
    position: sticky;
    right: 0;
    z-index: 2;
    background-color: #ffffff;
    box-shadow: -6px 0 12px -8px rgba(15, 23, 42, 0.12);
}
#incomingInvoicesEmailsTable thead th.incoming-invoices-actions-col {
    z-index: 3;
    background-color: #f9fafb;
}

.incoming-invoices-info-description {
    margin-top: 1.5rem;
    margin-left: auto;
    padding: 0.75rem 0;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}
.incoming-invoices-info-text {
    font-size: 0.8125rem;
    line-height: 1.5;
    color: #6b7280;
    margin: 0;
}
.incoming-invoices-info-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.35rem;
    padding: 0.2rem 0.4rem;
    border: none;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    vertical-align: middle;
    border-radius: 4px;
}
.incoming-invoices-info-toggle:hover {
    color: #374151;
    background: rgba(0, 0, 0, 0.05);
}
.incoming-invoices-info-rest {
    margin-top: 0.5rem;
}
.incoming-invoices-info-rest[hidden] {
    display: none;
}

.incoming-invoices-pdf-debug {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}
.incoming-invoices-pdf-debug-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #374151;
    margin: 0 0 0.5rem 0;
}
.incoming-invoices-pdf-debug-textarea {
    display: block;
    width: 100%;
    box-sizing: border-box;
    min-height: 12rem;
    padding: 0.65rem 0.75rem;
    font-size: 0.75rem;
    line-height: 1.45;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    color: #1f2937;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    resize: vertical;
}
.incoming-invoices-pdf-debug-textarea:focus {
    outline: none;
    border-color: #94a3b8;
    background: #fff;
}

#financeUploadBtn i {
    margin: 0;
}

/* Finance categories view – uses .form-group, .services-table, .btn-primary, .btn-icon */
.finance-categories-view {
    padding: 0;
}
.finance-category-form.form-row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
    margin-bottom: 20px;
}
.finance-actions-col {
    white-space: nowrap;
    width: 1%;
}
.finance-actions-btns {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.finance-actions-btns .btn-icon {
    margin: 0;
}
.finance-schedule-view {
    padding: 0;
}
.finance-schedule-view-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 16px;
    gap: 12px;
    flex-wrap: wrap;
}
.finance-schedule-view-switcher {
    display: flex;
    gap: 4px;
}
.finance-view-btn {
    padding: 8px 10px;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 6px;
    background: var(--bg-secondary, #f5f5f5);
    color: var(--text-primary, #333);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.finance-view-btn i {
    font-size: 1.35rem;
}
.finance-view-btn:hover {
    background: var(--bg-hover, #eee);
}
.finance-view-btn.active {
    background: var(--primary, #0B1E3F);
    border-color: var(--primary, #0B1E3F);
    color: #fff;
}
.finance-schedule-month-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
    padding: 8px 0;
}
.finance-schedule-month-label {
    font-weight: 600;
    min-width: 180px;
    text-align: center;
}
.finance-schedule-year-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
    padding: 8px 0;
}
.finance-schedule-year-label {
    font-weight: 600;
    min-width: 100px;
    text-align: center;
}
.finance-month-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 6px;
    background: var(--bg-secondary, #f5f5f5);
    color: var(--text-primary, #333);
    cursor: pointer;
}
.finance-month-nav:hover {
    background: var(--bg-hover, #eee);
}
.finance-schedule-section {
    margin-bottom: 28px;
}
.finance-schedule-section:last-child {
    margin-bottom: 0;
}
.finance-schedule-difference-block {
    margin-top: 8px;
    padding-top: 12px;
    border-bottom: 0;
}
/* Mēneša skats: vienots pirmās kolonnas platums (kategorijas) un paplašinātāja kolonna */
#financeScheduleMonthView .finance-schedule-section .services-table {
    table-layout: fixed;
    width: 100%;
}
#financeScheduleMonthView .finance-schedule-section .services-table thead th:first-child,
#financeScheduleMonthView .finance-schedule-section .services-table tbody td:first-child {
    width: 58%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
#financeScheduleMonthView .finance-schedule-section .services-table .finance-expand-col {
    width: 40px;
}
.finance-schedule-heading-row--table-below {
    border-bottom: none;
    margin-bottom: 8px;
    padding-bottom: 0;
}
.finance-profitability-year-row td:first-child {
    font-weight: 600;
    color: #1e293b;
}
/* Gada skats: vienots pirmās (nozīmju) kolonnas platums starp trim tabulām */
#financeScheduleYearView .finance-schedule-months-table {
    table-layout: fixed;
    width: 100%;
}
#financeScheduleYearView .finance-schedule-months-table thead th:first-child,
#financeScheduleYearView .finance-schedule-months-table tbody td:first-child {
    width: 12rem;
    max-width: 32%;
    word-wrap: break-word;
    overflow-wrap: break-word;
    vertical-align: top;
}
.finance-difference-row td {
    padding-top: 12px;
    border-bottom:0;
}
.finance-difference-row.finance-section-head .finance-section-head-label {
    font-weight: 700;
}
.finance-schedule-months-table th.finance-total-col,
.finance-schedule-months-table td.finance-total-col {
    text-align: right;
    white-space: nowrap;
}
.finance-schedule-months-table .finance-section-head td.finance-total-col {
    font-weight: 700;
}
.finance-year-total-col {
    font-weight: 700;
    border-left: 1px solid #e2e8f0;
    padding-left: 12px;
}
.finance-schedule-year-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.finance-schedule-year-table-wrapper .finance-schedule-months-table {
    min-width: min-content;
}
.finance-schedule-year-table-wrapper .finance-schedule-months-table tbody tr:last-child td {
    border-bottom: 0;
}
/* Gada skats: katrs otrais mēnesis ar fonu (izņemot 1. kol. un "Kopā") */
#financeScheduleYearView .finance-schedule-months-table thead th:not(:first-child):not(.finance-year-total-col):nth-child(2n+1),
#financeScheduleYearView .finance-schedule-months-table tbody td:not(:first-child):not(.finance-year-total-col):nth-child(2n+1) {
    background: #f8fafc;
}
.finance-section-head td {
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}
.finance-section-head:first-child td {
    border-top: none;
}
.finance-section-head-label {
    font-weight: 700;
    color: #1e293b;
}
.finance-schedule-heading-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 0 12px 0;
    padding-bottom: 6px;
    border-bottom: 1px solid #e2e8f0;
}
.finance-schedule-heading {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}
.finance-schedule-section-total {
    font-weight: 700;
    color: #1e293b;
    white-space: nowrap;
}
#financeScheduleYearView .finance-schedule-section-total {
    display: none;
}
#financeScheduleYearView .finance-schedule-difference-block .finance-section-head-label {
    visibility: hidden;
}
.finance-category-other {
    color: #64748b;
    font-style: italic;
}
.finance-total-col {
    text-align: right !important;
    white-space: nowrap;
}
.finance-expand-col {
    width: 40px;
    text-align: center;
    vertical-align: middle;
}
.finance-category-toggle {
    padding: 4px 8px;
    border: none;
    background: transparent;
    color: var(--text-secondary, #64748b);
    cursor: pointer;
    border-radius: 4px;
}
.finance-category-toggle:hover {
    color: var(--primary, #0B1E3F);
    background: rgba(37, 99, 235, 0.08);
}
.finance-category-toggle i {
    font-size: 0.875rem;
}
/* Pelēko rindiņu zem kategorijas rāda tikai kad transakciju saraksts atvērts */
#financeScheduleIncomeTable .finance-category-drop-target td,
#financeScheduleExpenseTable .finance-category-drop-target td {
    border-bottom: none;
}
.finance-category-detail-row td {
    padding: 0;
    border-top: none;
    background: var(--bg-secondary, #f8fafc);
    vertical-align: top;
    overflow-x: hidden;
    overflow-y: visible;
    max-width: 100%;
}
.finance-category-detail-row:not(.finance-detail-closed) td {
    border-top: 1px solid #e5e7eb;
}
.finance-transactions-list {
    padding: 12px 16px 12px 40px;
    max-height: 1120px;
    overflow-x: hidden;
    overflow-y: auto;
    transition: max-height 0.28s ease-out, padding-top 0.28s ease-out, padding-bottom 0.28s ease-out;
}
.finance-tx-hint {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0 0 10px 0;
    padding: 10px 12px;
    font-size: 0.8125rem;
    line-height: 1.4;
    color: #475569;
    background: rgba(37, 99, 235, 0.06);
    border: 1px solid rgba(37, 99, 235, 0.2);
    border-radius: 8px;
}
.finance-tx-hint-icon {
    flex-shrink: 0;
    margin-top: 1px;
    color: #0B1E3F;
    font-size: 1rem;
}
.finance-tx-hint-text {
    flex: 1;
}
.finance-tx-bulk-bar {
    margin: 0 0 12px 0;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}
.finance-tx-bulk-bar-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
}
.finance-tx-bulk-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}
.finance-tx-bulk-bar .finance-tx-bulk-category-select {
    min-width: 200px;
    max-width: 100%;
    padding: 6px 10px;
    font-size: 0.875rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
}
.finance-tx-bulk-meta {
    font-size: 0.8125rem;
    color: #64748b;
}
/* Viena kolonna: vilkt augšā, checkbox apakšā; šauri = tik platu cik ikona + rūtiņa */
.finance-tx-list col.finance-tx-col-actions {
    width: 36px;
}
.finance-tx-list col.finance-tx-col-date {
    width: 9.25rem;
}
.finance-tx-list col.finance-tx-col-uploader {
    width: 9rem;
}
.finance-tx-list col.finance-tx-col-amount {
    width: 10.75rem;
}
.finance-tx-list th.finance-tx-date-col,
.finance-tx-list td.finance-tx-date-col {
    white-space: nowrap;
    overflow: visible;
}
.finance-tx-list th.finance-total-col,
.finance-tx-list td.finance-total-col {
    white-space: nowrap;
    overflow: visible;
}
/* Atlikusī platība — apraksts (col.finance-tx-col-desc bez width) */
.finance-tx-actions-col {
    width: 36px;
    min-width: 36px;
    max-width: 36px;
    text-align: center;
    vertical-align: middle;
    padding: 2px 1px !important;
    box-sizing: border-box;
}
.finance-tx-list th.finance-tx-actions-col--header {
    max-width: 36px;
    min-width: 36px;
    width: 36px;
    padding: 2px 0 !important;
}
.finance-tx-actions-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
}
.finance-tx-actions-grip {
    display: block;
    line-height: 1;
    color: #94a3b8;
    user-select: none;
}
.finance-tx-actions-grip i {
    font-size: 0.72rem;
}
.finance-tx-actions-col .finance-tx-check,
.finance-tx-actions-col .finance-tx-select-all {
    width: 1rem;
    height: 1rem;
    margin: 0;
    cursor: pointer;
    flex-shrink: 0;
}
.finance-tx-actions-col.finance-tx-drag-handle {
    cursor: grab;
}
.finance-tx-actions-col.finance-tx-drag-handle:active {
    cursor: grabbing;
}
.finance-tx-check-col {
    width: 36px;
    text-align: center;
    vertical-align: middle;
}
.finance-tx-check-col input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    cursor: pointer;
    margin: 0;
    vertical-align: middle;
}
.finance-tx-list th.finance-tx-check-col {
    line-height: 1;
}
.finance-category-detail-row.finance-detail-closed {
    display:none;
}
.finance-category-detail-row.finance-detail-closed .finance-transactions-list {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    overflow: hidden;
    visibility: hidden;
}
.finance-tx-list {
    width: 100%;
    table-layout: fixed;
    font-size: 0.875rem;
    border-collapse: collapse;
    border-spacing: 0;
}
.finance-tx-list .finance-tx-desc-cell {
    width: auto;
    min-width: 0;
    word-wrap: break-word;
}
.finance-tx-list th,
.finance-tx-list td {
    padding: 6px 10px;
    text-align: left;
    border: none;
    vertical-align: middle;
}
.finance-tx-list .finance-total-col {
    text-align: right;
}
.finance-tx-empty {
    margin: 0;
    color: #64748b;
    font-size: 0.875rem;
}
.finance-tx-drag-col {
    width: 28px;
    text-align: center;
    vertical-align: middle;
}
.finance-tx-invoices-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    margin-top: 5px;
}
.finance-tx-invoice-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.finance-tx-invoice-badges--block {
    flex-direction: column;
    align-items: flex-start;
    flex-wrap: nowrap;
    gap: 3px;
}
.finance-tx-invoices-wrap--purpose {
    flex-direction: column;
    align-items: flex-start;
}
.finance-tx-invoice-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
    min-width: 0;
}
.finance-tx-invoice-move-btn {
    border: 0;
    background: transparent;
    color: #475569;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
}
.finance-tx-invoice-move-btn--disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.finance-tx-invoice-move-btn:hover {
    color: #1d4ed8;
}
.finance-tx-invoice-move-btn--disabled:hover {
    color: #475569;
}
.finance-tx-invoice-line-amt-wrap {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
}
.finance-tx-invoice-line .finance-tx-invoice-badge {
    max-width: none;
    overflow: visible;
    text-overflow: clip;
    flex-shrink: 0;
}
.finance-tx-invoice-line:first-child {
    margin-top: 0;
}
.finance-tx-invoice-line-amt {
    font-size: 0.78rem;
    font-weight: 600;
    color: #334155;
    white-space: nowrap;
}
.finance-tx-invoice-line-amt-sub {
    font-size: 0.68rem;
    color: #64748b;
    line-height: 1.1;
}
.finance-tx-total-sub {
    font-size: 0.68rem;
    color: #64748b;
    line-height: 1.1;
    margin-top: 2px;
}
.finance-move-invoice-modal-wrap {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.finance-move-invoice-label {
    font-size: 14px;
    color: #334155;
    font-weight: 700;
}
.finance-move-invoice-hint-wrap {
    position: relative;
}
#financeTxMoveInvoiceInput.finance-move-invoice-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    color: #0f172a;
    background: #fff;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
#financeTxMoveInvoiceInput.finance-move-invoice-input:focus {
    outline: none;
    border-color: #0B1E3F;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
#financeTxMoveInvoiceHints.autocomplete-dropdown {
    width: 100%;
    max-height: 240px;
    overflow-y: auto;
}
#financeTxMoveInvoiceModal .modal-content {
    overflow: visible;
    max-height: none;
}
#financeTxMoveInvoiceModal .modal-body {
    overflow: visible;
    max-height: none;
}
.finance-tx-invoice-badge--hint {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(37, 99, 235, 0.35);
}
.finance-tx-invoice-badge--clickable {
    cursor: pointer;
}
.finance-tx-invoice-badge--clickable:hover {
    background: rgba(37, 99, 235, 0.18);
    border-color: rgba(37, 99, 235, 0.6);
}
.finance-tx-invoice-total-hint {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 3px;
    padding-left: 2px;
}
.finance-tx-invoices {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 5px;
}
.finance-tx-invoice-badge {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 4px;
    background: rgba(11, 30, 63, 0.07);
    color: #1e40af;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    border: 1px solid rgba(11, 30, 63, 0.15);
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s;
}
.finance-tx-invoice-badge--assigned {
    background: rgba(22, 163, 74, 0.12);
    border-color: rgba(22, 163, 74, 0.4);
    color: #15803d;
}
.finance-tx-split-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 9px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    background: #f8fafc;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    line-height: 1.6;
    transition: background 0.12s, color 0.12s;
}
.finance-tx-split-btn:hover {
    background: #e2e8f0;
    color: #1e293b;
    border-color: #94a3b8;
}
.finance-tx-split-btn i {
    font-size: 0.72rem;
}
.finance-tx-split-btn[aria-expanded="true"] {
    background: #e0f2fe;
    color: #0369a1;
    border-color: #7dd3fc;
}
.finance-tx-split-panel {
    margin-top: 7px;
    padding: 7px 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 7px;
}
.finance-tx-split-loading {
    text-align: center;
    color: #94a3b8;
    padding: 6px 0;
}
.finance-tx-split-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    border-bottom: 1px solid #f1f5f9;
    flex-wrap: wrap;
}
.finance-tx-split-row:last-child {
    border-bottom: none;
}
.finance-tx-split-inv {
    font-weight: 600;
    color: #1e293b;
    font-size: 0.79rem;
    min-width: 105px;
}
.finance-tx-split-amt {
    color: #475569;
    font-size: 0.79rem;
    min-width: 85px;
    text-align: right;
}
.finance-tx-split-cat-sel {
    flex: 1;
    min-width: 130px;
    max-width: 220px;
    padding: 3px 7px;
    font-size: 0.79rem;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    background: #fff;
}
.finance-tx-split-cat-sel:disabled {
    opacity: 0.6;
}
.finance-tx-split-status {
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}
.finance-tx-split-ok {
    color: #16a34a;
    font-size: 0.85rem;
}
.finance-tx-drag-handle {
    cursor: grab;
    color: #94a3b8;
    padding: 4px 6px;
    user-select: none;
}
.finance-tx-drag-handle:active {
    cursor: grabbing;
}
.finance-tx-row {
    cursor: pointer;
}
.finance-tx-row.finance-tx-row--no-move {
    cursor: default;
}
.finance-tx-row.finance-tx-selected td {
    background-color: rgba(37, 99, 235, 0.12) !important;
    border: none !important;
}
.finance-tx-row.finance-tx-selected {
    outline: 1px solid rgba(37, 99, 235, 0.45);
    outline-offset: -1px;
}
.finance-tx-row.finance-dragging {
    opacity: 0.5;
}
.finance-category-drop-target.finance-drop-over {
    background: rgba(37, 99, 235, 0.12);
    outline: 2px dashed var(--primary, #0B1E3F);
    outline-offset: -2px;
}
.finance-upload-hint {
    margin-bottom: 16px;
    color: #64748b;
}
.finance-upload-modal-body {
    position: relative;
}
.finance-upload-loading {
    display: none;
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 0 0 12px 12px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px;
    z-index: 10;
}
.finance-upload-loading[aria-hidden="false"],
.modal.finance-modal-uploading .finance-upload-loading {
    display: flex !important;
}
.finance-upload-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e2e8f0;
    border-top-color: #0B1E3F;
    border-radius: 50%;
    animation: finance-spin 0.8s linear infinite;
}
@keyframes finance-spin {
    to { transform: rotate(360deg); }
}
.finance-upload-loading-text {
    margin: 0;
    font-weight: 500;
    color: #475569;
}
body.finance-upload-page-loading .dashboard-main,
body.finance-upload-page-loading .finance-start-menu {
    filter: blur(4px);
    pointer-events: none;
}
.company-finance-page .modal-footer .btn-primary,
.company-finance-page .modal-footer .btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Services Table Styles */
.services-container {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-top: 24px;
}

.service-info {
    display: flex;
    flex-direction: column;
}

.service-name {
    font-weight: 600;
    color: #111827;
}

.service-article {
    font-size: 12px;
    color: #6b7280;
}

.services-table-wrapper {
    overflow-x: auto;
}

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

/* Rēķinu tabula: auto layout, lai termiņa, summas un statusa kolonnas normāli attīstās (fixed layout tos saspieda) */

.services-table thead {
    background: #f9fafb;
}

.services-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
}

.services-table td {
    padding: 16px;
    border-bottom: 1px solid #e5e7eb;
    color: #6b7280;
}

/* Rēķinu kājenes tabuliņa – bez redzamām robežām (krāsa = fons) */
#invoicesTable .invoices-totals-mini-table td {
    border: none !important;
    border-bottom: 1px solid #f8fafc !important;
}

/* User groups: drag column and drag states */
#groupsTable .col-drag {
    width: 40px;
    padding: 12px 8px;
    vertical-align: middle;
}
#groupsTable .drag-handle {
    cursor: grab;
    color: #94a3b8;
    display: inline-flex;
}
#groupsTable .drag-handle:active {
    cursor: grabbing;
}
#groupsTable .col-drag-disabled .drag-handle.disabled {
    cursor: not-allowed;
    color: #cbd5e1;
    opacity: 0.6;
}
#groupsTable tr.group-row-draggable {
    cursor: default;
}
#groupsTable tr.group-row-draggable.group-row-dragging {
    opacity: 0.9;
    background: #f8fafc;
}

/* Bieza zila līnija – kur tiks ievietota rinda (drag-and-drop) */
#groupsTable tr.group-drop-indicator {
    height: 0;
    padding: 0;
    margin: 0;
    border: none;
    vertical-align: middle;
}
#groupsTable tr.group-drop-indicator td.group-drop-indicator-cell {
    height: 0;
    padding: 0;
    border: none;
    line-height: 0;
    vertical-align: middle;
}
#groupsTable .group-drop-line {
    height: 4px;
    background: #0B1E3F;
    border-radius: 2px;
    margin: 0;
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.3);
}

/* Opcijas (lapu saraksts) — viena zem otras */
.group-access-pages-list,
.group-access-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 60vh;
    overflow-y: auto;
}
.group-access-checkboxes .checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.group-page-block {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 14px;
    background: #fafafa;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
}
/* Apakšlapa (Definētie pakalpojumi zem Rēķiniem, Definētie līgumi zem Dokumentu pārvaldības) */
.group-page-block.group-page-block--sub {
    margin-left: 24px;
    margin-top: 6px;
    background: #f4f4f5;
    border-color: #e4e4e7;
}
.group-page-view-wrap {
    flex-shrink: 0;
}
.group-page-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 28px;
}
.group-page-row.group-page-view {
    font-weight: 500;
    color: #374151;
    width: 100%;
    justify-content: space-between;
}
.group-page-view-left {
    display: flex;
    align-items: center;
    gap: 8px;
}
.group-page-view-right.group-page-all-actions-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    color: #374151;
    font-size: 13px;
}
.group-page-view-right.group-page-all-actions-inline.is-hidden {
    display: none;
}
/* Lapas darbības rādītas tikai kad lapa ir atzīmēta (is-active); opcijas viena zem otras */
.group-page-actions {
    margin-top: 6px;
    margin-left: 24px;
    display: none;
    flex-direction: column;
    gap: 4px;
}
.group-page-block.is-active .group-page-actions {
    display: flex;
}
.group-page-actions .group-page-row,
.group-page-actions .group-page-action-item {
    font-weight: normal;
    color: #6b7280;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.group-page-actions .checkbox-label {
    font-weight: normal;
}

.group-access-modal-content {
    max-width: 560px;
}

/* Popup ziņojumi (nevis alert) */
.site-user-groups-toast-container {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}
.site-user-groups-toast {
    padding: 12px 18px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    font-size: 14px;
    line-height: 1.4;
    max-width: 320px;
    animation: site-user-groups-toast-in 0.25s ease;
}
.site-user-groups-toast-success { background: #d1fae8; color: #065f46; border: 1px solid #a7f3d0; }
.site-user-groups-toast-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.site-user-groups-toast-info { background: #dbeafe; color: #4a2270; border: 1px solid #bfdbfe; }
@keyframes site-user-groups-toast-in {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.group-access-hint {
    margin-bottom: 1rem;
    color: #6b7280;
    font-size: 14px;
}

.group-form-hint {
    margin-bottom: 1rem;
    color: #6b7280;
    font-size: 14px;
}
.confirm-delete-text {
    margin: 0 0 0.5rem 0;
    color: #374151;
    font-size: 15px;
    line-height: 1.4;
}
.group-form-languages .form-group {
    margin-bottom: 1rem;
}
.group-form-languages .form-group label {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
    color: #374151;
}
.group-form-languages .form-group input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
}
/* Grupu tabula: 3 kolonnas (velkšana | nosaukums | darbības), skaidra līdzība */
#groupsTable {
    table-layout: fixed;
    width: 100%;
}
#groupsTable thead th {
    border-bottom: none;
}
#groupsTable th.col-drag,
#groupsTable td.col-drag {
    width: 44px;
    min-width: 44px;
    max-width: 44px;
    box-sizing: border-box;
}
#groupsTable th.col-max,
#groupsTable td.col-max {
    width: 70px;
    min-width: 70px;
    max-width: 70px;
    box-sizing: border-box;
    text-align: center;
    vertical-align: middle;
}
#groupsTable .group-max-switch {
    margin: 0;
    display: inline-block;
}
#groupsTable th:not(.col-drag):not(.col-actions):not(.col-max),
#groupsTable td:not(.col-drag):not(.col-actions):not(.col-max) {
    min-width: 0;
}
#groupsTable th.col-actions,
#groupsTable td.col-actions {
    width: 160px;
    min-width: 160px;
    max-width: 160px;
    box-sizing: border-box;
    white-space: nowrap;
    text-align: right;
    padding-left: 12px;
    padding-right: 12px;
    border: none;
    vertical-align: middle;
}
#groupsTable td {
    border-bottom: none;
}
/* Darbību kolonna: pogas VIENĀ HORIZONTĀLĀ RINDĀ, savā kolonnā */
#groupsTable td.col-actions {
    vertical-align: middle;
    text-align: right;
    line-height: 1;
}
#groupsTable td.col-actions .groups-actions-row {
    display: inline-flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}
#groupsTable td.col-actions .btn-icon,
#groupsTable td.col-actions .btn {
    display: inline-flex !important;
    flex-shrink: 0 !important;
    margin: 0 !important;
}
#groupsTable .col-actions .btn-icon:last-child {
    margin: 0 !important;
}

/* Piedāvājumu tabula: nepārtraukta border-bottom visā rindas platumā */
#offersTable tbody tr {
    box-shadow: 0 1px 0 0 #e5e7eb;
}
#offersTable tbody td {
    border-bottom: none;
}

/* Klienta nosaukums: vienā rindā, ja neietilpst – saīsināts ar "..." */
#offersTable .offers-client-cell {
    max-width: 35%;
    overflow: hidden;
}
#offersTable .offers-client-name {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Darbību "..." poga: desktopā slēpta, mobilā redzama */
.offers-actions-more-btn {
    display: none;
}

/* PC: "..." pogu nerāda, vienmēr rāda visas darbību pogas; backdrop un panel wrapper slēpti */
@media (min-width: 769px) {
    #offersTable .offers-actions-more-btn {
        display: none !important;
    }
    #offersTable .offers-actions-backdrop {
        display: none !important;
    }
    #offersTable .offers-actions-panel {
        display: flex !important;
        flex-wrap: nowrap;
        gap: 6px;
    }
    #offersTable .offers-actions-panel-status,
    #offersTable .offers-actions-panel-date {
        display: none !important;
    }
    #offersTable .offers-actions-list {
        display: flex !important;
    }
}

/* Mobilā: rāda tikai "..." pogu; nospiežot – pilnekrāna overlay ar sidebar */
@media (max-width: 768px) {
    #offersTable .offers-actions-cell-inner {
        position: relative;
    }
    table.services-table#offersTable th:nth-child(1),
    table.services-table#offersTable td:nth-child(1),
    table.services-table#offersTable th:nth-child(3),
    table.services-table#offersTable td:nth-child(3) {
        display: none;
    }
    table.services-table#offersTable th:nth-child(5) {
        font-size: 0;
        line-height: 0;
        padding: 12px 8px;
        width: 1%;
        white-space: nowrap;
    }
    #offersTable .offers-amount-vat,
    #offersTable .invoice-amount-vat {
        font-size: 75% !important;
    }
    #offersTable .offers-client-name {
        font-size: 90%;
    }
    #offersTable .offers-actions-more-btn {
        display: inline-flex;
    }
    #offersTable .offers-actions-list {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 9999;
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 0;
        padding: 0;
        background: transparent;
        border: none;
        border-radius: 0;
        box-shadow: none;
    }
    #offersTable .offers-actions-cell-inner.is-open .offers-actions-list {
        display: flex;
    }
    #offersTable .offers-actions-backdrop {
        flex: 1;
        min-width: 0;
        background: rgba(0, 0, 0, 0.4);
        cursor: pointer;
    }
    #offersTable .offers-actions-panel {
        width: 280px;
        max-width: 85vw;
        background: #fff;
        display: flex;
        flex-direction: column;
        gap: 12px;
        padding: 24px;
        box-shadow: -2px 0 12px rgba(0, 0, 0, 0.15);
        overflow-y: auto;
    }
    #offersTable .offers-actions-panel-date {
        padding-bottom: 12px;
        margin-bottom: 0;
        border-bottom: 1px solid #e5e7eb;
    }
    #offersTable .offers-actions-panel-date .offers-panel-date-value {
        font-weight: 600;
        color: #1e293b;
        font-size: 15px;
    }
    #offersTable .offers-actions-panel-date .offer-number {
        font-size: 12px;
        color: #6b7280;
        margin-top: 4px;
    }
    #offersTable .offers-actions-panel-status {
        padding-bottom: 16px;
        margin-bottom: 8px;
        border-bottom: 1px solid #e5e7eb;
    }
    #offersTable .offers-actions-panel-status .sent-date {
        margin-top: 6px;
    }
    #offersTable .offers-actions-cell-inner.is-open .offers-actions-panel .btn-icon {
        justify-content: flex-start;
        padding: 12px 16px;
    }
    /* Uz mobilās: parāda ikonu nozīmes aiz ikonām sidebarā */
    #offersTable .offers-actions-panel .btn-action-label {
        display: inline;
        margin-left: 8px;
        font-size: 14px;
        white-space: nowrap;
    }
}

/* Darbību pogās tekstus desktopā nerāda (tikai ikonas) */
.btn-action-label {
    display: none;
}

/* Rēķinu tabula: nepārtraukta border-bottom visā rindas platumā */
#invoicesTable tbody tr {
    box-shadow: 0 1px 0 0 #e5e7eb;
}
#invoicesTable tbody td {
    border-bottom: none;
}

/* Rēķinu darbības: "..." poga noklusējumā slēpta */
.inv-actions-more-btn {
    display: none;
}

/* Platāks par 1200px: rēķinu tabulā rāda visas darbību pogas inline */
@media (min-width: 1200px) {
    #invoicesTable .inv-actions-more-btn {
        display: none !important;
    }
    #invoicesTable .inv-actions-backdrop {
        display: none !important;
    }
    #invoicesTable .inv-actions-list {
        display: flex !important;
    }
    #invoicesTable .inv-actions-panel {
        display: flex !important;
        flex-wrap: nowrap;
        gap: 6px;
        align-items: flex-start;
    }
    #invoicesTable .inv-actions-panel .btn-action-label {
        display: none !important;
    }
    #invoicesTable .inv-actions-panel-term {
        display: none !important;
    }
    #invoicesTable .inv-actions-panel-amount {
        display: none !important;
    }
    #invoicesTable .inv-actions-panel-status {
        display: none !important;
    }
}

/* Šaurāks par 1000px: rēķinu tabulā slēpt 3. kolonnu (termiņš), termiņa info rādīt side menu virs pogām */
@media (max-width: 999px) {
    table.services-table#invoicesTable th:nth-child(3),
    table.services-table#invoicesTable td:nth-child(3) {
        display: none;
    }
    #invoicesTable .inv-actions-panel-term {
        display: block !important;
        padding-bottom: 14px;
        margin-bottom: 10px;
        border-bottom: 1px solid #e5e7eb;
        font-size: 14px;
        color: #374151;
        line-height: 1.4;
    }
    #invoicesTable .inv-actions-panel-term .invoice-term-date {
        font-weight: 600;
    }
    #invoicesTable .inv-actions-panel-term-label {
        font-weight: 600;
        font-size: 12px;
        color: #6b7280;
        text-transform: uppercase;
        letter-spacing: 0.02em;
        margin-bottom: 6px;
    }
    #invoicesTable .inv-actions-panel-term .payment-status {
        margin-top: 4px;
        font-size: 11px; /* ~10% mazāk nekā 12px */
        color: #6b7280;
    }
}

/* Mobilā (<768px): rēķinu tabulā slēpt 4. kolonnu (Summa), summas info rādīt side menu virs pogām */
@media (max-width: 768px) {
    #invoicesTableFoot {
        display: none !important;
    }
    #invoicesTable .invoice-number {
        font-size: 75%;
    }
    #invoicesTable .client-name {
        font-size: 90%;
    }
    #invoicesTable .invoice-date,
    #invoicesTable .client-reg-nr {
        font-size: 81%;
    }
    table.services-table#invoicesTable th:nth-child(4),
    table.services-table#invoicesTable td:nth-child(4) {
        display: none;
    }
    #invoicesTable .inv-actions-panel-amount {
        display: block !important;
        padding-bottom: 14px;
        margin-bottom: 10px;
        border-bottom: 1px solid #e5e7eb;
        font-size: 14px;
        color: #374151;
        line-height: 1.4;
    }
    #invoicesTable .inv-actions-panel-amount-label {
        font-weight: 600;
        font-size: 12px;
        color: #6b7280;
        text-transform: uppercase;
        letter-spacing: 0.02em;
        margin-bottom: 6px;
    }
    #invoicesTable .inv-actions-panel-amount .invoice-amount {
        font-weight: 600;
    }
    #invoicesTable .inv-actions-panel-amount .invoice-amount-vat {
        margin-top: 4px;
        font-size: 12px;
        color: #6b7280;
    }
}

/* Kad rēķinu tabulā ir "..." un sidebar (≤1199px): "E-pasts netika piegādāts" nerādīt šūnā, tikai sidebar (panelī) */
@media (max-width: 1199px) {
    #invoicesTable .inv-actions-cell-inner > .email-bounced-warning-in-cell {
        display: none !important;
    }
}

/* Ļoti šaura ekrāna (<500px): rēķinu tabulā slēpt 5. kolonnu (Status), statusa info rādīt sidebar */
@media (max-width: 499px) {
    table.services-table#invoicesTable th:nth-child(5),
    table.services-table#invoicesTable td:nth-child(5) {
        display: none;
    }
    #invoicesTable .inv-actions-panel-status {
        display: block !important;
        padding-bottom: 14px;
        margin-bottom: 10px;
        border-bottom: 1px solid #e5e7eb;
        font-size: 14px;
        color: #374151;
        line-height: 1.4;
    }
    #invoicesTable .inv-actions-panel-status-label {
        font-weight: 600;
        font-size: 12px;
        color: #6b7280;
        text-transform: uppercase;
        letter-spacing: 0.02em;
        margin-bottom: 6px;
    }
    #invoicesTable .inv-actions-panel-status .status-badge {
        display: inline-block;
    }
    #invoicesTable .inv-actions-panel-status .sent-date,
    #invoicesTable .inv-actions-panel-status .payment-method,
    #invoicesTable .inv-actions-panel-status .eds-status {
        margin-top: 4px;
        font-size: 12px;
        color: #6b7280;
    }
}

/* Uz datora (≥1200px), kad nav sidebar režīms: sidebārā nerādīt "E-pasts netika piegādāts" – tas redzams tikai šūnā; panelī tikai kad ir sidebar režīms (≤1199px) */
@media (min-width: 1200px) {
    #invoicesTable .inv-actions-panel .email-bounced-warning.inv-actions-panel-bounced {
        display: none !important;
    }
}

/* Šaurāks par 1200px: rēķinu tabulā "..." poga un sānu izvēlne ar paskaidrojumiem */
@media (max-width: 1199px) {
    #invoicesTable .inv-actions-panel-term {
        display: none;
    }
    #invoicesTable .inv-actions-panel-amount {
        display: none;
    }
    #invoicesTable .inv-actions-panel-status {
        display: none;
    }
    table.services-table#invoicesTable th:nth-child(6) {
        font-size: 0;
        line-height: 0;
    }
    table.services-table#invoicesTable td:nth-child(6) {
        padding: 12px 8px;
        width: 1%;
        min-width: 44px;
        white-space: nowrap;
    }
    #invoicesTable .inv-actions-cell-inner {
        position: relative;
    }
    #invoicesTable .inv-actions-more-btn {
        display: inline-flex;
    }
    #invoicesTable .inv-actions-more-btn i {
        font-size: 16px;
        line-height: 1;
    }
    #invoicesTable .inv-actions-list {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 9999;
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 0;
        padding: 0;
        background: transparent;
        border: none;
        border-radius: 0;
        box-shadow: none;
    }
    #invoicesTable .inv-actions-cell-inner.is-open .inv-actions-list {
        display: flex;
    }
    #invoicesTable .inv-actions-backdrop {
        flex: 1;
        min-width: 0;
        background: rgba(0, 0, 0, 0.4);
        cursor: pointer;
    }
    #invoicesTable .inv-actions-panel {
        width: 330px;
        max-width: 100%;
        background: #fff;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        flex-wrap: nowrap;
        gap: 12px;
        padding: 28px 24px 24px 24px;
        box-shadow: -2px 0 12px rgba(0, 0, 0, 0.15);
        overflow-y: auto;
        overflow-x: visible;
    }
    #invoicesTable .inv-actions-cell-inner.is-open .inv-actions-panel .btn-icon {
        justify-content: flex-start;
        align-items: center;
        padding: 12px 16px;
        width: auto;
        min-width: 0;
        height: auto;
        min-height: 44px;
    }
    #invoicesTable .inv-actions-panel .btn-icon i {
        flex-shrink: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 1.25em;
    }
    #invoicesTable .inv-actions-panel .btn-action-label {
        display: inline;
        margin-left: 8px;
        font-size: 14px;
        white-space: nowrap;
    }
    /* Sūtīšanas pogai side menu – visa fona pulsēšana (ne apaļa), etiķete redzama */
    #invoicesTable .inv-actions-panel .btn-send,
    #invoicesTable .inv-actions-panel .btn-send-draft-pulse {
        overflow: visible;
    }
    #invoicesTable .inv-actions-panel .btn-send-draft-pulse::before {
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        border-radius: 6px;
        transform: none;
        filter: none;
        animation: inv-panel-send-pulse-bg 1.5s ease-in-out infinite;
    }
    #invoicesTable .inv-actions-panel .btn-send-draft-pulse i {
        animation: send-draft-pulse-icon 1.5s ease-in-out infinite;
    }
    @keyframes inv-panel-send-pulse-bg {
        0%, 100% { opacity: 0.25; }
        50% { opacity: 0.5; }
    }
    #invoicesTable .inv-actions-panel-reminder {
        display: flex;
        align-items: center;
        flex-wrap: nowrap;
    }
    /* Sidebar: atstarpe starp atgādinājuma slēdzi un tekstu, lai "A" neapgriežas */
    #invoicesTable .inv-actions-panel .inv-actions-panel-reminder .reminder-label {
        margin-left: 26px !important;
    }
    /* Sidebar: rādīt garo datuma formātu (dienas.mēnesis.gads laiks), darbību kolonnā – īso (dienas.mēnesis + laiks zem tā) */
    #invoicesTable .inv-actions-cell-inner.is-open .manual-reminder-sent-at-short {
        display: none !important;
    }
    #invoicesTable .inv-actions-cell-inner.is-open .manual-reminder-sent-at-long {
        display: block !important;
        white-space: nowrap;
        margin-left: 40px;
    }
}

/* Dokumentu pārvaldības tabula: darbību kolonna pietiekami plata, overflow redzams */
.services-table-wrapper:has(#documentsTable) {
    overflow-x: auto;
}
#documentsTable {
    table-layout: auto;
    width: 100%;
    min-width: 800px;
}
#documentsTable th:nth-child(1),
#documentsTable td:nth-child(1) { width: 28%; min-width: 140px; }
#documentsTable th:nth-child(2),
#documentsTable td:nth-child(2) { width: 28%; min-width: 140px; }
#documentsTable th:nth-child(3),
#documentsTable td:nth-child(3) { width: 14%; min-width: 80px; }
#documentsTable th:nth-child(4),
#documentsTable td:nth-child(4) { width: 15%; min-width: 80px; }
#documentsTable th:nth-child(5),
#documentsTable td:nth-child(5) { width: auto; min-width: 320px; }
#documentsTable tbody tr {
    box-shadow: 0 1px 0 0 #e5e7eb;
}
#documentsTable tbody td {
    border-bottom: none;
}

/* 1. kolonna: līguma numurs un sagataves nosaukums vienā rindā, saīsināts ar "..." */
#documentsTable .docs-doc-number-type-wrap {
    max-width: 100%;
    overflow: hidden;
}
#documentsTable .docs-doc-number-type {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#documentsTable .docs-doc-template-name {
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 2. kolonna: klienta nosaukums un zem tā reģistrācijas numurs */
#documentsTable .docs-client-cell {
    max-width: 35%;
    overflow: hidden;
}
#documentsTable .docs-client-name {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#documentsTable .docs-client-reg-nr {
    display: block;
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: 2px;
}

/* Dokumentu darbības: "..." poga desktopā slēpta */
.docs-actions-more-btn {
    display: none;
}

/* PC (≥1001px): dokumentu tabula – darbību kolonna 320px, pogas vienā rindā, bez overflow */
@media (min-width: 1001px) {
    #documentsTable th:nth-child(5),
    #documentsTable td:nth-child(5) {
        width: 320px;
        min-width: 320px;
        max-width: none;
        overflow: visible;
    }
    #documentsTable .docs-actions-cell-inner,
    #documentsTable .docs-actions-list,
    #documentsTable .docs-actions-panel {
        overflow: visible !important;
    }
    #documentsTable .docs-actions-more-btn {
        display: none !important;
    }
    #documentsTable .docs-actions-backdrop {
        display: none !important;
    }
    #documentsTable .docs-actions-panel {
        display: flex !important;
        flex-wrap: nowrap;
        gap: 6px;
    }
    #documentsTable .docs-actions-list {
        display: flex !important;
    }
    #documentsTable .docs-actions-panel-term,
    #documentsTable .docs-actions-panel-status {
        display: none !important;
    }
}

/* Šaurāks ekrāns (≤1000px): 4. kolonna (Status) slēpta, pogas uz "..." un sidebar; tabula ietilpst ekrānā */
@media (max-width: 1000px) {
    .services-table-wrapper:has(#documentsTable) {
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    #documentsTable {
        min-width: 0;
        width: 100%;
        table-layout: fixed;
    }
    table.services-table#documentsTable th:nth-child(1),
    table.services-table#documentsTable td:nth-child(1) {
        width: 38%;
        min-width: 0;
    }
    table.services-table#documentsTable th:nth-child(2),
    table.services-table#documentsTable td:nth-child(2) {
        width: 38%;
        min-width: 0;
    }
    table.services-table#documentsTable th:nth-child(3),
    table.services-table#documentsTable td:nth-child(3) {
        width: 18%;
        min-width: 0;
    }
    table.services-table#documentsTable th:nth-child(3),
    table.services-table#documentsTable td:nth-child(3) {
        display: none;
    }
    #documentsTable .docs-actions-cell-inner {
        position: relative;
    }
    #documentsTable th:nth-child(5),
    #documentsTable td:nth-child(5) {
        width: 6%;
        min-width: 44px;
        max-width: 52px;
        font-size: 0;
        line-height: 0;
        padding: 12px 8px;
        white-space: nowrap;
        box-sizing: border-box;
    }
    #documentsTable .docs-actions-more-btn {
        display: inline-flex;
    }
    #documentsTable .docs-actions-list {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 9999;
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 0;
        padding: 0;
        background: transparent;
        border: none;
        border-radius: 0;
        box-shadow: none;
    }
    #documentsTable .docs-actions-cell-inner.is-open .docs-actions-list {
        display: flex;
    }
    #documentsTable .docs-actions-backdrop {
        flex: 1;
        min-width: 0;
        background: rgba(0, 0, 0, 0.4);
        cursor: pointer;
    }
    #documentsTable .docs-actions-panel {
        width: 280px;
        max-width: 85vw;
        background: #fff;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        flex-wrap: nowrap;
        gap: 12px;
        padding: 28px 24px 24px 24px;
        box-shadow: -2px 0 12px rgba(0, 0, 0, 0.15);
        overflow-y: auto;
        overflow-x: visible;
    }
    #documentsTable .docs-actions-cell-inner.is-open .docs-actions-panel .btn-icon {
        justify-content: flex-start;
        padding: 12px 16px;
    }
    #documentsTable .docs-actions-panel .btn-action-label {
        display: inline;
        margin-left: 8px;
        font-size: 14px;
        white-space: nowrap;
    }
    #documentsTable .docs-actions-panel-term {
        display: block;
        flex: 0 0 auto;
        width: 100%;
        min-width: 0;
        padding: 10px 0 14px 0;
        margin: 0;
        border-bottom: 1px solid #e5e7eb;
        font-size: 14px;
        line-height: 1.4;
        color: #374151;
    }
    #documentsTable .docs-actions-panel-term div {
        display: block;
        margin-top: 6px;
        line-height: 1.4;
    }
    #documentsTable .docs-actions-panel-term div:first-child {
        margin-top: 0;
    }
    #documentsTable .docs-actions-panel-status {
        display: block;
        flex: 0 0 auto;
        width: 100%;
        min-width: 0;
        padding: 12px 0 16px 0;
        margin: 0;
        border-bottom: 1px solid #e5e7eb;
        line-height: 1.4;
    }
    #documentsTable .docs-actions-panel-status .status-badge {
        display: inline-block;
        line-height: 1.35;
        padding: 6px 12px;
        vertical-align: middle;
    }
    #documentsTable .docs-actions-panel-status div {
        display: block;
        margin-top: 8px;
        font-size: 12px;
        color: #6b7280;
        line-height: 1.4;
    }
    /* Status sidebārā slēpts līdz 768px (≤1000px status vēl rādās tabulā) */
    #documentsTable .docs-actions-panel-status {
        display: none !important;
    }
}

/* Mobilā (≤768px): dokumentu tabula – tabula ietilpst ekrānā, 3. un 4. kolonna slēptas; sidebārā parādās statuss */
@media (max-width: 768px) {
    #documentsTable .docs-actions-panel-status {
        display: block !important;
    }
    .services-table-wrapper:has(#documentsTable) {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }
    #documentsTable {
        min-width: 0;
        width: 100%;
        table-layout: fixed;
    }
    table.services-table#documentsTable th:nth-child(1),
    table.services-table#documentsTable td:nth-child(1) {
        width: 40%;
        min-width: 0;
        max-width: 50%;
    }
    table.services-table#documentsTable th:nth-child(2),
    table.services-table#documentsTable td:nth-child(2) {
        width: 45%;
        min-width: 0;
        max-width: 55%;
    }
    table.services-table#documentsTable th:nth-child(3),
    table.services-table#documentsTable td:nth-child(3),
    table.services-table#documentsTable th:nth-child(4),
    table.services-table#documentsTable td:nth-child(4) {
        display: none;
    }
    table.services-table#documentsTable th:nth-child(5),
    table.services-table#documentsTable td:nth-child(5) {
        width: 15%;
    }
}

/* Klientu tabula: nepārtraukta border-bottom visā rindas platumā */
#clientsTable tbody tr {
    box-shadow: 0 1px 0 0 #e5e7eb;
}
#clientsTable tbody td {
    border-bottom: none;
}

/* Klientu saraksts: lielais sākumburts katrā .details rindiņā (CSS backup, ja tulkojumā ir mazais) */
body.company-clients-page #clientsTable tbody td .details::first-letter {
    text-transform: uppercase;
}

/* Sagatavju tabula (company_set_contracts): nepārtraukta border-bottom visā rindas platumā */
#workpiecesTable tbody tr {
    box-shadow: 0 1px 0 0 #e5e7eb;
}
#workpiecesTable tbody td {
    border-bottom: none;
}

/* Workpieces "..." button: desktop hidden, mobile visible */
.workpieces-actions-more-btn {
    display: none;
}

@media (min-width: 769px) {
    #workpiecesTable .workpieces-actions-more-btn {
        display: none !important;
    }
    #workpiecesTable .workpieces-actions-backdrop {
        display: none !important;
    }
    #workpiecesTable .workpieces-actions-panel {
        display: flex !important;
        flex-wrap: nowrap;
        gap: 6px;
        align-items: center;
    }
    #workpiecesTable .workpieces-actions-panel-row {
        display: none !important;
    }
    #workpiecesTable .workpieces-actions-panel-buttons {
        display: flex !important;
        flex-direction: row;
        gap: 6px;
        padding: 0;
        margin: 0;
        border: none;
    }
    #workpiecesTable .workpieces-actions-list {
        display: flex !important;
    }
}

/* Workpieces mobile: show "..." only; tap opens sidebar with hidden columns + actions */
@media (max-width: 768px) {
    #workpiecesTable .workpieces-actions-cell-inner {
        position: relative;
    }
    table.services-table#workpiecesTable th:nth-child(2),
    table.services-table#workpiecesTable td:nth-child(2),
    table.services-table#workpiecesTable th:nth-child(3),
    table.services-table#workpiecesTable td:nth-child(3),
    table.services-table#workpiecesTable th:nth-child(4),
    table.services-table#workpiecesTable td:nth-child(4) {
        display: none;
    }
    table.services-table#workpiecesTable th:nth-child(5) {
        font-size: 0;
        line-height: 0;
        padding: 12px 8px;
        width: 1%;
        white-space: nowrap;
    }
    #workpiecesTable .workpieces-actions-more-btn {
        display: inline-flex;
    }
    #workpiecesTable .workpieces-actions-list {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 9999;
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 0;
        padding: 0;
        background: transparent;
        border: none;
        border-radius: 0;
        box-shadow: none;
    }
    #workpiecesTable .workpieces-actions-cell-inner.is-open .workpieces-actions-list {
        display: flex;
    }
    #workpiecesTable .workpieces-actions-backdrop {
        flex: 1;
        min-width: 0;
        background: rgba(0, 0, 0, 0.4);
        cursor: pointer;
    }
    #workpiecesTable .workpieces-actions-panel {
        width: 280px;
        max-width: 85vw;
        background: #fff;
        display: flex;
        flex-direction: column;
        gap: 12px;
        padding: 24px;
        box-shadow: -2px 0 12px rgba(0, 0, 0, 0.15);
        overflow-y: auto;
    }
    #workpiecesTable .workpieces-actions-panel-row {
        padding-bottom: 8px;
        font-size: 14px;
        color: #374151;
    }
    #workpiecesTable .workpieces-actions-panel-row .workpieces-panel-label {
        font-weight: 600;
        color: #6b7280;
        margin-right: 6px;
    }
    #workpiecesTable .workpieces-actions-panel-buttons {
        display: flex;
        flex-direction: column;
        gap: 8px;
        padding-top: 12px;
        margin-top: 8px;
        border-top: 1px solid #e5e7eb;
    }
    #workpiecesTable .workpieces-actions-cell-inner.is-open .workpieces-actions-panel .btn-icon {
        justify-content: flex-start;
        padding: 12px 16px;
    }
    #workpiecesTable .workpieces-actions-panel .btn-action-label {
        display: inline;
        margin-left: 8px;
        font-size: 14px;
        white-space: nowrap;
    }
}

/* Pakalpojumu tabula (company_services): nepārtraukta border-bottom visā rindas platumā, vienā līmenī */
#servicesTable tbody tr {
    box-shadow: 0 1px 0 0 #e5e7eb;
}
#servicesTable tbody td {
    border-bottom: none;
}

.services-table tr:hover {
    background: #f9fafb;
}

.services-table tr.pricing-row {
    background-color: #f5f5f5 !important;
}

.services-table tr.pricing-row:hover {
    background-color: #eeeeee !important;
}

.actions-cell {
    width: 1%;
    white-space: nowrap;
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    align-items: center;
    vertical-align: top;
}

.actions-cell .fa-lock {
    color: #9ca3af;
    font-size: 16px;
    padding: 8px;
}

.actions-container {
    display: flex;
    gap: 8px;
}

/* company_api.php – rēķinu opcijas: virsraksts, zem tā opcijas ID, pakalpojumi; darbības kā citur (.btn-icon) */
.company-api-page #optionsTable .company-api-option-main-cell {
    vertical-align: top;
}
.company-api-page #optionsTable .company-api-option-title {
    display: block;
    font-weight: 600;
    color: #0b1e3f;
    line-height: 1.35;
}
.company-api-page #optionsTable .company-api-option-public-id {
    display: block;
    font-size: 0.8125rem;
    color: #6b7280;
    margin-top: 4px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
.company-api-page #optionsTable .company-api-option-services {
    margin-top: 10px;
}
.company-api-page #optionsTable .company-api-option-service-name {
    display: block;
    font-size: 0.875rem;
    line-height: 1.45;
    color: #374151;
    padding: 2px 0;
}
.company-api-page #optionsTable td.actions-cell {
    vertical-align: top;
    text-align: right;
}
.company-api-page #optionsTable td.actions-cell .actions-container {
    justify-content: flex-end;
}

/* Nepārtraukta apakšējā līnija visā rindas platumā (td.actions-cell ir display:flex – border-bottom uz šūnām plīst) */
.company-api-page #optionsTable tbody tr {
    box-shadow: 0 1px 0 0 #e5e7eb;
}
.company-api-page #optionsTable tbody td {
    border-bottom: none;
}

.btn-icon {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #6b7280;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.btn-icon:hover {
    background: #f3f4f6;
    color: #0B1E3F;
}

.btn-icon-danger:hover {
    background: #fef2f2;
    color: #ef4444;
}

.btn-icon-info:hover {
    background: #eff6ff;
    color: #0284c7;
}

.btn-icon-success:hover {
    background: #f0fdf4;
    color: #16a34a;
}

.btn-icon.btn-icon-primary {
    color: #0B1E3F !important;
}

.btn-icon-primary:hover {
    background: #eff6ff;
    color: #0B1E3F;
}

.btn-resend.btn-icon-primary {
    color: #0B1E3F !important;
    border: 1px solid #0B1E3F !important;
}

.btn-resend.btn-icon-primary:hover {
    background: #eff6ff;
    color: #4a2270;
}

.btn-resend:hover {
    background: #f3f4f6;
    color: #0B1E3F;
}

.btn-send.btn-icon-primary {
    border: 1px solid #0B1E3F !important;
}

/* Pulsējoša animācija sūtīšanas pogai, kad rēķins ir draft – no centra uz malu ar blur, bez apmales */
.btn-icon.btn-send-draft-pulse {
    --send-draft-pulse-bg: 59, 130, 246; /* #0B1E3F – sistēmas zils */
    position: relative;
    overflow: hidden;
    border: none;
}

.btn-icon.btn-send-draft-pulse::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 100%;
    height: 100%;
    background: rgba(var(--send-draft-pulse-bg), 0.4);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    transform-origin: center;
    filter: blur(4px);
    animation: send-draft-pulse-center-out 1.5s ease-in-out infinite;
    pointer-events: none;
}

.btn-send-draft-pulse i {
    position: relative;
    z-index: 1;
    animation: send-draft-pulse-icon 1.5s ease-in-out infinite;
}

@keyframes send-draft-pulse-center-out {
    0%, 100% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0.9;
    }
    50% {
        transform: translate(-50%, -50%) scale(0.7);
        opacity: 0.6;
    }
}

@keyframes send-draft-pulse-icon {
    0%, 100% {
        opacity: 0.75;
        transform: scale(0.92);
    }
    50% {
        opacity: 1;
        transform: scale(1.12);
    }
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #9ca3af;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* Client Search Wrapper */
.client-search-wrapper .form-group {
    margin: 0;
}

.client-search-wrapper .form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-weight: 500;
    color: #374151;
}

.client-search-wrapper .form-group label i {
    color: #6b7280;
}

.client-search-wrapper .form-group input {
    width: 100%;
    padding: 10px 16px;
    font-size: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.client-search-wrapper .form-group input:focus {
    outline: none;
    border-color: #0B1E3F;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Form Row for Side-by-Side Fields */
.form-row {
    display: grid;
    gap: 20px;
}

.form-row-2 {
    grid-template-columns: 1fr 1fr;
}

.vat-payer-custom-row {
    align-items: start;
}

.form-row-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

/* Noliktavas modāls: artikuls 40% mazāks, nosaukums aizpilda atlikušo */
.warehouse-add-product-row-sku-name {
    grid-template-columns: 30% 1fr;
}

/* Pievienot preci noliktavā: mērvienība aiz vienības cenas lauka */
.warehouse-price-with-unit {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.warehouse-price-with-unit .warehouse-piece-price-input,
.warehouse-price-with-unit .warehouse-qty-with-unit-input {
    flex: 1;
    min-width: 100px;
}
.warehouse-input-unit-suffix {
    color: #64748b;
    font-size: 0.9375rem;
    font-weight: 500;
    white-space: nowrap;
}

/* Noliktavas saraksts: mērvienība / valūta pie daudzuma un cenas */
.warehouse-list-meta-suffix {
    color: #64748b;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
}

/* Noliktavas saraksts: artikula kods zem nosaukuma, 20% mazāks fonts */
.warehouse-product-sku {
    font-size: 80%;
    color: #64748b;
    margin-top: 2px;
}

/* Saraksta meklēšanas lauks (vienots stils) */
.warehouse-list-search,
.list-search-wrapper {
    margin-bottom: 1rem;
}
.warehouse-list-search {
    display: flex;
    align-items: center;
    gap: 16px;
}
.warehouse-list-search .list-search-input {
    flex: 1;
    min-width: 0;
}
.warehouse-show-zero-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: #475569;
    cursor: pointer;
    white-space: nowrap;
}
.warehouse-show-zero-checkbox input[type="checkbox"] {
    cursor: pointer;
}
.list-search-input,
.warehouse-list-search .list-search-input {
    width: 100%;
    padding: 10px 16px;
    font-size: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.list-search-input:focus,
.warehouse-list-search .list-search-input:focus {
    outline: none;
    border-color: #0B1E3F;
    box-shadow: 0 0 0 3px rgba(11, 30, 63, 0.1);
}

/* Noliktavas saraksts: Darbību kolonna */
#warehouseProductsTable th.col-actions,
#warehouseProductsTable td.col-actions {
    width: 1%;
    white-space: nowrap;
    text-align: right;
    vertical-align: middle;
}
.warehouse-row-actions,
.logistics-row-actions {
    display: inline-flex;
    gap: 6px;
    justify-content: flex-end;
}
.warehouse-row-actions .btn-icon,
.logistics-row-actions .btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.logistics-vehicle-cost-add-form {
    margin-bottom: 20px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
}
.logistics-vehicle-cost-form-grid {
    display: grid;
    gap: 12px;
    align-items: end;
    grid-template-columns: 1fr;
}
.logistics-vehicle-cost-form-field {
    margin: 0;
}
.logistics-vehicle-cost-form-field .form-control {
    width: 100%;
}
@media (min-width: 640px) {
    .logistics-vehicle-cost-form-grid {
        grid-template-columns: 1fr 2fr 1fr;
    }
}
#logisticsVehicleCostsTable .text-right {
    text-align: right;
}

/* Vēstures modāls */
.warehouse-history-product-name {
    font-weight: 600;
    margin-bottom: 12px;
}
.warehouse-history-loading {
    text-align: center;
    padding: 24px;
}
.warehouse-history-list table {
    width: 100%;
}
.warehouse-history-time {
    font-size: 80%;
    color: #64748b;
    margin-top: 2px;
}
.warehouse-delete-product-name {
    font-weight: 600;
    margin-top: 8px;
}
.warehouse-storages-list .warehouse-storage-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    margin-bottom: 6px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}
.warehouse-storages-list .warehouse-storage-item .btn-icon {
    flex-shrink: 0;
}
.form-hint {
    display: block;
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 6px;
    line-height: 1.4;
}
.warehouse-storage-drag-handle {
    cursor: grab;
    color: #9ca3af;
    padding: 4px 8px;
    margin-right: 8px;
    display: inline-flex;
    align-items: center;
    user-select: none;
}
.warehouse-storage-drag-handle:hover {
    color: #6b7280;
}
.warehouse-storage-item-draggable .warehouse-storage-drag-handle:active {
    cursor: grabbing;
}
.warehouse-storage-item-name {
    flex: 1;
}
.warehouse-storage-item.warehouse-storage-dragging {
    opacity: 0.6;
}
.warehouse-storage-empty-icon {
    color: #94a3b8;
    font-size: 1rem;
}
.warehouse-assign-storage-product-name {
    font-weight: 600;
    margin-bottom: 16px;
    padding: 10px 12px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}
.warehouse-storage-empty-icon i {
    opacity: 0.7;
}
/* Zila horizontāla svītra – kur tiks ievietots vilktais bloks (starp blokiem) */
.warehouse-storage-drop-indicator {
    list-style: none;
    padding: 4px 0;
    margin: 0;
    border: none;
    pointer-events: none;
}
.warehouse-storage-drop-line {
    height: 4px;
    background: #3b82f6;
    border-radius: 2px;
    margin: 0;
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.4);
}

/* Ensure all form-group elements in form-row-3 have consistent alignment */
.form-row-3 .form-group {
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.form-row-3 .form-group label {
    margin-bottom: 8px !important;
    margin-top: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    min-height: 1.5rem;
    display: flex;
    align-items: center;
    line-height: 1.5rem;
    height: auto;
}

/* Ensure all invoice form labels have consistent structure */
.invoice-form-label {
    display: flex !important;
    align-items: center !important;
    gap: 6px;
    min-height: 1.5rem !important;
    height: 1.5rem !important;
}

.invoice-term-info-icon {
    color: #0B1E3F;
    font-size: 0.875rem;
    cursor: help;
    flex-shrink: 0;
}

.form-row-3 .form-group input,
.form-row-3 .form-group select {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 12px !important;
    padding-bottom: 12px !important;
    flex: 1;
    box-sizing: border-box;
    height: auto !important;
    min-height: 44px !important;
    max-height: 44px !important;
    line-height: 1.5 !important;
}

.form-row-4 {
    grid-template-columns: 1fr 1fr 1fr 1fr;
}

.form-row-30-70 {
    grid-template-columns: 30% 70%;
    padding-right: 20px;
}

@media (max-width: 1000px) {
    .form-row-4 {
        grid-template-columns: 1fr 1fr;
    }
}

.form-separator {
    height: 1px;
    background: #e5e7eb;
    margin: 24px 0;
    width: 100%;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    justify-content: flex-end;
}

/* Disabled Field Styles */
.disabled-field {
    background-color: #f3f4f6 !important;
    color: #9ca3af !important;
    cursor: not-allowed !important;
    opacity: 0.6;
}

input:disabled,
textarea:disabled,
select:disabled {
    background-color: #f3f4f6 !important;
    color: #9ca3af !important;
    cursor: not-allowed !important;
    opacity: 0.6;
}

input[type="checkbox"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    .form-row,
    .form-row-2,
    .form-row-3,
    .form-row-4,
    .form-row-30-70 {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
    }
    
    .form-actions {
        flex-direction: column-reverse;
        gap: 0;
    }
    
    .form-actions .btn-secondary {
        margin-bottom: 10px;
    }
    
    .form-actions .btn-primary {
        width: 100%;
        text-align: center;
        justify-content: center;
        margin-bottom: 10px;
    }
}

/* Ensure all standard checkboxes are 20px wide */
input[type="checkbox"] {
    width: 20px;
    height: 20px;
    min-width: 20px;
    max-width: 20px;
    flex-shrink: 0;
}

/* Custom checkbox container should remain display:none */
.checkbox-container input[type="checkbox"] {
    display: none;
}

/* Client info in table */
.invoice-number {
    font-weight: 600;
    color: #1f2937;
}

.invoice-date {
    font-size: 0.875rem;
    color: #6b7280;
}

/* Invoice badges for document type and language */
.invoice-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.4;
}

.badge-document-type {
    background-color: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

/* Rēķinu tabula: 1. kolonna (numurs, datums, badge) – nedaudz šaurāk, lai mazāk horizontāli scrollotu */
#invoicesTable td.invoice-first-cell {
    max-width: 118px;
    min-width: 0;
    overflow: hidden;
}
#invoicesTable td.invoice-first-cell .invoice-number {
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#invoicesTable td.invoice-first-cell .invoice-date {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* Uzņemuma (klienta) šūna – pietiekami plata, lai redzētu nosaukumus; ja ir manuālā atgādinājuma rupors, nedaudz šaurāk */
#invoicesTable td.invoice-client-cell {
    max-width: 240px;
    min-width: 110px;
}
#invoicesTable.has-manual-reminder td.invoice-client-cell {
    max-width: 210px;
    min-width: 100px;
}
/* Dokumenta tipa badge: labā mala vienā līnijā ar rēķina numuru (100% no pirmās kolonnas) */
#invoicesTable .invoice-first-cell .invoice-badge.badge-document-type-ellipsis {
    max-width: 100%;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
    box-sizing: border-box;
}

.badge-language {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.invoice-term-date {
    font-size: 0.875rem;
    color: #1f2937;
    margin-bottom: 4px;
}

/* Rēķinu tabulā: apmaksas termiņš – bez virsraksta teksta, šaura kolonna, mazāks teksts */
#invoicesTable th.invoice-term-cell {
    padding-left: 0;
    padding-right: 0;
    width: 0;
    min-width: 7.2em;
    max-width: 7.2em;
    overflow: hidden;
    font-size: 0;
    line-height: 0;
}
#invoicesTable td.invoice-term-cell {
    padding-left: 0;
    padding-right: 0;
    width: 0;
    min-width: 7.2em;
    max-width: 7.2em;
    font-size: 0.7rem;
}
#invoicesTable td.invoice-term-cell .invoice-term-date,
#invoicesTable td.invoice-term-cell .sent-date {
    font-size: 1em;
}
#invoicesTable td.invoice-term-cell .payment-status {
    font-size: 0.9em; /* "X dienas līdz maksājumam" / "kavēti X dienas" – par 10% mazāk */
}

/* Rēķinu tabula: visām kolonnām padding-right uz pusi (8px) */
#invoicesTable th,
#invoicesTable td {
    padding-right: 8px;
}

/* Rēķinā iekļauta parāda informācija – tikai ikona, tekst tooltip */
.invoice-debt-included-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: help;
    color: var(--primary-color, #0B1E3F);
}
.invoice-debt-included-icon i {
    font-size: 0.875rem;
}

/* Viena info ikona: parāda info un "Papildus nosūtīts uz" rāda kā tooltip (title) */
.invoice-info-icon-block {
    margin-top: 6px;
    cursor: help;
}

/* Pielāgots tooltip ar jauno rindu (white-space: pre-line) */
#invoice-info-custom-tooltip {
    position: fixed;
    z-index: 10000;
    max-width: 280px;
    padding: 8px 10px;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    font-size: 13px;
    line-height: 1.4;
    color: #374151;
    white-space: pre-line;
    pointer-events: none;
    display: none;
}

.payment-status {
    font-size: 0.675rem; /* ~10% mazāk nekā 0.75rem */
    font-weight: 500;
    margin-top: 4px;
}

.payment-status.overdue {
    color: #dc2626;
}

.payment-status.due-today {
    color: #ea580c;
    font-weight: 600;
}

.payment-status.days-remaining {
    color: #059669;
}

.client-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.client-name {
    font-weight: 600;
    color: #1f2937;
}

/* Rēķinu tabula: uzņemuma (klienta) šūna – min-width tikai mobilai */
#invoicesTable .invoice-client-cell {
    min-width: 80px;
}
#invoicesTable .invoice-client-cell .client-info {
    min-width: 0;
}
#invoicesTable .invoice-client-cell .client-name.client-name-ellipsis {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

/* Mobilā: rēķina numura kolonna – minimāls platums (tikai pēc satura); atlikušais – klientam */
@media (max-width: 768px) {
    #invoicesTable td.invoice-first-cell,
    #invoicesTable th:nth-child(1) {
        width: 1%;
        max-width: 82px !important;
        min-width: 0;
    }
    #invoicesTable td.invoice-client-cell,
    #invoicesTable th:nth-child(2) {
        max-width: none !important;
        min-width: 0;
        width: auto;
    }
    #invoicesTable.has-manual-reminder td.invoice-client-cell,
    #invoicesTable.has-manual-reminder th:nth-child(2) {
        max-width: none !important;
        min-width: 0;
    }
}

/* Rēķinu tabula: summas kolonna – minimāls platums (neaizņem lieku vietu) */
#invoicesTable th.invoice-amount-cell,
#invoicesTable td.invoice-amount-cell {
    width: 1%;
    white-space: nowrap;
}

/* Rēķinu tabula: statusa kolonna – platums pēc satura (fit-content), teksts vienā rindā, nesaīsināts */
#invoicesTable th.invoice-status-cell,
#invoicesTable td.invoice-status-cell {
    width: 1%;
    min-width: max-content;
    white-space: nowrap;
}
#invoicesTable td.invoice-status-cell .status-container {
    min-width: max-content;
}

.client-reg-nr {
    font-size: 0.875rem;
    color: #6b7280;
}

/* Resend indicator triangle */
.resend-triangle {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 30px 30px 0 0;
    border-color: #0B1E3F transparent transparent transparent;
    z-index: 1;
    cursor: help;
}

.resend-triangle-text {
    position: absolute;
    top: -25px;
    left: 4px;
    color: #ffffff;
    font-weight: bold;
    font-size: 12px;
    line-height: 1;
    z-index: 2;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    pointer-events: none;
}

.resend-triangle--clickable {
    cursor: pointer;
}

.resend-triangle--clickable:hover {
    border-color: #1a3a6e transparent transparent transparent;
}

.client-address {
    font-size: 0.7rem;
    color: #6b7280;
    line-height: 1;
}

/* Status badges */
.status-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
}

.status-badge {
    display: inline-block;
    padding: 2px 12px;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: capitalize;
}

.sent-date {
    font-size: 0.55rem;
    color: #6b7280;
    font-weight: 400;
    margin-top: 2px;
    line-height: 1.2;
}

.status-draft {
    background-color: #e5e7eb;
    color: #6b7280;
}

.status-sent {
    background-color: #dbeafe;
    color: #4a2270;
}

.status-paid {
    background-color: #d1fae5;
    color: #065f46;
}

/* Gaida pārvadātāju – oranzīgs tonis (badge un modāla opcija vienāda krāsa) */
/* status-waiting_carrier = no invoice.status; status-waiting-carrier = modāla poga */
.status-waiting-carrier,
.status-waiting_carrier,
.status-badge.status-waiting-carrier,
.status-badge.status-waiting_carrier,
#invoiceStatusModal .status-badge.status-waiting-carrier,
#invoicesTable .status-badge.status-waiting_carrier,
#invoicesTable .status-badge.status-waiting_carrier,
.invoice-item-card .status-badge.status-waiting_carrier {
    background-color: #fed7aa !important;
    color: #9a3412 !important;
}

.status-badge.status-waiting-carrier:hover,
.status-badge.status-waiting_carrier:hover,
#invoiceStatusModal .status-badge.status-waiting-carrier:hover,
#invoicesTable .status-badge.status-waiting_carrier:hover {
    background-color: #fdba74 !important;
    color: #9a3412 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(194, 65, 12, 0.2);
}

/* Loģistika: brauciens DB – «Ceļā» (violets) */
.status-on_the_way,
.status-on-the-way,
.status-badge.status-on_the_way,
#invoiceStatusModal .status-badge.status-on_the_way,
#invoicesTable .status-badge.status-on_the_way,
.invoice-item-card .status-badge.status-on_the_way {
    background-color: #ede9fe !important;
    color: #5b21b6 !important;
    border: 1px solid #c4b5fd !important;
}

.status-badge.status-on_the_way:hover,
#invoicesTable .status-badge.status-on_the_way:hover {
    background-color: #ddd6fe !important;
    color: #4c1d95 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(91, 33, 182, 0.15);
}

.status-partially_paid {
    background-color: #fef3c7;
    color: #92400e;
}

/* Apmaksātā summa / Atlikusī summa – tooltip ar help cursor */
.partially-paid-amounts span {
    cursor: help;
}

.status-accepted {
    background-color: #d1fae5;
    color: #065f46;
}

.status-rejected {
    background-color: #fee2e2;
    color: #991b1b;
}

.status-created_invoice {
    background-color: #dbeafe;
    color: #4a2270;
}

.status-created_contract {
    background-color: #ffedd5;
    color: #c2410c;
}

.status-approved {
    background-color: #bbf7d0;
    color: #166534;
}

.status-terminated {
    background-color: #fecaca;
    color: #991b1b;
}

.status-expired {
    background-color: #e9d5ff;
    color: #6b21a8;
}

.status-extension {
    background-color: #ffedd5;
    color: #c2410c;
}

.status-changes {
    background-color: #e0e7ff;
    color: #3730a3;
}

.status-archived {
    background-color: #e5e7eb;
    color: #6b7280;
}

/* Status selection modal buttons hover effects */
.status-badge.status-sent:hover {
    background-color: #bfdbfe !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(30, 64, 175, 0.2);
}

.status-badge.status-paid:hover {
    background-color: #a7f3d0 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(6, 95, 70, 0.2);
}

.status-badge.status-partially_paid:hover {
    background-color: #fde68a !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(146, 64, 14, 0.2);
}

.status-badge.status-accepted:hover {
    background-color: #a7f3d0 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(6, 95, 70, 0.2);
}

.status-badge.status-rejected:hover {
    background-color: #fecaca !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(153, 27, 27, 0.2);
}

.status-badge.status-created_invoice:hover {
    background-color: #bfdbfe !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(30, 64, 175, 0.2);
}

.status-badge.status-created_contract:hover {
    background-color: #fed7aa !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(194, 65, 12, 0.2);
}

.status-overdue {
    background-color: #fee2e2;
    color: #991b1b;
}

.payment-method {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 4px;
}

/* Logistics carrier/vehicle hints - same style as service autocomplete, width matches input */
.logistics-hint-container .logistics-input-wrapper {
    position: relative;
    width: 100%;
}

/* Service Search and Autocomplete */
.service-search-container {
    position: relative;
}
.site-training-page #trainingLinks {
    padding-left: 34px;
}

#service_search {
    width: 100%;
    padding: 10px 15px 10px 40px;
    border: 2px solid #93c5fd;
    border-radius: 8px;
    font-size: 0.9rem;
    background-color: #f0f7ff;
    color: #1e40af;
    transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
}

#service_search::placeholder {
    color: #60a5fa;
}

#service_search:focus {
    outline: none;
    border-color: #3b82f6;
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
    color: #1e293b;
}

.service-search-container::before {
    content: '\f002';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: #60a5fa;
    font-size: 0.85rem;
    pointer-events: none;
    z-index: 1;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    margin-top: 4px;
    max-height: min(55vh, 420px);
    overflow-y: auto;
    z-index: 10000;
    display: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.autocomplete-item {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.highlighted {
    background-color: #f9fafb;
}

.autocomplete-item-manual {
    background-color: #f3f4f6 !important;
    cursor: pointer;
    padding: 15px 20px !important;
}

.autocomplete-item-manual:hover {
    background-color: #e5e7eb !important;
}

/* Noliktavas preces rēķina pakalpojumu meklēšanā — viegli zilgans fons (atšķirībā no pakalpojumiem) */
.autocomplete-item.autocomplete-item-warehouse-product {
    background-color: #e8f4f7;
}
.autocomplete-item.autocomplete-item-warehouse-product:hover,
.autocomplete-item.autocomplete-item-warehouse-product.highlighted {
    background-color: #d5ebf2;
}

.autocomplete-name-manual {
    font-weight: 600;
    color: #1f2937;
    font-size: 1rem;
}

.autocomplete-content {
    flex: 1;
    min-width: 0;
}

.autocomplete-name {
    font-weight: 600;
    color: #1f2937;
    font-size: 0.875rem;
    margin-bottom: 2px;
}

.autocomplete-article {
    color: #6b7280;
    font-size: 0.75rem;
}

.autocomplete-details {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.autocomplete-price {
    font-weight: 600;
    color: #1f2937;
    font-size: 0.875rem;
    white-space: nowrap;
}

.autocomplete-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: #6b7280;
}

.autocomplete-unit {
    white-space: nowrap;
}

.autocomplete-vat {
    white-space: nowrap;
}

/* Invoice Items */
.invoice-items-container {
    margin-top: 10px;
}

.invoice-item {
    position: relative;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    display: flex;
    gap: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.invoice-item.dragging {
    opacity: 0.5;
    transform: scale(0.95);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
}

.invoice-item.drag-over {
    border-color: #0B1E3F;
    background: #eff6ff;
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.invoice-item-placeholder {
    background: #e0e7ff;
    border: 2px dashed #0B1E3F;
    border-radius: 8px;
    margin-bottom: 15px;
    opacity: 0.6;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 0.8;
    }
}

.invoice-item-drag-handle {
    cursor: grab;
    color: #6b7280;
    padding: 4px;
    display: flex;
    align-items: flex-start;
    flex-shrink: 0;
    transition: color 0.2s;
    user-select: none;
}

.invoice-item-drag-handle:hover {
    color: #0B1E3F;
}

.invoice-item-drag-handle:active {
    cursor: grabbing;
}

.invoice-item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.invoice-item-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

.invoice-item-row-1 {
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
}

/* Noliktavas atlikums zem preces — mazas zīmītes (chip) */
.invoice-item-warehouse-stock {
    width: 100%;
    margin: 4px 0 0;
    box-sizing: border-box;
}
.invoice-item-warehouse-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.invoice-item-warehouse-chip {
    display: inline-flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.6875rem;
    line-height: 1.25;
    background: #e0f2f7;
    color: #0c4a6e;
    border: 1px solid #a5d8e8;
    max-width: 100%;
    box-sizing: border-box;
}
.invoice-item-warehouse-chip-name {
    font-weight: 600;
    color: #075985;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.invoice-item-warehouse-chip-qty {
    font-weight: 700;
    color: #0B1E3F;
    white-space: nowrap;
}
.invoice-item-warehouse-chip-total {
    background: #dbeafe;
    border-color: #93c5fd;
    color: #1e3a8a;
}
.invoice-item-warehouse-chip-total .invoice-item-warehouse-chip-name {
    color: #1d4ed8;
}
.invoice-item-warehouse-available-line {
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px dashed #bae6fd;
    font-size: 0.75rem;
    line-height: 1.35;
    color: #334155;
}
.invoice-item-warehouse-available-label {
    font-weight: 600;
    color: #475569;
}
.invoice-item-warehouse-available-value {
    font-weight: 700;
    color: #0B1E3F;
}
.invoice-item-warehouse-stock-note {
    font-size: 0.6875rem;
    color: #64748b;
    font-style: italic;
    padding: 2px 0;
}

.invoice-item-row-2 {
    align-items: flex-end;
}

.invoice-item-row-3 {
    align-items: center;
}

.invoice-item-row-options {
    flex-direction: column;
    align-items: flex-start;
    padding-top: 8px;
    border-top: 1px solid #e5e7eb;
    margin-top: 8px;
    gap: 0;
    width: 100%;
    box-sizing: border-box;
}

.invoice-item-extra-options-header {
    margin-bottom: 0;
}

.invoice-item-extra-options-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.invoice-item-extra-options-text {
    color: #0B1E3F;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    transition: color 0.2s ease;
}

.invoice-item-extra-options-toggle:hover .invoice-item-extra-options-text {
    color: #0B1E3F;
}

.invoice-item-extra-options-icon {
    font-size: 0.75rem;
    color: #0B1E3F;
    transition: transform 0.2s ease, color 0.2s ease;
}

.invoice-item-extra-options-toggle:hover .invoice-item-extra-options-icon {
    color: #0B1E3F;
}

.invoice-item-extra-options-switches {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 0;
    margin-top: 4px;
}

.invoice-item-option-switch {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.invoice-item-option-switch:last-child {
    margin-bottom: 0;
}

.invoice-item-option-switch label {
    margin-bottom: 0;
    font-size: 0.875rem;
    color: #374151;
}

.invoice-item-period-row {
    margin-top: 4px;
}

.invoice-item-row-extra {
    margin-top: 4px;
}

.invoice-item-manual-name {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 600;
}

.invoice-item-save-to-defined-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    color: #4b5563;
    margin-left: auto;
}

.invoice-item-save-to-defined-label span {
    color: #4b5563;
    font-weight: 400;
}

.invoice-item-name-section {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.invoice-item-name-display {
    flex: 1;
}

.invoice-item-name-edit {
    flex: 1;
    padding: 4px 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.875rem;
}

.invoice-item-price-section {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.invoice-item-unit-price-currency-wrap {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Rēķina modāls: mobilā – bez horizontālā scroll */
.btn-icon-small {
    padding: 4px 6px;
    font-size: 0.75rem;
    min-width: auto;
    height: auto;
}


.invoice-item-unit-price-header {
    width: auto;
    min-width: 4ch;
    text-align: right;
    padding: 3px 6px;
    field-sizing: content;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #059669;
    background: white;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.invoice-item-unit-price-header:focus {
    outline: none;
    border-color: #059669;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

.invoice-item-unit-price-header:hover {
    border-color: #059669;
}

.invoice-item-service strong {
    color: #1f2937;
    font-size: 0.875rem;
}

.invoice-item-price {
    color: #059669;
    font-weight: 600;
    font-size: 0.875rem;
}

.invoice-item-price.custom-price {
    color: #d97706;
    position: relative;
}

.invoice-item-article {
    color: #6b7280;
    font-size: 0.75rem;
    margin-top: 4px;
}

.invoice-item-row-2 .form-group {
    flex: 1;
    margin-bottom: 0;
}

.invoice-item-row-2 .form-group label {
    font-size: 0.75rem;
    margin-bottom: 4px;
}

.invoice-item-row-2 input {
    padding: 6px 10px;
    font-size: 0.875rem;
}


.invoice-item-total {
    background-color: #f3f4f6;
    font-weight: 600;
    color: #059669;
    cursor: not-allowed;
}

.empty-state-small {
    text-align: center;
    padding: 20px;
    color: #6b7280;
    font-size: 0.875rem;
}

/* first_invoice_create: pakalpojuma rinda kā rēķina modālī (company_invoices) */
.page-first-invoice-create .fic-invoice-item-readonly .invoice-item-drag-handle {
    display: none;
}
@media (max-width: 768px) {
    .page-first-invoice-create #fic_services_display.invoice-items-container {
        overflow-x: hidden;
        min-width: 0;
    }
    .page-first-invoice-create #fic_services_display .invoice-item {
        flex-wrap: wrap;
        padding: 12px;
        min-width: 0;
        display: flex;
        flex-direction: row;
        align-items: flex-start;
        gap: 10px;
    }
    .page-first-invoice-create #fic_services_display .invoice-item-row-1 {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        align-items: center;
        order: 1;
        width: 100%;
    }
    .page-first-invoice-create #fic_services_display .invoice-item-name-section {
        flex: 1 1 calc(100% - 8px);
        min-width: 0;
        order: 1;
    }
    .page-first-invoice-create #fic_services_display .invoice-item-price-section {
        flex: 1 1 100%;
        min-width: 0;
        order: 2;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        align-items: center;
    }
    .page-first-invoice-create #fic_services_display .invoice-item-unit-price-currency-wrap {
        display: inline-flex;
        align-items: center;
        gap: 4px;
    }
    .page-first-invoice-create #fic_services_display .invoice-item-price-section .invoice-item-unit-price-header {
        width: 100%;
        min-width: 0;
        max-width: none;
        box-sizing: border-box;
    }
    .page-first-invoice-create #fic_services_display .invoice-item-price-section .invoice-item-unit-display {
        margin-left: 0;
    }
    .page-first-invoice-create #fic_services_display .invoice-item-row-2 {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        align-items: end;
        order: 3;
        width: 100%;
    }
    .page-first-invoice-create #fic_services_display .invoice-item-row-2 .form-group {
        min-width: 0;
        margin-bottom: 0;
    }
    .page-first-invoice-create #fic_services_display .invoice-item-row-2 .form-group label {
        display: block;
        margin-bottom: 4px;
    }
    .page-first-invoice-create #fic_services_display .invoice-item-row-2 .form-group input {
        width: 100%;
        box-sizing: border-box;
    }
    .page-first-invoice-create #fic_services_display .invoice-item-row-2 .form-group:has(.invoice-item-total) {
        grid-column: 1 / -1;
    }
}

/* Mobile responsive for invoice items */
@media (max-width: 768px) {
    .invoice-item-details {
        flex-direction: column;
        gap: 10px;
    }
    
    .invoice-item-details .form-group {
        width: 100%;
    }
    
    .invoice-item-details .remove-item {
        width: 100%;
        margin-top: 10px;
    }

    /* Pakalpojumu forma rēķina modālā – mobilā: nosaukums augšā, drag kreisā, divas kolonnas */
    #addInvoiceModal .modal-content {
        max-width: 100%;
        margin: 0 12px;
        overflow-x: hidden;
    }
    #addInvoiceModal .modal-body {
        overflow-x: hidden;
        max-width: 100%;
    }
    #addInvoiceModal .invoice-items-container {
        overflow-x: hidden;
        min-width: 0;
    }
    #addInvoiceModal .invoice-item {
        flex-wrap: wrap;
        padding: 12px;
        min-width: 0;
        display: flex;
        flex-direction: row;
        align-items: flex-start;
        gap: 10px;
    }
    #addInvoiceModal .invoice-item-drag-handle {
        flex-shrink: 0;
        align-self: flex-start;
        padding: 6px 4px;
    }
    #addInvoiceModal .invoice-item-content {
        min-width: 0;
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 12px;
    }
    /* 1. rinda: nosaukums pa labi no drag (vienā līnijā) */
    #addInvoiceModal .invoice-item-row-1 {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        align-items: center;
        order: 1;
    }
    #addInvoiceModal .invoice-item-name-section {
        flex: 1 1 calc(100% - 40px);
        min-width: 0;
        order: 1;
    }
    #addInvoiceModal .invoice-item-name-section .invoice-item-manual-name,
    #addInvoiceModal .invoice-item-name-section .invoice-item-name-display {
        max-width: 100%;
        min-width: 0;
    }
    /* 2. rinda: vienības cena un mērvienība divās kolonnās */
    #addInvoiceModal .invoice-item-price-section {
        flex: 1 1 100%;
        min-width: 0;
        order: 2;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        align-items: center;
    }
    #addInvoiceModal .invoice-item-unit-price-currency-wrap {
        display: inline-flex;
        align-items: center;
        gap: 4px;
    }
    #addInvoiceModal .invoice-item-price-section .invoice-item-unit-price-header {
        width: 100%;
        min-width: 0;
        max-width: none;
        box-sizing: border-box;
    }
    #addInvoiceModal .invoice-item-price-section .invoice-item-unit-input,
    #addInvoiceModal .invoice-item-price-section .invoice-item-unit-wrap {
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }
    #addInvoiceModal .invoice-item-price-section .invoice-item-unit-input {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
    }
    #addInvoiceModal .invoice-item-price-section .invoice-item-unit-display {
        margin-left: 0;
    }
    /* 3. rinda: daudzums un atlaide divās kolonnās */
    #addInvoiceModal .invoice-item-row-2 {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        align-items: end;
        order: 3;
    }
    #addInvoiceModal .invoice-item-row-2 .form-group {
        min-width: 0;
        margin-bottom: 0;
    }
    #addInvoiceModal .invoice-item-row-2 .form-group label {
        display: block;
        margin-bottom: 4px;
    }
    #addInvoiceModal .invoice-item-row-2 .form-group input {
        width: 100%;
        box-sizing: border-box;
    }
    /* PVN un Kopā – divās kolonnās (VAT maksātājam); ja nav PVN maksātājs – Kopā noņemts no divām kolonnām */
    #addInvoiceModal .invoice-item-row-2 .form-group .invoice-item-vat-rate,
    #addInvoiceModal .invoice-item-row-2 .form-group .invoice-item-total {
        max-width: 100%;
    }
    #addInvoiceModal .invoice-item-row-2 .form-group .invoice-item-total {
        width: 100%;
        box-sizing: border-box;
    }
    #addInvoiceModal .invoice-item-row-2 .form-group:has(.invoice-item-total) {
        grid-column: 1 / -1;
    }
    #addInvoiceModal .invoice-item-row-2 .form-group.invoice-item-total-hidden-mobile {
        display: none;
    }
    #addInvoiceModal .invoice-item-row-2 > div:last-of-type {
        grid-column: 1 / -1;
        justify-content: flex-start;
        margin-top: 4px;
        display: flex;
        gap: 8px;
        width: 100%;
    }
    #addInvoiceModal .invoice-item-row-2 .copy-item,
    #addInvoiceModal .invoice-item-row-2 .remove-item {
        flex: 1 1 50%;
        width: 50%;
        max-width: 50%;
        box-sizing: border-box;
        justify-content: center;
    }
    /* 4. Opcijas: virsraksts, zem tā katra papildu opcija savā rindā */
    #addInvoiceModal .invoice-item-row-options {
        order: 4;
        flex-direction: column;
        align-items: stretch;
        padding-top: 12px;
        margin-top: 4px;
        border-top: 1px solid #e5e7eb;
        gap: 8px;
        width: 100%;
        box-sizing: border-box;
    }
    #addInvoiceModal .invoice-item-row-options > div:first-child {
        display: flex;
        flex-direction: column;
        flex-wrap: wrap;
        align-items: flex-start;
        width: 100%;
        margin-bottom: 0;
        gap: 10px;
    }
    /* Mobilā: "Saglabāt pie Definētajiem Pakalpojumiem" virs "Papildu opcijas" */
    #addInvoiceModal .invoice-item-row-options .invoice-item-save-to-defined-label {
        order: 1;
    }
    #addInvoiceModal .invoice-item-row-options .invoice-item-extra-options-toggle {
        order: 2;
        margin-bottom: 0;
    }
    #addInvoiceModal .invoice-item-extra-options-switches {
        width: 100%;
        margin-top: 8px;
        display: flex;
        flex-direction: column;
        gap: 4px;
    }
    #addInvoiceModal .invoice-item-option-switch {
        margin-bottom: 0;
        padding: 8px 0;
        border-bottom: 1px solid #f3f4f6;
    }
    #addInvoiceModal .invoice-item-option-switch:last-child {
        border-bottom: none;
    }
    /* Periods un papildu rindas */
    #addInvoiceModal .invoice-item-row-3.invoice-item-period-row,
    #addInvoiceModal .invoice-item-row-extra {
        order: 5;
    }
    /* Uz mobilas: "Periods: " teksta nerāda */
    #addInvoiceModal .invoice-item-period-label {
        display: none !important;
    }
    /* Papildus teksts un pakalpojuma datums – katrs savā rindā */
    #addInvoiceModal .invoice-item-row-extra {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    #addInvoiceModal .invoice-item-row-extra .form-group {
        width: 100%;
        flex: 1 1 100%;
        min-width: 0;
    }
    #addInvoiceModal .invoice-item-row-extra .invoice-item-extra-text {
        width: 100%;
        box-sizing: border-box;
    }
    
    .autocomplete-dropdown {
        z-index: 2000;
    }
}

/* Unit Autocomplete Styles */
.unit-autocomplete-container {
    position: relative;
    width: 100%;
    margin-bottom: 0;
}

/* Add padding to form-group when autocomplete is visible */
.form-group.autocomplete-open {
    padding-bottom: 280px; /* Space for dropdown (max-height: 250px + margin) */
    transition: padding-bottom 0.2s ease;
}

.unit-autocomplete {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    margin-top: 4px;
    max-height: 250px;
    overflow-y: auto;
    overflow-x: hidden;
    min-width: 100%; /* At least as wide as input */
    width: max-content; /* Expand to fit content */
    max-width: 500px; /* Limit maximum width */
    box-sizing: border-box;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Ensure dropdown doesn't overflow modal on mobile */
@media (max-width: 768px) {
    .unit-autocomplete {
        max-width: calc(100vw - 80px); /* Account for modal padding */
    }
}

.unit-autocomplete .autocomplete-item {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.2s;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.unit-autocomplete .autocomplete-item:last-child {
    border-bottom: none;
}

.unit-autocomplete .autocomplete-item:hover,
.unit-autocomplete .autocomplete-item.highlighted {
    background-color: #f3f4f6;
}

.unit-autocomplete .autocomplete-item-main {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    margin-bottom: 4px;
    min-width: 0;
    overflow: visible;
    flex-wrap: nowrap;
}

.unit-autocomplete .autocomplete-item-main strong {
    color: #1f2937;
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: visible;
    flex-shrink: 0;
}

.unit-autocomplete .autocomplete-item-code {
    color: #6b7280;
    font-size: 0.75rem;
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    white-space: nowrap;
    flex-shrink: 0;
}

.unit-autocomplete .autocomplete-item-desc {
    color: #6b7280;
    font-size: 0.75rem;
    margin-top: 2px;
    white-space: nowrap;
    overflow: visible;
    flex-shrink: 0;
}

/* Loading Overlay Styles */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
}

.loading-overlay.show {
    display: flex;
}

.loading-overlay .loading-spinner {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    /* Prevent conflicting spinner animation from other .loading-spinner definitions */
    width: auto;
    height: auto;
    border: none;
    animation: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f4f6;
    border-top: 4px solid #0B1E3F;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    color: #374151;
    font-weight: 500;
    font-size: 16px;
}

.invoice-amount-vat {
    font-size: 0.75rem;
    color: #6b7280;
}

/* Pending Invoices List Styles */
.invoice-item-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    width: 100%;
}

.activity-content.scrollable .invoice-item-card {
    width: calc(100% - 0.3rem);
    margin-right: 0.3rem;
}

.invoice-item-card .status-badge {
    cursor: pointer;
    transition: all 0.2s ease;
}

.invoice-item-card .status-badge:hover {
    background-color: #0B1E3F;
    color:#fff;
}


.invoice-item-card:hover {
    border-color: #0B1E3F;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.invoice-item-content {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.invoice-item-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.invoice-item-middle {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    align-items: flex-start;
}

.invoice-item-right .status-badge {
    align-self: flex-start;
    margin-bottom:-10px;
}

.invoice-item-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
    text-align: right;
}

.invoice-item-client {
    font-size: 1rem;
    color: #1f2937;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    min-width: 0;
}

.invoice-item-number {
    font-size: 12px;
    color: #4b5563;
    font-weight: 500;
    margin-top:-10px;
}

/* Date input (hidden, used for date picker) */
.invoice-item-period-start,
.invoice-item-period-end {
    position: absolute !important;
    opacity: 0 !important;
    width: 100% !important;
    height: 100% !important;
    left: 0 !important;
    top: 0 !important;
    cursor: pointer !important;
    z-index: 2 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    box-sizing: border-box !important;
    pointer-events: none !important;
}

/* Hide the calendar icon but keep functionality - make entire input clickable */
.invoice-item-period-start::-webkit-calendar-picker-indicator,
.invoice-item-period-end::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0;
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    z-index: 1;
    margin: 0 !important;
    padding: 0 !important;
}

.invoice-item-period-start::-moz-calendar-picker-indicator,
.invoice-item-period-end::-moz-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0;
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    z-index: 1;
    margin: 0 !important;
    padding: 0 !important;
}

/* Style for period container */
.invoice-item-period-container {
    display: flex !important;
    gap: 8px !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    margin-top: 8px !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    align-self: flex-start !important;
    font-size: 90% !important;
}

/* Style for period label */
.invoice-item-period-label {
    margin: 0 !important;
    padding: 0 !important;
    font-weight: 500 !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    font-size: 90% !important;
}

/* Style for period separator */
.invoice-item-period-separator {
    padding: 0 4px !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    font-size: 90% !important;
}

/* Style for period date wrapper */
.invoice-item-period-wrapper {
    position: relative !important;
    display: inline-block !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    flex-basis: auto !important;
    vertical-align: baseline !important;
}

/* Style for period icon */
.invoice-item-period-icon {
    margin-right: 4px !important;
    font-size: 90% !important;
    color: inherit !important;
    flex-shrink: 0 !important;
    cursor: pointer !important;
}

/* Style for span elements (formatted date text) */
.invoice-item-period-start-span,
.invoice-item-period-end-span {
    position: relative !important;
    background: transparent !important;
    border: none !important;
    border-bottom: 1px solid transparent !important;
    padding: 4px 6px !important;
    margin: 0 !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    box-sizing: content-box !important;
    cursor: pointer !important;
    color: inherit !important;
    font-size: 90% !important;
    font-family: inherit !important;
    outline: none !important;
    border-radius: 4px;
    transition: background-color 0.2s ease, border-bottom-color 0.2s ease;
    display: inline-block !important;
    text-align: left !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    overflow: visible !important;
    vertical-align: baseline !important;
    line-height: normal !important;
    user-select: none !important;
}

.invoice-item-period-start-span:hover,
.invoice-item-period-end-span:hover {
    background-color: rgba(37, 99, 235, 0.1) !important;
    border-bottom-color: #0B1E3F !important;
}

.invoice-item-date {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top:-7px;
}

.invoice-item-term {
    font-size: 12px;
    color: #1f2937;
    font-weight: 500;
}

.invoice-item-days {
    font-size: 12px;
    color: #dc2626;
    font-weight: 500;
    margin-top:-5px;
}
.invoice-amount {
    font-size:14px;
    margin-top:-5px;
}

.invoice-amount-with-vat {
    font-size:12px;
    margin-top:-5px;
    font-size: 0.75rem; color: #6b7280; font-weight: 400;
}

.invoice-item-days-positive {
    color: #16a34a !important;
    font-weight: 600;
}

.invoice-item-days-negative {
    color: #dc2626 !important;
    font-weight: 600;
}

.invoice-item-amount {
    font-size: 1rem;
    font-weight: 700;
    color: #1f2937;
}

/* Responsive styles for invoice-item-card */
@media (max-width: 768px) {
    .invoice-item-card {
        padding: 12px;
    }
    
    .invoice-item-content {
        flex-direction: row;
        gap: 0.75rem;
        align-items: flex-start;
    }
    
    .invoice-item-left {
        flex: 1;
        align-items: flex-start !important;
        text-align: left !important;
    }
    
    .invoice-item-middle {
        display: none;
    }
    
    .invoice-item-right {
        flex: 1;
        align-items: flex-end !important;
        text-align: right !important;
        border-top: none;
        padding-top: 0;
        margin-top: 0;
        flex-direction: column;
    }
    
    .invoice-item-right .status-badge {
        margin-bottom: 0;
        align-self: flex-end;
    }
    
    .invoice-item-client {
        font-size: 0.9rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
        min-width: 0;
    }
    
    .invoice-item-number {
        font-size: 11px;
        margin-top: 0;
    }
    
    .invoice-item-date {
        font-size: 0.7rem;
        margin-top: 0;
    }
    
    .invoice-item-term {
        font-size: 11px;
    }
    
    .invoice-item-days {
        font-size: 11px;
        margin-top: 0;
    }
    
    .invoice-item-amount {
        font-size: 0.9rem;
    }
    
    .invoice-amount {
        font-size: 13px;
        margin-top: 0;
    }
    
    .invoice-amount-with-vat {
        font-size: 11px;
        margin-top: 0;
    }
    
    .activity-content.scrollable .invoice-item-card {
        width: 100%;
        margin-right: 0;
    }
}

/* Empty state when all invoices are paid */
.empty-state .empty-icon i.fa-check-circle {
    color: #10b981;
}

.empty-state.all-invoices-paid {
    margin-top: 100px;
}

/* Custom styles for dashboard unpaid invoices list - ensure 3 columns are always visible */
#pendingInvoicesList .invoice-item-card .invoice-item-content {
    display: flex !important;
    justify-content: space-between !important;
    gap: 1rem !important;
    flex-direction: row !important;
}

#pendingInvoicesList .invoice-item-card .invoice-item-left {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.25rem !important;
    min-width: 0 !important;
}

#pendingInvoicesList .invoice-item-card .invoice-item-middle {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.25rem !important;
    align-items: flex-start !important;
    min-width: 0 !important;
}

#pendingInvoicesList .invoice-item-card .invoice-item-right {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-end !important;
    gap: 0.25rem !important;
    text-align: right !important;
    min-width: 0 !important;
}

#pendingInvoicesList .invoice-item-amount-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

#pendingInvoicesList .dashboard-invoice-send-btn {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #374151;
    cursor: pointer;
}

#pendingInvoicesList .dashboard-invoice-send-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

#pendingInvoicesList .dashboard-invoice-send-btn.btn-send-draft-pulse {
    border-color: #3b82f6;
    color: #2563eb;
}

/* Override any media queries that might hide the middle column for dashboard list */
@media (max-width: 900px) {
    #pendingInvoicesList .invoice-item-card .invoice-item-middle {
        display: flex !important;
    }
}

/* Site Integrations Styles */
.integrations-container {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-top: 24px;
}

.integrations-table-wrapper {
    overflow-x: auto;
}

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

.integrations-table thead {
    background: #f9fafb;
}

.integrations-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
}

.integrations-table td {
    padding: 16px;
    border-bottom: 1px solid #e5e7eb;
    color: #6b7280;
    vertical-align: middle;
}

.integrations-table tr:hover {
    background: #f9fafb;
}

.integrations-table .actions {
    width: 1%;
    white-space: nowrap;
}

.integrations-table .empty-state {
    text-align: center;
    padding: 40px;
    color: #9ca3af;
}

.integrations-table .empty-state i {
    font-size: 48px;
    color: #d1d5db;
    margin-bottom: 16px;
}

.integrations-table .empty-state p {
    font-size: 16px;
    margin: 0;
}

.integrations-table .status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.integrations-table .status-badge:hover {
    opacity: 0.8;
    transform: scale(1.05);
}

.integrations-table .status-badge.active {
    background: #d1fae5;
    color: #065f46;
}

.integrations-table .status-badge.inactive {
    background: #fee2e2;
    color: #991b1b;
}

.badge.beta-badge,
.beta-badge-inline,
.integrations-table .status-badge.beta-badge-inline {
    display: inline-block;
    padding: 2px 8px;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 4px;
    background: #dbeafe;
    color: #1d4ed8;
    margin-left: 4px;
    vertical-align: middle;
}

.side-menu-item .badge.beta-badge {
    position: absolute;
    right: 12px;
    flex-shrink: 0;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 6px;
    min-width: 1.25rem;
    text-align: center;
    cursor: help;
    box-sizing: border-box;
}

.integrations-table .actions .btn-icon {
    margin: 0 4px;
}

/* Switch Toggle Styles */
.integrations-table .switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.integrations-table .switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.integrations-table .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 26px;
}

.integrations-table .slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.integrations-table .switch input:checked + .slider {
    background-color: #10b981;
}

.integrations-table .switch input:checked + .slider:before {
    transform: translateX(24px);
}

.integrations-table .switch input:focus + .slider {
    box-shadow: 0 0 1px #10b981;
}

/* General Switch Toggle Styles for modals and forms */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 26px;
}

.slider.round {
    border-radius: 26px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.slider.round:before {
    border-radius: 50%;
}

.switch input:checked + .slider {
    background-color: #10b981;
}

.switch input:checked + .slider:before {
    transform: translateX(24px);
}

.switch input:focus + .slider {
    box-shadow: 0 0 1px #10b981;
}

.switch input:disabled + .slider {
    background-color: #e5e7eb;
    cursor: not-allowed;
    opacity: 0.6;
}

.switch input:disabled + .slider:before {
    background-color: #d1d5db;
}

.slider.disabled {
    background-color: #e5e7eb;
    cursor: not-allowed;
    opacity: 0.6;
}

.slider.disabled:before {
    background-color: #d1d5db;
}

/* Reminder switch - make it 25% smaller; mazāks margin-top, lai saskaņotos ar darbību pogu rindu */
.reminder-switch {
    width: 37.5px !important;
    height: 19.5px !important;
    margin-top: 0px !important;
}

.reminder-switch .slider {
    height: 19.5px !important;
}

.reminder-switch .slider:before {
    height: 15px !important;
    width: 15px !important;
    left: 2.25px !important;
    bottom: 2.25px !important;
}

.reminder-switch input:checked + .slider:before {
    transform: translateX(18px) !important;
}

/* Atstarpe starp atgādinājuma slēdzi un tekstu (sānjosla / panelis) */
.reminder-switch .reminder-label,
.inv-actions-panel-reminder .reminder-label {
    margin-left: 14px;
}

/* Reminder switch - red when disabled (unchecked) */
/* Override default gray/green for reminder-disabled */
.reminder-switch .slider.reminder-disabled {
    background-color: #dc3545 !important;
}

.reminder-switch input:not(:checked) + .slider.reminder-disabled:before {
    background-color: white !important;
    transform: translateX(0) !important;
}

/* Override checked state - should still be red when reminder-disabled */
.reminder-switch input:checked + .slider.reminder-disabled {
    background-color: #dc3545 !important;
}

td.list-icon-cell {
    padding:0;
    padding-left:15px;
}
.list-icon {
    font-size: 1.5rem;
}

/* Mobile user controls (avatar + submenu button) */
.mobile-user-controls { display: none; gap: 8px; align-items: center; position:absolute; right:60px;}
.mobile-user-controls .user-avatar { width: 42px; height: 42px; border-radius: 50%; background: #eef1f6; display: grid; place-items: center; color: #64748b; flex-shrink: 0;}
.mobile-user-controls .mobile-company-selector { display: flex; align-items: center;}
.mobile-user-controls .mobile-company-selector .selected-company { padding: 6px 10px; font-size: 11px; max-width: 120px;}
.mobile-user-controls .mobile-company-selector .company-name-text { max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;}
/* Inherit desktop submenu button styles for consistent look */

/* Disabled button state */
.btn-disabled, .btn-disabled:hover {
    cursor: not-allowed !important;
    animation: none !important;
    transition: none !important;
    transform: none !important;
    background: #666 !important;
    box-shadow: 0 10px 25px transparent !important;
}
p#company-admin-note, p#company-admin-request-note, p#company-membership-pending-note {color:red;margin-top:10px;}
button#showMoreBtn {border:0;background:transparent;margin:0;padding:0;margin-top:10px;margin-bottom:-10px;}
h2.month-header {font-size: 1.3rem; font-weight: 600; color: #1e293b; margin-top: -1.5rem; margin-bottom: 0.5rem;}
#nameDaysDisplay {
font-weight:normal;
font-size:12px;
display:block;
color:#666;
}

@media (max-width: 1100px) {
    table.services-table#clientsTable th:nth-child(3),table.services-table#clientsTable td:nth-child(3){display:none}
}
@media (max-width: 1000px) {
    .invoice-date-filters {display:none;}
}
@media (max-width: 900px) {
    table.services-table#clientsTable th:nth-child(4),table.services-table#clientsTable td:nth-child(4){display:none}
    table.services-table#usersTable th:nth-child(3),table.services-table#usersTable td:nth-child(3){display:none}
}

@media (max-width: 793px) {
    table.services-table#servicesTable th:nth-child(3),table.services-table#servicesTable td:nth-child(3){display:none}
}

@media (max-width: 768px) {
    table.services-table#servicesTable th:nth-child(2),table.services-table#servicesTable td:nth-child(2){display:none}
    table.services-table#servicesTable th:nth-child(3),table.services-table#servicesTable td:nth-child(3){display:none}
}

@media (max-width: 768px) {
    .mobile-user-controls { display: flex; }
    .invoice-item-middle {display:none;}
    .stats-calendar-card {display:none;}
    .activity-content.scrollable {padding-right: 0.6rem;}
    .invoice-item-card {padding: 20px !important;}
    .activity-content.scrollable .invoice-item-card {width: calc(100% - 1rem);margin-right:3rem;}
    .services-container {margin-top: 0 !important; padding-left: 0; padding-right: 0;}
    .invoice-filters-wrapper {margin-bottom: 0 !important;}
    .header-content h1 {margin-bottom: 0;}
    .header-actions {margin:10px 0;}
    table.services-table#clientsTable th:nth-child(1),table.services-table#clientsTable td:nth-child(1){display:none}
    table.services-table#clientsTable th:nth-child(5),table.services-table#clientsTable td:nth-child(5){display:none}
    table.services-table#usersTable th:nth-child(2),table.services-table#usersTable td:nth-child(2){display:none}
    table.services-table#usersTable th:nth-child(3),table.services-table#usersTable td:nth-child(3){display:none}
}

/* Site Users: desktop – rādam Assign pogu, slēpjam "..." */
.site-users-page .site-users-actions-more-btn {
    display: none;
    min-width: 44px;
    width: 44px;
    height: 44px;
    padding: 10px;
    font-size: 1rem;
}
.site-users-page .site-users-actions-list {
    display: none;
}
/* Pirmā šūna: lietotāja info + "..." poga vienā šūnā (poga tabulā, ne ārpus) */
.site-users-page table.services-table#usersTable td.site-users-first-cell {
    vertical-align: middle;
}
.site-users-page .site-users-first-cell-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-width: 0;
}
.site-users-page .site-users-first-cell-inner .user-info {
    flex: 1;
    min-width: 0;
}
/* Avots zem e-pasta – zils logs (plats lauks, ne šaurs badge) */
.site-users-page .user-info .user-source.user-source-badge,
.site-users-page .user-info .user-source-badge {
    display: block;
    margin-top: 6px;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 500;
    background: #dbeafe;
    color: #4a2270;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}
.site-users-page .site-users-panel-source .user-source-badge {
    margin-top: 4px;
    display: block;
    width: 100%;
    min-width: 0;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 500;
    background: #dbeafe;
    color: #4a2270;
    box-sizing: border-box;
}
.site-users-page .site-users-first-cell-inner .site-users-actions-cell-inner {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    position: static;
}
.site-users-page .site-users-actions-more-btn {
    position: static;
}

/* Pēdējā kolonna: tikai Assign poga (desktop) */
.site-users-page table.services-table#usersTable td.site-users-actions-cell,
.site-users-page table.services-table#usersTable th:last-child {
    width: 1%;
    min-width: 48px;
    white-space: nowrap;
    text-align: right;
    padding-left: 12px;
    padding-right: 16px;
    overflow: visible;
    vertical-align: middle;
}
/* Pogas (Piesaistīt uzņēmumam, Avots) viena otrai blakus, vienā stilā ar pārējo sistēmu */
.site-users-page .site-users-actions-btns {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
}
.site-users-page .site-users-actions-btns .btn-icon {
    flex-shrink: 0;
}
.site-users-page .site-users-actions-cell .assign-in-cell,
.site-users-page .site-users-actions-cell .user-source-btn {
    flex-shrink: 0;
}

/* Site Users: šaurāks ekrāns – slēpjam Company, Created un Assign kolonnu; "..." ir pirmajā šūnā */
@media (max-width: 768px) {
    .site-users-page table.services-table#usersTable th:nth-child(2),
    .site-users-page table.services-table#usersTable td:nth-child(2),
    .site-users-page table.services-table#usersTable th:nth-child(3),
    .site-users-page table.services-table#usersTable td:nth-child(3),
    .site-users-page table.services-table#usersTable th:last-child,
    .site-users-page table.services-table#usersTable td.site-users-actions-cell {
        display: none;
    }
    .site-users-page .services-container {
        margin-left: 0;
        margin-right: 0;
        padding-left: 8px;
        padding-right: 8px;
        max-width: 100%;
        overflow-x: visible;
    }
    .site-users-page .services-table-wrapper {
        overflow-x: visible;
        max-width: 100%;
    }
    .site-users-page table.services-table#usersTable {
        table-layout: fixed;
        width: 100%;
        overflow: visible;
    }
    .site-users-page table.services-table#usersTable th,
    .site-users-page table.services-table#usersTable td {
        padding: 8px 6px;
        font-size: 12px;
    }
    .site-users-page table.services-table#usersTable td.site-users-first-cell {
        width: 100%;
    }
    .site-users-page .site-users-company-mobile {
        display: block !important;
        margin-top: 4px;
        font-size: 0.8125rem;
        color: #6b7280;
    }
    .site-users-page .site-users-actions-more-btn {
        display: inline-flex !important;
        flex-shrink: 0;
    }
    .site-users-page .site-users-actions-list {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 9999;
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 0;
        padding: 0;
        background: transparent;
        border: none;
        box-shadow: none;
    }
    .site-users-page .site-users-actions-cell-inner.is-open .site-users-actions-list {
        display: flex;
    }
    .site-users-page .site-users-actions-backdrop {
        flex: 1;
        min-width: 0;
        background: rgba(0, 0, 0, 0.4);
        cursor: pointer;
    }
    .site-users-page .site-users-actions-panel {
        width: 280px;
        max-width: 85vw;
        background: #fff;
        display: flex;
        flex-direction: column;
        gap: 12px;
        padding: 24px;
        box-shadow: -2px 0 12px rgba(0, 0, 0, 0.15);
        overflow-y: auto;
    }
    .site-users-page .site-users-panel-row {
        font-size: 14px;
        color: #374151;
        word-break: break-word;
    }
    .site-users-page .site-users-panel-row.site-users-panel-name {
        font-weight: 600;
        font-size: 16px;
    }
    .site-users-page .site-users-panel-row.site-users-panel-email {
        color: #6b7280;
        font-size: 13px;
    }
    .site-users-page .site-users-panel-label {
        font-weight: 600;
        color: #6b7280;
        display: block;
        margin-bottom: 2px;
    }
    .site-users-page .site-users-panel-block .site-users-panel-value {
        margin-top: 2px;
        color: #374151;
    }
    .site-users-page .site-users-panel-buttons {
        display: flex;
        flex-direction: column;
        gap: 8px;
        padding-top: 12px;
        margin-top: 8px;
        border-top: 1px solid #e5e7eb;
    }
    .site-users-page .site-users-panel-buttons .site-users-actions-btns {
        flex-direction: row;
    }
    .site-users-page .site-users-panel-buttons .btn {
        justify-content: center;
    }
}

/* Desktop: panelā pogas blakus */
.site-users-page .site-users-panel-buttons .site-users-actions-btns {
    flex-direction: row;
}
.site-users-page .site-users-panel-buttons {
    padding-top: 12px;
    margin-top: 8px;
    border-top: 1px solid #e5e7eb;
}
.site-users-page .site-users-panel-buttons .btn-icon {
    flex-shrink: 0;
}

div.email-switches {
    padding-bottom:15px;
    margin-bottom:5px;
    border-bottom:1px solid #e5e7eb;
}

/* Email switches specific styling - match site_integrations style */
.email-switches .form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.email-switches .form-group > label:first-of-type {
    font-weight: 600;
    color: #1e293b;
    font-size: 0.875rem;
    margin-bottom: 0;
    display: block;
}

.email-switches .form-group .switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
    margin: 4px 0;
    flex-shrink: 0;
}

.email-switches .form-group small {
    font-size: 0.75rem;
    color: #6b7280;
    line-height: 1.5;
    margin-top: 0;
    display: block;
}

.progress-label span {display:block;font-size:0.65rem;color:#6b7280;margin-left:5px;}

/* Module name and date styling for paid modules */
.progress-label-module {
    display: flex;
    flex-direction: column;
}

.progress-label-module .module-name {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    flex-shrink: 0;
    font-size: 0.875rem;
    color: #000000;
    font-weight: 500;
}

.progress-label-module .module-date {
    display: block;
    font-size: 0.65rem;
    color: #6b7280;
    margin-top: 2px;
    white-space: normal;
    word-wrap: break-word;
    max-width: 100%;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    position: absolute !important;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 10px;
    color: #475569;
    font-size: 18px;
    cursor: pointer;
    z-index: 10000;
    outline: none;
}

/* Hide mobile menu toggle when user is logged in */
.mobile-menu-toggle.logged-in {
    display: none !important;
}

.mobile-menu-toggle:hover {
    background: rgba(255, 255, 255, 1);
    color: #0B1E3F;
}

.mobile-menu-toggle.active {
    transform: translateY(-50%) scale(0.95);
}

.nav-right-cluster .mobile-menu-toggle.active {
    transform: scale(0.95);
}

/* Side Menu Burger Toggle */
.side-menu-toggle {
    position: absolute !important;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 10px;
    color: #475569;
    font-size: 18px;
    cursor: pointer;
    z-index: 10000;
    outline: none;
}

.side-menu-toggle:hover {
    background: rgba(255, 255, 255, 1);
    color: #0B1E3F;
}

.side-menu-toggle:active {
    transform: translateY(-50%) scale(0.95);
}

/* Floating Side Menu */
.side-menu {
    position: fixed;
    left: 14px;
    top: 85px;
    width: 20vw;
    min-width: 250px;
    max-width: 250px;
    max-height: calc(100vh - 110px);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.06);
    padding: 12px 0;
    z-index: 999;
    transition: all 0.3s ease;
    transform: translateX(0);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.side-menu-header {
    padding: 0 20px 16px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    margin-bottom: 12px;
}

.side-menu-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

.side-menu-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 12px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    min-height: 0;
}

/* Custom scrollbar styling for side menu */
.side-menu-nav::-webkit-scrollbar {
    width: 6px;
}

.side-menu-nav::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 10px;
}

.side-menu-nav::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.side-menu-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

.side-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #475569;
    text-decoration: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
}

.side-menu-item i {
    font-size: 16px;
    width: 20px;
    text-align: center;
    color: #64748b;
    flex-shrink: 0;
}

.side-menu-item:hover {
    background: rgba(37, 99, 235, 0.08);
    color: #0B1E3F;
}

.side-menu-item:hover i {
    color: #0B1E3F;
}

.side-menu-item.active {
    background: rgba(37, 99, 235, 0.12);
    color: #0B1E3F;
    font-weight: 600;
    padding-left: 13px;
}

.side-menu-item.active i {
    color: #0B1E3F;
}

.side-menu-item span {
    flex: 1;
}

.side-menu-count {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    height: 20px;
    padding: 0 8px !important;
    background: #0B1E3F;
    color: white;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    margin-left: auto;
    line-height: 1;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    width: auto !important;
    min-width: auto !important;
    max-width: none !important;
    box-sizing: border-box !important;
    white-space: nowrap;
}

.side-menu-item.has-beta .side-menu-count {
    margin-right: 8px;
}

.side-menu-separator {
    height: 1px;
    min-height: 1px;
    background: #e2e8f0;
    margin: 8px -12px;
    flex-shrink: 0;
}

/* Side menu animated dropdown */
.side-menu-dropdown {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.side-menu-dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    width: 100%;
    border: none;
    background: transparent;
    color: #475569;
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s ease, color 0.2s ease;
}

.side-menu-dropdown-trigger:hover {
    background: rgba(37, 99, 235, 0.08);
    color: #0B1E3F;
}

.side-menu-dropdown-chevron {
    font-size: 12px;
    width: 20px;
    text-align: center;
    color: #64748b;
    flex-shrink: 0;
    transition: transform 0.25s ease;
}

.side-menu-dropdown.open .side-menu-dropdown-chevron {
    transform: rotate(0deg);
}

.side-menu-dropdown:not(.open) .side-menu-dropdown-chevron {
    transform: rotate(-90deg);
}

.side-menu-dropdown-trigger span {
    flex: 1;
}

.side-menu-dropdown-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.2s ease;
}

.side-menu-dropdown.open .side-menu-dropdown-content {
    max-height: 600px;
    opacity: 1;
}

.side-menu-section-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    padding: 8px 32px 4px;
    margin: 0;
}

/* Ensure side menu is visible on desktop by default */
@media (min-width: 1716px) {
    .side-menu {
        display: flex !important;
        transform: translateX(0) !important;
        opacity: 1 !important;
        pointer-events: all !important;
    }
}

/* Responsive: Hide side menu on smaller screens and show burger */
@media (max-width: 1715px) {
    .side-menu {
        transform: translateX(-100%);
        opacity: 0;
        pointer-events: none;
        left: 0;
        top: 70px;
        width: 280px;
        max-height: calc(100vh - 90px);
        border-radius: 0 0 16px 0;
    }
    .side-menu.active,
    .side-menu.active[style],
    .side-menu.side-menu-open,
    .side-menu[data-force-visible="true"],
    .side-menu.active.side-menu-open,
    .side-menu.active[data-force-visible="true"] {
        display: flex !important;
        transform: translateX(0) !important;
        opacity: 1 !important;
        pointer-events: all !important;
        visibility: visible !important;
        z-index: 9999 !important;
    }
    .side-menu-toggle {display: flex;}
    
    /* Adjust nav-logo position to make room for burger */
    .nav-container.logged-in-option {padding-left: 70px;}
    .nav-logo {margin-left: 0;}
}

/* Mobile: Make side menu full width */
@media (max-width: 768px) {
    .side-menu {
        width: 100% !important;
        left: 0 !important;
        right: 0 !important;
        top: 70px !important;
        max-width: 100% !important;
        border-radius: 0 !important;
    }
    .side-menu-item {
        padding: 15px 20px;
        font-size: 16px;
    }
}

/* Cookie Consent Popup Styles */
.cookie-consent-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10001;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cookie-consent-popup.show {
    display: flex;
    opacity: 1;
}

.cookie-consent-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.cookie-consent-content {
    position: relative;
    background: white;
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    z-index: 10002;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.cookie-consent-popup.show .cookie-consent-content {
    transform: scale(1);
}

.cookie-consent-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 24px 0;
    border-bottom: 1px solid #e5e7eb;
}

.cookie-consent-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.cookie-consent-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #64748b;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.cookie-consent-close:hover {
    background: #f1f5f9;
    color: #374151;
}

.cookie-consent-body {
    padding: 24px;
}

.cookie-consent-description {
    color: #4b5563;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 24px;
}

.cookie-categories {
    margin-bottom: 24px;
}

.cookie-category {
    padding: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 12px;
    background: #f9fafb;
}

.cookie-category:last-child {
    margin-bottom: 0;
}

.cookie-category-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.cookie-category-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 4px 0;
}

.cookie-category-header p {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
}

.cookie-category-header .switch.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.cookie-consent-links {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.cookie-consent-links a {
    color: #0B1E3F;
    text-decoration: none;
    transition: color 0.2s ease;
}

.cookie-consent-links a:hover {
    color: #4a2270;
    text-decoration: underline;
}

.cookie-consent-links span {
    color: #d1d5db;
}

.cookie-consent-footer {
    display: flex;
    gap: 12px;
    padding: 24px;
    border-top: 1px solid #e5e7eb;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.btn-cookie-reject,
.btn-cookie-accept,
.btn-cookie-save {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-cookie-reject {
    background: #f3f4f6;
    color: #374151;
}

.btn-cookie-reject:hover {
    background: #e5e7eb;
}

.btn-cookie-accept {
    background: #0B1E3F;
    color: white;
}

.btn-cookie-accept:hover {
    background: #4a2270;
}

.btn-cookie-save {
    background: #10b981;
    color: white;
}

.btn-cookie-save:hover {
    background: #059669;
}

@media (max-width: 768px) {
    .cookie-consent-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .cookie-consent-footer {
        flex-direction: column;
    }
    
    .btn-cookie-reject,
    .btn-cookie-accept,
    .btn-cookie-save {
        width: 100%;
        justify-content: center;
    }
    
    .cookie-category-header {
        flex-direction: column;
        gap: 12px;
    }
}

/* Company Pricing Plan Styles – 2 plāni vienā rindā */
.pricing-plans-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-top: 32px;
}

#loadingState {
    text-align: center;
    padding: 40px;
}

.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f4f6;
    border-top: 4px solid #0B1E3F;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

#loadingState p {
    margin-top: 16px;
    color: #6b7280;
}

#errorState {
    display: none;
    text-align: center;
    padding: 40px;
}

#errorState p {
    color: #ef4444;
}

#currentPlanInfo {
    display: none;
    margin-top: 32px;
    padding: 20px;
    background: #f3f4f6;
    border-radius: 8px;
}

#currentPlanInfo h3 {
    margin: 0 0 8px 0;
}

#currentPlanName {
    margin: 8px 0;
    font-size: 18px;
    font-weight: 600;
}

#currentPlanDetails {
    margin: 4px 0;
    color: #6b7280;
}

#currentPlanExpiry {
    color: #666;
    font-size: 18px;
    font-weight: 500;
    margin-top: 10px;
    display: none;
    text-align: center;
    width: 100%;	
}

#currentPlanExpiry.expiring-soon {
    color: #ffffff !important;
    background-color: #dc3545 !important;
    padding: 10px 15px !important;
    border-radius: 6px !important;
    display: inline-block !important;
}

.pricing-plan-card {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: visible;
}

.discount-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #059669, #047857);
    color: white;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.3);
    z-index: 10;
    border-radius: 10px;
    white-space: nowrap;
}

/* Ensure badge works on both pricing-plan-card and module-card */
.pricing-plan-card .discount-badge,
.module-card .discount-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #059669, #047857);
    color: white;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.3);
    z-index: 10;
    border-radius: 10px;
    white-space: nowrap;
}

/* Beta moduļa 50% cenas nozīme (paid modules) - violeta, lai atšķirtu no globālās atlaides */
.module-card .beta-module-discount-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    color: white;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.35);
    z-index: 10;
    border-radius: 10px;
    white-space: nowrap;
    max-width: calc(100% - 24px);
    text-align: center;
}

.module-card .discount-badge + .beta-module-discount-badge {
    top: 48px;
}

/* Maksas moduļi: vecā cena mazāka, kolonna, augšā pa kreisi no atlaižu cenas */
.paid-module-price-block {
    font-size: 1.5rem;
    font-weight: 700;
    color: #059669;
}

.paid-module-price-block .paid-module-price-wrap {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.15;
}

.paid-module-price-block .paid-module-price-was {
    font-size: 0.52em;
    font-weight: 500;
    color: #9ca3af;
    text-decoration: line-through;
    margin: 0 0 0.12em;
    align-self: flex-start;
    line-height: 1.1;
}

.paid-module-price-block .paid-module-price-now {
    font-size: 1em;
    font-weight: 700;
    color: #059669;
}

/* Izvēlētā moduļa apmaksas bloks (#selectedModulePrice) – līdzīgs izkārtojums, mazāks bāzes izmērs */
.paid-module-price-wrap--selected {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.15;
}

.paid-module-price-wrap--selected .paid-module-price-was {
    font-size: 0.75rem;
    font-weight: 500;
    color: #9ca3af;
    text-decoration: line-through;
    margin: 0 0 3px;
    line-height: 1.1;
}

.paid-module-price-wrap--selected .paid-module-price-now {
    font-size: 1.125rem;
    font-weight: 700;
    color: #059669;
}

.paid-module-price-foot--selected {
    margin-top: 6px;
    font-size: 0.8125rem;
    color: #6b7280;
    line-height: 1.4;
}

.pricing-plan-card:hover {
    border-color: #0B1E3F;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
    transform: translateY(-2px);
}

.pricing-plan-card.selected {
    border-color: #0B1E3F;
    background: #eff6ff;
}

.pricing-plan-card.most-popular {
    border-color: #10b981;
    position: relative;
}

.pricing-plan-card.most-popular::before {
    content: attr(data-popular-label);
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: #10b981;
    color: white;
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.plan-name {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 8px;
}

.plan-price {
    font-size: 36px;
    font-weight: 700;
    color: #0B1E3F;
    margin: 16px 0;
}

.plan-price .currency {
    font-size: 20px;
    vertical-align: top;
}

.plan-price .period {
    font-size: 16px;
    color: #6b7280;
    font-weight: 400;
}

.pricing-note {
    margin-top:20px;
}

.pricing-note p {
    margin: 0;
    color: #6b7280;
    font-size: 12px;
    font-style: italic;
}

.plan-features {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.plan-features li {
    padding: 8px 0;
    color: #374151;
    display: flex;
    align-items: center;
}

.plan-features li::before {
    content: '✓';
    color: #10b981;
    font-weight: bold;
    margin-right: 8px;
    font-size: 18px;
}

.plan-select-btn {
    width: 100%;
    padding: 12px 24px;
    background: #0B1E3F;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 16px;
}

.plan-select-btn:hover {
    background: #0B1E3F;
}

.plan-select-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.plan-select-btn.selected {
    background: #10b981;
}

.no-plans-message {
    grid-column: 1 / -1;
    text-align: center;
    color: #6b7280;
}

/* Billing Period Toggle Switch */
.billing-period-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* In header (company_paid_modules, company_pricing_plan): show below h1 and p, aligned right */
.header-content .billing-period-toggle {
    margin-top: 16px;
    justify-content: flex-end;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 26px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #007bff;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

/* Apvienotais rēķins slēdzis uzņēmumu sarakstā – 20% mazāks */
.combined-invoice-wrap .toggle-switch {
    transform: scale(0.8);
    transform-origin: left center;
}

.billing-period-label.active {
    color: #007bff;
    font-weight: 600;
}

.billing-period-label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
    transition: color 0.3s ease;
}

.billing-period-label.active {
    color: #007bff;
    font-weight: 600;
}

.billing-discount-badge {
    background: #007bff;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 8px;
    white-space: nowrap;
}

/* Responsive: 2 plāni lielos ekrānos, 1 plāns šauros */
@media (max-width: 768px) {
    .pricing-plans-container {
        grid-template-columns: 1fr !important;
    }
}

.user-role {
    font-size:12px;
    margin-top:-3px;
}

/* Client Type Buttons (Radio Button Style) */
.client-type-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
}

.client-type-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    color: #6b7280;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.client-type-btn:hover {
    border-color: #0B1E3F;
    color: #0B1E3F;
    background: #eff6ff;
}

.client-type-btn.active {
    border-color: #0B1E3F;
    background: #0B1E3F;
    color: white;
}

.client-type-btn.active:hover {
    background: #4a2270;
    border-color: #4a2270;
}

.client-type-btn i {
    font-size: 16px;
}

@media (max-width: 768px) {
    .client-type-buttons {
        flex-direction: column;
        gap: 8px;
    }
    
    .client-type-btn {
        width: 100%;
    }
}

div.details {
    font-size:13px;
    color:#666;
}
td.comment-cell {font-size:12px;}

/* Text color utilities */
.text-red {
    color: #dc2626 !important;
}
.text-green {
    color: #166534 !important;
}

/* Mobile styles for Add New Address and Add New Bank buttons */
@media (max-width: 768px) {
    #addNewAddressBtn,
    #addNewBankAccountBtn,
    #addNewModalAddressBtn,
    #addNewModalBankBtn {
        width: auto !important;
        display: inline-block !important;
    }
    
    /* Ensure the container doesn't force full width */
    #addNewAddressBtn + div,
    #addNewBankAccountBtn + div,
    #addNewModalAddressBtn + div,
    #addNewModalBankBtn + div,
    div[style*="text-align: center"] button#addNewAddressBtn,
    div[style*="text-align: center"] button#addNewBankAccountBtn,
    div[style*="text-align: center"] button#addNewModalAddressBtn,
    div[style*="text-align: center"] button#addNewModalBankBtn {
        width: auto !important;
        max-width: 100%;
    }
}

.additional-address-field, .additional-client-address-field, .additional-modal-address-field {
    padding-top:10px;
    margin-top:20px;
    border-top:1px solid #e5e7eb;
    }
.additional-bank-account-field, .additional-client-bank-field, .additional-modal-bank-field {
    padding-top:10px;
    border-top:1px solid #e5e7eb;
}

/* Missing Fields Badges */
.missing-fields-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 5px;
    margin-bottom: 4px;
    align-items: center;
}

.missing-information-label {
    font-size: 0.7rem;
    font-weight: 500;
    color: #6b7280;
    margin-right: 2px;
}

.missing-field-badge {
    display: inline-block;
    padding: 2px 8px;
    background-color: #dbeafe;
    color: #4a2270;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 500;
    line-height: 1.4;
    white-space: nowrap;
    cursor: help;
    transition: all 0.2s ease;
}

.missing-field-badge:hover {
    background-color: #bfdbfe;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(30, 64, 175, 0.2);
}

#credit_limit_message {
    margin-top: 8px;
    padding: 8px;
    border-radius: 4px;
    display: none;
    font-size: 12px;
    white-space: pre-line;
    line-height: 1.5;
}

/* Credit limit message - Normal state (blue) */
#credit_limit_message.credit-limit-normal {
    display: block;
    background-color: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

/* Credit limit message - Warning state (orange) - less than 10% remaining */
#credit_limit_message.credit-limit-warning {
    display: block;
    background-color: #fed7aa;
    color: #9a3412;
    border: 1px solid #fdba74;
}

/* Credit limit message - Danger state (red) - over limit */
#credit_limit_message.credit-limit-danger {
    display: block;
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Credit limit message - Unlimited state (yellow) - no credit limit specified */
#credit_limit_message.credit-limit-unlimited {
    display: block;
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

/* Credit limit exceeded warning - Large red text */
#credit_limit_warning {
    display: none;
    margin-top: 12px;
    padding: 16px;
    background-color: #fee2e2;
    border: 2px solid #dc2626;
    border-radius: 6px;
    color: #991b1b;
    font-weight: bold;
    text-align: center;
    line-height: 1.5;
}

/* Credit limit warning before save button */
#credit_limit_warning_before_save {
    margin-bottom: 16px;
    padding: 12px 16px;
    background-color: #fee2e2;
    border: 2px solid #dc2626;
    border-radius: 6px;
    color: #991b1b;
    font-weight: 600;
    text-align: center;
    line-height: 1.6;
    white-space: pre-line;
    font-size: 14px;
}

#credit_limit_warning.show {
    display: block;
}

#credit_limit_warning .warning-title {
    font-size: 16px;
    margin-bottom: 8px;
    font-weight: bold;
}

#credit_limit_warning .warning-message {
    font-size: 14px;
    font-weight: normal;
}

/* Client debt warning - Red warning for clients with debt */
#client_debt_warning {
    display: none;
    margin-top: 12px;
    padding: 16px;
    background-color: #fee2e2;
    border: 2px solid #dc2626;
    border-radius: 6px;
    color: #991b1b;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    line-height: 1.5;
}

#client_debt_warning.show {
    display: block;
}

#client_debt_warning .warning-title {
    font-size: 16px;
    margin-bottom: 8px;
    font-weight: bold;
}

#client_debt_warning .warning-message {
    font-size: 14px;
    font-weight: normal;
}

/* Remove button animations for site-errors and site-requests pages */
.site-errors-page .btn-primary,
.site-errors-page .btn-secondary,
.site-errors-page .btn-danger,
.site-errors-page .btn-action,
.site-errors-page .btn-icon,
.site-errors-page .btn-edit,
.site-errors-page .btn-toggle,
.site-errors-page .btn-add,
.site-errors-page .btn-settings,
.site-errors-page .btn-export,
.site-requests-page .btn-primary,
.site-requests-page .btn-secondary,
.site-requests-page .btn-danger,
.site-requests-page .btn-action,
.site-requests-page .btn-icon,
.site-requests-page .btn-edit,
.site-requests-page .btn-toggle,
.site-requests-page .btn-add,
.site-requests-page .btn-settings,
.site-requests-page .btn-export {
    transition: none !important;
}

.site-errors-page .btn-primary:hover,
.site-errors-page .btn-secondary:hover,
.site-errors-page .btn-action:hover,
.site-errors-page .btn-icon:hover,
.site-errors-page .btn-edit:hover,
.site-errors-page .btn-toggle:hover,
.site-requests-page .btn-primary:hover,
.site-requests-page .btn-secondary:hover,
.site-requests-page .btn-action:hover,
.site-requests-page .btn-icon:hover,
.site-requests-page .btn-edit:hover,
.site-requests-page .btn-toggle:hover {
    transform: none !important;
    box-shadow: none !important;
}

/* Remove animations specifically for delete button on site-errors page */
.site-errors-page .btn-danger,
.site-errors-page .btn-danger:hover {
    transition: none !important;
    transform: none !important;
    box-shadow: none !important;
}

/* Custom Tooltip Styles - Modern Design - Instant Display */
.custom-tooltip {
    position: absolute;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 50%, #f1f5f9 100%);
    color: #1e293b;
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.6;
    max-width: 350px;
    white-space: normal;
    word-wrap: break-word;
    z-index: 10100;
    pointer-events: none;
    box-shadow: 
        0 20px 40px -12px rgba(0, 0, 0, 0.15),
        0 8px 16px -4px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    display: none;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    font-weight: 500;
    letter-spacing: 0.02em;
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.custom-tooltip::before {
    content: '';
    position: absolute;
    bottom: -7px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-top: 7px solid rgba(0, 0, 0, 0.05);
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
    z-index: -1;
}

.custom-tooltip::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #ffffff;
}

.custom-tooltip[data-position="bottom"]::before {
    bottom: auto;
    top: -7px;
    border-top: none;
    border-bottom: 7px solid rgba(0, 0, 0, 0.05);
    filter: drop-shadow(0 -4px 6px rgba(0, 0, 0, 0.1));
}

.custom-tooltip[data-position="bottom"]::after {
    bottom: auto;
    top: -6px;
    border-top: none;
    border-bottom: 6px solid #ffffff;
}

/* Blog Styles */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.blog-container {
    padding: 32px 0;
    margin-top: 70px;
}

.blog-container-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.blog-header {
    text-align: center;
    margin-bottom: 48px;
    padding-bottom: 32px;
    border-bottom: 1px solid #e2e8f0;
}

.blog-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: #1e293b;
    letter-spacing: -0.02em;
}

.blog-header p {
    font-size: 1.125rem;
    color: #64748b;
    max-width: 600px;
    margin: 0 auto;
    font-weight: 400;
}

.blog-articles-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.blog-article-card {
    background: #fff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    margin-bottom: 0;
    overflow: hidden;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
}

.blog-article-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #0B1E3F;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.blog-article-card:hover {
    transform: translateX(4px);
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.blog-article-card:hover::before {
    opacity: 1;
}

.blog-article-card-content {
    padding: 24px 28px;
}

.blog-article-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.5;
    margin: 0;
    letter-spacing: -0.01em;
    transition: color 0.2s ease;
}

.blog-article-card:hover .blog-article-title {
    color: #0B1E3F;
}

/* Alternate/custom URL links – visually hidden from users, kept in DOM for Google/crawlers (SEO) */
.blog-card-alt-urls {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Footer: all blog + post links (incl. custom URLs) for crawlers only – same technique */
.footer-crawler-links {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.footer-crawler-links a {
    color: #64748b;
    text-decoration: none;
}

.blog-card-alt-link {
    color: #64748b;
    text-decoration: none;
}
.blog-card-alt-link:hover {
    color: #0B1E3F;
    text-decoration: underline;
}

.blog-article-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 0.9rem;
    color: #999;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.blog-article-date {
    display: flex;
    align-items: center;
    gap: 5px;
}

.blog-single-article {
    margin: 0 auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 50px;
}

.blog-single-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 20px;
    line-height: 1.2;
}

.blog-single-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333;
}

.blog-single-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
}

/* BBCode font sizes: 160=main, 130=section, 120/115=subheadline, 100=normal */
.blog-single-content .bbcode-size-160 { font-size: 160%; font-weight: 700; line-height: 1.2; display: block; margin: 1em 0 0.5em; }
.blog-single-content .bbcode-size-130 { font-size: 130%; font-weight: 600; line-height: 1.3; display: block; margin: 0.8em 0 0.4em; }
.blog-single-content .bbcode-size-120,
.blog-single-content .bbcode-size-115 { font-size: 117.5%; font-weight: 600; line-height: 1.4; display: block; margin: 0.6em 0 0.3em; }
.blog-single-content .bbcode-size-100 { font-size: 100%; }

/* BBCode lists */
.blog-single-content .bbcode-list {
    margin: 1em 0;
    padding-left: 1.5em;
}
.blog-single-content .bbcode-list-bullet {
    list-style-type: disc;
}
.blog-single-content .bbcode-list-bullet .bbcode-list-bullet-item {
    margin: 0.3em 0;
}
.blog-single-content .bbcode-list-dash {
    list-style-type: none;
    padding-left: 1.5em;
}
.blog-single-content .bbcode-list-dash .bbcode-list-dash-item {
    list-style: none;
    margin: 0.3em 0;
    padding-left: 0;
    position: relative;
}
.blog-single-content .bbcode-list-dash .bbcode-list-dash-item::before {
    content: "– ";
    position: absolute;
    left: -1.2em;
}

.blog-single-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 0.9rem;
    color: #999;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.blog-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #3498db;
    text-decoration: none;
    margin-bottom: 30px;
    font-size: 1rem;
    transition: color 0.3s ease;
}

.blog-back-link:hover {
    color: #2980b9;
}

.blog-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.blog-empty-state i {
    font-size: 4rem;
    margin-bottom: 20px;
    color: #ddd;
}

.blog-loading {
    text-align: center;
    padding: 40px;
}

.blog-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .blog-container {
        padding: 20px 0;
        margin-top: 70px;
    }
    
    .blog-container-inner {
        padding: 0 16px;
    }
    
    .blog-header {
        margin-bottom: 32px;
        padding-bottom: 24px;
    }
    
    .blog-header h1 {
        font-size: 2rem;
    }
    
    .blog-header p {
        font-size: 1rem;
    }
    
    .blog-article-card-content {
        padding: 20px;
    }
    
    .blog-article-title {
        font-size: 1.125rem;
    }
    
    .blog-single-article {
        padding: 30px 20px;
    }
    
    .blog-single-title {
        font-size: 1.8rem;
    }
}

/* ========== Landing Page Settings ========== */
@media (max-width: 768px) {
    .landing-page-settings table.data-table#landingSettingsTable th:nth-child(3),
    .landing-page-settings table.data-table#landingSettingsTable td:nth-child(3) { display: none; }
}

/* ========== Site Companies Page ========== */
.site-companies-page .services-container { overflow: visible; }
.site-companies-page .services-table-wrapper { overflow-x: auto; max-width: 100%; padding-right: 16px; }
.site-companies-page table.services-table#companiesTable { table-layout: fixed; width: 100%; min-width: min(100%, 800px); }
.site-companies-page table.services-table#companiesTable td { overflow: hidden; }
.site-companies-page table.services-table#companiesTable th:first-child,
.site-companies-page table.services-table#companiesTable td:first-child { width: 48px; min-width: 48px; text-align: center; padding: 12px 8px; box-sizing: border-box; }
.site-companies-page .company-contact { min-width: 0; }
.site-companies-page .company-email-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; max-width: 100%; }
.site-companies-page table.services-table#companiesTable td:nth-child(5),
.site-companies-page table.services-table#companiesTable .paid-modules-cell { overflow: visible !important; }
.site-companies-page .companies-actions-col,
.site-companies-page .companies-actions-cell { display: none; width: 56px; min-width: 56px; max-width: 56px; box-sizing: border-box; white-space: nowrap; text-align: right; overflow: visible !important; padding-right: 12px; }
.site-companies-page table.services-table#companiesTable td.companies-actions-cell { overflow: visible !important; }
.site-companies-page table.services-table#companiesTable th:last-child { padding-right: 12px; }
.site-companies-page .companies-actions-cell-inner { display: inline-flex; align-items: center; justify-content: flex-end; flex-shrink: 0; min-width: 44px; }
.site-companies-page .companies-actions-more-btn { display: none; min-width: 44px; width: 44px; height: 44px; padding: 10px; flex-shrink: 0; box-sizing: border-box; }
.site-companies-page .companies-actions-list { display: none; }
@media (max-width: 1200px) {
    .site-companies-page table.services-table#companiesTable th:nth-child(6),
    .site-companies-page table.services-table#companiesTable td:nth-child(6),
    .site-companies-page table.services-table#companiesTable th:nth-child(7),
    .site-companies-page table.services-table#companiesTable td:nth-child(7),
    .site-companies-page table.services-table#companiesTable th:nth-child(8),
    .site-companies-page table.services-table#companiesTable td:nth-child(8) { display: none; }
    .site-companies-page .companies-actions-col,
    .site-companies-page .companies-actions-cell { display: table-cell !important; width: 56px; min-width: 56px; max-width: 56px; }
    .site-companies-page .companies-actions-cell-inner { display: inline-flex !important; align-items: center; justify-content: flex-end; flex-shrink: 0; }
    .site-companies-page .companies-actions-more-btn { display: inline-flex !important; min-width: 44px; width: 44px; height: 44px; padding: 10px; flex-shrink: 0; }
    .site-companies-page .companies-actions-list { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 9999; flex-direction: row; flex-wrap: nowrap; padding: 0; background: transparent; }
    .site-companies-page .companies-actions-cell-inner.is-open .companies-actions-list { display: flex; }
    .site-companies-page .companies-actions-backdrop { flex: 1; min-width: 0; background: rgba(0,0,0,0.4); cursor: pointer; }
    .site-companies-page .companies-actions-panel { width: 280px; max-width: 90vw; background: #fff; padding: 24px; box-shadow: -2px 0 12px rgba(0,0,0,0.15); overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
    .site-companies-page .companies-panel-row .companies-panel-label { display: block; font-weight: 600; color: #6b7280; font-size: 0.8125rem; margin-bottom: 2px; }
    .site-companies-page .companies-panel-row .companies-panel-value { font-size: 0.9375rem; color: #374151; }
    .site-companies-page .companies-panel-modules-list { display: flex; flex-direction: column; gap: 4px; min-width: 0; overflow: hidden; }
    .site-companies-page .companies-panel-modules-list span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
}
@media (max-width: 900px) {
    .site-companies-page table.services-table#companiesTable th:nth-child(4),
    .site-companies-page table.services-table#companiesTable td:nth-child(4),
    .site-companies-page table.services-table#companiesTable th:nth-child(5),
    .site-companies-page table.services-table#companiesTable td:nth-child(5) { display: none; }
}
@media (max-width: 768px) {
    .site-companies-page table.services-table#companiesTable th:nth-child(3),
    .site-companies-page table.services-table#companiesTable td:nth-child(3) { display: none; }
}

/* Paid modules admin modal: optional date fields, module option checkboxes */
.site-companies-page #paidModulesModal #paidModulesForm .paid-module-edit-row input[type="date"].module-end-date {
    border-color: #d1d5db;
    box-shadow: none;
}
.site-companies-page #paidModulesModal #paidModulesForm .paid-module-edit-row input[type="date"].module-end-date:focus {
    border-color: #0B1E3F;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.site-companies-page #paidModulesModal #paidModulesForm .paid-module-edit-row .module-checkbox,
.site-companies-page #paidModulesModal #paidModulesForm .paid-module-edit-row .module-feature-opt {
    width: auto;
    min-width: 1rem;
    padding: 0;
    border: none;
    box-shadow: none;
}
.site-companies-page #paidModulesModal #paidModulesForm .paid-module-edit-row .module-checkbox:focus,
.site-companies-page #paidModulesModal #paidModulesForm .paid-module-edit-row .module-feature-opt:focus {
    outline: 2px solid rgba(11, 30, 63, 0.35);
    outline-offset: 2px;
}

/* ========== Site Feedback Page ========== */
.feedback-show-toggle { margin-right: 10px; }
.feedback-rating-under-name { margin-top: 4px; font-size: 0.875rem; }
.feedback-date-under-rating { margin-top: 4px; font-size: 0.8125rem; color: #6b7280; }
.site-feedback-page .feedback-actions-more-btn,
.site-feedback-page .feedback-actions-list { display: none; }
.site-feedback-page .feedback-actions-cell-inner { display: none; }
@media (max-width: 1000px) {
    .site-feedback-page .feedback-actions-cell-inner { display: inline-flex !important; align-items: center; flex-shrink: 0; }
    .site-feedback-page .feedback-actions-more-btn { display: inline-flex !important; min-width: 44px; width: 44px; height: 44px; padding: 10px; flex-shrink: 0; }
    .site-feedback-page table.services-table#feedbackTable th:nth-child(2),
    .site-feedback-page table.services-table#feedbackTable td:nth-child(2),
    .site-feedback-page table.services-table#feedbackTable th:nth-child(3),
    .site-feedback-page table.services-table#feedbackTable td:nth-child(3),
    .site-feedback-page table.services-table#feedbackTable th:nth-child(4),
    .site-feedback-page table.services-table#feedbackTable td:nth-child(4) { display: none; }
    .site-feedback-page .feedback-first-cell-inner { display: flex; align-items: center; gap: 12px; width: 100%; min-width: 0; }
    .site-feedback-page .feedback-first-cell-inner .feedback-user-block { flex: 1; min-width: 0; }
    .site-feedback-page .feedback-actions-list { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 9999; flex-direction: row; flex-wrap: nowrap; padding: 0; background: transparent; }
    .site-feedback-page .feedback-actions-cell-inner.is-open .feedback-actions-list { display: flex; }
    .site-feedback-page .feedback-actions-backdrop { flex: 1; min-width: 0; background: rgba(0,0,0,0.4); cursor: pointer; }
    .site-feedback-page .feedback-actions-panel { width: 320px; max-width: 90vw; background: #fff; padding: 24px; box-shadow: -2px 0 12px rgba(0,0,0,0.15); overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
    .site-feedback-page .feedback-panel-label { font-weight: 600; color: #6b7280; font-size: 0.8125rem; margin-bottom: 4px; }
    .site-feedback-page .feedback-panel-value { font-size: 0.9375rem; color: #374151; white-space: pre-wrap; word-break: break-word; }
}

/* ========== Site Modules Page ========== */
.site-modules-page .module-price-mobile-only { display: none; }
.site-modules-page .modules-actions-more-btn,
.site-modules-page .modules-actions-list { display: none; }
.site-modules-page .modules-actions-cell-inner { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.site-modules-page .modules-actions-desktop { display: inline-flex; align-items: center; gap: 8px; }

/* Drag-and-drop reorder */
.site-modules-page .drag-handle-th { width: 44px; padding: 12px 8px !important; text-align: center; vertical-align: middle; }
.site-modules-page .module-drag-handle-cell { width: 44px; padding: 12px 8px !important; text-align: center; vertical-align: middle; }
.site-modules-page .module-drag-handle { cursor: grab; color: #9ca3af; padding: 8px; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; user-select: none; }
.site-modules-page .module-drag-handle:hover { color: #6b7280; background: #f3f4f6; }
.site-modules-page .module-drag-handle:active { cursor: grabbing; }
.site-modules-page .module-row-draggable { transition: background-color 0.15s ease; }
.site-modules-page .module-row-draggable.module-dragging { opacity: 0.6; background: #f3f4f6; }
/* Drop indicator: blue horizontal line where module will be inserted */
.site-modules-page .module-row-draggable.module-drag-over-before { box-shadow: 0 -3px 0 0 #3b82f6; }
.site-modules-page .module-row-draggable.module-drag-over-after { box-shadow: 0 3px 0 0 #3b82f6; }

@media (max-width: 1100px) {
    .site-modules-page table.integrations-table#modulesTable th:nth-child(3),
    .site-modules-page table.integrations-table#modulesTable td:nth-child(3) { display: none; }
}
@media (max-width: 768px) {
    .site-modules-page .module-price-mobile-only { display: inline; }
    .site-modules-page table.integrations-table#modulesTable th:nth-child(1),
    .site-modules-page table.integrations-table#modulesTable td:nth-child(1),
    .site-modules-page table.integrations-table#modulesTable th:nth-child(4),
    .site-modules-page table.integrations-table#modulesTable td:nth-child(4) { display: none; }
    .site-modules-page .modules-actions-desktop { display: none !important; }
    .site-modules-page .modules-actions-more-btn { display: inline-flex !important; min-width: 44px; width: 44px; height: 44px; padding: 10px; align-items: center; justify-content: center; flex-shrink: 0; }
    .site-modules-page .modules-actions-list { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 9999; flex-direction: row; flex-wrap: nowrap; padding: 0; background: transparent; }
    .site-modules-page .modules-actions-cell-inner.is-open .modules-actions-list { display: flex; }
    .site-modules-page .modules-actions-backdrop { flex: 1; min-width: 0; background: rgba(0,0,0,0.4); cursor: pointer; }
    .site-modules-page .modules-actions-panel { width: 320px; max-width: 90vw; background: #fff; padding: 24px; box-shadow: -2px 0 12px rgba(0,0,0,0.15); overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
    .site-modules-page .modules-panel-label { font-weight: 600; color: #6b7280; font-size: 0.8125rem; margin-bottom: 4px; }
    .site-modules-page .modules-panel-value { font-size: 0.9375rem; color: #374151; }
    .site-modules-page .modules-panel-row-description .modules-panel-value { white-space: normal; word-break: break-word; overflow-wrap: break-word; min-width: 0; }
}

/* ========== Site Pricing Page ========== */
.site-pricing-page .pricing-actions-more-btn,
.site-pricing-page .pricing-actions-list { display: none; }
.site-pricing-page .pricing-actions-cell-inner { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.site-pricing-page .pricing-actions-desktop { display: inline-flex; align-items: center; gap: 8px; }
@media (max-width: 768px) {
    .site-pricing-page .integrations-container { max-width: 100%; overflow-x: hidden; }
    .site-pricing-page .integrations-table-wrapper { overflow-x: visible; max-width: 100%; }
    .site-pricing-page table.integrations-table#pricingTable { width: 100%; min-width: 0; table-layout: fixed; }
    .site-pricing-page table.integrations-table#pricingTable th,
    .site-pricing-page table.integrations-table#pricingTable td { padding: 10px 8px; font-size: 0.8125rem; }
    .site-pricing-page table.integrations-table#pricingTable th { font-size: 0.8125rem; }
    .site-pricing-page table.integrations-table#pricingTable td:nth-child(1),
    .site-pricing-page table.integrations-table#pricingTable td:nth-child(2) { word-break: break-word; min-width: 0; }
    .site-pricing-page table.integrations-table#pricingTable th:nth-child(3),
    .site-pricing-page table.integrations-table#pricingTable td:nth-child(3) { display: none; }
    .site-pricing-page table.integrations-table#pricingTable th:last-child,
    .site-pricing-page table.integrations-table#pricingTable td.pricing-actions-cell { width: 1%; min-width: 52px; max-width: 52px; padding: 8px 6px; overflow: visible; white-space: nowrap; }
    .site-pricing-page .pricing-actions-desktop { display: none !important; }
    .site-pricing-page .pricing-actions-more-btn { display: inline-flex !important; min-width: 44px; width: 44px; height: 44px; padding: 10px; align-items: center; justify-content: center; flex-shrink: 0; box-sizing: border-box; }
    .site-pricing-page .pricing-actions-list { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 9999; flex-direction: row; flex-wrap: nowrap; padding: 0; background: transparent; }
    .site-pricing-page .pricing-actions-cell-inner.is-open .pricing-actions-list { display: flex; }
    .site-pricing-page .pricing-actions-backdrop { flex: 1; min-width: 0; background: rgba(0,0,0,0.4); cursor: pointer; }
    .site-pricing-page .pricing-actions-panel { width: 320px; max-width: 90vw; background: #fff; padding: 24px; box-shadow: -2px 0 12px rgba(0,0,0,0.15); overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
    .site-pricing-page .pricing-panel-label { font-weight: 600; color: #6b7280; font-size: 0.8125rem; margin-bottom: 4px; }
    .site-pricing-page .pricing-panel-value { font-size: 0.9375rem; color: #374151; }
}

/* ========== Site Discount Codes Page ========== */
.site-discount-codes-page .discount-expires-cell .discount-expires-date { font-weight: 500; }
.site-discount-codes-page .discount-expires-cell .discount-expires-time { font-size: 0.8125rem; color: #64748b; margin-top: 2px; }
.site-discount-codes-page .discount-expires-cell .discount-expires-hours { font-size: 0.75rem; color: #059669; margin-top: 4px; }
.site-discount-codes-page .discount-expires-cell.is-expired .discount-expires-hours { color: #b91c1c; }
.site-discount-codes-page tr.discount-code-row-usage-exhausted .discount-code-usage-cell.is-exhausted .discount-code-usage-count,
.site-discount-codes-page .discount-code-usage-cell.is-exhausted .discount-code-usage-count {
    color: #b91c1c;
    font-weight: 600;
}
.site-discount-codes-page .discount-code-usage-exhausted-note {
    font-size: 0.75rem;
    color: #b91c1c;
    font-weight: 500;
    margin-top: 4px;
    line-height: 1.3;
}
.site-discount-codes-page .discount-code-plan-attach-note {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 500;
    margin-top: 4px;
    line-height: 1.3;
}
.site-discount-codes-page .discount-codes-status-cell {
    text-align: center;
    vertical-align: middle;
    width: 72px;
}
.site-discount-codes-page .discount-code-status-switch {
    margin: 0 auto;
    vertical-align: middle;
}
.site-discount-codes-page .discount-code-form-status-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.site-discount-codes-page .discount-code-form-status-label {
    font-weight: 600;
    color: #374151;
}
.site-discount-codes-page .switch-inline {
    flex-shrink: 0;
}
.site-discount-codes-page .discount-code-history-modal-content {
    max-width: 720px;
    width: 92vw;
}
.site-discount-codes-page .discount-code-history-table-wrap {
    max-height: 60vh;
    overflow: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}
.site-discount-codes-page table.discount-code-history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}
.site-discount-codes-page table.discount-code-history-table th,
.site-discount-codes-page table.discount-code-history-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #f3f4f6;
}
.site-discount-codes-page table.discount-code-history-table th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
    position: sticky;
    top: 0;
    z-index: 1;
}
.site-discount-codes-page .discount-code-history-place-cell {
    vertical-align: top;
}
.site-discount-codes-page .discount-code-history-place-main {
    font-weight: 500;
    color: #111827;
}
.site-discount-codes-page .discount-code-history-place-sub {
    margin-top: 4px;
    font-size: 0.8125rem;
    color: #6b7280;
    line-height: 1.35;
}
.site-discount-codes-page .discount-code-history-snapshot {
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid #e5e7eb;
}
.site-discount-codes-page .discount-code-history-timeline-section {
    margin-top: 0.5rem;
}
.site-discount-codes-page .discount-code-history-subtitle {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 0.75rem 0;
}
.site-discount-codes-page .discount-code-history-h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin: 1rem 0 0.5rem 0;
}
.site-discount-codes-page .discount-code-history-usage-line {
    margin: 0 0 0.5rem 0;
    font-size: 0.9375rem;
    color: #374151;
}
.site-discount-codes-page .discount-code-history-list {
    margin: 0;
    padding-left: 1.25rem;
    font-size: 0.875rem;
    color: #374151;
}
.site-discount-codes-page .discount-code-history-timeline-hint {
    margin: 0;
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.45;
}
.site-discount-codes-page .discount-code-history-empty {
    padding: 24px;
    text-align: center;
    color: #6b7280;
    font-size: 0.9375rem;
}
.site-discount-codes-page .discount-code-history-loading {
    text-align: center;
    padding: 24px;
}
.site-discount-codes-page .discount-codes-panel-value .discount-code-usage-cell.is-exhausted .discount-code-usage-count {
    color: #b91c1c;
    font-weight: 600;
}
.site-discount-codes-page .discount-codes-actions-more-btn,
.site-discount-codes-page .discount-codes-actions-list { display: none; }
.site-discount-codes-page .discount-codes-actions-cell-inner { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.site-discount-codes-page .discount-codes-actions-desktop { display: inline-flex; align-items: center; gap: 8px; }
@media (max-width: 768px) {
    .site-discount-codes-page .integrations-container { max-width: 100%; overflow-x: hidden; }
    .site-discount-codes-page .integrations-table-wrapper { overflow-x: visible; max-width: 100%; }
    .site-discount-codes-page table.integrations-table#discountCodesTable { width: 100%; min-width: 0; table-layout: fixed; }
    .site-discount-codes-page table.integrations-table#discountCodesTable th,
    .site-discount-codes-page table.integrations-table#discountCodesTable td { padding: 10px 8px; font-size: 0.8125rem; }
    .site-discount-codes-page table.integrations-table#discountCodesTable th:nth-child(2),
    .site-discount-codes-page table.integrations-table#discountCodesTable td:nth-child(2),
    .site-discount-codes-page table.integrations-table#discountCodesTable th:nth-child(3),
    .site-discount-codes-page table.integrations-table#discountCodesTable td:nth-child(3),
    .site-discount-codes-page table.integrations-table#discountCodesTable th:nth-child(4),
    .site-discount-codes-page table.integrations-table#discountCodesTable td:nth-child(4),
    .site-discount-codes-page table.integrations-table#discountCodesTable th:nth-child(5),
    .site-discount-codes-page table.integrations-table#discountCodesTable td:nth-child(5),
    .site-discount-codes-page table.integrations-table#discountCodesTable th:nth-child(6),
    .site-discount-codes-page table.integrations-table#discountCodesTable td:nth-child(6) { display: none; }
    .site-discount-codes-page table.integrations-table#discountCodesTable th:last-child,
    .site-discount-codes-page table.integrations-table#discountCodesTable td.discount-codes-actions-cell { width: 1%; min-width: 52px; max-width: 52px; padding: 8px 6px; overflow: visible; white-space: nowrap; }
    .site-discount-codes-page .discount-codes-actions-desktop { display: none !important; }
    .site-discount-codes-page .discount-codes-actions-more-btn { display: inline-flex !important; min-width: 44px; width: 44px; height: 44px; padding: 10px; align-items: center; justify-content: center; flex-shrink: 0; box-sizing: border-box; }
    .site-discount-codes-page .discount-codes-actions-list { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 9999; flex-direction: row; flex-wrap: nowrap; padding: 0; background: transparent; }
    .site-discount-codes-page .discount-codes-actions-cell-inner.is-open .discount-codes-actions-list { display: flex; }
    .site-discount-codes-page .discount-codes-actions-backdrop { flex: 1; min-width: 0; background: rgba(0,0,0,0.4); cursor: pointer; }
    .site-discount-codes-page .discount-codes-actions-panel { width: 320px; max-width: 90vw; background: #fff; padding: 24px; box-shadow: -2px 0 12px rgba(0,0,0,0.15); overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
    .site-discount-codes-page .discount-codes-panel-label { font-weight: 600; color: #6b7280; font-size: 0.8125rem; margin-bottom: 4px; }
    .site-discount-codes-page .discount-codes-panel-value { font-size: 0.9375rem; color: #374151; word-break: break-word; }
}

/* ========== Site Integrations Page ========== */
.site-integrations-page table.integrations-table#integrationsTable { table-layout: fixed; width: 100%; }
.site-integrations-page table.integrations-table#integrationsTable th:first-child,
.site-integrations-page table.integrations-table#integrationsTable td:first-child { width: 22%; max-width: 22%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.site-integrations-page table.integrations-table#integrationsTable th:nth-child(2),
.site-integrations-page table.integrations-table#integrationsTable td:nth-child(2) { width: 56%; min-width: 0; }
.site-integrations-page table.integrations-table#integrationsTable th:nth-child(3),
.site-integrations-page table.integrations-table#integrationsTable td:nth-child(3) { width: 11%; min-width: 72px; white-space: nowrap; text-align: center; }
.site-integrations-page table.integrations-table#integrationsTable th:last-child,
.site-integrations-page table.integrations-table#integrationsTable td.integrations-actions-cell { width: 11%; min-width: 96px; white-space: nowrap; }
.site-integrations-page .integrations-actions-more-btn,
.site-integrations-page .integrations-actions-list { display: none; }
.site-integrations-page .integrations-actions-cell-inner { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.site-integrations-page .integrations-actions-desktop { display: inline-flex; align-items: center; gap: 8px; }
@media (max-width: 1200px) {
    .site-integrations-page table.integrations-table#integrationsTable th:nth-child(2),
    .site-integrations-page table.integrations-table#integrationsTable td:nth-child(2) { display: none; }
    .site-integrations-page table.integrations-table#integrationsTable th:first-child,
    .site-integrations-page table.integrations-table#integrationsTable td:first-child { width: 70%; max-width: 70%; }
}
@media (max-width: 1000px) {
    .site-integrations-page .integrations-actions-desktop { display: none !important; }
    .site-integrations-page .integrations-actions-more-btn { display: inline-flex !important; min-width: 44px; width: 44px; height: 44px; padding: 10px; align-items: center; justify-content: center; flex-shrink: 0; }
    .site-integrations-page .integrations-actions-list { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 9999; flex-direction: row; flex-wrap: nowrap; padding: 0; background: transparent; }
    .site-integrations-page .integrations-actions-cell-inner.is-open .integrations-actions-list { display: flex; }
    .site-integrations-page .integrations-actions-backdrop { flex: 1; min-width: 0; background: rgba(0,0,0,0.4); cursor: pointer; }
    .site-integrations-page .integrations-actions-panel { width: 320px; max-width: 90vw; background: #fff; padding: 24px; box-shadow: -2px 0 12px rgba(0,0,0,0.15); overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
    .site-integrations-page .integrations-panel-label { font-weight: 600; color: #6b7280; font-size: 0.8125rem; margin-bottom: 4px; }
    .site-integrations-page .integrations-panel-value { font-size: 0.9375rem; color: #374151; }
    .site-integrations-page .integrations-panel-row-json .integrations-panel-value { white-space: pre-wrap; word-break: break-word; max-height: 200px; overflow-y: auto; }
}
@media (max-width: 700px) {
    .site-integrations-page table.integrations-table#integrationsTable th:nth-child(3),
    .site-integrations-page table.integrations-table#integrationsTable td:nth-child(3) { display: none; }
    .site-integrations-page table.integrations-table#integrationsTable th:first-child,
    .site-integrations-page table.integrations-table#integrationsTable td:first-child { width: 85%; max-width: 85%; }
}

/* ========== Site Calendar Page ========== */
.site-calendar-page .calendar-actions-more-btn,
.site-calendar-page .calendar-actions-list { display: none; }
.site-calendar-page .calendar-actions-cell-inner { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.site-calendar-page .calendar-actions-desktop { display: flex; align-items: center; gap: 8px; }
@media (max-width: 1200px) {
    .site-calendar-page table.data-table#calendarTable th:nth-child(3),
    .site-calendar-page table.data-table#calendarTable td:nth-child(3) { display: none; }
}
@media (max-width: 768px) {
    .site-calendar-page .calendar-actions-desktop { display: none !important; }
    .site-calendar-page .calendar-actions-more-btn { display: inline-flex !important; min-width: 44px; width: 44px; height: 44px; padding: 10px; align-items: center; justify-content: center; flex-shrink: 0; }
    .site-calendar-page .calendar-actions-list { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 9999; flex-direction: row; flex-wrap: nowrap; padding: 0; background: transparent; }
    .site-calendar-page .calendar-actions-cell-inner.is-open .calendar-actions-list { display: flex; }
    .site-calendar-page .calendar-actions-backdrop { flex: 1; min-width: 0; background: rgba(0,0,0,0.4); cursor: pointer; }
    .site-calendar-page .calendar-actions-panel { width: 320px; max-width: 90vw; background: #fff; padding: 24px; box-shadow: -2px 0 12px rgba(0,0,0,0.15); overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
    .site-calendar-page .calendar-panel-label { font-weight: 600; color: #6b7280; font-size: 0.8125rem; margin-bottom: 4px; }
    .site-calendar-page .calendar-panel-value { font-size: 0.9375rem; color: #374151; }
    .site-calendar-page .calendar-panel-row-description .calendar-panel-value { white-space: normal; word-break: break-word; overflow-wrap: break-word; min-width: 0; }
}

/* ========== Site SEO Page ========== */
@media (max-width: 768px) {
    .site-seo-page table.integrations-table#seoTable th:nth-child(2),
    .site-seo-page table.integrations-table#seoTable td:nth-child(2) { display: none; }
}

/* ========== Site Rules Page ========== */
.site-rules-page .rules-tabs-container { width: 100vw; position: relative; left: 50%; right: 50%; margin-left: -50vw; margin-right: -50vw; display: flex; gap: 0; border-bottom: 2px solid #e5e7eb; margin-bottom: 24px; }
.site-rules-page .rules-tabs-container .rules-tab { flex: 1; justify-content: center; min-width: 0; }
@media (max-width: 768px) {
    .site-rules-page .dashboard-main { width: 100%; max-width: 100%; box-sizing: border-box; }
    .site-rules-page .dashboard-main .container { width: 100%; max-width: 100%; padding-left: 16px; padding-right: 16px; box-sizing: border-box; }
    .site-rules-page #rulesContentArea { padding-left: 0; padding-right: 0; }
}

/* ========== Extracted from inline styles (no inline CSS in HTML) ========== */

/* Delivery information fields - landing_head */
@media (min-width: 768px) {
    #delivery_information_fields > div[style*="grid-template-columns"] {
        grid-template-columns: 1fr 1fr !important;
    }
}

/* Create offer modal - company_offers */
@media (max-width: 768px) {
    #createOfferModal .modal-body > form > div:first-child {
        grid-template-columns: 1fr !important;
    }
}

/* Translations page - loading spinner */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f4f6;
    border-top: 4px solid #0B1E3F;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
.loading-state {
    text-align: center;
    padding: 40px;
}
.loading-state p {
    color: #6b7280;
    font-size: 0.875rem;
    margin: 16px 0 0 0;
}

/* Company finance - upload modal */
.finance-upload-banks { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 1rem; }
.finance-upload-bank-option { margin: 0; cursor: pointer; }
.finance-upload-bank-option input { position: absolute; opacity: 0; width: 0; height: 0; }
.finance-upload-bank-card {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; border: 2px solid #e2e8f0; border-radius: 10px;
    background: #f8fafc; min-width: 140px; transition: border-color .15s, background .15s;
}
.finance-upload-bank-option input:focus-visible + .finance-upload-bank-card { outline: 2px solid var(--primary-color, #0B1E3F); outline-offset: 2px; }
.finance-upload-bank-option input:checked + .finance-upload-bank-card { border-color: var(--primary-color, #0B1E3F); background: #eff6ff; }
.finance-upload-bank-option:hover .finance-upload-bank-card { border-color: #cbd5e1; }
.finance-upload-bank-logo { width: 48px; height: 48px; object-fit: contain; border-radius: 6px; flex-shrink: 0; }
.finance-upload-bank-name { font-weight: 600; color: #1e293b; }
.finance-upload-label-banks { margin-bottom: 0.5rem; }
.finance-upload-info-box {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 10px 12px; margin-top: 0.75rem; margin-bottom: 0;
    border: 1px solid #7dd3fc; border-radius: 6px;
    background-color: #f0f9ff; color: #475569;
    font-size: 0.875rem; line-height: 1.4;
}
.finance-upload-info-box.finance-upload-more-banks { margin-top: 0; margin-bottom: 1rem; }
.finance-upload-info-box.finance-upload-data-privacy { margin-top: 0.75rem; }
.finance-upload-info-icon { flex-shrink: 0; margin-top: 2px; font-size: 1rem; color: #7dd3fc; }
.finance-upload-info-text { flex: 1; }
.finance-upload-test-data {
    margin-top: 1rem; padding: 12px; border: 1px solid #cbd5e1; border-radius: 8px;
    background: #f1f5f9; max-height: 320px; overflow: auto;
}
.finance-upload-test-title { margin: 0 0 8px 0; font-size: 0.95rem; color: #334155; }
.finance-upload-test-summary { margin: 0 0 8px 0; font-size: 0.875rem; color: #475569; }
.finance-upload-test-json { margin: 0; padding: 10px; font-size: 11px; line-height: 1.35; background: #fff; border: 1px solid #e2e8f0; border-radius: 6px; white-space: pre-wrap; word-break: break-all; max-height: 240px; overflow: auto; }

/* Company email - tabs */
.email-tabs {
    display: flex;
    gap: 0;
    margin-top: 24px;
    margin-bottom: 24px;
    border-bottom: 2px solid #e5e7eb;
    min-height: 48px;
}
.email-tab {
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: #6b7280;
    font-weight: 500;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    bottom: -2px;
}
.email-tab:hover {
    color: #007bff;
    background-color: #f8f9fa;
}
.email-tab.active {
    color: #007bff;
    font-weight: 600;
    border-bottom-color: #007bff;
}
.email-tab-content {
    display: none;
}
.email-tab-content.active {
    display: block;
}

/* Site blog / site posts - custom-url-badge, bbcode */
.custom-url-badge {
    display: inline-flex;
    align-items: center;
    background: #e5e7eb;
    color: #374151;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.875rem;
}
.custom-url-badge a { color: #0B1E3F; text-decoration: none; }
.custom-url-badge a:hover { text-decoration: underline; }
.custom-url-badge-remove {
    margin-left: 4px;
    padding: 0 4px;
    border: none;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
}
.custom-url-badge-remove:hover { color: #dc2626; }
.bbcode-list-popup h4 { margin: 0 0 8px; font-size: 1.1rem; }
.bbcode-list-popup .bbcode-list-hint { margin: 0 0 10px; font-size: 0.9rem; color: #6b7280; }
.bbcode-list-popup textarea { width: 100%; margin-bottom: 12px; padding: 8px; border: 1px solid #d1d5db; border-radius: 6px; }
.bbcode-list-popup .bbcode-list-type { margin-bottom: 12px; display: flex; gap: 16px; }
.bbcode-list-popup .bbcode-list-type label { cursor: pointer; }
.bbcode-list-popup .bbcode-list-actions { display: flex; gap: 8px; justify-content: flex-end; }
.bbcode-toolbar select {
    width: auto !important; min-width: 110px; height: 34px; flex-shrink: 0; padding: 5px 32px 5px 10px !important;
    border: 1px solid #d1d5db; border-radius: 6px; font-size: 0.875rem; line-height: 1.5;
    background: #fff; background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat; background-position: right 8px center; background-size: 14px;
}

/* Company set contracts - variable-chip */
.variable-chip {
    background: #ffffff;
    color: #111827;
    border: 1px solid #d1d5db;
    transition: background-color 0.15s ease, color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.variable-chip:hover {
    background: #0B1E3F;
    color: #ffffff;
    border-color: #4a2270;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.4);
    transform: translateY(-1px);
}

/* Company invoice settings - invoice number grid */
@media (min-width: 768px) {
    #invoice_number_grid {
        grid-template-columns: 2fr minmax(auto, 120px) !important;
    }
    #invoice_number_grid.has-start-input {
        grid-template-columns: 2fr minmax(auto, 120px) minmax(150px, 1fr) !important;
    }
}
@media (min-width: 1024px) {
    #invoice_number_grid {
        grid-template-columns: 2fr auto !important;
    }
    #invoice_number_grid.has-start-input {
        grid-template-columns: 2fr auto 1fr !important;
    }
}

/* Company subscriptions */
.subscriptions-table th,
.subscriptions-table td { vertical-align: top; }

/* Change password - password toggle */
.password-toggle-btn {
    transition: color 0.2s ease;
}
.password-toggle-btn:hover {
    color: #374151 !important;
}
.password-toggle-btn:focus {
    outline: 2px solid #0B1E3F;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Cookie, privacy, rules - rotating loading text */
.rotating-loading-text {
    animation: textRotate 3s linear infinite;
    transform-origin: center center;
}
@keyframes textRotate {
    0% { transform: rotate(0deg) scale(1); opacity: 1; }
    25% { transform: rotate(90deg) scale(1.1); opacity: 0.8; }
    50% { transform: rotate(180deg) scale(1); opacity: 0.6; }
    75% { transform: rotate(270deg) scale(1.1); opacity: 0.8; }
    100% { transform: rotate(360deg) scale(1); opacity: 1; }
}

/* Company invoices - EDS submit, overdue, totals, delete/credit modal, etc */
.btn-eds-submit {
    background: #f8fafc !important;
    color: #374151 !important;
    border: 1px solid #e2e8f0 !important;
}
.btn-eds-submit:hover {
    background: #eff6ff !important;
    border-color: #0B1E3F !important;
}
.btn-eds-submit i { color: #0B1E3F !important; }
.btn-eds-submit:hover i { color: #0B1E3F !important; }

@keyframes invoice-overdue-pulse {
    0%, 100% { background-color: #f0e0e0; }
    50% { background-color: #e8c8c8; }
}
.invoice-overdue-row {
    animation: invoice-overdue-pulse 3s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.invoices-totals-row {
    border-top: 2px solid #e2e8f0;
    background: #f8fafc;
}
.invoices-totals-row td { border-bottom: none !important; }
.invoices-totals-label {
    text-align: right !important;
    font-weight: 600;
    padding: 12px 8px !important;
    color: #374151;
}
.invoices-totals-values {
    padding: 12px 8px !important;
    font-weight: 600;
    vertical-align: middle;
    min-width: 180px;
}
.invoices-totals-mini-table {
    border-collapse: collapse;
    font-size: 1em;
    min-width: 160px;
}
#invoicesTable .invoices-totals-mini-table td {
    padding: 2px 0 2px 12px;
    vertical-align: middle;
    border: none !important;
    border-bottom: 1px solid #f8fafc !important;
}
.invoices-totals-mini-table td:first-child {
    padding-left: 0;
    padding-right: 12px;
    color: #475569;
    font-weight: 500;
    font-size: 0.8em;
    white-space: nowrap;
    text-align: right;
}
.invoices-totals-mini-table .invoices-totals-mini-value {
    text-align: right;
    font-weight: 600;
    white-space: nowrap;
}

.invoice-bounced-row { background-color: #fef2f2; }
.invoice-bounced-row .status-badge { border-color: #b91c1c; }
.email-bounced-warning { color: #b91c1c; }
.email-bounced-warning .email-bounced-info-icon { color: #0B1E3F; }
/* Vienots linku stils visai sistēmai: upgrade, buy module, increase limit u.c. */
.link-upgrade,
.increase-credit-limit-link,
.manual-reminder-buy-link {
    color: var(--landing-primary, #0B1E3F);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    display: inline-block;
}
button.increase-credit-limit-link {
    appearance: none;
    background: transparent;
    border: 0;
    padding: 0;
    margin-top: 4px;
    font: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: inherit;
    color: var(--landing-primary, #0B1E3F);
    text-decoration: underline;
    cursor: pointer;
}
.link-upgrade:hover,
.increase-credit-limit-link:hover,
.manual-reminder-buy-link:hover { text-decoration: underline; }
/* Link progress bar kontekstā (ierobežojuma sasniegts) */
.header-progress .link-upgrade,
.header-progress .manual-reminder-buy-link { margin-top: 6px; }
/* Link kā header-progress blakus elements (document_management utt.) */
.header-progress + .link-upgrade { margin-top: 8px; }
/* Pilna platuma centrēts variants (piem. offers) */
.link-upgrade-block { display: block !important; width: 100%; margin-top: 8px; text-align: center; }

#deleteOrCreditInvoiceModal .modal-content {
    width: 72%;
    max-width: 560px;
}
#deleteOrCreditInvoiceModal .modal-body .btn-primary,
#deleteOrCreditInvoiceModal .modal-body .btn-secondary,
#deleteOrCreditInvoiceModal .modal-footer .btn-secondary {
    padding: 13px 26px;
}
#deleteOrCreditModalDeleteBtn {
    background: linear-gradient(135deg, #dc2626, #b91c1c) !important;
    color: #fff !important;
    border: none;
}
#deleteOrCreditModalDeleteBtn:hover {
    background: linear-gradient(135deg, #b91c1c, #991b1b) !important;
}
#deleteOrCreditModalCreditBtn {
    background: linear-gradient(135deg, #16a34a, #15803d) !important;
    color: #fff !important;
    border: none;
}
#deleteOrCreditModalCreditBtn:hover {
    background: linear-gradient(135deg, #15803d, #166534) !important;
}

.status-badge.status-created-credit-invoice { background-color: #fecaca; color: #b91c1c; }
.invoice-badge.badge-document-type-credit,
.badge-document-type.invoice-badge-document-type-credit {
    background-color: #fecaca !important;
    color: #b91c1c !important;
    border: 1px solid #b91c1c !important;
}
.invoice-amount-negative,
.invoice-amount-vat.invoice-amount-negative { color: #b91c1c; }
.btn-manual-reminder.disabled { opacity: 0.6; cursor: not-allowed; }
.btn-resend.disabled { opacity: 0.6; cursor: not-allowed; }
.manual-reminder-cell { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; align-self: flex-start; }
.manual-reminder-cell .btn-manual-reminder { align-self: flex-start; }
.manual-reminder-sent-at { font-size: 0.7rem; color: #64748b; text-align: left; line-height: 1.2; }
.manual-reminder-sent-at-short { display: block; white-space: nowrap; }
.manual-reminder-sent-at-long { display: none; }
/* manual-reminder-buy-link – skatīt .link-upgrade augstāk */
@keyframes manual-reminder-overdue-pulse {
    0%, 100% { color: #dc2626; transform: scale(1); }
    50% { color: #b91c1c; transform: scale(1.2); }
}
.btn-manual-reminder.manual-reminder-overdue-pulse i.fa-bullhorn {
    animation: manual-reminder-overdue-pulse 1.44s cubic-bezier(0.33, 1, 0.68, 1) infinite;
    display: inline-block;
    transform-origin: center center;
    will-change: transform;
}

/* First Invoice Create page */
.page-first-invoice-create {
    background: linear-gradient(135deg, #f8faff 0%, #eef2ff 35%, #e0e7ff 70%, #e2e8f0 100%);
    min-height: 100vh;
}
.fic-container {
    width: 100%;
    max-width: 850px; /* +15% (bij. 900px) – platāks logs rēķina soliem */
    margin: 0 auto;
    padding: 5rem 1.5rem 4rem;
    box-sizing: border-box;
}
.page-first-invoice-create .fic-card {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
.page-first-invoice-create .company-type-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.page-first-invoice-create .company-type-btn {
    flex: 1;
    min-width: 130px;
    padding: 12px 14px;
    background: #f3f4f6;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    transition: border-color 0.2s, background 0.2s;
}
.page-first-invoice-create .company-type-btn:hover {
    border-color: #94a3b8;
}
.page-first-invoice-create .company-type-btn.active {
    background: #eff6ff;
    border-color: var(--landing-primary, #0B1E3F);
    color: var(--landing-primary, #0B1E3F);
}
.fic-progress {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 2.5rem;
    padding: 0 0.25rem;
    gap: 0;
}
.fic-progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 0 0 auto;
    cursor: default;
}
.fic-progress-step.fic-step-clickable { cursor: pointer; }
.fic-progress-circle {
    width: 44px; height: 44px; min-width: 44px; min-height: 44px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; font-weight: 600;
    background: #94a3b8; color: #fff;
    transition: background 0.25s, color 0.25s, border-color 0.25s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
.fic-progress-circle.active {
    background: var(--landing-primary, #0B1E3F);
    color: #fff;
    border: 2px solid var(--landing-primary-hover, #4a2270);
}
.fic-progress-circle.done { background: #22c55e; color: #fff; }
.fic-progress-circle.done .fic-check { display: flex !important; }
.fic-progress-circle .fic-check { display: none; align-items: center; justify-content: center; font-size: 16px; }
.fic-progress-circle.done .fic-step-num { display: none; }
.fic-progress-circle.active .fic-check { display: none; }
.fic-progress-line {
    flex: 1; min-width: 24px; height: 4px;
    background: #cbd5e1;
    margin: 20px 6px 0;
    align-self: flex-start;
    transition: background 0.25s;
}
.fic-progress-line.done { background: #22c55e; }
.fic-progress-label {
    font-size: 0.72rem; font-weight: 500; color: #64748b;
    margin-top: 0.5rem; text-align: center;
    max-width: 76px; line-height: 1.15;
}
.fic-progress-step.active .fic-progress-label { color: var(--landing-primary, #0B1E3F); }
.fic-progress-step.done .fic-progress-label { color: #22c55e; }
.fic-card {
    background: #fff;
    border-radius: var(--landing-radius, 16px);
    box-shadow: var(--landing-shadow-md, 0 4px 12px rgba(0,0,0,0.06));
    padding: 2rem;
    margin-bottom: 1.5rem;
}
.fic-step-content { display: none; }
.fic-step-content.active { display: block; }
.fic-form-group { margin-bottom: 1.25rem; }
.fic-form-group label {
    display: block; font-weight: 500; margin-bottom: 0.5rem;
    color: #334155;
}
.fic-form-group input,
.fic-form-group select,
.fic-form-group textarea {
    width: 100%; padding: 0.75rem 1rem;
    border: 1px solid #e2e8f0; border-radius: 8px;
    font-size: 1rem;
}
.fic-form-group input:focus,
.fic-form-group select:focus,
.fic-form-group textarea:focus {
    outline: none; border-color: #0B1E3F;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.fic-btn-row { display: flex; gap: 1rem; margin-top: 2rem; flex-wrap: wrap; }
.fic-btn {
    padding: 0.75rem 1.5rem; border-radius: 8px;
    font-weight: 600; font-size: 1rem;
    cursor: pointer; border: none;
    display: inline-flex; align-items: center; gap: 0.5rem;
    transition: background 0.2s;
}
.fic-btn-primary { background: #0B1E3F; color: #fff; }
.fic-btn-primary:hover { background: #4a2270; }
.fic-btn-secondary { background: #f1f5f9; color: #475569; }
.fic-btn-secondary:hover { background: #e2e8f0; }
.fic-invoice-preview {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    background: #e2e8f0;
    border-radius: 12px;
    padding: 0.75rem 0;
    overflow-x: auto;
}
.fic-invoice-preview .fic-inv-print-mimic {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
.fic-step5-cta { text-align: center; padding: 2rem 0; }
.fic-step5-cta p { margin-bottom: 1.5rem; color: #64748b; }
.fic-step5-cta .fic-btn { padding: 1rem 2rem; font-size: 1.125rem; }
.fic-error { color: #dc2626; font-size: 0.875rem; margin-top: 0.25rem; }
.fic-quick-btn {
    padding: 4px 10px; margin: 0 4px 4px 0;
    border: 1px solid #e2e8f0; border-radius: 6px;
    background: #f8fafc; font-size: 0.75rem;
    cursor: pointer; color: #475569;
}
.fic-quick-btn:hover { background: #e2e8f0; }
.page-first-invoice-create .form-group small {
    display: block; font-size: 0.75rem; color: #6b7280;
    line-height: 1.5; margin-top: 4px;
}
.page-first-invoice-create .invoice-term-info-icon {
    margin-left: 4px; color: #6b7280; cursor: help;
}

/* URL highlight feature */
.url-highlight-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9000;
    cursor: pointer;
}
.url-highlight-pulse {
    position: relative;
    z-index: 9001;
    animation: urlHighlightPulse 1s ease-in-out infinite;
}
@keyframes urlHighlightPulse {
    0%, 100% {
        box-shadow: 0 0 8px 2px rgba(255, 255, 255, 0.6), 0 0 24px 6px rgba(255, 255, 255, 0.25);
        outline: 2px solid rgba(255, 255, 255, 0.85);
        outline-offset: 3px;
    }
    50% {
        box-shadow: 0 0 16px 6px rgba(255, 255, 255, 0.95), 0 0 40px 12px rgba(255, 255, 255, 0.4);
        outline: 2px solid rgba(255, 255, 255, 0.5);
        outline-offset: 6px;
    }
}

/* Invoice number helper links (under invoice number input in Add Invoice modal) */
.invoice-number-helper-links {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    margin-top: 6px;
}

.invoice-number-helper-link {
    font-size: 0.75rem;
    color: #3b82f6;
    text-decoration: none;
    white-space: nowrap;
}

.invoice-number-helper-link:hover {
    text-decoration: underline;
    color: #2563eb;
}

/* Hash navigation highlight (company_invoice_settings) */
@keyframes hashHighlightPulse {
    0% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.15); }
    100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}

.hash-highlight {
    animation: hashHighlightPulse 0.8s ease 2;
    border-color: #3b82f6 !important;
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}