/* ===================================
   Invoice Builder Styles
   =================================== */

/* ===================================
   Builder Layout
   =================================== */

.builder-page {
    background: var(--gray-100);
    min-height: 100vh;
}

.builder-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 64px;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

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

.logo-small {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    color: var(--gray-900);
}

.header-center {
    display: flex;
    align-items: center;
}

.template-selector {
    display: flex;
    gap: 4px;
    background: var(--gray-100);
    padding: 4px;
    border-radius: var(--radius);
}

.template-btn {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-600);
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.template-btn:hover {
    color: var(--gray-900);
    background: var(--white);
}

.template-btn.active {
    color: var(--gray-900);
    background: var(--white);
    box-shadow: var(--shadow-sm);
}

.premium-badge {
    font-size: 9px;
    font-weight: 700;
    padding: 2px 5px;
    background: linear-gradient(135deg, #F59E0B, #EC4899);
    color: white;
    border-radius: 3px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Mobile Header */
.mobile-builder-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    height: 56px;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.mobile-actions {
    display: flex;
    gap: 8px;
}

/* ===================================
   Main Builder Area
   =================================== */

.builder-main {
    display: flex;
    padding-top: 64px;
    min-height: 100vh;
}

/* ===================================
   Editor Panel
   =================================== */

.editor-panel {
    width: 400px;
    background: var(--white);
    border-right: 1px solid var(--gray-200);
    height: calc(100vh - 64px);
    position: fixed;
    left: 0;
    top: 64px;
    overflow: hidden;
}

.editor-scroll {
    height: 100%;
    overflow-y: auto;
    padding: 24px;
}

.editor-section {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--gray-200);
}

.editor-section:last-child {
    border-bottom: none;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 20px;
}

.section-title svg {
    color: var(--gray-500);
}

/* Form Elements */
.form-group {
    margin-bottom: 16px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
    color: var(--gray-900);
    background: var(--white);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

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

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

/* Logo Upload */
.logo-upload {
    position: relative;
    width: 100%;
    height: 100px;
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    overflow: hidden;
}

.logo-upload:hover {
    border-color: var(--primary);
    background: rgba(79, 70, 229, 0.02);
}

.logo-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--gray-500);
}

.logo-placeholder svg {
    opacity: 0.5;
}

.logo-placeholder span {
    font-size: 13px;
}

.logo-preview {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.remove-logo {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
}

/* Line Items */
.line-item {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
    position: relative;
}

.line-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.line-item-number {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-500);
}

.remove-item {
    padding: 4px 8px;
    font-size: 12px;
    color: var(--danger);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.remove-item:hover {
    background: rgba(239, 68, 68, 0.1);
    border-radius: var(--radius-sm);
}

.line-item .form-group {
    margin-bottom: 12px;
}

.line-item-totals {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}

.line-item-totals .form-group input {
    text-align: right;
}

.line-amount {
    background: var(--gray-100) !important;
    font-weight: 600;
}

.add-item-btn {
    border: 2px dashed var(--gray-300);
    color: var(--gray-500);
    background: transparent;
}

.add-item-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(79, 70, 229, 0.02);
}

/* Totals Display */
.totals-display {
    background: var(--gray-50);
    border-radius: var(--radius);
    padding: 16px;
    margin-top: 16px;
}

.total-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
    color: var(--gray-600);
}

.total-row.grand-total {
    border-top: 2px solid var(--gray-300);
    margin-top: 8px;
    padding-top: 16px;
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-900);
}

/* ===================================
   Preview Panel
   =================================== */

.preview-panel {
    flex: 1;
    margin-left: 400px;
    padding: 32px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: calc(100vh - 64px);
}

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

.preview-wrapper {
    background: var(--white);
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius);
    overflow: hidden;
}

/* ===================================
   Invoice Templates
   =================================== */

.invoice-template {
    padding: 48px;
    min-height: 1000px;
    font-size: 14px;
    color: #333;
    position: relative;
}

/* Watermark */
.watermark {
    position: absolute;
    bottom: 24px;
    right: 24px;
    font-size: 11px;
    color: #999;
    opacity: 0.7;
}

/* Modern Template */
.template-modern {
    font-family: 'Inter', sans-serif;
}

