:root {
    /* Color Palette - Premium Korean Design */
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --success-dark: #059669;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;

    /* Neutral Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-overlay: rgba(0, 0, 0, 0.6);

    /* Text Colors */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #94a3b8;
    --text-inverse: #ffffff;

    /* Border Colors */
    --border-light: #e2e8f0;
    --border-medium: #cbd5e1;
    --border-dark: #94a3b8;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;

    /* Typography */
    --font-family-ko: 'Noto Sans KR', sans-serif;
    --font-family-en: 'Inter', sans-serif;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: var(--font-family-ko);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* App Container */
.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--spacing-xl);
}

/* Header */
.header {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
    box-shadow: var(--shadow-xl);
    animation: slideDown 0.5s ease-out;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-lg);
}

.logo-section {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.logo-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-inverse);
    box-shadow: var(--shadow-lg);
}

.logo-icon svg {
    width: 32px;
    height: 32px;
}

.logo-text h1 {
    font-size: 1.75rem;
    font-weight: 900;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.logo-text p {
    font-family: var(--font-family-en);
    font-size: 0.875rem;
    color: var(--text-tertiary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.header-actions {
    display: flex;
    gap: var(--spacing-md);
}

/* Bottom Cards Section */
.bottom-cards-section {
    margin-top: var(--spacing-xl);
    padding: 0;
}

.bottom-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-lg);
}

.bottom-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.bottom-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--primary-light) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.bottom-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.bottom-card:hover::before {
    opacity: 1;
}

.bottom-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.bottom-card-icon svg {
    width: 24px;
    height: 24px;
}

.bottom-card-icon.board-icon {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
}

.bottom-card-icon.settings-icon {
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
    color: white;
}

.bottom-card-icon.company-icon {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.bottom-card-content {
    flex: 1;
    min-width: 0;
}

.bottom-card-content h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.bottom-card-content p {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bottom-card-badge {
    position: absolute;
    top: 12px;
    right: 40px;
    background: var(--danger-color);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

.bottom-card-arrow {
    width: 20px;
    height: 20px;
    color: var(--text-tertiary);
    transition: transform 0.3s ease, color 0.3s ease;
    flex-shrink: 0;
}

.bottom-card:hover .bottom-card-arrow {
    transform: translateX(4px);
    color: var(--primary-color);
}

/* Responsive Bottom Cards */
@media (max-width: 900px) {
    .bottom-cards-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .bottom-card {
        padding: var(--spacing-md);
    }

    .bottom-card-icon {
        width: 40px;
        height: 40px;
    }

    .bottom-card-icon svg {
        width: 20px;
        height: 20px;
    }

    .bottom-card-content h3 {
        font-size: 0.9rem;
    }

    .bottom-card-content p {
        font-size: 0.8rem;
    }
}

/* Footer */
.footer {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    margin-top: var(--spacing-xl);
    box-shadow: var(--shadow-lg);
    animation: fadeInUp 0.8s ease-out;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-lg);
}

.footer-info {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.footer-provider {
    font-size: 1rem;
    color: var(--text-secondary);
}

.footer-provider strong {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.125rem;
}

.footer-contact {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

.footer-contact svg {
    width: 20px;
    height: 20px;
    color: var(--primary-color);
}

.footer-contact a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition-base);
}

.footer-contact a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    font-size: 0.875rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: all var(--transition-base);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
}

.footer-links a:hover {
    color: var(--primary-color);
    background: var(--bg-secondary);
}

.footer-separator {
    color: var(--border-medium);
}

.footer-copyright {
    color: var(--text-tertiary);
}

/* Main Content */
.main-content {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Editor Section */
.editor-section {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: var(--spacing-2xl);
    box-shadow: var(--shadow-xl);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xl);
    flex-wrap: wrap;
    gap: var(--spacing-lg);
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.format-selector {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.format-selector label {
    font-weight: 500;
    color: var(--text-secondary);
}

.format-buttons {
    display: flex;
    gap: var(--spacing-sm);
    background: var(--bg-tertiary);
    padding: var(--spacing-xs);
    border-radius: var(--radius-lg);
}

.format-btn {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-lg);
    border: none;
    background: transparent;
    border-radius: var(--radius-md);
    font-family: var(--font-family-ko);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-base);
}

.format-btn svg {
    width: 18px;
    height: 18px;
}

.format-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.format-btn.active {
    background: var(--primary-color);
    color: var(--text-inverse);
    box-shadow: var(--shadow-md);
    transform: scale(1.02);
}

.format-btn:active {
    transform: scale(0.98);
}

/* Form Sections */
.form-section {
    margin-bottom: var(--spacing-2xl);
    padding-bottom: var(--spacing-2xl);
    border-bottom: 2px solid var(--border-light);
}

.form-section:last-of-type {
    border-bottom: none;
}

.form-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.form-section h3::before {
    content: '';
    width: 4px;
    height: 24px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-radius: var(--radius-sm);
}

.section-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
}

