:root {
    --brand-primary: #ff4d0f;
    --brand-dark: #c93d0c;
    --brand-deep: #7a2a0d;
    --brand-soft: #ffe9e0;
    --sidebar-bg: #7a2a0d;
    --sidebar-bg-2: #a43710;
    --sidebar-border: rgba(255, 255, 255, 0.2);
    --page-bg: #eef0f6;
    --card-border: #dfe4ef;
    --text-main: #273043;
    --muted: #64748b;
    --success-soft: #e7f7ef;
    --warning-soft: #fff4d8;
    --danger-soft: #fde7e4;
}

html,
body {
    min-height: 100%;
}

body.isas-body {
    margin: 0;
    background: var(--page-bg);
    color: var(--text-main);
    font-family: "Segoe UI", "Noto Sans", "Helvetica Neue", Arial, sans-serif;
}

a {
    text-decoration: none;
}

.isas-logo-light,
.isas-logo-dark {
    width: 152px;
    height: 42px;
    object-fit: contain;
}

.isas-guest-topbar,
.isas-guest-footer,
.isas-topbar {
    background: #fff;
    border-color: #dde2ec;
}

.isas-guest-topbar {
    min-height: 60px;
    border-bottom: 1px solid #dde2ec;
}

.isas-guest-main {
    min-height: calc(100vh - 106px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.25rem 1rem 3rem;
}

.isas-guest-footer {
    min-height: 46px;
    border-top: 1px solid #dde2ec;
    color: var(--muted);
    font-size: .9rem;
}

.isas-brand-button {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: #fff;
    font-weight: 600;
}

.isas-brand-button:hover,
.isas-brand-button:focus {
    background: var(--brand-dark);
    border-color: var(--brand-dark);
    color: #fff;
}

.isas-outline-button {
    border-color: #f2a386;
    color: var(--brand-dark);
}

.isas-outline-button:hover,
.isas-outline-button:focus {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: #fff;
}

.landing-card,
.login-card,
.card {
    border: 1px solid var(--card-border);
    border-radius: 14px;
    box-shadow: 0 8px 20px rgba(11, 16, 28, 0.08);
    background: #fff;
}

.landing-card .card-body,
.login-card .card-body {
    padding: 2rem;
}

.login-card {
    width: 100%;
    max-width: 470px;
}

.login-title,
.landing-title {
    color: var(--text-main);
    font-weight: 700;
}

.form-control:focus,
.form-select:focus {
    border-color: #f2a386;
    box-shadow: 0 0 0 .2rem rgba(255, 77, 15, .12);
}

.isas-shell {
    display: flex;
    min-height: 100vh;
}

.isas-sidebar {
    width: 250px;
    flex: 0 0 250px;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    overflow-y: auto;
    background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg-2) 100%);
    color: #fff;
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    transition: width .22s ease, transform .22s ease;
    z-index: 1040;
}

.isas-sidebar-header {
    min-height: 84px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem .9rem;
    border-bottom: 1px solid var(--sidebar-border);
    background: rgba(0, 0, 0, 0.06);
}

.isas-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.isas-nav {
    flex: 1;
}

.isas-nav-section {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: rgba(255, 255, 255, .72);
    margin: .8rem .6rem .5rem;
}

.isas-nav-link {
    height: 42px;
    display: flex;
    align-items: center;
    gap: .7rem;
    color: #fff4ef;
    border-radius: 10px;
    padding: 0 .75rem;
    margin: 0 .2rem .3rem;
    border: 1px solid transparent;
}

.isas-nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
}

.isas-nav-link.active {
    background: linear-gradient(90deg, #ff5c22 0%, #ff4d0f 100%);
    color: #fff;
    box-shadow: 0 .4rem 1rem rgba(201, 61, 12, .38);
}

.isas-nav-link.disabled {
    opacity: .55;
    pointer-events: none;
}

.isas-nav-link i {
    min-width: 20px;
}

.isas-sidebar-footer {
    border-top: 1px solid var(--sidebar-border);
    padding: .85rem .8rem;
}

.isas-sidebar-clock {
    margin-bottom: .8rem;
    padding: .75rem .8rem;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff7f2;
}

.isas-sidebar-clock-time {
    font-size: 1.28rem;
    line-height: 1.1;
    font-weight: 700;
}

.isas-sidebar-clock-date {
    margin-top: .22rem;
    font-size: .86rem;
    color: rgba(255, 255, 255, 0.88);
}

.isas-logout-link {
    border: 0;
    background: transparent;
    color: #fff;
    font-weight: 700;
    padding: .35rem .5rem;
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
}

.isas-logout-link:hover,
.isas-logout-link:focus {
    color: #fff;
    background: rgba(255, 255, 255, .12);
    border-radius: 8px;
}

.isas-content {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    margin-left: 250px;
    transition: margin-left .22s ease;
    min-height: 100vh;
}

.work-plan-shell .card-body {
    padding: 1rem 1rem 1.25rem;
}

.work-plan-legend {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    align-items: center;
}

.work-plan-legend-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.85rem;
    padding: .35rem .65rem;
    border-radius: 999px;
    font-weight: 600;
    border: 1px solid transparent;
    color: #fff !important;
    background-color: #6c757d !important;
    line-height: 1;
}

