:root {
    --pdi-blue-900: #071e4d;
    --pdi-blue-800: #0a2d73;
    --pdi-blue-700: #1146a6;
    --pdi-blue-100: #dfe8fb;
    --pdi-white: #ffffff;
    --pdi-slate: #6f7a91;
    --pdi-border: #c8d7f6;
    --ok: #0c8f59;
    --warn: #d78512;
    --danger: #c72f3e;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: "Outfit", sans-serif;
    color: var(--pdi-blue-900);
    background:
        radial-gradient(circle at 8% 14%, #b8cbff 0%, rgba(184, 203, 255, 0) 48%),
        radial-gradient(circle at 88% 92%, #c2e1ff 0%, rgba(194, 225, 255, 0) 44%),
        linear-gradient(160deg, #edf3ff 0%, #f8fbff 52%, #eaf2ff 100%);
    min-height: 100vh;
}

.pdi-shell {
    max-width: 1180px;
    margin: 0 auto;
    padding: 24px 18px 36px;
}

.pdi-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.pdi-top-right {
    display: grid;
    gap: 8px;
    justify-items: end;
}

.pdi-user-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid var(--pdi-border);
    border-radius: 12px;
    padding: 8px 10px;
}

.pdi-user-info {
    display: grid;
    line-height: 1.1;
}

.pdi-user-info strong {
    font-size: 0.85rem;
}

.pdi-user-info span {
    font-size: 0.76rem;
    color: var(--pdi-slate);
}

.pdi-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 250px;
}

.pdi-logo-wrap {
    width: 62px;
    height: 62px;
    background: var(--pdi-white);
    border: 1px solid var(--pdi-border);
    border-radius: 16px;
    display: grid;
    place-items: center;
    box-shadow: 0 10px 28px rgba(10, 45, 115, 0.15);
}

.pdi-logo-wrap img {
    width: 44px;
    height: 44px;
    object-fit: contain;
}

.pdi-brand h1 {
    margin: 0;
    font-family: "Rajdhani", sans-serif;
    font-size: 2rem;
    letter-spacing: 0.6px;
    line-height: 1;
}

.pdi-brand p {
    margin: 5px 0 0;
    color: var(--pdi-slate);
    font-size: 0.94rem;
}

.pdi-status {
    background: linear-gradient(145deg, var(--pdi-blue-900), var(--pdi-blue-700));
    color: var(--pdi-white);
    border-radius: 14px;
    padding: 12px 16px;
    box-shadow: 0 10px 24px rgba(7, 30, 77, 0.28);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
}

.pdi-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #77ffbd;
    box-shadow: 0 0 0 5px rgba(119, 255, 189, 0.2);
    animation: pulse 1.8s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.96); opacity: 1; }
    70% { transform: scale(1.15); opacity: 0.72; }
    100% { transform: scale(0.96); opacity: 1; }
}

.pdi-grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 16px;
}

.pdi-card {
    background: var(--pdi-white);
    border: 1px solid var(--pdi-border);
    border-radius: 16px;
    box-shadow: 0 12px 30px rgba(17, 70, 166, 0.08);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pdi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 36px rgba(17, 70, 166, 0.14);
}