.section-title-row h3 {
    margin-bottom: 0;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-lg);
}

/* Collapsible Section (더보기) */
.collapsible-section {
    margin-top: var(--spacing-lg);
    border-top: 1px solid var(--border-light);
    padding-top: var(--spacing-sm);
}

.collapsible-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: var(--font-family-ko);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition-base);
}

.collapsible-toggle:hover {
    background: var(--bg-secondary);
    color: var(--primary-color);
    border-color: var(--primary-light);
}

.collapsible-toggle.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.collapsible-toggle .collapse-icon {
    width: 20px;
    height: 20px;
    transition: transform var(--transition-base);
}

.collapsible-toggle.active .collapse-icon {
    transform: rotate(180deg);
}

.collapsible-content {
    padding-top: var(--spacing-lg);
    animation: slideDown 0.3s ease;
}

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

/* ==================== 간접비 설정 섹션 ==================== */
.indirect-cost-section {
    background: linear-gradient(135deg, #fefce8 0%, #fef3c7 100%);
    border: 2px solid #fbbf24;
    border-radius: var(--radius-lg);
}

.indirect-cost-section .collapsible-toggle {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-color: #f59e0b;
    color: #92400e;
}

.indirect-cost-section .collapsible-toggle:hover {
    background: linear-gradient(135deg, #fde68a 0%, #fcd34d 100%);
}

.indirect-cost-section .collapsible-toggle.active {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border-color: #b45309;
}

.indirect-cost-notice {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.indirect-cost-notice p {
    margin: 0;
    font-size: 0.85rem;
    color: #92400e;
}

.indirect-cost-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.indirect-cost-item {
    background: white;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.indirect-cost-item.highlight {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-color: var(--primary-color);
}

.indirect-cost-item label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.rate-input-group {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.rate-input-group input {
    width: 70px;
    padding: var(--spacing-sm);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary-color);
    text-align: right;
    transition: all var(--transition-base);
}

.rate-input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.rate-unit {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.rate-base {
    font-size: 0.7rem;
    color: var(--text-tertiary);
}

/* 프리셋 버튼 */
.indirect-cost-presets {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-sm);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-light);
}

.preset-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.preset-btn {
    padding: var(--spacing-sm) var(--spacing-md);
    background: white;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-base);
}

.preset-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary-light);
    color: var(--primary-color);
}

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

/* 반응형 */
@media (max-width: 768px) {
    .indirect-cost-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .indirect-cost-grid {
        grid-template-columns: 1fr;
    }

    .indirect-cost-presets {
        flex-direction: column;
        align-items: flex-start;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group input,
.form-group textarea {
    padding: var(--spacing-md);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    font-family: var(--font-family-ko);
    font-size: 0.9375rem;
    color: var(--text-primary);
    transition: all var(--transition-base);
    background: var(--bg-primary);
}

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

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-tertiary);
}