.work-plan-state-created {
    background-color: #ff4d0f !important;
    border-color: #cf3f0c;
}

.work-plan-state-progress {
    background-color: #0d6efd !important;
    border-color: #0a58ca;
}

.work-plan-state-hold {
    background-color: #f4b267 !important;
    border-color: #d9822b;
    color: #4b2e0f !important;
}

.work-plan-state-completed {
    background-color: #198754 !important;
    border-color: #146c43;
}

.work-plan-state-cancelled {
    background-color: #6c757d !important;
    border-color: #565e64;
}

#work-plan-calendar .fc {
    --fc-border-color: #dfe4ef;
    --fc-button-bg-color: #ff4d0f;
    --fc-button-border-color: #ff4d0f;
    --fc-button-hover-bg-color: #c93d0c;
    --fc-button-hover-border-color: #c93d0c;
    --fc-button-active-bg-color: #7a2a0d;
    --fc-button-active-border-color: #7a2a0d;
    --fc-today-bg-color: rgba(255, 77, 15, 0.08);
    font-size: .94rem;
}

#work-plan-calendar .fc-toolbar-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
}

#work-plan-calendar .fc-daygrid-day-number,
#work-plan-calendar .fc-col-header-cell-cushion {
    color: var(--text-main);
    text-decoration: none;
}

#work-plan-calendar .fc-event {
    border-radius: 10px;
    padding: .15rem .3rem;
    box-shadow: 0 6px 14px rgba(11, 16, 28, 0.12);
}

#work-plan-calendar .fc-event-title,
#work-plan-calendar .fc-event-main {
    color: inherit;
}

.work-plan-event-content {
    display: flex;
    flex-direction: column;
    gap: .05rem;
    line-height: 1.15;
}

.work-plan-event-request {
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .02em;
    opacity: .95;
}

.work-plan-event-title {
    font-size: .75rem;
    font-weight: 600;
    white-space: normal;
}

.isas-topbar {
    min-height: 60px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #dde2ec;
}

.isas-topbar-logout {
    line-height: 1.2;
    font-weight: 600;
}

.isas-toggle-button {
    width: 38px;
    height: 38px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: var(--brand-primary);
    color: #fff;
}

.isas-toggle-button:hover,
.isas-toggle-button:focus {
    background: var(--brand-dark);
    color: #fff;
}

.isas-main {
    flex: 1 1 auto;
    padding: 1.5rem;
}

.isas-page-header h1 {
    font-size: 2.6rem;
    line-height: 1.12;
    margin: 0;
    font-weight: 700;
}

.kpi-card .card-body {
    padding: 1.35rem;
}

.kpi-label {
    font-size: .92rem;
    color: var(--muted);
    margin-bottom: .5rem;
}

.kpi-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    color: var(--text-main);
}

.status-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .75rem .95rem;
    border-radius: 12px;
    border: 1px solid var(--card-border);
    background: #fff;
}

.status-strip strong {
    display: block;
    font-size: .95rem;
}

.status-strip span {
    color: var(--muted);
    font-size: .9rem;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex: 0 0 10px;
}

.status-indicator.success {
    background: #198754;
}

.status-indicator.warning {
    background: #f59f00;
}

.status-indicator.danger {
    background: #dc3545;
}

.module-list {
    display: grid;
    gap: .9rem;
}

.module-item {
    display: flex;
    gap: .9rem;
    align-items: flex-start;
    padding: .85rem 0;
    border-bottom: 1px solid #edf1f7;
}

.module-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.module-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--brand-soft);
    color: var(--brand-dark);
    flex: 0 0 42px;
}

.module-item.py-2 {
    padding-top: .5rem;
    padding-bottom: .5rem;
}

.workflow-list {
    display: grid;
    gap: 1rem;
}

.workflow-step {
    display: grid;
    gap: .3rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #edf1f7;
}

.workflow-step:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.workflow-step strong {
    font-size: .96rem;
    color: var(--text-main);
}

.workflow-step span {
    font-size: .9rem;
    color: var(--muted);
}

.soft-panel {
    border-radius: 12px;
    padding: 1rem 1.1rem;
    border: 1px solid var(--card-border);
}

