:root {
    --wf-radius: .375rem;
    --wf-background: oklch(98% .008 75);
    --wf-card: oklch(100% 0 0);
    --wf-brand-orange: oklch(56% .18 35);
    --wf-brand-yellow: oklch(78% .2 72);
    --wf-brand-bg: oklch(98% .008 75);
    --wf-brand-dark: oklch(18% .04 45);
    --wf-primary: oklch(56% .18 35);
    --wf-secondary: oklch(48% .15 158);
    --wf-primary-soft: oklch(96% .035 78);
    --wf-accent: oklch(48% .15 158);
    --wf-sidebar-bg: oklch(22% .06 45);
    --wf-sidebar-text: oklch(92% .015 75);
    --wf-sidebar-muted: oklch(74% .025 75);
    --wf-sidebar-accent: oklch(32% .05 45);
    --wf-sidebar-border: oklch(35% .04 45);
    --wf-success: oklch(55% .16 145);
    --wf-warning: oklch(72% .18 65);
    --wf-danger: oklch(55% .22 25);
    --wf-info: oklch(55% .14 230);
    --wf-text: oklch(18% .04 45);
    --wf-muted: oklch(45% .03 45);
    --wf-muted-surface: oklch(95% .015 80);
    --wf-border: oklch(88% .025 75);
    --wf-input: oklch(92% .02 75);
    --wf-table-head: oklch(94% .02 85);
    --wf-table-hover: oklch(96% .016 82);
    --wf-shadow: 0 10px 28px color-mix(in oklch, var(--wf-brand-dark) 8%, transparent);
}

body {
    background: linear-gradient(180deg, var(--wf-background) 0%, #fff 100%);
    color: var(--wf-text);
}

.text-gradient {
    background: linear-gradient(315deg, var(--wf-primary) 0%, var(--wf-accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.pc-sidebar {
    background: var(--wf-sidebar-bg) !important;
    border-right: 1px solid var(--wf-sidebar-border);
    box-shadow: 8px 0 28px color-mix(in oklch, var(--wf-sidebar-bg) 42%, transparent) !important;
}

.pc-sidebar .m-header {
    border-bottom: 1px solid var(--wf-sidebar-border);
}

.pc-sidebar .pc-navbar {
    padding: 8px 10px 16px;
}

.pc-sidebar .pc-caption {
    padding: 22px 18px 8px !important;
}

.pc-sidebar .pc-caption label {
    color: var(--wf-sidebar-muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.pc-sidebar .pc-link {
    margin: 3px 0;
    border-radius: 10px;
    color: var(--wf-sidebar-text) !important;
    font-weight: 700;
    transition: background-color .18s ease, color .18s ease, transform .18s ease;
}

.pc-sidebar .pc-link:hover,
.pc-sidebar .pc-item.active > .pc-link,
.pc-sidebar .pc-item.pc-trigger > .pc-link {
    background: var(--wf-sidebar-accent);
    color: var(--wf-sidebar-text) !important;
    text-decoration: none;
}

.pc-sidebar .pc-link:hover {
    transform: translateX(2px);
}

.pc-sidebar .pc-micon,
.pc-sidebar .pc-link > i:first-child {
    width: 34px;
    height: 34px;
    margin-right: 10px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in oklch, var(--wf-sidebar-accent) 70%, white 4%);
    color: var(--wf-sidebar-muted);
    vertical-align: middle;
}

.pc-sidebar .pc-micon i,
.pc-sidebar .pc-link > i:first-child {
    font-size: 15px;
}

.pc-sidebar .pc-link:hover .pc-micon,
.pc-sidebar .pc-link:hover > i:first-child,
.pc-sidebar .pc-item.active > .pc-link .pc-micon,
.pc-sidebar .pc-item.active > .pc-link > i:first-child {
    background: linear-gradient(135deg, var(--wf-primary), var(--wf-brand-yellow));
    color: var(--wf-sidebar-text);
}

.pc-sidebar .card {
    background: var(--wf-sidebar-accent);
    border: 1px solid var(--wf-sidebar-border);
    border-radius: 10px;
    color: var(--wf-sidebar-text);
    box-shadow: none;
}

.pc-sidebar .card p {
    color: var(--wf-muted);
}

.pc-header {
    background: color-mix(in oklch, var(--wf-background) 82%, white 18%);
    border-bottom: 1px solid var(--wf-border);
    box-shadow: 0 8px 24px color-mix(in oklch, var(--wf-brand-dark) 5%, transparent);
}

.pc-header .pc-head-link {
    color: var(--wf-);
}

#btnToggleSidebar,
#btnCloseSideBar {
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: var(--wf-radius);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in oklch, var(--wf-brand-orange) 16%, white 84%);
    border: 1px solid color-mix(in oklch, var(--wf-brand-orange) 32%, white 68%);
    color: var(--wf-brand-dark) !important;
    box-shadow: 0 8px 18px color-mix(in oklch, var(--wf-brand-dark) 8%, transparent);
}

#btnToggleSidebar:hover,
#btnToggleSidebar:focus,
#btnCloseSideBar:hover,
#btnCloseSideBar:focus {
    background: linear-gradient(135deg, var(--wf-brand-orange), var(--wf-brand-yellow));
    border-color: transparent;
    color: white !important;
}

#btnToggleSidebar i,
#btnCloseSideBar i {
    color: inherit;
    font-size: 18px;
}

.app-page {
    padding: 10px;
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    background: linear-gradient(135deg, var(--wf-brand-orange), var(--wf-brand-yellow));
    border-radius: 12px;
    padding: 24px;
    color: white;
    box-shadow: 0 14px 32px color-mix(in oklch, var(--wf-brand-orange) 26%, transparent);
}

.app-title {
    margin: 0;
    font-size: 34px;
    font-weight: 900;
    color: inherit;
}

.app-title i {
    margin-right: 10px;
}

.app-subtitle {
    margin-top: 4px;
    opacity: .92;
}

.app-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.app-btn-light {
    border: none;
    background: white;
    color: var(--wf-brand-orange);
    border-radius: 10px;
    padding: 14px 20px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: .2s;
    text-decoration: none;
    cursor: pointer;
}

.app-btn-light:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, .12);
    color: var(--wf-brand-orange);
    text-decoration: none;
}