.template-modern .invoice-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 48px;
}

.template-modern .company-info {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.template-modern .company-logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.template-modern .company-logo-placeholder {
    width: 60px;
    height: 60px;
    background: var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 24px;
}

.template-modern .company-details h2 {
    font-size: 20px;
    font-weight: 700;
    color: #111;
    margin-bottom: 4px;
}

.template-modern .company-details p {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
}

.template-modern .invoice-title {
    text-align: right;
}

.template-modern .invoice-title h1 {
    font-size: 32px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 8px;
}

.template-modern .invoice-meta {
    font-size: 13px;
    color: #666;
}

.template-modern .invoice-meta strong {
    color: #333;
}

.template-modern .parties {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    margin-bottom: 48px;
}

.template-modern .party h3 {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #999;
    margin-bottom: 12px;
}

.template-modern .party-name {
    font-size: 16px;
    font-weight: 600;
    color: #111;
    margin-bottom: 4px;
}

.template-modern .party-details {
    font-size: 13px;
    color: #666;
    line-height: 1.6;
}

.template-modern .items-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 32px;
}

.template-modern .items-table th {
    background: var(--primary);
    color: white;
    padding: 14px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.template-modern .items-table th:first-child {
    border-radius: 8px 0 0 8px;
}

.template-modern .items-table th:last-child {
    border-radius: 0 8px 8px 0;
    text-align: right;
}

.template-modern .items-table td {
    padding: 16px;
    border-bottom: 1px solid #eee;
}

.template-modern .items-table td:last-child {
    text-align: right;
    font-weight: 600;
}

.template-modern .items-table .qty-col,
.template-modern .items-table .rate-col {
    text-align: center;
}

.template-modern .items-table th.qty-col,
.template-modern .items-table th.rate-col {
    text-align: center;
}

.template-modern .totals-section {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 48px;
}

.template-modern .totals-box {
    width: 280px;
}

.template-modern .totals-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    font-size: 14px;
}

.template-modern .totals-row.total {
    border-top: 2px solid #111;
    margin-top: 8px;
    padding-top: 16px;
    font-size: 20px;
    font-weight: 700;
}

.template-modern .footer-section {
    border-top: 1px solid #eee;
    padding-top: 32px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
}

.template-modern .footer-section h4 {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #999;
    margin-bottom: 8px;
}

.template-modern .footer-section p {
    font-size: 13px;
    color: #666;
    line-height: 1.6;
}

/* Classic Template */
.template-classic {
    font-family: 'Georgia', serif;
    border: 3px double #333;
    padding: 40px;
}

.template-classic .invoice-header {
    text-align: center;
    border-bottom: 2px solid #333;
    padding-bottom: 24px;
    margin-bottom: 32px;
}

.template-classic .invoice-header h1 {
    font-size: 36px;
    font-weight: 400;
    letter-spacing: 8px;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.template-classic .company-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.template-classic .company-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 8px;
}

.template-classic .company-name {
    font-size: 18px;
    font-weight: 600;
}

.template-classic .company-details {
    font-size: 13px;
    color: #666;
}

.template-classic .meta-row {
    display: flex;
    justify-content: space-between;
    padding: 24px 0;
    border-bottom: 1px solid #ddd;
}

.template-classic .meta-item {
    text-align: center;
}

.template-classic .meta-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #999;
    margin-bottom: 4px;
}

.template-classic .meta-value {
    font-size: 15px;
    font-weight: 600;
}

.template-classic .parties {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    padding: 32px 0;
}

.template-classic .party h3 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 8px;
    margin-bottom: 12px;
}

.template-classic .items-table {
    width: 100%;
    border-collapse: collapse;
    margin: 32px 0;
}

.template-classic .items-table th {
    background: #f5f5f5;
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.template-classic .items-table td {
    border: 1px solid #ddd;
    padding: 12px;
}

.template-classic .items-table td:last-child,
.template-classic .items-table th:last-child {
    text-align: right;
}

.template-classic .totals-section {
    display: flex;
    justify-content: flex-end;
}

.template-classic .totals-box {
    width: 250px;
    border: 1px solid #ddd;
}

.template-classic .totals-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid #ddd;
}

