/* ============================================================
   dongthue.com — Main Styles
   ============================================================ */

* { box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    background: #f8fafc;
    color: #0f172a;
}

/* === Card === */
.card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}
.card-sm {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

/* === Button variants === */
.btn-primary {
    background: #3b82f6;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}
.btn-primary:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, .3);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 500;
    cursor: pointer;
    transition: all .15s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}
.btn-secondary:hover { background: #e2e8f0; }

.btn-outline {
    background: transparent;
    color: #3b82f6;
    border: 1px solid #3b82f6;
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}
.btn-outline:hover { background: #eff6ff; }

.btn-success {
    background: #10b981;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}
.btn-success:hover { background: #059669; }

.btn-danger {
    background: #ef4444;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 14px;
    font-weight: 500;
    cursor: pointer;
    font-size: 13px;
    border-radius: 6px;
}
.btn-danger:hover { background: #dc2626; }

/* === Input === */
.input {
    width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    outline: none;
    transition: border-color .15s;
    background: #fff;
    color: #0f172a;
}
.input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,.1);
}
.input::placeholder { color: #94a3b8; }
.input-sm { padding: 8px 12px; font-size: 13px; }

select.input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}

/* === Label === */
.label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #334155;
    margin-bottom: 6px;
}

/* === Step dots === */
.step-dot {
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 600;
    transition: all .3s; flex-shrink: 0;
}
.step-dot.active {
    background: #3b82f6; color: #fff;
    box-shadow: 0 0 0 4px rgba(59,130,246,.2);
}
.step-dot.completed { background: #10b981; color: #fff; }
.step-dot.pending   { background: #e2e8f0; color: #94a3b8; }
.step-line { flex:1; height:2px; background:#e2e8f0; transition:background .3s; }
.step-line.done { background: #10b981; }

/* === Badge === */
.badge {
    display: inline-flex; align-items: center;
    padding: 2px 10px; border-radius: 20px;
    font-size: 12px; font-weight: 500;
}
.badge-blue   { background: #dbeafe; color: #1d4ed8; }
.badge-green  { background: #d1fae5; color: #065f46; }
.badge-orange { background: #fef3c7; color: #92400e; }
.badge-red    { background: #fee2e2; color: #991b1b; }
.badge-gray   { background: #f1f5f9; color: #475569; }

/* === Alerts === */
.alert-info    { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 8px; padding: 12px 16px; }
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 8px; padding: 12px 16px; }
.alert-warning { background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; padding: 12px 16px; }
.alert-error   { background: #fef2f2; border: 1px solid #fecaca; border-radius: 8px; padding: 12px 16px; }

/* === Persona card === */
.persona-card {
    border: 2px solid #e2e8f0; border-radius: 12px;
    padding: 20px; cursor: pointer;
    transition: all .2s; background: #fff;
}
.persona-card:hover {
    border-color: #93c5fd; background: #eff6ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(59,130,246,.1);
}
.persona-card.selected {
    border-color: #3b82f6; background: #eff6ff;
    box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}

/* === Tax table === */
.table-tax { width: 100%; border-collapse: collapse; font-size: 14px; }
.table-tax th {
    background: #f8fafc; font-weight: 600; text-align: left;
    padding: 10px 14px; border-bottom: 1px solid #e2e8f0;
    color: #334155; font-size: 13px;
}
.table-tax td { padding: 10px 14px; border-bottom: 1px solid #f1f5f9; color: #475569; }
.table-tax tr:last-child td { border-bottom: none; }
.table-tax .total-row td     { font-weight: 700; color: #0f172a; background: #f8fafc; }
.table-tax .highlight-row td { background: #eff6ff; color: #1d4ed8; font-weight: 600; }
.table-tax .tax-row td       { background: #f0fdf4; color: #065f46; font-weight: 700; }

/* === Section transitions === */
.section { display: none; }
.section.active { display: block; animation: fadeIn .3s ease; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* === Mobile === */
@media (max-width: 640px) {
    .hide-mobile  { display: none !important; }
    .stack-mobile { flex-direction: column !important; }
    .full-mobile  { width: 100% !important; }
}

/* === Print === */
@media print {
    .no-print { display: none !important; }
    body { background: white; }
    .card { border: 1px solid #e2e8f0; box-shadow: none; }
}

/* === Scrollbar === */
::-webkit-scrollbar       { width: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

/* === Income item === */
.income-item {
    border: 1px solid #e2e8f0; border-radius: 10px;
    padding: 16px; background: #fff; transition: all .2s;
}
.income-item:hover {
    border-color: #93c5fd;
    box-shadow: 0 2px 8px rgba(59,130,246,.08);
}

/* === Tooltip === */
.tooltip-wrap { position: relative; display: inline-flex; align-items: center; }
.tooltip-icon {
    width: 16px; height: 16px; background: #94a3b8; color: white;
    border-radius: 50%; font-size: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: help; margin-left: 4px; flex-shrink: 0;
}

/* === App header === */
.app-header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(255,255,255,.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #e2e8f0;
}

/* === Progress bar === */
.progress-bar  { height: 4px; background: #e2e8f0; border-radius: 2px; overflow: hidden; }
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #10b981);
    border-radius: 2px; transition: width .4s ease;
}

/* === Number display === */
.number-display { font-variant-numeric: tabular-nums; font-weight: 600; }

/* === Toggle switch === */
.toggle { position: relative; display: inline-block; width: 44px; height: 24px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute; cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #e2e8f0; transition: .3s; border-radius: 24px;
}
.toggle-slider:before {
    position: absolute; content: "";
    height: 18px; width: 18px; left: 3px; bottom: 3px;
    background-color: white; transition: .3s; border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
input:checked + .toggle-slider { background-color: #3b82f6; }
input:checked + .toggle-slider:before { transform: translateX(20px); }

/* === Result cards === */
.result-card-positive {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border: 1px solid #86efac; border-radius: 16px;
}
.result-card-negative {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    border: 1px solid #fca5a5; border-radius: 16px;
}
.result-card-zero {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border: 1px solid #e2e8f0; border-radius: 16px;
}

/* ============================================================
   DATA IMPORTER — Styles
   ============================================================ */

/* Tab switcher */
.importer-tabs {
    display: flex; gap: 0; border-radius: 10px;
    background: #f1f5f9; padding: 4px; margin-bottom: 16px;
}
.importer-tab {
    flex: 1; padding: 10px 12px; border: none; background: transparent;
    border-radius: 8px; font-size: 13px; font-weight: 500;
    color: #64748b; cursor: pointer; transition: all .2s;
    display: flex; align-items: center; justify-content: center; gap: 6px;
}
.importer-tab:hover { color: #334155; }
.importer-tab.active {
    background: #fff; color: #1d4ed8; font-weight: 600;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

/* Tab panels */
.importer-panel { display: none; }
.importer-panel.active { display: block; animation: fadeIn .25s ease; }

/* File drop zone */
.file-drop-zone {
    border: 2px dashed #cbd5e1; border-radius: 12px;
    padding: 32px 20px; text-align: center;
    transition: all .2s; cursor: pointer;
    background: #fafbfc;
}
.file-drop-zone:hover,
.file-drop-zone.dragover {
    border-color: #3b82f6; background: #eff6ff;
}
.file-drop-zone i { font-size: 28px; color: #94a3b8; margin-bottom: 8px; }
.file-drop-zone.dragover i { color: #3b82f6; }

/* Keyword tag input */
.keyword-input-wrap {
    display: flex; flex-wrap: wrap; gap: 6px;
    border: 1px solid #e2e8f0; border-radius: 8px;
    padding: 8px 10px; background: #fff;
    min-height: 44px; align-items: center;
    transition: border-color .15s;
}
.keyword-input-wrap:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,.1);
}
.keyword-tag {
    display: inline-flex; align-items: center; gap: 4px;
    background: #dbeafe; color: #1d4ed8;
    padding: 3px 10px; border-radius: 6px;
    font-size: 13px; font-weight: 500;
    animation: fadeIn .2s ease;
}
.keyword-tag button {
    background: none; border: none; color: #1d4ed8;
    cursor: pointer; padding: 0 2px; font-size: 14px;
    opacity: .6; transition: opacity .15s;
}
.keyword-tag button:hover { opacity: 1; }
.keyword-input {
    border: none; outline: none; flex: 1;
    min-width: 120px; font-size: 13px;
    background: transparent; color: #0f172a;
}
.keyword-input::placeholder { color: #94a3b8; }

/* Preview table */
.preview-table-wrap {
    max-height: 360px; overflow-y: auto;
    border: 1px solid #e2e8f0; border-radius: 10px;
    background: #fff;
}
.preview-table {
    width: 100%; border-collapse: collapse; font-size: 13px;
}
.preview-table thead { position: sticky; top: 0; z-index: 2; }
.preview-table th {
    background: #f8fafc; font-weight: 600; text-align: left;
    padding: 10px 12px; border-bottom: 1px solid #e2e8f0;
    color: #475569; font-size: 12px; text-transform: uppercase;
    letter-spacing: .03em;
}
.preview-table td {
    padding: 8px 12px; border-bottom: 1px solid #f1f5f9; color: #334155;
}
.preview-table tr.matched { background: #eff6ff; }
.preview-table tr.matched td:first-child { border-left: 3px solid #3b82f6; }
.preview-table tr:hover { background: #f8fafc; }
.preview-table input[type="checkbox"] {
    width: 16px; height: 16px; accent-color: #3b82f6; cursor: pointer;
}

/* Sticky total footer */
.preview-footer {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; background: #f8fafc;
    border-top: 1px solid #e2e8f0; border-radius: 0 0 10px 10px;
    position: sticky; bottom: 0;
}
.preview-footer .total-label { font-size: 13px; color: #475569; font-weight: 500; }
.preview-footer .total-value { font-size: 18px; font-weight: 700; color: #0f172a; }

/* Paste zone */
.paste-zone {
    width: 100%; min-height: 140px; max-height: 240px;
    border: 1px solid #e2e8f0; border-radius: 8px;
    padding: 12px 14px; font-size: 13px; font-family: 'Inter', monospace;
    resize: vertical; outline: none; background: #fff; color: #0f172a;
    transition: border-color .15s;
}
.paste-zone:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,.1);
}
.paste-zone::placeholder { color: #94a3b8; }

/* Import summary card */
.import-summary {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border: 1px solid #93c5fd; border-radius: 12px;
    padding: 16px 20px;
}
