/* ==========================================================================
   Denovo Bootstrap Override - Dark Theme + Brand Identity
   Loaded AFTER bootstrap.min.css to customize Bootstrap for Denovo backoffice
   ========================================================================== */

/* Google Font - DM Sans for headings */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

/* Font-size base */
html {
    font-size: 16px;
}

@media (max-width: 768px) {
    html {
        font-size: 15px;
    }
}

/* Override Bootstrap dark theme colors to match Denovo palette */
[data-bs-theme="dark"] {
    --bs-body-bg: #1a1a1a;
    --bs-body-color: #f0f0f0;
    --bs-secondary-bg: #3a3a3a;
    --bs-tertiary-bg: #2d2d2d;
    --bs-border-color: #3a3a3a;
    --bs-primary: #e6642b;
    --bs-primary-rgb: 230, 100, 43;
    --bs-link-color: #e6642b;
    --bs-link-color-rgb: 230, 100, 43;
    --bs-link-hover-color: #f07840;
    --bs-link-hover-color-rgb: 240, 120, 64;
}

/* Denovo custom variables (alias - kept for backward compat with module CSS) */
:root {
    --bg-dark: #1a1a1a;
    --bg-sidebar: #252525;
    --bg-card: #2d2d2d;
    --bg-card-elevated: #353535;
    --bg-hover: #3a3a3a;
    --bg-input: #222222;
    --text-primary: #f0f0f0;
    --text-secondary: #a0a0a0;
    --text-muted: #888888;
    --text-tertiary: #606060;
    --accent-orange: #e6642b;
    --accent-orange-light: #f07840;
    --border-color: #3a3a3a;
    --accent-teal: #0891b2;
    --accent-teal-light: #22d3ee;
    --font-family-heading: 'DM Sans', system-ui, -apple-system, sans-serif;
    --font-size-base: 16px;
    --sidebar-width: 300px;
}

/* ==========================================================================
   Typography - DM Sans for headings, improved scale
   ========================================================================== */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--font-family-heading);
}

h1, .h1 { font-weight: 600; }
h2, .h2 { font-weight: 600; }
h3, .h3 { font-weight: 500; }

/* ==========================================================================
   Secondary accent color (teal) - for info-type elements
   ========================================================================== */
.text-teal { color: var(--accent-teal); }
.text-teal-light { color: var(--accent-teal-light); }

/* Links in body text use teal to free orange for CTAs */
.main-content a:not(.btn):not(.back-link):not(.nav-link):not([class*="status"]) {
    color: var(--accent-teal-light);
    transition: color 0.15s ease;
}
.main-content a:not(.btn):not(.back-link):not(.nav-link):not([class*="status"]):hover {
    color: #67e8f9;
}

/* Info alert uses teal instead of generic blue */
.alert-info {
    background: rgba(8, 145, 178, 0.12);
    border-color: rgba(8, 145, 178, 0.3);
    color: var(--accent-teal-light);
}

/* ==========================================================================
   Bootstrap component overrides for Denovo style
   ========================================================================== */

/* Primary button = orange Denovo */
.btn-primary {
    --bs-btn-bg: #e6642b;
    --bs-btn-border-color: #e6642b;
    --bs-btn-hover-bg: #f07840;
    --bs-btn-hover-border-color: #f07840;
    --bs-btn-active-bg: #d4581f;
    --bs-btn-active-border-color: #d4581f;
    --bs-btn-color: #fff;
}

/* Secondary button = subtle fill style */
.btn-secondary {
    --bs-btn-bg: rgba(255, 255, 255, 0.06);
    --bs-btn-border-color: rgba(255, 255, 255, 0.12);
    --bs-btn-color: #f0f0f0;
    --bs-btn-hover-bg: rgba(255, 255, 255, 0.1);
    --bs-btn-hover-border-color: #e6642b;
    --bs-btn-hover-color: #e6642b;
    --bs-btn-active-bg: rgba(230, 100, 43, 0.15);
    --bs-btn-active-border-color: #e6642b;
    --bs-btn-active-color: #e6642b;
}

/* Danger button */
.btn-danger {
    --bs-btn-bg: #ef4444;
    --bs-btn-border-color: #ef4444;
    --bs-btn-hover-bg: #dc2626;
    --bs-btn-hover-border-color: #dc2626;
    --bs-btn-active-bg: #b91c1c;
    --bs-btn-active-border-color: #b91c1c;
}

/* Cards - elevated with shadow, no border */
.card {
    --bs-card-bg: var(--bg-sidebar);
    --bs-card-border-color: transparent;
    --bs-card-cap-bg: var(--bg-dark);
    --bs-card-border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Form controls - dark inputs, slightly elevated from body bg */
.form-control, .form-select {
    background-color: var(--bg-input);
    border-color: var(--border-color);
    color: var(--text-primary);
    font-size: 1rem;
    padding: 0.45rem 0.65rem;
    border-radius: 8px;
}

.form-control:focus, .form-select:focus {
    background-color: var(--bg-input);
    border-color: var(--accent-orange);
    color: var(--text-primary);
    box-shadow: 0 0 0 0.2rem rgba(230, 100, 43, 0.25);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-label {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 0.3rem;
}

/* Alerts - compact sizing + Denovo dark colors */
.alert {
    padding: 0.6rem 0.8rem;
    font-size: 1rem;
}

.alert-success {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.3);
    color: #10b981;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.3);
    color: #f59e0b;
}

/* alert-info defined in Typography section above (uses teal) */

/* Tables */
.table {
    --bs-table-bg: var(--bg-sidebar);
    --bs-table-border-color: var(--border-color);
    --bs-table-color: var(--text-primary);
    --bs-table-hover-bg: var(--bg-hover);
    font-size: 1rem;
}

.table th {
    background: var(--bg-dark);
    color: var(--text-muted);
    font-size: 0.95rem;
    text-transform: uppercase;
    font-weight: 500;
    letter-spacing: 0.05em;
}

/* Zebra striping for readability */
.table > tbody > tr:nth-child(even) > td {
    background: rgba(255, 255, 255, 0.02);
}

/* Table rounded corners wrapper */
.table-rounded {
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.table-rounded .table {
    margin-bottom: 0;
}

/* Badge overrides */
.badge {
    font-size: 0.9rem;
    font-weight: 500;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px var(--bg-input) inset !important;
    -webkit-text-fill-color: var(--text-primary) !important;
    caret-color: var(--text-primary);
}

/* Compact button sizes to match Denovo design */
.btn {
    font-size: 1rem;
    padding: 0.45rem 0.85rem;
    line-height: 1;
    transition: all 0.15s ease;
}

.btn:active {
    transform: scale(0.97);
}

.btn-sm {
    font-size: 0.95rem;
    padding: 0.3rem 0.55rem;
}

/* ==========================================================================
   Focus-visible: show focus ring only for keyboard navigation
   ========================================================================== */
.btn:focus:not(:focus-visible),
.form-control:focus:not(:focus-visible),
.form-select:focus:not(:focus-visible) {
    box-shadow: none;
}

/* ==========================================================================
   Page content fade-in animation
   ========================================================================== */
@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.main-content > * {
    animation: fadeSlideIn 0.2s ease-out;
}

/* ==========================================================================
   Autofill override (updated bg)
   ========================================================================== */