.soft-panel.success {
    background: var(--success-soft);
}

.soft-panel.warning {
    background: var(--warning-soft);
}

.soft-panel.danger {
    background: var(--danger-soft);
}

.table-shell {
    overflow: hidden;
}

.branch-table-shell .card-header {
    background: #fff;
}

.isas-branch-toolbar .input-group-text {
    border-color: var(--card-border);
}

.branch-row {
    cursor: pointer;
}

.branch-row:focus {
    outline: 0;
    box-shadow: inset 0 0 0 2px rgba(255, 77, 15, .16);
}

.branch-primary {
    font-size: 1.03rem;
    font-weight: 700;
    color: var(--text-main);
}

.branch-secondary {
    color: var(--muted);
    font-size: .92rem;
    margin-top: .2rem;
}

.branch-flags {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
}

.isas-detail-drawer {
    --bs-offcanvas-width: min(760px, 100vw);
    width: var(--bs-offcanvas-width);
}

.isas-detail-drawer.is-fullscreen {
    --bs-offcanvas-width: 100vw;
    width: 100vw !important;
    max-width: 100vw !important;
}

.isas-detail-drawer .offcanvas-header {
    border-bottom: 1px solid var(--card-border);
    background: #fff;
}

.isas-detail-drawer .offcanvas-body {
    background: #f7f9fd;
    padding: 1rem;
}

.isas-drawer-header-actions {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    margin-left: auto;
}

.isas-drawer-toggle {
    width: 2.2rem;
    height: 2.2rem;
    border: 0;
    background: transparent;
    color: var(--muted);
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.isas-drawer-toggle:hover,
.isas-drawer-toggle:focus {
    background: #f2f4fa;
    color: var(--text-main);
}

.branch-drawer-summary {
    display: flex;
    flex-direction: column;
    gap: .9rem;
    padding: 1rem;
    border: 1px solid var(--card-border);
    border-radius: 14px;
    background: #fff;
}

.branch-summary-main {
    display: flex;
    align-items: flex-start;
    gap: .9rem;
}

.branch-summary-code {
    font-size: .95rem;
    padding: .45rem .7rem;
}

.branch-summary-text {
    display: grid;
    gap: .2rem;
}

.branch-summary-text strong {
    font-size: 1.2rem;
    line-height: 1.2;
}

.branch-summary-text span {
    color: var(--muted);
    font-size: .92rem;
}

.branch-summary-badges {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
}

.branch-form-section {
    margin-bottom: 1rem;
    padding: 1rem;
    border: 1px solid var(--card-border);
    border-radius: 14px;
    background: #fff;
}

.branch-section-title {
    font-size: .94rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: .9rem;
}

.isas-map-shell {
    border: 1px solid var(--card-border);
    border-radius: 12px;
    background: #fbfcfe;
    padding: .9rem;
}

.isas-location-map {
    width: 100%;
    min-height: 320px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #d7deeb;
    background: linear-gradient(180deg, #eef3fb 0%, #e4ebf6 100%);
}

.isas-map-shell .form-text {
    color: var(--muted);
}

.isas-map-shell .input-group .btn {
    white-space: nowrap;
}

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

.table-shell thead th {
    background: #f8fafc;
    color: #475569;
    font-size: .85rem;
    font-weight: 700;
    border-bottom-color: var(--card-border);
}

.badge-soft {
    background: var(--brand-soft);
    color: var(--brand-dark);
    border: 1px solid #f4c5b5;
}

.status-badge-warning {
    background: var(--warning-soft);
    color: #8a5a00;
    border: 1px solid #e7c46a;
}

.status-badge-danger {
    background: var(--danger-soft);
    color: #a53a24;
    border: 1px solid #e6b5ab;
}

.status-badge-success {
    background: var(--success-soft);
    color: #166c43;
    border: 1px solid #add9c1;
}

.isas-toast {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-dark) 100%);
    color: #fff;
    box-shadow: 0 10px 28px rgba(122, 42, 13, 0.28);
}