.form-group input:read-only {
    background: var(--bg-tertiary);
    cursor: not-allowed;
}

/* Items Table */
.items-table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
}

.items-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-primary);
}

.items-table thead {
    background: var(--bg-secondary);
}

.items-table th {
    padding: var(--spacing-md) var(--spacing-sm);
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-light);
}

.items-table th:nth-child(2),
.items-table th:nth-child(3),
.items-table th:nth-child(4),
.items-table th:nth-child(5) {
    text-align: center;
}

.items-table tbody tr {
    border-bottom: 1px solid var(--border-light);
    transition: background var(--transition-base);
}

.items-table tbody tr:hover {
    background: var(--bg-secondary);
}

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

.items-table td {
    padding: var(--spacing-sm);
}

.items-table td input {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    transition: border-color var(--transition-base);
}

.items-table td input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.items-table td:nth-child(2) input,
.items-table td:nth-child(3) input {
    text-align: center;
}

.items-table td:nth-child(4) input {
    text-align: right;
}

.items-table .item-total,
.items-table .order-item-total {
    text-align: right;
    font-weight: 600;
    color: var(--primary-color);
    padding: var(--spacing-sm) var(--spacing-md);
    white-space: nowrap;
}

/* Number input improvements */
.items-table input[inputmode="numeric"] {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.remove-item-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--danger-color);
    color: var(--text-inverse);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-item-btn:hover {
    background: #dc2626;
    transform: scale(1.1);
}

.remove-item-btn svg {
    width: 18px;
    height: 18px;
}

/* Live Preview Section */
.live-preview-section {
    background: var(--bg-secondary);
}

.live-preview-content {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: var(--spacing-xl);
    min-height: 200px;
    max-height: 600px;
    overflow-y: auto;
    transition: all 0.3s ease;
}

.live-preview-content .quote-template {
    transform-origin: top left;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.live-preview-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: var(--text-muted);
    text-align: center;
    gap: var(--spacing-md);
}

.live-preview-empty svg {
    width: 48px;
    height: 48px;
    opacity: 0.5;
}

/* Partners Management */
.partners-toolbar {
    display: flex;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 200px;
    padding: var(--spacing-md) var(--spacing-lg);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    transition: border-color var(--transition-base);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.partners-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    max-height: 400px;
    overflow-y: auto;
}

.partner-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    transition: all var(--transition-base);
}

.partner-item:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-sm);
}

.partner-info {
    flex: 1;
}

.partner-info h4 {
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.partner-info p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.partner-actions {
    display: flex;
    gap: var(--spacing-sm);
}

.partner-actions .icon-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
}

.partner-actions .icon-btn svg {
    width: 18px;
    height: 18px;
}

.partner-actions .icon-btn.select {
    background: var(--primary-color);
    color: white;
}

.partner-actions .icon-btn.select:hover {
    background: var(--primary-dark);
}

.partner-actions .icon-btn.edit {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.partner-actions .icon-btn.edit:hover {
    background: var(--primary-light);
    color: var(--primary-color);
}

.partner-actions .icon-btn.delete {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.partner-actions .icon-btn.delete:hover {
    background: var(--danger-color);
    color: white;
}

/* Modal Large */
.modal-lg {
    max-width: 900px;
}

/* Item Selection for Order */
.item-select-desc {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
    font-size: 0.9rem;
}

.item-select-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    max-height: 400px;
    overflow-y: auto;
}

.item-select-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    border: 2px solid transparent;
}

.item-select-item:hover {
    background: var(--bg-tertiary);
}

.item-select-item.selected {
    background: var(--primary-light);
    border-color: var(--primary-color);
}

.item-select-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.item-select-info {
    flex: 1;
}