.pdi-card-head {
    padding: 14px 16px;
    border-bottom: 1px solid var(--pdi-border);
    background: linear-gradient(180deg, #ffffff 0%, #f3f7ff 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.pdi-card-title {
    margin: 0;
    font-size: 1rem;
    font-family: "Rajdhani", sans-serif;
    letter-spacing: 0.45px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.pdi-card-body {
    padding: 16px;
}

.pdi-search {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
}

.pdi-input,
.pdi-textarea,
.pdi-select,
.pdi-btn {
    font-family: inherit;
    font-size: 0.95rem;
    border-radius: 10px;
    border: 1px solid var(--pdi-border);
    padding: 11px 12px;
}

.pdi-input,
.pdi-textarea,
.pdi-select {
    background: #fbfdff;
    color: var(--pdi-blue-900);
    width: 100%;
}

.pdi-input:focus,
.pdi-textarea:focus,
.pdi-select:focus {
    outline: 2px solid rgba(17, 70, 166, 0.22);
    border-color: var(--pdi-blue-700);
}

.pdi-textarea {
    min-height: 86px;
    resize: vertical;
}

.pdi-btn {
    cursor: pointer;
    font-weight: 600;
    background: var(--pdi-white);
    color: var(--pdi-blue-800);
    transition: all 0.16s ease;
}

.pdi-btn:hover {
    transform: translateY(-1px);
}

.pdi-btn-primary {
    background: linear-gradient(160deg, var(--pdi-blue-800), var(--pdi-blue-700));
    color: var(--pdi-white);
    border-color: transparent;
}

.pdi-btn-ghost {
    background: #f5f8ff;
}

.pdi-ficha {
    margin-top: 14px;
    border: 1px solid var(--pdi-border);
    border-radius: 12px;
    background: #f8fbff;
    padding: 14px;
    display: none;
}

.pdi-ficha.active {
    display: block;
}

.pdi-ficha-header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}

.pdi-ficha-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #d7e5ff;
    background: #fff;
}

.pdi-ficha-main h3 {
    margin: 0;
    font-size: 1.06rem;
}

.pdi-ficha-main p {
    margin: 2px 0 8px;
    color: var(--pdi-slate);
    font-size: 0.86rem;
}

.pdi-chip-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.pdi-chip {
    border-radius: 999px;
    border: 1px solid #ccdaff;
    background: #eef4ff;
    color: #103b89;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 9px;
}

.pdi-tabs-ficha {
    margin-top: 8px;
}

.pdi-ficha-section {
    display: none;
    margin-top: 10px;
}

.pdi-ficha-section.active {
    display: block;
}

.pdi-datos-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.pdi-dato {
    border: 1px dashed var(--pdi-border);
    border-radius: 10px;
    background: #fff;
    padding: 8px 10px;
}

.pdi-dato small {
    color: var(--pdi-slate);
    display: block;
    margin-bottom: 2px;
}

.pdi-vehiculo-item {
    border: 1px solid var(--pdi-border);
    border-radius: 12px;
    background: #fff;
    padding: 11px;
    margin-bottom: 8px;
}

.pdi-vehiculo-top {
    display: flex;
    gap: 8px;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.pdi-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--pdi-border);
    border-radius: 10px;
    background: #fff;
}

.pdi-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 560px;
}

.pdi-table th,
.pdi-table td {
    padding: 9px;
    border-bottom: 1px solid #edf3ff;
    text-align: left;
    font-size: 0.82rem;
    vertical-align: top;
}

.pdi-table th {
    font-family: "Rajdhani", sans-serif;
    letter-spacing: 0.35px;
    background: #f5f9ff;
    font-size: 0.82rem;
}

.pdi-results {
    margin-top: 10px;
    display: grid;
    gap: 8px;
}

.pdi-result-item {
    border: 1px solid var(--pdi-border);
    border-radius: 10px;
    padding: 9px 10px;
    background: #f9fbff;
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: center;
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.pdi-result-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(17, 70, 166, 0.12);
}

.pdi-result-main strong {
    display: block;
    font-size: 0.9rem;
}

.pdi-result-main span {
    color: var(--pdi-slate);
    font-size: 0.78rem;
}

.pdi-result-type {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid #c9d9ff;
    background: #eef4ff;
    color: #134295;
}

.pdi-empty-tight {
    padding: 16px 12px;
}

.pdi-empty i {
    font-size: 1.25rem;
    margin-bottom: 6px;
    display: block;
}

.pdi-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(7, 30, 77, 0.42);
    backdrop-filter: blur(2px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 60;
    padding: 16px;
}

.pdi-modal {
    width: min(720px, 100%);
    background: #fff;
    border-radius: 16px;
    border: 1px solid var(--pdi-border);
    box-shadow: 0 24px 56px rgba(7, 30, 77, 0.3);
    overflow: hidden;
}