.isas-toast.isas-toast-error {
    background: linear-gradient(135deg, #d2552d 0%, var(--brand-deep) 100%);
}

.isas-toast .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

.isas-topbar-profile-link {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: inherit;
    text-decoration: none;
}

.isas-topbar-profile-link:hover {
    color: inherit;
}

.isas-topbar-avatar-shell {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 999px;
    overflow: hidden;
    background: linear-gradient(135deg, #ff6b1a, #8f2f0e);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.isas-topbar-avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.isas-topbar-profile-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.isas-topbar-profile-name {
    font-size: 0.95rem;
    color: #334155;
}

.isas-topbar-profile-link-label {
    font-size: 0.75rem;
    color: #64748b;
}

.profile-card {
    border-radius: 1rem;
}

.profile-photo-panel {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
    text-align: center;
}

.profile-photo-frame {
    width: 8rem;
    height: 8rem;
    border-radius: 1.25rem;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ff6b1a, #8f2f0e);
    color: #fff;
    font-size: 2rem;
    font-weight: 700;
    box-shadow: 0 18px 45px rgba(143, 47, 14, 0.22);
}

.profile-photo-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.profile-photo-placeholder-icon {
    width: 100%;
    height: 100%;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    background: linear-gradient(180deg, #fff4ef 0%, #ffe4d6 100%);
    color: var(--brand-dark);
}

.profile-photo-placeholder-icon i {
    font-size: 2rem;
    line-height: 1;
}

.profile-photo-placeholder-icon small {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-transform: uppercase;
}

.profile-readonly-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem 1.25rem;
}

.profile-meta-label {
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 0.25rem;
}

.profile-meta-value {
    color: #1e293b;
    font-weight: 500;
}

.profile-inline-alert {
    margin-bottom: 1rem;
}

@media (max-width: 767.98px) {
    .profile-readonly-grid {
        grid-template-columns: 1fr;
    }

    .isas-topbar-profile-meta {
        display: none;
    }
}

.mini-progress {
    height: 8px;
    border-radius: 999px;
    background: #eef2f7;
    overflow: hidden;
}

.mini-progress > span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #ff5c22 0%, #ff4d0f 100%);
}

.empty-state-icon {
    width: 58px;
    height: 58px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--brand-soft);
    color: var(--brand-dark);
}

.isas-sidebar-backdrop {
    display: none;
}

body.sidebar-collapsed .isas-sidebar {
    width: 84px;
    flex-basis: 84px;
}

body.sidebar-collapsed .isas-content {
    margin-left: 84px;
}

body.sidebar-collapsed .isas-nav-section,
body.sidebar-collapsed .isas-nav-link span,
body.sidebar-collapsed .isas-logout-link span,
body.sidebar-collapsed .isas-sidebar-clock {
    display: none !important;
}

body.sidebar-collapsed .isas-sidebar-header,
body.sidebar-collapsed .isas-sidebar-footer {
    justify-content: center;
}

body.sidebar-collapsed .isas-nav-link,
body.sidebar-collapsed .isas-logout-link {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

body.sidebar-collapsed .isas-logo-light {
    width: 38px;
    height: 38px;
}

.work-order-assignee-picker {
    position: relative;
    overflow: visible;
    isolation: isolate;
}

.work-order-assignee-search {
    position: relative;
    overflow: visible;
    z-index: 80;
}

.work-order-assignee-results {
    position: absolute;
    top: calc(100% + 0.35rem);
    left: 0;
    right: 0;
    z-index: 2000;
    max-height: 240px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 0.9rem;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.16);
}

.work-order-location-results {
    padding: 0.4rem;
}

.work-order-location-results .list-group-item {
    margin-bottom: 0.35rem;
    border-radius: 0.7rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.work-order-location-results .list-group-item:last-child {
    margin-bottom: 0;
}

.work-order-assignee-selected {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.work-order-assignee-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.8rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 0.95rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.98) 100%);
}

.work-order-assignee-chip-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.work-order-assignee-chip-text strong,
.work-order-assignee-chip-text span {
    line-height: 1.2;
}

.work-order-assignee-chip-text span {
    color: #64748b;
    font-size: 0.82rem;
}

.work-order-assignee-chip-remove {
    border: 0;
    background: transparent;
    color: #9ca3af;
    padding: 0;
    line-height: 1;
}

.work-order-assignee-chip-remove:hover {
    color: var(--isas-brand, #ff5a1f);
}

.work-order-assignee-picker.is-locked .work-order-assignee-chip {
    background: #f8fafc;
}

.isas-chart-panel {
    position: relative;
    min-height: 320px;
}

.isas-chart-panel canvas {
    width: 100% !important;
    height: 320px !important;
}

@media (max-width: 991px) {
    .isas-sidebar {
        transform: translateX(-100%);
        width: 250px;
        flex: 0 0 250px;
    }

    .isas-content {
        margin-left: 0;
        min-height: 100vh;
    }

    body.sidebar-open .isas-sidebar {
        transform: translateX(0);
    }

    body.sidebar-open .isas-sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.42);
        z-index: 1035;
    }

    body.sidebar-collapsed .isas-content {
        margin-left: 0;
    }

    .isas-page-header h1 {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .isas-logo-dark,
    .isas-logo-light {
        width: 132px;
    }

    .landing-card .card-body,
    .login-card .card-body {
        padding: 1.4rem;
    }

    .isas-guest-main {
        padding-top: 1.4rem;
        align-items: flex-start;
    }
}
