:root {
    --navbar-height: 60px;
    --footer-height: 36px;
}
body { font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; }
body.has-navbar { padding-top: var(--navbar-height); }
.app-navbar {
    background: #fff; border-bottom: 1px solid #e2e8f0;
    height: var(--navbar-height); box-shadow: 0 1px 3px rgba(0,0,0,.04);
    padding: 0;
}
.app-navbar .container-fluid { height: 100%; }
.app-navbar .navbar-brand {
    margin-right: 1rem; padding: 0; gap: .6rem;
    color: #1e293b; height: 100%; align-items: center;
}
.app-navbar .navbar-brand img { background: #f8fafc; padding: 2px; flex-shrink: 0; }
.app-navbar .navbar-brand .brand-name { font-size: .9rem; line-height: 1.15; }
.app-navbar .navbar-brand .brand-address { font-size: .68rem; line-height: 1.15; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-navbar .navbar-toggler { border: 1px solid #e2e8f0; padding: .25rem .5rem; }
.app-navbar .navbar-nav { height: 100%; align-items: center; }
.app-navbar .nav-link {
    color: #475569; font-size: .85rem; font-weight: 500;
    padding: .4rem .65rem; display: flex; align-items: center; gap: .3rem;
    border-radius: .375rem; transition: .12s; white-space: nowrap; cursor: pointer;
}
.app-navbar .nav-link:hover { color: #0d6efd; background: #f1f5f9; }
.app-navbar .nav-link.active { color: #0d6efd; background: #e0e7ff; }
.app-navbar .nav-link i { font-size: .95rem; }
.app-navbar .dropdown-toggle::after { margin-left: .35rem; font-size: .7rem; }
.app-navbar .dropdown-menu {
    border: 1px solid #e2e8f0; box-shadow: 0 6px 16px rgba(0,0,0,.08);
    border-radius: .5rem; padding: .3rem; min-width: 210px; margin-top: .25rem;
}
.app-navbar .dropdown-item {
    padding: .45rem .7rem; border-radius: .3rem; font-size: .85rem;
    color: #334155; display: flex; align-items: center; gap: .5rem;
}
.app-navbar .dropdown-item:hover { background: #f1f5f9; color: #0d6efd; }
.app-navbar .dropdown-item i { width: 18px; text-align: center; font-size: .9rem; }
.app-navbar .dropdown-item.active { background: #e0e7ff; color: #0d6efd; }
.app-navbar .dropdown-divider { margin: .25rem 0; }
.app-navbar .navbar-nav .nav-item:last-child .dropdown-menu { right: 0; }
.app-content { min-height: calc(100vh - var(--navbar-height)); background: #f1f5f9; padding-bottom: var(--footer-height); }
.app-content.has-breadcrumb { padding-top: 0; }
.app-breadcrumb {
    position: fixed; top: var(--navbar-height); left: 0; right: 0; z-index: 1019;
    background: #fff; border-bottom: 1px solid #e2e8f0;
    padding: .35rem 0; font-size: .8rem;
}
.app-breadcrumb .breadcrumb { padding: 0; margin: 0; }
.app-breadcrumb .breadcrumb-item a { color: #64748b; text-decoration: none; }
.app-breadcrumb .breadcrumb-item a:hover { color: #0d6efd; }
.app-breadcrumb .breadcrumb-item.active { color: #1e293b; font-weight: 500; }
.app-breadcrumb .breadcrumb-item + .breadcrumb-item::before { content: '/'; color: #cbd5e1; }
.app-content.has-breadcrumb { margin-top: 32px; }
.nav-search { width: 200px; }
.nav-search .input-group { height: 32px; }
.nav-search .input-group-text { padding: .25rem .5rem; color: #94a3b8; }
.nav-search .form-control { padding: .25rem .5rem; font-size: .8rem; }
.nav-search .form-control:focus { box-shadow: none; border-color: #0d6efd; }
.app-footer {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 1020;
    background: #fff; border-top: 1px solid #e2e8f0;
    padding: 0 1rem; margin: 0;
    font-size: .75rem; color: #94a3b8;
    display: flex; align-items: center; justify-content: center; gap: .25rem;
    height: var(--footer-height);
}
.app-footer strong { color: #475569; }
@media (max-width: 991px) {
    .app-navbar .navbar-collapse {
        position: absolute; top: 100%; left: 0; right: 0;
        background: #fff; border-bottom: 1px solid #e2e8f0;
        box-shadow: 0 4px 12px rgba(0,0,0,.08); padding: .5rem 1rem; max-height: 70vh; overflow-y: auto;
    }
    .app-navbar .navbar-nav { height: auto; align-items: flex-start; }
    .app-navbar .navbar-nav .nav-item { width: 100%; }
    .app-navbar .navbar-nav .dropdown-menu { position: static; box-shadow: none; border: none; min-width: 100%; margin: 0; }
}
.card { border: none; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.card-header { font-size: .85rem; }
.card-body { font-size: .85rem; }
.form-label { font-size: .85rem; margin-bottom: .35rem; }
.form-control, .form-select { font-size: .85rem; }
.form-control-sm, .form-select-sm { font-size: .8rem; }
.form-text { font-size: .75rem; }
.btn { font-size: .85rem; }
.btn-sm { font-size: .8rem; }
.btn-lg { font-size: .95rem; }
.table { font-size: .8rem; }
.table th { font-size: .72rem; text-transform: uppercase; letter-spacing: .03em; color: #64748b; font-weight: 600; padding: .4rem .5rem; }
.table td { font-size: .8rem; padding: .35rem .5rem; vertical-align: middle; }
.table-sm td, .table-sm th { font-size: .75rem; padding: .25rem .4rem; }
.table > :not(caption) > * > * { padding: .35rem .5rem; }
.card .table { margin-bottom: 0; }
.card .table thead th { border-bottom: 2px solid #e2e8f0; background: #f8fafc; }
.card .table tbody tr:hover { background: #f1f5f9; }
.badge { font-size: .75rem; font-weight: 500; }
.text-muted { font-size: .8rem; }
.small { font-size: .8rem; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.15rem; }
h4 { font-size: 1.05rem; }
h5 { font-size: .95rem; }
h6 { font-size: .88rem; }
.alert { font-size: .85rem; }
.dropdown-menu { font-size: .85rem; }
.dropdown-item { font-size: .85rem; }
.modal-title { font-size: 1rem; }
.modal-body { font-size: .85rem; }
.page-title { font-size: 1.05rem; font-weight: 600; }
.stat-card { border-left: 4px solid var(--bs-primary); }
.stat-card.emergency { border-left-color: #dc3545; }
.stat-card.high { border-left-color: #fd7e14; }
.stat-card.normal { border-left-color: #0dcaf0; }
.stat-card.low { border-left-color: #6c757d; }
.stat-card.overdue { border-left-color: #dc3545; }
.stat-number { font-size: 1.5rem; font-weight: 700; line-height: 1; }
/* Dashboard stat card colors by function */
.stat-card { border-left: 4px solid #dee2e6; transition: transform .15s; }
.stat-card:hover { transform: translateY(-2px); }
.stat-card.stat-new { border-left-color: #0d6efd; }
.stat-card.stat-new .stat-number { color: #0d6efd; }
.stat-card.stat-new .stat-icon { color: #0d6efd; opacity: .5; }
.stat-card.stat-verification { border-left-color: #6f42c1; }
.stat-card.stat-verification .stat-number { color: #6f42c1; }
.stat-card.stat-verification .stat-icon { color: #6f42c1; opacity: .5; }
.stat-card.stat-assigned { border-left-color: #0dcaf0; }
.stat-card.stat-assigned .stat-number { color: #0d6efd; }
.stat-card.stat-assigned .stat-icon { color: #0dcaf0; opacity: .6; }
.stat-card.stat-progress { border-left-color: #fd7e14; }
.stat-card.stat-progress .stat-number { color: #fd7e14; }
.stat-card.stat-progress .stat-icon { color: #fd7e14; opacity: .5; }
.stat-card.stat-waiting { border-left-color: #ffc107; }
.stat-card.stat-waiting .stat-number { color: #b8860b; }
.stat-card.stat-waiting .stat-icon { color: #ffc107; opacity: .6; }
.stat-card.stat-completed { border-left-color: #198754; }
.stat-card.stat-completed .stat-number { color: #198754; }
.stat-card.stat-completed .stat-icon { color: #198754; opacity: .5; }
.stat-card.stat-reopened { border-left-color: #dc3545; }
.stat-card.stat-reopened .stat-number { color: #dc3545; }
.stat-card.stat-reopened .stat-icon { color: #dc3545; opacity: .5; }
.stat-card.stat-closed { border-left-color: #6c757d; }
.stat-card.stat-closed .stat-number { color: #495057; }
.stat-card.stat-closed .stat-icon { color: #6c757d; opacity: .5; }
.stat-card.stat-overdue { border-left-color: #dc3545; background: #fff5f5; }
.stat-card.stat-overdue .stat-number { color: #dc3545; }
.stat-card.stat-overdue .stat-icon { color: #dc3545; opacity: .6; }
.stat-card.stat-processing { border-left-color: #0d6efd; }
.stat-card.stat-processing .stat-number { color: #0d6efd; }
.stat-card.stat-processing .stat-icon { color: #0d6efd; opacity: .5; }
.stat-card.stat-assigned-today { border-left-color: #0d6efd; }
.stat-card.stat-assigned-today .stat-number { color: #0d6efd; }
.stat-card.stat-assigned-today .stat-icon { color: #0d6efd; opacity: .5; }
.stat-card .stat-icon { position: absolute; right: .8rem; top: .8rem; font-size: 1.5rem; }
.timeline { list-style: none; padding-left: 1.5rem; position: relative; }
.timeline::before { content:''; position:absolute; left:.4rem; top:0; bottom:0; width:2px; background:#e2e8f0; }
.timeline-item { position: relative; padding-bottom: 1rem; }
.timeline-item::before { content:''; position:absolute; left:-1.35rem; top:.3rem; width:12px; height:12px; border-radius:50%; background:var(--bs-primary); border:2px solid #fff; }

/* Work stage entries in history - distinct, clearer styling */
.timeline-item.timeline-progress {
    background: #f0f7ff;
    border-left: 3px solid #0d6efd;
    padding: .6rem .8rem;
    margin-left: -.5rem;
    border-radius: .375rem;
}
.timeline-item.timeline-progress::before {
    background: #0d6efd;
    width: 14px;
    height: 14px;
    left: -1.45rem;
    top: .8rem;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, .2);
}
.progress-stage-badge {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    background: linear-gradient(135deg, #0d6efd, #6610f2);
    color: #fff;
    padding: .3rem .7rem;
    border-radius: 1rem;
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
    margin-bottom: .35rem;
}
.progress-stage-badge i { font-size: .9rem; }
.progress-stage-detail {
    background: #fff;
    border: 1px solid #b6d4fe;
    border-radius: .375rem;
    padding: .4rem .6rem;
    margin-top: .35rem;
    font-size: .9rem;
    color: #0d6efd;
    display: flex;
    align-items: flex-start;
    gap: .3rem;
}
.progress-stage-detail strong { color: #032d5f; font-weight: 600; }
.wo-emergency { border-left: 4px solid #dc3545 !important; }
.btn-sm i { font-size: .8rem; }
.nav-tabs .nav-link { font-size: .85rem; }
.stat-card .stat-icon { position: absolute; right: .8rem; top: .8rem; font-size: 1.3rem; }
