/* Extracted from accounting/index.blade.php */
/* Auto-generated - do not edit inline styles in the template */

/* ===== 會計系統樣式 ===== */
.accounting-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.accounting-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    color: white;
}

.accounting-header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.accounting-header p {
    opacity: 0.9;
    font-size: 1.1rem;
}

/* 主導航標籤 */
.accounting-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 25px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.accounting-nav-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 12px;
    background: #f0f2f5;
    color: #333;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.accounting-nav-btn:hover {
    background: #e0e3e7;
}

.accounting-nav-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.accounting-nav-btn i {
    font-size: 1.1rem;
}

/* 內容區塊 */
.accounting-section {
    display: none;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    padding: 25px;
    margin-bottom: 20px;
}

.accounting-section.active {
    display: block;
}

.section-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f2f5;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title i {
    color: #667eea;
}

/* 子導航標籤（成本計算） */
.sub-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.sub-tab {
    padding: 10px 18px;
    border: 2px solid #667eea;
    border-radius: 25px;
    background: white;
    color: #667eea;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.sub-tab:hover, .sub-tab.active {
    background: #667eea;
    color: white;
}

/* 計算器面板 */
.calculator-panel {
    display: none;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.calculator-panel.active {
    display: block;
}

/* 表單樣式 */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #333;
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 12px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

/* 按鈕 */
.btn-primary {
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102,126,234,0.4);
}

.btn-secondary {
    padding: 12px 24px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
}

.btn-success {
    background: #28a745;
}

.btn-warning {
    background: #ffc107;
    color: #333;
}

/* 結果區塊 */
.result-card {
    margin-top: 20px;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: none;
}

.result-card.show {
    display: block;
}

.result-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
}

.result-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

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

.result-row.highlight {
    font-weight: bold;
    font-size: 1.1rem;
    color: #667eea;
    padding-top: 15px;
    margin-top: 15px;
    border-radius: 12px;
    border-top: 2px solid #667eea;
}

/* 總覽卡片 */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.summary-card {
    padding: 20px;
    border-radius: 10px;
    color: white;
    text-align: center;
}