.template-classic .totals-row:last-child {
    border-bottom: none;
    background: #333;
    color: white;
    font-weight: 600;
}

/* Minimal Template */
.template-minimal {
    font-family: 'Inter', sans-serif;
    padding: 60px;
}

.template-minimal .invoice-header {
    margin-bottom: 60px;
}

.template-minimal .invoice-header h1 {
    font-size: 14px;
    font-weight: 400;
    text-transform: lowercase;
    letter-spacing: 4px;
    color: #999;
    margin-bottom: 32px;
}

.template-minimal .header-content {
    display: flex;
    justify-content: space-between;
}

.template-minimal .company-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.template-minimal .invoice-meta {
    text-align: right;
    font-size: 13px;
    color: #666;
    line-height: 1.8;
}

.template-minimal .parties {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    margin-bottom: 60px;
}

.template-minimal .party h3 {
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #999;
    margin-bottom: 16px;
}

.template-minimal .party-content {
    font-size: 14px;
    line-height: 1.8;
    color: #333;
}

.template-minimal .items-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 40px;
}

.template-minimal .items-table th {
    padding: 16px 0;
    text-align: left;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #999;
    border-bottom: 1px solid #eee;
}

.template-minimal .items-table td {
    padding: 20px 0;
    border-bottom: 1px solid #eee;
}

.template-minimal .items-table td:last-child,
.template-minimal .items-table th:last-child {
    text-align: right;
}

.template-minimal .totals-section {
    display: flex;
    justify-content: flex-end;
}

.template-minimal .totals-box {
    width: 240px;
}

.template-minimal .totals-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 13px;
    color: #666;
}

.template-minimal .totals-row.total {
    padding-top: 16px;
    margin-top: 8px;
    border-top: 1px solid #333;
    font-size: 18px;
    font-weight: 600;
    color: #111;
}

/* Bold Template */
.template-bold {
    font-family: 'Inter', sans-serif;
    position: relative;
}

.template-bold::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 8px;
    background: var(--primary);
}

.template-bold .invoice-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 48px;
    padding-left: 16px;
}

.template-bold .invoice-title h1 {
    font-size: 48px;
    font-weight: 900;
    color: var(--primary);
    line-height: 1;
}

.template-bold .invoice-meta {
    text-align: right;
    font-size: 13px;
}

.template-bold .invoice-meta .number {
    font-size: 24px;
    font-weight: 800;
    color: #111;
}

.template-bold .company-section {
    display: flex;
    gap: 16px;
    align-items: center;
    background: #f8f8f8;
    padding: 24px;
    border-radius: 8px;
    margin-bottom: 32px;
    margin-left: 16px;
}

.template-bold .company-logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
}

.template-bold .company-name {
    font-size: 18px;
    font-weight: 700;
}

.template-bold .company-details {
    font-size: 13px;
    color: #666;
}

.template-bold .parties {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-bottom: 40px;
    padding-left: 16px;
}

.template-bold .party {
    background: #f8f8f8;
    padding: 24px;
    border-radius: 8px;
}

.template-bold .party h3 {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 12px;
}

.template-bold .items-table {
    width: calc(100% - 16px);
    margin-left: 16px;
    border-collapse: collapse;
    margin-bottom: 32px;
}

.template-bold .items-table th {
    background: #111;
    color: white;
    padding: 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.template-bold .items-table td {
    padding: 16px;
    border-bottom: 2px solid #eee;
}

.template-bold .items-table td:last-child,
.template-bold .items-table th:last-child {
    text-align: right;
}

.template-bold .totals-section {
    display: flex;
    justify-content: flex-end;
    padding-right: 16px;
}

.template-bold .totals-box {
    background: var(--primary);
    color: white;
    padding: 24px;
    border-radius: 8px;
    width: 280px;
}

.template-bold .totals-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
    opacity: 0.9;
}

.template-bold .totals-row.total {
    border-top: 1px solid rgba(255,255,255,0.3);
    margin-top: 8px;
    padding-top: 16px;
    font-size: 24px;
    font-weight: 800;
    opacity: 1;
}

/* ===================================
   Modals
   =================================== */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    position: relative;
    background: var(--white);
    border-radius: var(--radius-lg);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--gray-400);
    cursor: pointer;
}

