/* ===== IPHOXY — Intelligent Enterprise Theme v4.0 (Enhanced Readability) ===== */

/* Base Settings */
:root {
    --primary: #B91C1C;
    --primary-light: #FEE2E2;
    --dark: #0F172A;
    --text: #334155;
    --border: #CBD5E1;
    --bg-body: #F1F5F9;
    --surface: #FFFFFF;
    --radius: 6px;
    --shadow-subtle: 0 1px 2px 0 rgba(0,0,0,0.05);
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Global Scale — Legible base (16px for maximum readability) */
html { font-size: 16px; }
body { font-family: var(--font-sans); background-color: var(--bg-body); color: var(--text); line-height: 1.5; -webkit-font-smoothing: antialiased; }

/* --- Typography --- */
h1, h2, h3, h4, h5, h6, .navbar-brand { color: var(--dark); font-weight: 700; letter-spacing: -0.025em; }

/* --- Navbar & Sidebar Links (Prominent Weight) --- */
.navbar .nav-link { font-weight: 600; }
.navbar .dropdown-item { font-weight: 600; }
.stat-value, .table td, .form-control { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; font-weight: 500; }

/* --- Page Headers (Enhanced) --- */
.page-pretitle { font-size: 0.75rem; text-transform: uppercase; font-weight: 700; color: #94A3B8; letter-spacing: 0.1em; margin-bottom: 0.2rem; }
.page-title-large { font-size: 1.6rem; font-weight: 800; color: var(--dark); letter-spacing: -0.02em; margin: 0; }
.page-header-block { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); margin-bottom: 1.5rem; }

/* --- Card Design --- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-subtle); margin-bottom: 1rem; }
.card-header { background: #F8FAFC; border-bottom: 1px solid var(--border); padding: 0.85rem 1.25rem; font-weight: 600; font-size: 1rem; color: var(--dark); }
.card-body { padding: 1.25rem; }

/* --- Action Toolbar --- */
.action-toolbar { background: white; padding: 0.85rem; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 1.5rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }

/* --- Status Badges --- */
.status-badge { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; padding: 0.3rem 0.7rem; border-radius: 4px; border: 1px solid transparent; }
.badge-active { background: #DCFCE7; color: #14532D; border-color: #86EFAC; }
.badge-closed { background: #FEF9C3; color: #713F12; border-color: #FDE047; }
.badge-archived { background: #F1F5F9; color: #475569; border-color: #CBD5E1; }

/* --- Date Widget --- */
.date-widget { background: #fff; border: 1px solid var(--border); padding: 0.35rem 0.85rem; border-radius: var(--radius); display: flex; align-items: center; gap: 0.5rem; }
.date-widget input { font-size: 0.95rem; font-weight: 600; border: none; background: transparent; color: var(--dark); outline: none; }

/* --- KPI Cards --- */
.stat-card { padding: 1.25rem; height: 100%; border: 1px solid var(--border); background: white; border-radius: var(--radius); position: relative; transition: all 0.2s ease; }
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.08); border-color: var(--primary); }
.stat-label { font-size: 0.8rem; text-transform: uppercase; font-weight: 600; color: #64748B; letter-spacing: 0.05em; margin-bottom: 0.25rem; }
.stat-value { font-size: 1.6rem; font-weight: 700; color: var(--dark); }
.stat-icon { width: 44px; height: 44px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }
.stat-icon-primary { background: #FEE2E2; color: #B91C1C; }
.stat-icon-success { background: #D1FAE5; color: #059669; }
.stat-icon-danger  { background: #FEE2E2; color: #DC2626; }
.stat-icon-warning { background: #FEF3C7; color: #D97706; }

/* --- Buttons (Fixed, Responsive, Easy to Click) --- */
.btn {
    font-size: 0.9rem;
    padding: 0.5rem 1.15rem;
    border-radius: 5px;
    font-weight: 600;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    transition: all 0.15s ease;
    white-space: nowrap;
}
.btn-sm {
    font-size: 0.8rem;
    padding: 0.35rem 0.85rem;
    min-height: 32px;
}
.btn-lg {
    font-size: 1rem;
    padding: 0.65rem 1.5rem;
    min-height: 44px;
}
.btn-brand { background: var(--primary); color: #fff; border: none; }
.btn-brand:hover { background: #991B1B; color: #fff; }

/* --- Tables (Readable, Comfortable Row Height) --- */
.table th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 700; color: #64748B; }
.table td { font-size: 0.9rem; vertical-align: middle; }
.table tbody tr { min-height: 45px; }
.table tbody td { padding-top: 0.55rem; padding-bottom: 0.55rem; }
.table-sm td, .table-sm th { padding: 0.5rem 0.65rem; }

/* --- Form Controls (Comfortable Size) --- */
.form-control, .form-select {
    font-size: 0.9rem;
    padding: 0.45rem 0.75rem;
    min-height: 38px;
    border-radius: 5px;
}
.form-label { font-size: 0.8rem; font-weight: 600; color: #475569; margin-bottom: 0.3rem; }
.form-control-sm, .form-select-sm { min-height: 32px; font-size: 0.85rem; padding: 0.3rem 0.65rem; }

/* --- Sticky Elements --- */
.sticky-actions { position: sticky; bottom: 0; background: #fff; border-top: 1px solid #e9ecef; padding: .75rem; z-index: 2; }
.sticky-bottom { position: sticky; bottom: 0; }

/* --- Soft Badge --- */
.badge-soft { background: #f1f3f5; color: #495057; border: 1px solid #e9ecef; border-radius: 999px; font-weight: 700; padding: .25rem .55rem; }

/* --- Week Management Card --- */
.week-mgmt-card { border: 2px solid var(--primary); border-radius: 8px; }
.week-mgmt-card .card-header { background: linear-gradient(135deg, #B91C1C, #991B1B); color: #fff; font-weight: 700; }

/* --- A4 PRINT OPTIMIZATION --- */
@media print {
    @page { size: A4; margin: 1cm; }
    body { background: white; font-size: 11pt; color: black; }
    .navbar, .btn, .no-print, form button, .action-toolbar form { display: none !important; }
    .container-xl, .container-fluid { max-width: 100% !important; padding: 0 !important; margin: 0 !important; }
    .card { border: 1px solid #000 !important; box-shadow: none !important; break-inside: avoid; margin-bottom: 15px; }
    .card-header { background: #eee !important; border-bottom: 1px solid #000 !important; color: #000 !important; }
    .col-xl-8, .col-xl-4, .col-md-6, .col-md-3 { width: 100% !important; flex: 0 0 100% !important; max-width: 100% !important; page-break-inside: avoid; }
    .row { display: block; }
    .row > * { display: block; width: 100%; margin-bottom: 10px; }
    .row.g-4.mb-5 { display: flex; flex-wrap: wrap; gap: 10px; }
    .row.g-4.mb-5 > * { width: 23% !important; flex: 0 0 23% !important; }
}

/* --- Mobile Responsive --- */
@media (max-width: 768px) {
    html { font-size: 14px; }
    .page-title-large { font-size: 1.3rem; }
    .stat-value { font-size: 1.3rem; }
    .action-toolbar { flex-direction: column; }
    .btn { min-height: 42px; font-size: 0.9rem; }
    .table td, .table th { font-size: 0.85rem; padding: 0.45rem; }
}
