* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
}

header {
    margin-bottom: 30px;
    color: white;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.document-type-toggle {
    display: flex;
    gap: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 4px;
}

.doc-type-btn {
    padding: 10px 20px;
    background: transparent;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.doc-type-btn.active {
    background: white;
    color: #667eea;
}

.doc-type-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.1);
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    margin: 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.user-info span {
    font-size: 1.1rem;
    font-weight: 600;
}

.usage-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.usage-badge {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    border: 2px solid white;
}

.usage-badge.limit-warning {
    background: #ffc107;
    color: #333;
    border-color: #ffc107;
}

.usage-badge.limit-reached {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
    animation: pulse 2s infinite;
}

.usage-badge.pro-unlimited {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

.btn-license {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid white;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.btn-license:hover {
    background: white;
    color: #667eea;
}

.btn-logout {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid white;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-logout:hover {
    background: white;
    color: #667eea;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.form-section {
    padding: 40px;
    background: #f8f9fa;
    overflow-y: auto;
    max-height: calc(100vh - 120px);
}

.preview-section {
    padding: 40px;
    background: white;
    overflow-y: auto;
    max-height: calc(100vh - 120px);
    border-left: 2px solid #e9ecef;
}

.form-group {
    margin-bottom: 30px;
    padding: 25px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.form-group h2 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: #667eea;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.input-group {
    margin-bottom: 15px;
}

.input-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #555;
    font-size: 0.9rem;
}

.input-group input,
.input-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.input-group input:focus,
.input-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-group-inline {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 15px;
    align-items: end;
}

.line-item {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 2px solid #e9ecef;
}

.btn-add-item {
    width: 100%;
    padding: 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-add-item:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-remove-item {
    padding: 12px 20px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-remove-item:hover {
    background: #c82333;
    transform: translateY(-2px);
}

.action-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 30px;
}

.action-buttons .btn-send-email,
.action-buttons .btn-send-whatsapp {
    grid-column: span 1;
}

.btn {
    padding: 14px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #667eea;
    color: white;
    grid-column: 1 / -1;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #28a745;
    color: white;
}

.btn-secondary:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.btn-tertiary {
    background: #6c757d;
    color: white;
}

.btn-tertiary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn-send-email {
    background: #17a2b8;
    color: white;
}

.btn-send-email:hover {
    background: #138496;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.3);
}

.btn-send-whatsapp {
    background: #25d366;
    color: white;
}

.btn-send-whatsapp:hover {
    background: #20ba5a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.btn-test {
    background: #ffc107;
    color: #333;
    font-weight: 600;
}

.btn-test:hover {
    background: #e0a800;
    transform: translateY(-2px);
}

.btn-icon {
    margin-right: 8px;
}

.toggle-section {
    margin-bottom: 15px;
}

.toggle-btn {
    width: 100%;
    padding: 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.toggle-btn:hover {
    background: #5568d3;
}

.toggle-arrow {
    transition: transform 0.3s ease;
}

.toggle-btn.active .toggle-arrow {
    transform: rotate(180deg);
}

.smtp-config {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #e9ecef;
}

.help-text {
    display: block;
    margin-top: 5px;
    font-size: 0.85rem;
    color: #6c757d;
    font-style: italic;
}

.input-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
    background: white;
}

.input-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Notification Toast */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #333;
    color: white;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    display: none;
    align-items: center;
    gap: 15px;
    z-index: 10000;
    max-width: 400px;
    animation: slideIn 0.3s ease;
}

.notification.show {
    display: flex;
}

.notification.success {
    background: #28a745;
}

.notification.error {
    background: #dc3545;
}

.notification.warning {
    background: #ffc107;
    color: #333;
}

.notification.info {
    background: #17a2b8;
}

.notification-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.notification-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Pro Feature Styles */
.pro-feature {
    position: relative;
    border: 2px solid #ffc107;
    background: linear-gradient(135deg, #fff9e6 0%, #ffffff 100%);
}

.pro-badge {
    position: absolute;
    top: -12px;
    right: 20px;
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    color: #333;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.3);
}

/* Pro Features Grid */
.pro-features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.pro-feature-item {
    padding: 15px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.pro-feature-item h3 {
    font-size: 1rem;
    margin-bottom: 10px;
    color: #667eea;
}

.pro-select {
    width: 100%;
    padding: 8px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 0.9rem;
}

.pro-select:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.6;
}

.pro-buttons {
    display: flex;
    gap: 10px;
}

.pro-buttons .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.pro-lock {
    display: block;
    margin-top: 8px;
    color: #ff9800;
    font-weight: 600;
    font-size: 0.8rem;
}

.upgrade-prompt {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #e9ecef;
    text-align: center;
}

.btn-upgrade {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    color: #333;
    font-weight: 700;
    width: 100%;
    padding: 14px;
    font-size: 1rem;
}

.btn-upgrade:hover {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 0;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    position: relative;
}

.modal-large {
    max-width: 900px;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 2rem;
    font-weight: 300;
    color: #999;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    z-index: 1;
}

.modal-close:hover {
    background: #f5f5f5;
    color: #333;
}

.modal-header {
    padding: 40px 40px 20px;
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px 20px 0 0;
}

.modal-header h2 {
    margin: 0 0 10px;
    font-size: 2rem;
}

.modal-header p {
    margin: 0;
    opacity: 0.9;
}

.modal-body {
    padding: 30px 40px 40px;
}

.pro-benefits {
    margin-bottom: 30px;
}

.benefit-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 15px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border-radius: 8px;
}

.benefit-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.benefit-item h3 {
    margin: 0 0 5px;
    font-size: 1rem;
    color: #333;
}

.benefit-item p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

.pricing {
    text-align: center;
}

.price-card {
    padding: 30px;
    background: linear-gradient(135deg, #fff9e6 0%, #ffffff 100%);
    border-radius: 12px;
    border: 2px solid #ffc107;
}

.price-card h3 {
    margin: 0 0 15px;
    color: #333;
    font-size: 1.5rem;
}

.price {
    font-size: 3rem;
    font-weight: 700;
    color: #ff9800;
    margin: 20px 0;
}

.price span {
    font-size: 1.2rem;
    color: #666;
    font-weight: 400;
}

.btn-upgrade-large {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    color: #333;
    font-weight: 700;
    font-size: 1.1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
}

.btn-upgrade-large:hover {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
}

/* License Modal Styles */
.license-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.license-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.license-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.license-status {
    margin-top: 15px;
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
}

.license-status.success {
    background: #d4edda;
    color: #155724;
    border: 2px solid #c3e6cb;
}

.license-status.error {
    background: #f8d7da;
    color: #721c24;
    border: 2px solid #f5c6cb;
}

.license-info {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.license-info p {
    margin: 8px 0;
    color: #666;
}

.license-info code {
    background: #e9ecef;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: #667eea;
    font-weight: 600;
}

/* License Tabs */
.license-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.license-tab {
    padding: 12px 24px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: #666;
    transition: all 0.3s ease;
    margin-bottom: -2px;
}

.license-tab:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.license-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.license-tab-content {
    animation: fadeIn 0.3s ease;
}

.device-info {
    margin: 15px 0;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 0.9rem;
    border-left: 4px solid #667eea;
}

.device-info code {
    background: #e9ecef;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: #667eea;
    font-weight: 600;
    word-break: break-all;
}

.license-warning {
    margin: 15px 0;
    padding: 12px;
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    border-radius: 4px;
    font-size: 0.9rem;
    color: #856404;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Invoice Templates (Pro) */
.invoice-preview.template-modern {
    border-top: 5px solid #667eea;
}

.invoice-preview.template-modern .invoice-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 12px 12px 0 0;
    margin: -40px -40px 40px -40px;
}

.invoice-preview.template-modern .invoice-title {
    color: white;
}

.invoice-preview.template-minimal {
    border: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.invoice-preview.template-minimal .invoice-header {
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 15px;
}

.invoice-preview.template-elegant {
    border: 2px solid #d4af37;
}

.invoice-preview.template-elegant .invoice-header {
    border-bottom: 3px solid #d4af37;
}

.invoice-preview.template-elegant .invoice-title {
    color: #d4af37;
}

.invoice-preview.template-colorful .invoice-header {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 50%, #4facfe 100%);
    color: white;
    padding: 30px;
    border-radius: 12px 12px 0 0;
    margin: -40px -40px 40px -40px;
}

.invoice-preview.template-colorful .invoice-title {
    color: white;
}

.invoice-preview.template-colorful .invoice-table thead {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.invoice-preview.template-colorful .total-final {
    color: #f5576c;
    border-top-color: #f5576c;
}

/* Logo Styles */
.logo-preview {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-preview img {
    max-width: 150px;
    max-height: 80px;
    object-fit: contain;
}

.btn-remove-logo {
    padding: 8px 16px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-remove-logo:hover {
    background: #c82333;
}

.logo-display {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.logo-display img {
    max-width: 200px;
    max-height: 100px;
    object-fit: contain;
}

/* Payment Status Badge */
.payment-status-badge {
    text-align: center;
    margin-bottom: 20px;
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.1rem;
}

.payment-status-badge.paid {
    background: #d4edda;
    color: #155724;
    border: 2px solid #c3e6cb;
}

.payment-status-badge.unpaid {
    background: #f8d7da;
    color: #721c24;
    border: 2px solid #f5c6cb;
}

.payment-status-badge.partial {
    background: #fff3cd;
    color: #856404;
    border: 2px solid #ffeaa7;
}

.payment-status-badge.overdue {
    background: #f8d7da;
    color: #721c24;
    border: 2px solid #f5c6cb;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* History List */
.history-list {
    max-height: 500px;
    overflow-y: auto;
}

.history-item {
    padding: 20px;
    margin-bottom: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    cursor: pointer;
    transition: all 0.2s ease;
}

.history-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.history-item-title {
    font-weight: 600;
    font-size: 1.1rem;
    color: #333;
}

.history-item-date {
    color: #666;
    font-size: 0.9rem;
}

.history-item-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 10px;
}

.history-item-detail {
    font-size: 0.9rem;
}

.history-item-detail strong {
    color: #667eea;
}

.empty-history {
    text-align: center;
    padding: 40px;
    color: #999;
    font-style: italic;
}

.btn-history {
    background: #6f42c1;
    color: white;
}

.btn-history:hover {
    background: #5a32a3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(111, 66, 193, 0.3);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
}

.input-with-button {
    display: flex;
    gap: 10px;
    align-items: center;
}

.input-with-button input {
    flex: 1;
}

.btn-icon-only {
    padding: 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    min-width: 44px;
}

.btn-icon-only:hover {
    background: #5568d3;
    transform: translateY(-2px);
}

.btn-client-manage {
    background: #6f42c1;
    color: white;
}

.btn-client-manage:hover {
    background: #5a32a3;
}

.discount-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.discount-controls select {
    flex: 1;
}

.discount-controls input {
    flex: 1;
}

.quote-validity {
    text-align: center;
    padding: 15px;
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 8px;
    margin-bottom: 20px;
    color: #856404;
    font-weight: 600;
}

.terms-display {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.terms-display h4 {
    margin-bottom: 10px;
    color: #667eea;
}

.terms-display p {
    color: #666;
    line-height: 1.6;
    white-space: pre-wrap;
}

.client-manager-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 200px;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
}

.clients-list-manager {
    max-height: 500px;
    overflow-y: auto;
}

.client-item-manager {
    padding: 20px;
    margin-bottom: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.client-item-manager:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.client-item-info h3 {
    margin: 0 0 5px;
    color: #333;
}

.client-item-info p {
    margin: 5px 0;
    color: #666;
    font-size: 0.9rem;
}

.client-item-actions {
    display: flex;
    gap: 10px;
}

.client-item-actions button {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.btn-use-client {
    background: #28a745;
    color: white;
}

.btn-use-client:hover {
    background: #218838;
}

.btn-delete-client {
    background: #dc3545;
    color: white;
}

.btn-delete-client:hover {
    background: #c82333;
}

/* Enhanced Responsive Design */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .preview-section {
        border-left: none;
        border-top: 2px solid #e9ecef;
        margin-top: 20px;
    }
}

@media (max-width: 768px) {
    .pro-features-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .modal-header,
    .modal-body {
        padding: 20px;
    }
    
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .header-controls {
        flex-direction: column;
        width: 100%;
        gap: 15px;
    }
    
    .document-type-toggle {
        width: 100%;
    }
    
    .doc-type-btn {
        flex: 1;
    }
    
    .history-item-details {
        grid-template-columns: 1fr;
    }
    
    .client-item-manager {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .client-item-actions {
        width: 100%;
        margin-top: 10px;
    }
    
    .client-item-actions button {
        flex: 1;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .input-with-button {
        flex-direction: column;
    }
    
    .btn-icon-only {
        width: 100%;
    }
    
    .discount-controls {
        flex-direction: column;
    }
    
    .client-manager-actions {
        flex-direction: column;
    }
    
    .search-input {
        width: 100%;
    }
    
    .action-buttons {
        grid-template-columns: 1fr;
    }
    
    .invoice-details {
        grid-template-columns: 1fr;
    }
    
    .invoice-meta {
        flex-direction: column;
        gap: 10px;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    .form-section,
    .preview-section {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5rem;
    }
    
    .invoice-title {
        font-size: 1.8rem;
    }
    
    .form-group {
        padding: 15px;
    }
    
    .input-group input,
    .input-group textarea,
    .input-group select {
        padding: 10px;
        font-size: 0.9rem;
    }
    
    .btn {
        padding: 12px 16px;
        font-size: 0.9rem;
    }
}

/* Bulk Contacts Styles */
.contacts-list {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #e9ecef;
}

.contacts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.contacts-header h3 {
    margin: 0;
    color: #667eea;
    font-size: 1.1rem;
}

.contacts-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.contacts-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 10px;
    background: white;
    margin-bottom: 15px;
}

.contact-item {
    display: flex;
    align-items: center;
    padding: 12px;
    margin-bottom: 8px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.contact-item:hover {
    background: #e9ecef;
    border-color: #667eea;
}

.contact-item.selected {
    background: #e7f3ff;
    border-color: #667eea;
}

.contact-checkbox {
    margin-right: 12px;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.contact-info {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 10px;
    align-items: center;
}

.contact-name {
    font-weight: 600;
    color: #333;
}

.contact-email {
    color: #666;
    font-size: 0.9rem;
    word-break: break-word;
}

.contact-phone {
    color: #666;
    font-size: 0.9rem;
}

.contact-address {
    color: #666;
    font-size: 0.85rem;
    word-break: break-word;
}

.bulk-send-actions {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.btn-bulk-email {
    flex: 1;
    background: #17a2b8;
    color: white;
}

.btn-bulk-email:hover {
    background: #138496;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.3);
}

.btn-bulk-whatsapp {
    flex: 1;
    background: #25d366;
    color: white;
}

.btn-bulk-whatsapp:hover {
    background: #20ba5a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

/* Responsive for contacts */
@media (max-width: 768px) {
    .contact-info {
        grid-template-columns: 1fr;
        gap: 5px;
    }
    
    .contacts-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .bulk-send-actions {
        flex-direction: column;
    }
}

/* Invoice Preview Styles */
.preview-container {
    background: white;
    position: relative;
}

/* Watermark */
.watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-45deg);
    font-size: 4rem;
    font-weight: 700;
    color: rgba(200, 200, 200, 0.15);
    z-index: 10;
    pointer-events: none;
    user-select: none;
    white-space: nowrap;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.watermark.hidden {
    display: none;
}

.invoice-preview {
    padding: 40px;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    position: relative;
    z-index: 1;
}

.invoice-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 3px solid #667eea;
}

.invoice-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #667eea;
}

.invoice-number {
    font-size: 1.2rem;
    color: #666;
    font-weight: 600;
}

.invoice-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.invoice-from h3,
.invoice-to h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: #333;
}

.invoice-from p,
.invoice-to p {
    margin: 5px 0;
    color: #666;
    line-height: 1.6;
}

.invoice-meta {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.meta-item {
    color: #666;
}

.meta-item strong {
    color: #333;
}

.invoice-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
}

.invoice-table thead {
    background: #667eea;
    color: white;
}

.invoice-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

.invoice-table td {
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
}

.invoice-table tbody tr:hover {
    background: #f8f9fa;
}

.empty-state {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 40px !important;
}

.invoice-totals {
    margin-top: 20px;
    margin-left: auto;
    width: 300px;
}

.total-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    font-size: 1.1rem;
}

.total-row:not(.total-final) {
    border-bottom: 1px solid #e9ecef;
}

.total-final {
    font-size: 1.5rem;
    font-weight: 700;
    color: #667eea;
    margin-top: 10px;
    padding-top: 15px;
    border-top: 3px solid #667eea;
}

.invoice-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 2px solid #e9ecef;
    text-align: center;
    color: #666;
    font-style: italic;
}

/* Print Styles */
@media print {
    body {
        background: white;
        padding: 0;
    }

    .form-section,
    .action-buttons,
    header {
        display: none;
    }

    .main-content {
        grid-template-columns: 1fr;
        box-shadow: none;
    }

    .preview-section {
        border-left: none;
        padding: 0;
    }

    .invoice-preview {
        box-shadow: none;
        border: none;
        padding: 20px;
    }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    .preview-section {
        border-left: none;
        border-top: 2px solid #e9ecef;
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 1.8rem;
    }

    .form-section,
    .preview-section {
        padding: 20px;
    }

    .input-group-inline {
        grid-template-columns: 1fr;
    }

    .invoice-details {
        grid-template-columns: 1fr;
    }

    .action-buttons {
        grid-template-columns: 1fr;
    }
}