.modal-body {
    padding: 24px;
    max-height: 60vh;
    overflow-y: auto;
}

/* Saved Invoices */
.saved-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.saved-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--gray-50);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}

.saved-item:hover {
    background: var(--gray-100);
}

.saved-item-info h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.saved-item-info span {
    font-size: 12px;
    color: var(--gray-500);
}

.saved-item-actions {
    display: flex;
    gap: 8px;
}

.saved-item-actions button {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.saved-item-actions .load-btn {
    background: var(--primary);
    color: white;
    border: none;
}

.saved-item-actions .delete-btn {
    background: transparent;
    color: var(--danger);
    border: 1px solid var(--danger);
}

.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--gray-500);
}

.empty-state svg {
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-weight: 600;
    margin-bottom: 4px;
}

/* Premium Modal */
.premium-modal {
    text-align: center;
    padding: 48px 40px;
}

.premium-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.premium-content h3 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.premium-content > p {
    color: var(--gray-600);
    margin-bottom: 24px;
}

.premium-features {
    list-style: none;
    text-align: left;
    margin-bottom: 24px;
}

.premium-features li {
    padding: 10px 0;
    font-size: 15px;
    color: var(--gray-700);
}

.premium-price {
    margin-bottom: 24px;
}

.premium-price .price {
    font-size: 36px;
    font-weight: 700;
    color: var(--gray-900);
}

.premium-price .period {
    display: block;
    font-size: 14px;
    color: var(--gray-500);
}

/* ===================================
   Toast
   =================================== */

.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--gray-900);
    color: white;
    padding: 14px 24px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 2000;
}

.toast.active {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ===================================
   Mobile Sheets
   =================================== */

.mobile-template-sheet,
.mobile-preview-sheet {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
    z-index: 1000;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.mobile-template-sheet.active,
.mobile-preview-sheet.active {
    transform: translateY(0);
}

.sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
}

.sheet-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.sheet-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--gray-400);
    cursor: pointer;
}

.template-options {
    padding: 16px;
}

.template-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 16px;
    background: var(--gray-50);
    border: 2px solid transparent;
    border-radius: var(--radius);
    margin-bottom: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.template-option.active {
    border-color: var(--primary);
    background: rgba(79, 70, 229, 0.05);
}

.template-name {
    font-weight: 500;
}

.template-status {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
}

.template-status.free {
    background: var(--accent);
    color: white;
}

.template-status.pro {
    background: linear-gradient(135deg, #F59E0B, #EC4899);
    color: white;
}

.mobile-preview-content {
    padding: 16px;
    max-height: 50vh;
    overflow: auto;
}

.sheet-actions {
    padding: 16px;
    display: flex;
    gap: 12px;
    border-top: 1px solid var(--gray-200);
}

.sheet-actions .btn {
    flex: 1;
}

/* ===================================
   Responsive
   =================================== */

@media (max-width: 1024px) {
    .editor-panel {
        width: 350px;
    }
    
    .preview-panel {
        margin-left: 350px;
    }
}

@media (max-width: 900px) {
    .builder-header {
        display: none;
    }
    
    .mobile-builder-header {
        display: flex;
    }
    
    .builder-main {
        padding-top: 56px;
        flex-direction: column;
    }
    
    .editor-panel {
        position: relative;
        width: 100%;
        height: auto;
        top: 0;
    }
    
    .editor-scroll {
        max-height: none;
        overflow: visible;
    }
    
    .preview-panel {
        display: none;
        margin-left: 0;
        padding: 16px;
    }
    
    .mobile-template-sheet,
    .mobile-preview-sheet {
        display: block;
    }
    
    .invoice-template {
        padding: 24px;
        font-size: 12px;
    }
    
    .template-modern .invoice-header,
    .template-bold .invoice-header {
        flex-direction: column;
        gap: 24px;
    }
    
    .template-modern .invoice-title,
    .template-bold .invoice-meta {
        text-align: left;
    }
    
    .template-modern .parties,
    .template-classic .parties,
    .template-minimal .parties,
    .template-bold .parties {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .template-modern .footer-section {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .editor-scroll {
        padding: 16px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .line-item-totals {
        grid-template-columns: 1fr;
    }
}