.pdi-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 13px 16px;
    border-bottom: 1px solid var(--pdi-border);
    background: linear-gradient(180deg, #ffffff 0%, #f5f9ff 100%);
}

.pdi-modal-head h3 {
    margin: 0;
    font-size: 1rem;
    font-family: "Rajdhani", sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.pdi-modal-close {
    border: 0;
    background: #e7efff;
    color: #103c91;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
}

.pdi-modal-body {
    padding: 14px 16px;
}

.pdi-modal-foot {
    padding: 12px 16px;
    border-top: 1px solid var(--pdi-border);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.pdi-ficha-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.pdi-kv {
    border: 1px dashed var(--pdi-border);
    border-radius: 10px;
    background: var(--pdi-white);
    padding: 8px 10px;
    min-height: 62px;
}

.pdi-kv small {
    display: block;
    color: var(--pdi-slate);
    margin-bottom: 3px;
}

.pdi-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 14px;
}

.pdi-tab {
    border: 1px solid var(--pdi-border);
    border-radius: 10px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    font-weight: 600;
    background: #f7faff;
    color: var(--pdi-blue-800);
}

.pdi-tab.active {
    color: var(--pdi-white);
    border-color: transparent;
    background: linear-gradient(155deg, var(--pdi-blue-900), var(--pdi-blue-700));
}

.pdi-section {
    display: none;
}

.pdi-section.active {
    display: block;
}

.pdi-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.pdi-field {
    margin-bottom: 10px;
}

.pdi-field label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.86rem;
    color: var(--pdi-blue-800);
    font-weight: 600;
}

.pdi-actions {
    display: flex;
    gap: 9px;
    justify-content: flex-end;
    flex-wrap: wrap;
    margin-top: 8px;
}

.pdi-list {
    display: grid;
    gap: 9px;
    margin-top: 14px;
    max-height: 388px;
    overflow: auto;
    padding-right: 2px;
}

.pdi-item {
    border: 1px solid var(--pdi-border);
    border-radius: 12px;
    background: #fbfdff;
    padding: 11px;
    position: relative;
}

.pdi-item-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.pdi-badge {
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.74rem;
    border: 1px solid transparent;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.pdi-badge.warn { background: #fff5df; color: var(--warn); border-color: #f4dfab; }
.pdi-badge.danger { background: #ffe8ea; color: var(--danger); border-color: #f7c1c8; }
.pdi-badge.ok { background: #e6fff3; color: var(--ok); border-color: #bcefd8; }

.pdi-empty {
    border: 1px dashed var(--pdi-border);
    border-radius: 12px;
    color: var(--pdi-slate);
    text-align: center;
    padding: 26px 12px;
    background: #f7faff;
}

.pdi-toast {
    position: fixed;
    right: 18px;
    bottom: 18px;
    background: var(--pdi-blue-900);
    color: var(--pdi-white);
    padding: 10px 13px;
    border-radius: 10px;
    box-shadow: 0 8px 18px rgba(7, 30, 77, 0.34);
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: 0.2s;
    font-size: 0.88rem;
    max-width: 320px;
}

.pdi-toast.show {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 980px) {
    .pdi-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .pdi-brand h1 {
        font-size: 1.72rem;
    }

    .pdi-top-right {
        width: 100%;
        justify-items: stretch;
    }

    .pdi-user-box {
        justify-content: space-between;
    }

    .pdi-ficha-header {
        grid-template-columns: 1fr;
    }

    .pdi-datos-grid {
        grid-template-columns: 1fr;
    }

    .pdi-ficha-grid,
    .pdi-form-grid {
        grid-template-columns: 1fr;
    }

    .pdi-search {
        grid-template-columns: 1fr;
    }

    .pdi-actions {
        justify-content: stretch;
    }

    .pdi-actions .pdi-btn {
        width: 100%;
    }
}