.item-select-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.item-select-details {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.item-select-price {
    font-weight: 600;
    color: var(--primary-color);
    white-space: nowrap;
}

/* Tabs */
.tabs {
    display: flex;
    gap: var(--spacing-xs);
    border-bottom: 2px solid var(--border-light);
    margin-bottom: var(--spacing-lg);
}

.tab-btn {
    padding: var(--spacing-md) var(--spacing-xl);
    border: none;
    background: none;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
    transition: all var(--transition-base);
}

.tab-btn:hover {
    color: var(--primary-color);
}

.tab-btn.active {
    color: var(--primary-color);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.tab-toolbar {
    display: flex;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    align-items: center;
}

.tab-toolbar .search-input {
    flex: 1;
    max-width: 300px;
}

/* Order Form */
.order-form .form-section {
    margin-bottom: var(--spacing-lg);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-xl);
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-family-ko);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn svg {
    width: 20px;
    height: 20px;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: var(--text-inverse);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-icon {
    width: 42px;
    height: 42px;
    padding: 0;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.btn-secondary {
    background: var(--secondary-color);
    color: var(--text-inverse);
    box-shadow: var(--shadow-md);
}

.btn-secondary:hover {
    background: #475569;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color), #34d399);
    color: var(--text-inverse);
    box-shadow: var(--shadow-md);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-sample {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    border: none;
    box-shadow: var(--shadow-md);
}

.btn-sample:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: linear-gradient(135deg, #d97706, #b45309);
}

.btn-group {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.btn-outline:hover {
    background: var(--primary-color);
    color: var(--text-inverse);
}

.btn-sm {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.85rem;
}

.btn-sm svg {
    width: 18px;
    height: 18px;
}

/* Input with button */
.input-with-btn {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
}

.input-with-btn select,
.input-with-btn input {
    flex: 1;
}

.input-with-btn .btn {
    flex-shrink: 0;
    height: 42px;
    padding: 0 var(--spacing-md);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: var(--spacing-md);
    justify-content: flex-end;
    margin-top: var(--spacing-xl);
}

/* Export Buttons */
.export-buttons {
    display: flex;
    gap: var(--spacing-md);
    justify-content: flex-end;
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 2px dashed var(--border-light);
}


/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-overlay);
    z-index: 1000;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease-out;
}

/* 중첩 모달 (거래처 편집 등) - 더 높은 z-index */
#partnerEditModal {
    z-index: 1100;
}

#partnerEditModal .modal-content {
    z-index: 1101;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-2xl);
    animation: modalSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.preview-modal {
    max-width: 900px;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-xl);
    border-bottom: 2px solid var(--border-light);
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
}

.modal-close:hover {
    background: var(--danger-color);
    color: var(--text-inverse);
    transform: rotate(90deg);
}

.modal-close svg {
    width: 24px;
    height: 24px;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-xl);
}

.modal-footer {
    display: flex;
    gap: var(--spacing-md);
    padding: var(--spacing-xl);
    border-top: 2px solid var(--border-light);
    justify-content: flex-end;
}

/* Preview Content */
.preview-content {
    background: var(--bg-primary);
    padding: var(--spacing-2xl);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
}

/* Settings Info Box */
.settings-info-box {
    display: flex;
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border-left: 4px solid var(--primary-color);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-xl);
    align-items: flex-start;
}

.settings-info-box svg {
    width: 24px;
    height: 24px;
    color: var(--primary-color);
    flex-shrink: 0;
    margin-top: 2px;
}

.settings-info-box p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* Welcome Message */
.welcome-message {
    text-align: center;
    padding: var(--spacing-xl);
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-xl);
}

.welcome-message h3 {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
}

.welcome-message p {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
    font-size: 1rem;
}

.welcome-features {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
}

.welcome-features li {
    padding: var(--spacing-md);
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    font-weight: 500;
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
}

.welcome-features li:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}


/* Quote Templates */
.quote-template {
    font-family: var(--font-family-ko);
    color: var(--text-primary);
}

/* Cover Page Styles (견적서 표지) */
.quote-cover {
    font-family: var(--font-family-ko);
    box-sizing: border-box;
}