.app-btn-primary {
    border: none;
    border-radius: 10px;
    min-height: 52px;
    padding: 0 22px;
    background: linear-gradient(135deg, var(--wf-brand-orange), var(--wf-brand-yellow));
    color: white;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 12px 28px color-mix(in oklch, var(--wf-brand-orange) 25%, transparent);
    text-decoration: none;
    cursor: pointer;
}

.app-btn-primary:hover {
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
}

.app-icon-btn {
    width: 52px;
    height: 52px;
    border: none;
    border-radius: 10px;
    background: white;
    color: var(--wf-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .06);
}

.app-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.app-kpi-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--wf-shadow);
}

.app-kpi-icon {
    width: 62px;
    height: 62px;
    flex: 0 0 62px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.app-kpi-icon.orange {
    background: color-mix(in oklch, var(--wf-brand-orange) 14%, white);
    color: var(--wf-brand-orange);
}

.app-kpi-icon.green {
    background: color-mix(in oklch, var(--wf-success) 14%, white);
    color: var(--wf-success);
}

.app-kpi-icon.yellow {
    background: color-mix(in oklch, var(--wf-warning) 22%, white);
    color: color-mix(in oklch, var(--wf-warning) 70%, black);
}

.app-kpi-icon.red {
    background: color-mix(in oklch, var(--wf-danger) 14%, white);
    color: var(--wf-danger);
}

.app-kpi-value {
    font-size: 28px;
    font-weight: 900;
    color: var(--wf-text);
    line-height: 1.1;
}

.app-kpi-label {
    font-size: 13px;
    color: var(--wf-muted);
    margin-top: 6px;
}

.app-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.app-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    align-items: end;
    gap: 14px;
    width: 100%;
}

.app-filter-action {
    display: flex;
    align-items: flex-end;
}

.app-filter-action .app-btn-primary,
.app-filter-action .app-btn-light {
    width: 100%;
}

.app-card,
.app-table-card {
    background: white;
    border-radius: 12px;
    box-shadow: var(--wf-shadow);
}

.app-card {
    padding: 18px;
}

.app-table-card {
    padding: 10px;
    overflow: hidden;
}

.app-card-title {
    margin-bottom: 5px;
    color: var(--wf-text);
    font-size: 20px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 10px;
}

.app-card-title i {
    color: var(--wf-brand-orange);
}

.app-card-subtitle {
    margin-bottom: 18px;
    color: var(--wf-muted);
    font-size: 13px;
}

.app-search-box {
    flex: 1;
    min-width: 260px;
    height: 56px;
    background: white;
    border-radius: 10px;
    padding: 0 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--wf-shadow);
    border: 1px solid var(--wf-border);
}

.app-search-box i {
    color: var(--wf-brand-orange);
}

.app-search-box input,
.app-search-box select {
    border: none;
    outline: none;
    width: 100%;
    background: transparent;
}

.app-table {
    margin: 0;
    color: var(--wf-text);
}

.app-table thead th {
    border: none !important;
    background: var(--wf-table-head) !important;
    color: var(--wf-brand-dark) !important;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .5px;
    padding: 16px !important;
    white-space: nowrap;
}

.app-table tbody tr {
    transition: .2s;
}

.app-table tbody tr:hover {
    background: #fffaf5;
    background: var(--wf-table-hover);
}

.app-table tbody td,
.app-table tbody th {
    vertical-align: middle;
    padding: 16px !important;
    border-color: var(--wf-border) !important;
}

.app-duration {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
}

.app-duration-bar {
    width: 80px;
}

.app-map {
    width: 100%;
    height: 600px;
    min-height: 600px;
    border-radius: 12px;
    overflow: hidden;
}

.app-card > .app-map,
.app-map.leaflet-container {
    display: block;
    height: 600px !important;
}