.summary-card.purchase { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.summary-card.shipping { background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%); }
.summary-card.tariff { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.summary-card.total { background: linear-gradient(135deg, #ee0979 0%, #ff6a00 100%); }

.summary-card h4 {
    font-size: 1rem;
    margin-bottom: 8px;
    opacity: 0.9;
}

.summary-card .amount {
    font-size: 1.6rem;
    font-weight: bold;
}

/* 表格樣式 */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

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

.data-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

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

/* 狀態標籤 */
.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.badge-draft { background: #ffc107; color: #333; }
.badge-posted { background: #28a745; color: white; }
.badge-voided { background: #dc3545; color: white; }

/* 會計科目樹 */
.account-tree {
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 12px;
}

.account-item {
    padding: 8px 12px;
    margin: 4px 0;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.account-item:hover {
    background: #e9ecef;
}

.account-item.level-1 { font-weight: bold; }
.account-item.level-2 { padding-left: 25px; }
.account-item.level-3 { padding-left: 45px; font-size: 0.95rem; }
.account-item.level-4 { padding-left: 65px; font-size: 0.9rem; }

.account-code {
    color: #667eea;
    margin-right: 10px;
    font-family: monospace;
}

.account-type-badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
}

.type-asset { background: #e3f2fd; color: #1976d2; }
.type-liability { background: #fce4ec; color: #c2185b; }
.type-equity { background: #e8f5e9; color: #388e3c; }
.type-revenue { background: #fff3e0; color: #f57c00; }
.type-expense { background: #f3e5f5; color: #7b1fa2; }

/* 日記帳分錄 */
.journal-entry-form {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
}

.journal-lines {
    margin-top: 20px;
}


.journal-line {
    display: grid;
    grid-template-columns: 80px minmax(0, 1fr) 110px 110px 50px 42px;
    gap: 12px;
    padding: 12px 15px;
    background: white;
    border-radius: 12px;
    margin-bottom: 12px;
    align-items: center;
    min-height: 54px;
}

.journal-line input,
.journal-line select {
    width: 100%;
    min-width: 0;
    height: 42px;
    font-size: 16px;
    border-radius: 10px;
    border: 1px solid #ddd;
    padding: 0 12px;
    box-sizing: border-box;
}

.journal-line select {
    width: 100%;
    min-width: 0;
    padding: 0 8px;
}

.journal-line input:focus,
.journal-line select:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.currency-label {
    color: #555;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    height: 42px;
    line-height: 42px;
}

.account-code-input {
    width: 100%;
    text-align: center;
    font-weight: 500;
}

.journal-line-header {
    font-weight: 600;
    font-size: 16px;
    background: linear-gradient(135deg, #3a3a3a 0%, #4a4a4a 100%);
    color: white;
    min-height: 54px;
    border-radius: 12px;
}

.journal-line-header span {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.remove-line-btn {
    width: 42px;
    height: 42px;
    padding: 0;
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.2s ease;
}

.remove-line-btn:hover {
    background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
    transform: scale(1.05);
}

.debit-input,
.credit-input {
    text-align: right;
    font-weight: 500;
}

.debit-input::placeholder,
.credit-input::placeholder {
    color: #888;
    font-size: 16px;
    font-weight: 400;
}









































}

.add-line-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 15px;
    border-radius: 12px;
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 600;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
}

/* 餘額顯示 */
.balance-display {
    display: flex;
    justify-content: space-between;
    padding: 20px;
    background: #f0f2f5;
    border-radius: 12px;
    margin-top: 15px;
}

.balance-item {
    text-align: center;
}

.balance-item .label {
    font-size: 16px;
    font-size: 1rem;
    color: #666;
}

.balance-item .value {
    font-size: 1.5rem;
    font-weight: bold;
}

.balance-item .value.debit { color: #1976d2; }
.balance-item .value.credit { color: #c2185b; }
.balance-item .value.balanced { color: #28a745; }
.balance-item .value.unbalanced { color: #dc3545; }

/* 報表樣式 */
.report-container {
    padding: 20px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 10px;
}

.report-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #333;
}

.report-header h2 {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.report-header .date {
    color: #666;
}

.report-section {
    margin-bottom: 25px;
}

.report-section h3 {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #ddd;
}

.report-line {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
}

.report-line.indent-1 { padding-left: 20px; }
.report-line.indent-2 { padding-left: 40px; font-size: 0.95rem; }

.report-line.total {
    font-weight: bold;
    border-top: 1px solid #333;
    margin-top: 15px;
    border-radius: 12px;
    padding-top: 10px;
}

.report-line.grand-total {
    font-weight: bold;
    font-size: 1.1rem;
    border-top: 2px double #333;
    margin-top: 15px;
    padding-top: 15px;
}

/* 分頁 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 20px;
}

.pagination button {
    padding: 8px 15px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 5px;
    cursor: pointer;
}

.pagination button:hover,
.pagination button.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* 響應式 */
@media (max-width: 768px) {
    .accounting-container {
        padding: 10px;
    }

    .accounting-header h1 {
        font-size: 1.5rem;
    }

    .accounting-nav {
        flex-direction: column;
    }

    .accounting-nav-btn {
        width: 100%;
        justify-content: center;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .journal-line {
        grid-template-columns: 1fr;
    }

    .journal-line-header {
        display: none;
    }

    .summary-cards {
        grid-template-columns: 1fr 1fr;
    }

    .data-table {
        display: block;
        overflow-x: auto;
    }
}

/* 載入中 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    display: none;
}

.loading-overlay.show {
    display: flex;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 提示訊息 */
.alert {
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 15px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.alert-info {
    background: #e7f3ff;
    color: #004085;
    border: 1px solid #b8daff;
}

/* 台灣稅務提示 */
.tax-info-box {
    padding: 20px;
    background: #e7f3ff;
    border-left: 4px solid #667eea;
    border-radius: 0 8px 8px 0;
    margin-bottom: 20px;
}

.tax-info-box h4 {
    margin-bottom: 8px;
    color: #333;
}

.tax-info-box ul {
    margin: 0;
    padding-left: 20px;
    font-size: 0.9rem;
    color: #666;
}

/* Modal 樣式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalFadeIn 0.3s ease;
}

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

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

.modal-header h3 {
    margin: 0;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 32px;
    height: 32px;
    line-height: 32px;
    text-align: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #f0f0f0;
    color: #333;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 15px 20px;
    border-top: 1px solid #eee;
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
}

/* 科目選擇器樣式 */
.account-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 2;
}

.account-type-badge {
    display: none;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    color: white;
    font-weight: 500;
    white-space: nowrap;
}

.journal-line .account-select {
    flex: 1;
}

/* 借貸輸入框高亮 */
.debit-input:focus, .credit-input:focus {
    outline: 2px solid #667eea;
    outline-offset: -2px;
}

.debit-input::placeholder, .credit-input::placeholder {
    color: #10b981;
    font-size: 11px;
}

/* 模板按鈕懸停效果 */
.template-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.template-btn:active {
    transform: translateY(0);
}

/* 科目分組樣式 */
.account-select optgroup {
    font-weight: bold;
    color: #334155;
    background: #f1f5f9;
}

.account-select option {
    padding: 8px;
}

/* 借貸法則提示卡片 */
.debit-credit-guide {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid #f59e0b;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 15px;
    font-size: 13px;
}

.debit-credit-guide table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
}

.debit-credit-guide th, .debit-credit-guide td {
    padding: 6px 12px;
    text-align: center;
    border: 1px solid #d97706;
}

.debit-credit-guide th {
    background: #fbbf24;
    color: #78350f;
}

/* 平衡狀態樣式改進 */
.balance-display .balanced {
    color: #10b981 !important;
    font-weight: bold;
}

.balance-display .unbalanced {
    color: #ef4444 !important;
    font-weight: bold;
}

/* 通知動畫 */
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}
