/* ============================================================
   VAT Panel - Stylesheet
   Cohérent avec Audit Panel pour future unification
   ============================================================ */

:root {
    --primary: #1E40AF;
    --primary-hover: #1E3A8A;
    --bg: #F9FAFB;
    --surface: #FFFFFF;
    --border: #E5E7EB;
    --text: #111827;
    --text-secondary: #6B7280;
    --text-subtle: #9CA3AF;
    --success: #059669;
    --warning: #D97706;
    --error: #DC2626;
    --warning-bg: #FEF3C7;
    --error-bg: #FEE2E2;
    --success-bg: #DCFCE7;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
    line-height: 1.5;
}

.container {
    padding: 16px;
    max-width: 100%;
}

/* ============ HEADER ============ */
.header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.logo-square {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--text);
    color: white;
    font-weight: 700;
    border-radius: 8px;
    font-size: 18px;
}

.header-text h1 {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    color: var(--text);
}

.header-text .subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 2px 0 0 0;
}

/* ============ DROP ZONE ============ */
.drop-section {
    margin-bottom: 16px;
}

.drop-zone {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 24px 16px;
    text-align: center;
    background: var(--surface);
    transition: all 0.15s ease;
    cursor: pointer;
}

.drop-zone:hover {
    border-color: var(--primary);
    background: #F0F4FF;
}

.drop-zone.drag-over {
    border-color: var(--primary);
    background: #DBEAFE;
}

.drop-zone-icon {
    font-size: 36px;
    margin-bottom: 8px;
}

.drop-zone-text strong {
    display: block;
    font-size: 14px;
    color: var(--text);
    margin-bottom: 4px;
}

.drop-zone-text p {
    margin: 0 0 12px 0;
    font-size: 12px;
    color: var(--text-secondary);
}

/* ============ BUTTONS ============ */
.btn-primary {
    width: 100%;
    padding: 10px 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}

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

.btn-primary:disabled {
    background: var(--text-subtle);
    cursor: not-allowed;
}

.btn-primary-outline {
    padding: 8px 16px;
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

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

.btn-secondary {
    padding: 8px 16px;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 12px;
}

.btn-secondary:hover {
    background: var(--bg);
}

/* ============ STATUS ============ */
.status {
    margin: 12px 0;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 13px;
    display: none;
}

.status.show {
    display: block;
}

.status.info {
    background: #EFF6FF;
    color: var(--primary);
    border: 1px solid #DBEAFE;
}

.status.success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid #BBF7D0;
}

.status.error {
    background: var(--error-bg);
    color: var(--error);
    border: 1px solid #FECACA;
}

/* ============ SUMMARY ============ */
.summary-section h2 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 12px 0;
}

.summary-meta {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
    font-size: 13px;
}

.summary-meta strong {
    color: var(--text);
}

.summary-meta .meta-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.summary-meta .meta-row:last-child {
    margin-bottom: 0;
}

.summary-meta .meta-label {
    color: var(--text-secondary);
}

/* ============ WARNINGS / ERRORS ============ */
.warnings, .errors-block {
    margin-bottom: 12px;
}

.warning-item, .error-item {
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    margin-bottom: 6px;
}

.warning-item {
    background: var(--warning-bg);
    color: var(--warning);
    border-left: 3px solid var(--warning);
}

.error-item {
    background: var(--error-bg);
    color: var(--error);
    border-left: 3px solid var(--error);
}

/* ============ DECLARATIONS LIST ============ */
.declarations-list {
    margin-bottom: 16px;
}

.declaration-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px 12px;
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.declaration-period {
    font-weight: 600;
    color: var(--text);
}

.declaration-meta {
    font-size: 11px;
    color: var(--text-secondary);
}

.declaration-codes {
    color: var(--text-subtle);
    font-size: 11px;
}

/* ============ RESULT ============ */
.result-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
}

.result-success {
    display: flex;
    align-items: center;
    gap: 12px;
}

.result-icon {
    width: 36px;
    height: 36px;
    background: var(--success-bg);
    color: var(--success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
}

.result-success strong {
    display: block;
    font-size: 14px;
    color: var(--text);
}

.result-success p {
    margin: 2px 0 0 0;
    font-size: 12px;
    color: var(--text-secondary);
}

/* ============ DECLARATIONS HEADER ============ */
.declarations-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.declarations-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn-link {
    background: none;
    border: none;
    color: var(--error);
    font-size: 12px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.btn-link:hover {
    background: var(--error-bg);
}

/* ============ DECLARATION CARD with delete ============ */
.declaration-card {
    position: relative;
}

.declaration-card-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex: 1;
}

.declaration-delete {
    background: none;
    border: none;
    color: var(--text-subtle);
    cursor: pointer;
    padding: 4px 8px;
    margin-left: 8px;
    border-radius: 4px;
    font-size: 16px;
    line-height: 1;
    transition: all 0.15s ease;
}

.declaration-delete:hover {
    background: var(--error-bg);
    color: var(--error);
}