/**
 * assets/css/app-v9-patch.css
 * Patches untuk readability & contrast fix.
 * Include SETELAH app.css di layout.
 */

/* === Tighter base contrast === */
:root {
    --color-text: #111827;            /* darker than #1a202c */
    --color-text-secondary: #374151;  /* darker than #4a5568 - readable on light bg */
    --color-text-muted: #4b5563;      /* darker than #718096 - readable on light bg */
    --color-text-faint: #9ca3af;      /* untuk hint sangat ringan saja */
    --color-border: #d1d5db;          /* lebih tegas dari #e2e8f0 */
}

/* Force base font size lebih besar di mobile */
body, table, .form-control, .btn, input, select, textarea {
    font-size: 14px;
}
@media (min-width: 768px) {
    body, table, .form-control, .btn, input, select, textarea {
        font-size: 14.5px;
    }
}

/* === STAT CARD GRADIENT FIX === */
/* Stat-card dengan inline gradient harus pakai text putih solid + drop shadow */
.stat-card[style*="gradient"] {
    color: #ffffff !important;
}
.stat-card[style*="gradient"] .stat-label {
    color: rgba(255, 255, 255, 0.95) !important;
    opacity: 1 !important;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}
.stat-card[style*="gradient"] .stat-value {
    color: #ffffff !important;
    font-weight: 700;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.stat-card[style*="gradient"] .stat-meta {
    color: rgba(255, 255, 255, 0.92) !important;
    opacity: 1 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

/* Stat-card biasa - perbesar font & tegas */
.stat-card .stat-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}
.stat-card .stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.1;
}
.stat-card .stat-meta {
    font-size: 12px;
    color: var(--color-text-secondary);
    margin-top: 6px;
}

/* === TABEL: kontras lebih jelas === */
.table th {
    font-weight: 600;
    color: var(--color-text);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: #f9fafb;
    border-bottom: 2px solid var(--color-border);
}
.table td {
    color: var(--color-text);
    border-bottom: 1px solid var(--color-border);
}
.table small, .table .text-muted {
    color: var(--color-text-secondary) !important;
}

/* === FORM: label & help text lebih readable === */
.form-group label {
    font-weight: 600;
    color: var(--color-text);
    font-size: 13.5px;
    margin-bottom: 4px;
    display: block;
}
.form-help {
    color: var(--color-text-secondary);
    font-size: 12px;
    margin-top: 4px;
    line-height: 1.4;
}
.form-control {
    color: var(--color-text);
    border-color: var(--color-border);
}
.form-control::placeholder {
    color: var(--color-text-faint);
    font-style: italic;
}

/* === BADGE: kontras lebih tegas === */
.badge {
    font-weight: 600;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    display: inline-block;
}
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-error { background: #fee2e2; color: #991b1b; }
.badge-gray { background: #f3f4f6; color: #374151; }

/* === PAGE HEADER: subtitle harus terbaca === */
.page-header .subtitle {
    color: var(--color-text-secondary);
    font-size: 14px;
    margin-top: 4px;
}

/* === CARD HEADER === */
.card-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text);
}

/* === Generic .text-muted === */
.text-muted {
    color: var(--color-text-secondary) !important;
}

/* === Tabel-empty state === */
.table-empty {
    text-align: center;
    color: var(--color-text-secondary);
    padding: 30px;
    font-style: italic;
}

/* === BUTTON: lebih tegas === */
.btn {
    font-weight: 500;
    color: var(--color-text);
}
.btn-primary {
    background: var(--color-primary);
    color: #ffffff;
    border-color: var(--color-primary);
    font-weight: 600;
}
.btn-success {
    background: #059669;
    color: #ffffff;
    border-color: #059669;
    font-weight: 600;
}
.btn-danger {
    background: #dc2626;
    color: #ffffff;
    border-color: #dc2626;
    font-weight: 600;
}

/* === Numeric cells: monospace untuk angka mudah dibaca === */
.numeric, .text-right {
    font-variant-numeric: tabular-nums;
}

/* === Print fix === */
@media print {
    .no-print, .sidebar, .page-actions, .btn { display: none !important; }
    body { background: white; }
    .card { box-shadow: none !important; border: none !important; }
}
