/* assets/css/styles.css - GLOBAL STANDARDIZATION (SMART MAP) */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    /* --- STANDARD ENTERPRISE THEME (Light) --- */
    --bg-body: #f8fafc;
    /* Slate 50 - Brighter/Cleaner */
    --bg-surface: #ffffff;
    /* White */
    --bg-subtle: #f1f5f9;
    /* Slate 100 */

    --text-main: #0f172a;
    /* Slate 900 (Primary Text) */
    --text-muted: #64748b;
    /* Slate 500 (Secondary Text) */
    --text-on-brand: #ffffff;
    /* White text on Standard Buttons */

    --brand-primary: #2563eb;
    /* Blue 600 */
    --brand-hover: #1d4ed8;
    /* Blue 700 */

    --border-color: #cbd5e1;
    /* Slate 300 */
    --border-focus: #3b82f6;
    /* Blue 500 */

    --radius: 0.5rem;
    /* 8px */
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);

    --danger: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;
}

/* [data-theme="dark"] {
    --bg-body: #0f172a;
    --bg-surface: #1e293b;
    --bg-subtle: #334155;

    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-on-brand: #ffffff;

    --brand-primary: #3b82f6;
    --brand-hover: #2563eb;

    --border-color: #334155;
    --border-focus: #60a5fa;

    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
} */

/* === RESET */
body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    transition: color 0.2s;
    color: inherit;
}

/* === SMART MAPPING: FORCE LEGACY DARK CLASSES TO LIGHT === */
/* This section overrides the inline Tailwind classes that are stuck in the PHP files */

/* Backgrounds: Turn Dark Backgrounds into White/Light */
.bg-slate-900,
.bg-gray-900,
.bg-slate-950 {
    background-color: var(--bg-body) !important;
    color: var(--text-main) !important;
}

.bg-slate-800,
.bg-gray-800,
.bg-slate-800\/50,
.bg-slate-800\/30 {
    background-color: var(--bg-surface) !important;
    color: var(--text-main) !important;
    border: 1px solid var(--border-color) !important;
    /* Add border to define edge */
    box-shadow: var(--shadow);
}

.glass-panel,
.glass-panel-dark {
    background-color: var(--bg-surface) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: var(--shadow) !important;
    backdrop-filter: none !important;
}

/* Text: Turn White Text into Dark Text */
.text-white,
.text-gray-100,
.text-slate-200,
.text-slate-300 {
    color: var(--text-main) !important;
}

.text-slate-400,
.text-gray-400 {
    color: var(--text-muted) !important;
}

/* Fix "Disturbed" Inputs */
input,
select,
textarea,
.glass-input,
.glass-input-dark {
    background-color: #ffffff !important;
    color: var(--text-main) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius) !important;
    padding: 0.65rem 1rem !important;
}

input::placeholder {
    color: #94a3b8 !important;
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    background-color: var(--bg-surface) !important;
    color: var(--text-main) !important;
    border-color: var(--border-color) !important;
}

/* === COMPONENT STANDARDS === */

/* Cards */
.card,
.stat-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

/* Buttons */
.btn-primary,
.btn-gradient-primary,
button[class*="bg-gradient"],
button[class*="bg-blue-600"] {
    background: var(--brand-primary) !important;
    color: var(--text-on-brand) !important;
    /* Whiten text on blue buttons */
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
}

.btn-primary:hover,
.btn-gradient-primary:hover {
    background: var(--brand-hover) !important;
}

.btn-secondary {
    background: #ffffff;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
}

/* Sidebar Specifics */
#sidebar,
aside {
    background-color: var(--bg-surface) !important;
    border-right: 1px solid var(--border-color) !important;
}

.sidebar-link {
    color: var(--text-muted) !important;
}

.sidebar-link:hover,
.sidebar-link.active {
    background-color: #eff6ff !important;
    /* Blue 50 */
    color: var(--brand-primary) !important;
    font-weight: 600;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background-color: var(--bg-subtle) !important;
    color: var(--text-muted) !important;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
}

tr:hover td {
    background-color: var(--bg-subtle);
}

/* SweetAlert Cleanup */
div.swal2-popup {
    background: #fff !important;
    color: #0f172a !important;
}

div.swal2-title {
    color: #0f172a !important;
}