.quote-cover table {
    width: 100%;
    border-collapse: collapse;
}

.quote-cover td {
    padding: 1rem;
}

/* Cover Preview Mini (라이브 프리뷰용) */
.cover-preview-mini {
    position: relative;
    overflow: hidden;
}

.cover-preview-mini::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
    pointer-events: none;
}

/* Print styles for cover page */
@media print {
    .quote-cover {
        page-break-after: always;
        min-height: 100vh;
    }

    .cover-preview-mini {
        display: none;
    }
}

.quote-header {
    text-align: center;
    margin-bottom: var(--spacing-2xl);
    padding-bottom: var(--spacing-lg);
    border-bottom: 3px solid var(--text-primary);
}

.quote-title {
    font-size: 2rem;
    font-weight: 900;
    margin-bottom: var(--spacing-md);
}

.quote-info-section {
    margin-bottom: var(--spacing-xl);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.info-box {
    border: 2px solid var(--border-medium);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
}

.info-box h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    color: var(--primary-color);
}

.info-row {
    display: flex;
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid var(--border-light);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 600;
    width: 120px;
    color: var(--text-secondary);
}

.info-value {
    flex: 1;
    color: var(--text-primary);
}

/* Excel Style Table */
.excel-table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--spacing-xl) 0;
    border: 2px solid var(--text-primary);
}

.excel-table th,
.excel-table td {
    border: 1px solid var(--border-dark);
    padding: var(--spacing-md);
    text-align: left;
}

.excel-table th {
    background: var(--text-primary);
    color: var(--text-inverse);
    font-weight: 700;
    text-align: center;
}

.excel-table td {
    background: var(--bg-primary);
}

.excel-table .text-right {
    text-align: right;
}

.excel-table .text-center {
    text-align: center;
}

.excel-table tfoot td {
    font-weight: 700;
    background: var(--bg-tertiary);
}

/* Basic Style */
.basic-table {
    width: 100%;
    margin: var(--spacing-xl) 0;
}

.basic-table .table-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-light);
}

.basic-table .table-header {
    font-weight: 700;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

.basic-table .table-footer {
    font-weight: 700;
    background: var(--bg-secondary);
    border-top: 2px solid var(--text-primary);
    margin-top: var(--spacing-md);
}

/* Minimal Style */
.minimal-table {
    width: 100%;
    margin: var(--spacing-xl) 0;
}

.minimal-table .table-row {
    display: flex;
    justify-content: space-between;
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid var(--border-light);
}

.minimal-table .item-desc {
    flex: 2;
}

.minimal-table .item-price {
    flex: 1;
    text-align: right;
    font-weight: 600;
}

.minimal-table .table-footer {
    font-weight: 700;
    font-size: 1.125rem;
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 2px solid var(--text-primary);
}

/* Saved Quotes List */
.saved-quotes-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.saved-quote-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-lg);
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 2px solid var(--border-light);
    transition: all var(--transition-base);
    cursor: pointer;
}

.saved-quote-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
}

.quote-item-info h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
    color: var(--text-primary);
}

.quote-item-info p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.quote-item-actions {
    display: flex;
    gap: var(--spacing-sm);
}

.icon-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
}

.icon-btn:hover {
    transform: scale(1.1);
}

.icon-btn svg {
    width: 20px;
    height: 20px;
}

.icon-btn.order {
    color: var(--success-color);
}

.icon-btn.order:hover {
    background: var(--success-color);
    color: white;
}

.icon-btn.tax {
    color: var(--warning-color);
}

.icon-btn.tax:hover {
    background: var(--warning-color);
    color: white;
}

.icon-btn.edit {
    color: var(--primary-color);
}

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

.icon-btn.delete {
    color: var(--danger-color);
}

.icon-btn.delete:hover {
    background: var(--danger-color);
    color: white;
}

.empty-state {
    text-align: center;
    padding: var(--spacing-2xl);
    color: var(--text-tertiary);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: var(--spacing-lg);
    opacity: 0.5;
}

