@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* ============ Theme tokens (InApp-inspired) ============ */
:root {
    --bs-primary: #E66239;
    --bs-primary-rgb: 230, 98, 57;
    --bs-success: #00C951;   --bs-success-rgb: 0, 201, 81;
    --bs-info: #00B8DB;      --bs-info-rgb: 0, 184, 219;
    --bs-warning: #F0B100;   --bs-warning-rgb: 240, 177, 0;
    --bs-danger: #FB2C36;    --bs-danger-rgb: 251, 44, 54;
    --bs-body-font-family: 'Poppins', system-ui, sans-serif;
    --bs-body-font-size: .875rem;
    --bs-body-color: #404040;
    --bs-body-bg: #fafafa;
    --bs-border-color: #e5e5e5;
    --bs-secondary-color: #737373;
    --bs-link-color: #404040;
    --bs-link-color-rgb: 64, 64, 64;
    --bs-link-hover-color: #E66239;
    --bs-heading-color: #171717;
    --sidebar-w: 248px;
}

body { font-family: var(--bs-body-font-family); background: var(--bs-body-bg); color: var(--bs-body-color); }
h1,h2,h3,h4,h5,h6 { color: var(--bs-heading-color); }

/* Buttons / accents recolored to orange */
.btn-primary {
    --bs-btn-bg: #E66239; --bs-btn-border-color: #E66239; --bs-btn-color: #fff;
    --bs-btn-hover-bg: #cf5530; --bs-btn-hover-border-color: #cf5530; --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: #b94a29; --bs-btn-active-border-color: #b94a29;
    --bs-btn-disabled-bg: #E66239; --bs-btn-disabled-border-color: #E66239;
}
.btn-outline-primary {
    --bs-btn-color: #E66239; --bs-btn-border-color: #E66239;
    --bs-btn-hover-bg: #E66239; --bs-btn-hover-border-color: #E66239; --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: #E66239; --bs-btn-active-border-color: #E66239;
}
.text-primary { color: #E66239 !important; }
.link-primary { color: #E66239 !important; }
.form-check-input:checked { background-color: #E66239; border-color: #E66239; }
.form-control:focus, .form-select:focus { border-color: #f0a487; box-shadow: 0 0 0 .2rem rgba(230,98,57,.15); }
a { text-decoration: none; }

.card { border: 1px solid var(--bs-border-color); border-radius: .65rem; }
.table { --bs-table-color: #404040; }
.table thead th { font-weight: 500; color: #737373; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; background: #fafafa; }

/* ============ Icon shapes / avatars ============ */
.icon-shape { display: inline-flex; align-items: center; justify-content: center; text-align: center; }
.icon-md { width: 2.75rem; height: 2.75rem; font-size: 1.25rem; }
.icon-sm { width: 2.1rem; height: 2.1rem; font-size: 1rem; }
.avatar { display: inline-flex; align-items: center; justify-content: center; }
.avatar-sm { width: 2rem; height: 2rem; }
.avatar-md { width: 2.5rem; height: 2.5rem; }
.avatar-initials { display: inline-flex; align-items: center; justify-content: center; width: 100%; height: 100%; text-transform: uppercase; font-weight: 600; }
.avatar-primary .avatar-initials { background: #E66239; color: #fff; }

.btn-icon { display: inline-flex; align-items: center; justify-content: center; padding: 0; width: 2.3rem; height: 2.3rem; }
.btn-icon.btn-sm { width: 2rem; height: 2rem; }

/* ============ Sidebar ============ */
.sidebar {
    width: var(--sidebar-w); background: #fff; border-right: 1px solid var(--bs-border-color);
    height: 100vh; position: fixed; top: 0; left: 0; padding-top: 62px; z-index: 1030;
    transition: width .25s, left .25s; overflow-y: auto;
}
.sidebar .logo-area {
    position: absolute; top: 0; left: 0; height: 62px; width: 100%; background: #fff;
    display: flex; align-items: center; gap: .6rem; padding-left: 20px;
    border-bottom: 1px solid var(--bs-border-color); font-weight: 700; font-size: 1.15rem; color: #171717;
}
.sidebar .logo-area .brand-icon {
    width: 34px; height: 34px; border-radius: 9px; background: #E66239; color: #fff;
    display: inline-flex; align-items: center; justify-content: center; font-size: 1.15rem;
}
.sidebar .nav-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .07em; color: #a3a3a3; padding: 1rem 1.4rem .35rem; font-weight: 600; }
.sidebar .nav-link {
    color: #404040; padding: .55rem .7rem; display: flex; align-items: center; gap: .75rem;
    font-size: .875rem; margin: 2px 12px; border-radius: 8px; white-space: nowrap;
}
.sidebar .nav-link .ti { font-size: 1.2rem; }
.sidebar .nav-link:hover { color: #E66239; background: rgba(230,98,57,.09); }
.sidebar .nav-link.active { color: #E66239; background: rgba(230,98,57,.11); font-weight: 500; }
.sidebar.collapsed { width: 66px; }
.sidebar.collapsed .nav-text, .sidebar.collapsed .nav-label, .sidebar.collapsed .logo-text { display: none; }
.sidebar.collapsed .nav-link { justify-content: center; margin: 2px 8px; }

/* ============ Topbar / content ============ */
.topbar { height: 62px; margin-left: var(--sidebar-w); transition: margin-left .25s; z-index: 1020; }
.topbar.full { margin-left: 66px; }
.content { margin-left: var(--sidebar-w); transition: margin-left .25s; padding: 1.75rem; min-height: calc(100vh - 62px); margin-top: 62px; }
.content.full { margin-left: 66px; }

.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: none; z-index: 1029; }
.overlay.show { display: block; }

@media (max-width: 992px) {
    .sidebar { left: calc(-1 * var(--sidebar-w)); }
    .sidebar.mobile-show { left: 0; }
    .topbar, .content { margin-left: 0 !important; }
}

/* ============ Helper classes ============ */
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; flex-wrap: wrap; gap: .75rem; }
.page-head h1 { font-size: 1.5rem; font-weight: 600; margin: 0; }
.pill { padding: .28rem .6rem; border-radius: 6px; font-size: .74rem; font-weight: 500; display: inline-block; }
.pill-status { background: rgba(230,98,57,.1); color: #b94a29; }
.badge-urg-High { background: rgba(251,44,54,.12); color: #c81e2e; }
.badge-urg-Medium { background: rgba(240,177,0,.15); color: #a67c00; }
.badge-urg-Low { background: rgba(0,201,81,.13); color: #0a8f42; }
.stat-card { border-radius: .65rem; padding: 1.25rem; }
.notif-badge { font-size: .6rem; }

/* Overdue highlighting (Job listing) */
.row-overdue > td { background: rgba(251,44,54,.09) !important; }
.row-overdue:hover > td { background: rgba(251,44,54,.14) !important; }
.row-overdue > td:first-child { box-shadow: inset 3px 0 0 0 #FB2C36; }
.btn-toggle { line-height: 1; }
.btn-toggle .ti { transition: transform .15s; }

/* ============ Auth ============ */
.auth-body { min-height: 100vh; background: #fafafa; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.auth-card { width: 100%; max-width: 430px; }
.auth-logo-icon { width: 46px; height: 46px; border-radius: 12px; background: #E66239; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 1.5rem; }

/* Global: enabled text-accepting controls should have white background; do not override disabled controls */
input:not([disabled]):not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=submit]):not([type=reset]):not([type=file]) ,
input[type="text"]:not([disabled]),
input[type="date"]:not([disabled]),
input[type="number"]:not([disabled]),
input[type="datetime-local"]:not([disabled]),
input[type="email"]:not([disabled]),
input[type="tel"]:not([disabled]),
input[type="search"]:not([disabled]),
input[type="password"]:not([disabled]),
textarea:not([disabled]),
select:not([disabled]),
.form-control:not([disabled]),
.form-select:not([disabled]) {
    background-color: #ffffff !important;
}