.grid-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.grid-container {
    width: 100%;
    overflow: hidden;
    border-radius: 12px;
}

.grid-container .ui-jqgrid,
.grid-container .ui-jqgrid-view,
.grid-container .ui-jqgrid-hdiv,
.grid-container .ui-jqgrid-bdiv {
    max-width: 100% !important;
}

.grid-container .ui-jqgrid {
    border: none !important;
}

.grid-container .ui-jqgrid-hdiv,
.grid-container .ui-jqgrid-labels th {
    background: var(--wf-table-head) !important;
}

.grid-container .ui-jqgrid-labels th {
    color: var(--wf-brand-dark) !important;
    border: none !important;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.grid-container .ui-jqgrid-btable tr:hover {
    background: var(--wf-table-hover) !important;
}

.grid-container .ui-jqgrid-btable td {
    border-color: var(--wf-border) !important;
}

.app-empty {
    padding: 28px;
    text-align: center;
    color: var(--wf-muted);
}

.app-muted {
    color: var(--wf-muted);
    font-size: 14px;
    margin-bottom: 16px;
}

.app-form-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--wf-shadow);
    margin-bottom: 22px;
}

.app-form-card .form-control,
.app-form-card .form-select {
    min-height: 48px;
    border-color: var(--wf-input);
    border-radius: 8px;
    color: var(--wf-text);
    box-shadow: none;
}

.app-form-card textarea.form-control {
    min-height: 96px;
}

.app-form-card .form-control:focus,
.app-form-card .form-select:focus {
    border-color: var(--wf-brand-orange);
    box-shadow: 0 0 0 .2rem color-mix(in oklch, var(--wf-brand-orange) 18%, transparent);
}

.app-form-card label,
.app-form-label {
    color: var(--wf-brand-dark);
    font-size: 13px;
    font-weight: 800;
    margin-bottom: 8px;
}

.app-form-section {
    padding-top: 18px;
    margin-top: 18px;
    border-top: 1px solid #f1f5f9;
}

.app-form-section:first-child {
    padding-top: 0;
    margin-top: 0;
    border-top: none;
}

.app-section-title {
    margin-bottom: 16px;
    color: var(--wf-text);
    font-size: 18px;
    font-weight: 900;
    display: flex;
    align-items: center;
    gap: 10px;
}

.app-section-title i {
    color: var(--wf-brand-orange);
}

.app-form-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 20px;
    margin-top: 20px;
    border-top: 1px solid #f1f5f9;
}

.app-btn-secondary,
.app-btn-danger,
.app-btn-success {
    border: none;
    border-radius: 10px;
    min-height: 48px;
    padding: 0 20px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
    cursor: pointer;
}

.app-btn-secondary {
    background: var(--wf-muted-surface);
    color: var(--wf-text);
}

.app-btn-danger {
    background: color-mix(in oklch, var(--wf-danger) 12%, white);
    color: var(--wf-danger);
}

.app-btn-success {
    background: var(--wf-success);
    color: white;
}

.app-btn-secondary:hover,
.app-btn-danger:hover {
    color: inherit;
    text-decoration: none;
}

.app-btn-success:hover {
    color: white;
    text-decoration: none;
}

.app-detail-table {
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #f1f5f9;
}

.app-total-panel {
    max-width: 520px;
    margin-left: auto;
    background: var(--wf-table-head);
    border-radius: 12px;
    padding: 18px;
}

.app-total-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    color: var(--wf-muted);
}

.app-total-row strong {
    color: var(--wf-text);
    font-size: 18px;
}

.app-total-row.total {
    border-top: 1px solid color-mix(in oklch, var(--wf-brand-orange) 18%, transparent);
    margin-top: 8px;
    padding-top: 14px;
    color: var(--wf-brand-dark);
    font-weight: 900;
}

.app-total-row.total strong {
    color: var(--wf-brand-orange);
    font-size: 26px;
}

.direccion-item {
    border: 1px solid #f1f5f9;
    border-radius: 10px;
    box-shadow: none;
}

.app-modal .modal-content {
    border: none;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px color-mix(in oklch, var(--wf-brand-dark) 18%, transparent);
}

.app-modal .modal-header {
    background: linear-gradient(135deg, var(--wf-brand-orange), var(--wf-brand-yellow));
    color: white;
}

.app-modal .modal-title,
.app-modal .modal-header h5 {
    font-weight: 900;
}

@media (max-width: 760px) {
    .app-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 16px;
        border-radius: 10px;
        padding: 20px;
    }

    .app-title {
        font-size: 28px;
    }

    .app-actions,
    .app-btn-light,
    .app-btn-primary {
        width: 100%;
    }

    .app-page > .row > .col-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .app-filter-grid,
    .app-kpis {
        grid-template-columns: 1fr;
    }

    .app-duration {
        align-items: flex-start;
        flex-direction: column;
    }

    .app-form-card {
        padding: 18px;
        border-radius: 10px;
    }

    .app-form-actions {
        justify-content: stretch;
    }

    .app-form-actions > * {
        width: 100%;
    }

    .app-total-panel {
        max-width: 100%;
    }
}