/* Responsive Design - Tablet */
@media (max-width: 992px) {
    .form-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* Responsive Design - Mobile */
@media (max-width: 768px) {
    :root {
        --spacing-xl: 1rem;
        --spacing-2xl: 1.25rem;
    }

    .app-container {
        padding: var(--spacing-sm);
    }

    .header {
        padding: var(--spacing-md);
    }

    .header-content {
        flex-direction: column;
        text-align: center;
        gap: var(--spacing-md);
    }

    .logo h1 {
        font-size: 1.25rem;
    }

    .logo span {
        font-size: 0.75rem;
    }

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

    .footer-info {
        align-items: center;
    }

    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
    }

    .header-actions {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        gap: var(--spacing-sm);
    }

    .header-actions .btn {
        flex: 1;
        min-width: 45%;
        justify-content: center;
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: 0.85rem;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-md);
    }

    .section-title-row {
        flex-direction: column;
        align-items: stretch;
        gap: var(--spacing-sm);
    }

    .section-title-row .btn {
        width: 100%;
        justify-content: center;
    }

    .format-selector {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-sm);
    }

    .format-buttons {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: var(--spacing-xs);
    }

    .format-btn {
        width: 100%;
        justify-content: center;
        padding: var(--spacing-sm);
        font-size: 0.8rem;
    }

    .format-btn svg {
        display: none;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }

    .form-group label {
        font-size: 0.85rem;
    }

    .form-group input,
    .form-group textarea {
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .form-section {
        padding: var(--spacing-md);
    }

    .form-section h3 {
        font-size: 1rem;
    }

    /* Mobile Items Table - Convert to Cards */
    .items-table-wrapper {
        border: none;
        border-radius: 0;
    }

    .items-table {
        display: block;
    }

    .items-table thead {
        display: none;
    }

    .items-table tbody {
        display: flex;
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    .items-table tbody tr {
        display: flex;
        flex-direction: column;
        background: var(--bg-secondary);
        border: 1px solid var(--border-light);
        border-radius: var(--radius-md);
        padding: var(--spacing-md);
        gap: var(--spacing-sm);
    }

    .items-table tbody tr:hover {
        background: var(--bg-secondary);
    }

    .items-table td {
        display: flex;
        align-items: center;
        padding: 0;
    }

    .items-table td:first-child {
        order: 1;
    }

    .items-table td:first-child input {
        font-weight: 600;
        font-size: 1rem;
    }

    .items-table td:nth-child(2),
    .items-table td:nth-child(3),
    .items-table td:nth-child(4) {
        order: 2;
        flex: 1;
    }

    .items-table td:nth-child(2)::before {
        content: '수량';
        font-size: 0.75rem;
        color: var(--text-muted);
        margin-right: var(--spacing-sm);
        min-width: 35px;
    }

    .items-table td:nth-child(3)::before {
        content: '단위';
        font-size: 0.75rem;
        color: var(--text-muted);
        margin-right: var(--spacing-sm);
        min-width: 35px;
    }

    .items-table td:nth-child(4)::before {
        content: '단가';
        font-size: 0.75rem;
        color: var(--text-muted);
        margin-right: var(--spacing-sm);
        min-width: 35px;
    }

    .items-table td:nth-child(2) input,
    .items-table td:nth-child(3) input,
    .items-table td:nth-child(4) input {
        text-align: left;
        flex: 1;
    }

    .items-table td:nth-child(5) {
        order: 3;
        justify-content: space-between;
        padding-top: var(--spacing-sm);
        border-top: 1px dashed var(--border-light);
        margin-top: var(--spacing-xs);
    }

    .items-table td:nth-child(5)::before {
        content: '합계';
        font-weight: 600;
        color: var(--text-secondary);
    }

    .items-table .item-total {
        font-size: 1.1rem;
    }

    .items-table td:last-child {
        order: 0;
        position: absolute;
        right: var(--spacing-md);
        top: var(--spacing-md);
    }

    .items-table tbody tr {
        position: relative;
        padding-right: 50px;
    }

    .remove-item-btn {
        width: 28px;
        height: 28px;
    }

    .remove-item-btn svg {
        width: 14px;
        height: 14px;
    }

    /* Info Grid */
    .info-grid {
        grid-template-columns: 1fr;
    }

    /* Action Buttons */
    .action-buttons {
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    .action-buttons .btn {
        width: 100%;
        justify-content: center;
        padding: var(--spacing-md);
    }

    /* Export Buttons */
    .export-buttons {
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    .export-buttons .btn {
        width: 100%;
        justify-content: center;
    }

    /* Modal */
    .modal-content {
        margin: var(--spacing-sm);
        max-height: calc(100vh - var(--spacing-md));
        width: calc(100% - var(--spacing-md));
    }

    .modal-header {
        padding: var(--spacing-md);
    }

    .modal-header h2 {
        font-size: 1.1rem;
    }

    .modal-body {
        padding: var(--spacing-md);
    }

    .modal-footer {
        flex-direction: column;
        padding: var(--spacing-md);
        gap: var(--spacing-sm);
    }

    .modal-footer .btn {
        width: 100%;
        justify-content: center;
    }

    /* Welcome Message */
    .welcome-message {
        padding: var(--spacing-md);
    }

    .welcome-message h3 {
        font-size: 1rem;
    }

    .welcome-features {
        font-size: 0.9rem;
    }

    .welcome-features li {
        padding: var(--spacing-sm);
    }

    /* Preview */
    .preview-content {
        padding: var(--spacing-md);
    }

    .quote-template {
        font-size: 0.85rem;
    }

    .quote-title {
        font-size: 1.5rem !important;
    }

    /* Saved Quotes */
    .saved-quote-item {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-sm);
    }

    .quote-item-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* Small Mobile */
@media (max-width: 380px) {
    .header-actions .btn {
        min-width: 100%;
    }

    .format-buttons {
        grid-template-columns: 1fr;
    }

    .items-table td:nth-child(2),
    .items-table td:nth-child(3),
    .items-table td:nth-child(4) {
        flex-direction: column;
        align-items: flex-start;
    }

    .items-table td:nth-child(2)::before,
    .items-table td:nth-child(3)::before,
    .items-table td:nth-child(4)::before {
        margin-bottom: 2px;
    }

    .items-table td:nth-child(2) input,
    .items-table td:nth-child(3) input,
    .items-table td:nth-child(4) input {
        width: 100%;
    }
}

/* Summary Dashboard */
.summary-dashboard {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

.summary-box {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-base);
    text-align: center;
}

.summary-box:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.summary-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
}

.summary-icon svg {
    width: 24px;
    height: 24px;
}

.summary-subtotal .summary-icon {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success-color);
}

.summary-vat .summary-icon {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning-color);
}

.summary-total .summary-icon {
    background: rgba(37, 99, 235, 0.15);
    color: var(--primary-color);
}

.summary-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-value {
    font-size: 1.25rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.summary-subtotal .summary-value {
    color: var(--success-color);
}

.summary-vat .summary-value {
    color: var(--warning-color);
}

.summary-total .summary-value {
    color: var(--primary-color);
}

/* Floating Action Button */
.fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
    transition: all var(--transition-base);
    z-index: 100;
}

.fab:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.5);
}

.fab:active {
    transform: scale(0.95);
}

.fab svg {
    width: 28px;
    height: 28px;
}

/* Auto-save Indicator */
.auto-save-indicator {
    position: fixed;
    bottom: 24px;
    left: 24px;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background: rgba(16, 185, 129, 0.95);
    color: white;
    border-radius: var(--radius-lg);
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateY(20px);
    transition: all var(--transition-base);
    z-index: 100;
}

.auto-save-indicator.show {
    opacity: 1;
    transform: translateY(0);
}

.auto-save-indicator svg {
    width: 18px;
    height: 18px;
}

/* Compact Number Display */
.compact-number {
    font-variant-numeric: tabular-nums;
}

/* Mobile responsive for Summary Dashboard */
@media (max-width: 768px) {
    .summary-dashboard {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--spacing-sm);
        margin-bottom: var(--spacing-md);
    }

    .summary-box {
        padding: var(--spacing-sm);
    }

    .summary-icon {
        width: 32px;
        height: 32px;
    }

    .summary-icon svg {
        width: 18px;
        height: 18px;
    }

    .summary-label {
        font-size: 0.7rem;
    }

    .summary-value {
        font-size: 0.95rem;
    }

    .fab {
        bottom: 16px;
        right: 16px;
        width: 50px;
        height: 50px;
    }

    .fab svg {
        width: 24px;
        height: 24px;
    }

    .auto-save-indicator {
        bottom: 16px;
        left: 16px;
        padding: var(--spacing-xs) var(--spacing-sm);
        font-size: 0.75rem;
    }
}

@media (max-width: 380px) {
    .summary-box {
        padding: var(--spacing-xs);
    }

    .summary-icon {
        width: 28px;
        height: 28px;
        margin-bottom: 2px;
    }

    .summary-label {
        font-size: 0.6rem;
    }

    .summary-value {
        font-size: 0.8rem;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
    }

    .app-container {
        max-width: 100%;
        padding: 0;
    }

    .header,
    .editor-section,
    .modal-header,
    .modal-footer,
    .action-buttons {
        display: none !important;
    }

    .preview-content {
        border: none;
        box-shadow: none;
    }
}
/* ==================== Auth Styles ==================== */

/* Modal Size Variants */
.modal-sm {
    max-width: 420px;
}

.modal-lg {
    max-width: 800px;
}

/* Auth Form */
.auth-form {
    padding: var(--spacing-md);
}

.auth-logo {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.auth-logo svg {
    width: 48px;
    height: 48px;
    color: var(--primary-color);
    margin-bottom: var(--spacing-sm);
}

.auth-logo h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.auth-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-md);
    font-size: 0.875rem;
}

.auth-divider {
    display: flex;
    align-items: center;
    margin: var(--spacing-lg) 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-light);
}

.auth-divider span {
    padding: 0 var(--spacing-md);
    color: var(--text-tertiary);
    font-size: 0.875rem;
}

.auth-offline-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-lg);
    padding: var(--spacing-sm);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.auth-offline-note svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Button Variants */
.btn-block {
    display: flex;
    width: 100%;
    justify-content: center;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border-medium);
    color: var(--text-secondary);
}

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

.btn-ghost {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: var(--spacing-xs) var(--spacing-sm);
}

.btn-ghost:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-sm {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: 0.75rem;
}

/* User Info in Header */
.user-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-xs) var(--spacing-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
}

.user-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Server Status Indicator */
.server-status {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
}

.server-status.online {
    background: #dcfce7;
    color: #16a34a;
}

.server-status.offline {
    background: #fef3c7;
    color: #d97706;
}

.server-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.server-status.online .server-status-dot {
    background: #16a34a;
}

.server-status.offline .server-status-dot {
    background: #d97706;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Mode Indicator (로컬/서버) */
.mode-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: help;
    transition: all 0.2s ease;
}

.mode-indicator.offline {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
    border: 1px solid #fcd34d;
}

.mode-indicator.online {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    color: #166534;
    border: 1px solid #86efac;
}

.mode-indicator:hover {
    transform: scale(1.05);
}

/* Sync Indicator */
.sync-indicator {
    position: fixed;
    bottom: 80px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--primary-color);
    color: white;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.sync-indicator.show {
    opacity: 1;
    transform: translateY(0);
}

.sync-indicator svg {
    width: 16px;
    height: 16px;
    animation: spin 1s linear infinite;
}

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