/* ============================================================
   MAESTROS - Panel Dashboard Styles
   Sidebar layout, cards, stats, sections
   ============================================================ */

/* ── Page layout ──────────────────────────────────────────── */
.page-panel {
    display: flex;
    min-height: 100vh;
    background: var(--gray-100);
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.panel-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    background: var(--dark);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    overflow-y: auto;
    transition: transform var(--transition);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,.06);
}

.sidebar-logo img {
    height: 90px;
    width: auto;
    filter: drop-shadow(0 0 6px rgba(237,50,55,.3));
}

.sidebar-close {
    display: none;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    color: rgba(255,255,255,.5);
    cursor: pointer;
    transition: all var(--transition);
}

.sidebar-close:hover {
    color: var(--white);
    background: rgba(255,255,255,.08);
}

.sidebar-close svg {
    width: 18px;
    height: 18px;
}

/* User card */
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,.06);
}

.sidebar-avatar {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: rgba(237,50,55,.15);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.sidebar-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar-avatar span {
    font-size: .85rem;
    font-weight: 700;
    color: var(--red);
}

.sidebar-user-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sidebar-user-info strong {
    font-size: .875rem;
    color: var(--white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-info small {
    font-size: .75rem;
    color: rgba(255,255,255,.4);
    margin-top: 2px;
}

/* Navigation */
.sidebar-nav {
    flex: 1;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 8px;
    font-size: .875rem;
    font-weight: 500;
    color: rgba(255,255,255,.55);
    transition: all var(--transition);
    cursor: pointer;
}

.sidebar-link:hover {
    color: rgba(255,255,255,.85);
    background: rgba(255,255,255,.06);
}

.sidebar-link.is-active {
    color: var(--white);
    background: rgba(237,50,55,.15);
}

.sidebar-link.is-active svg {
    color: var(--red);
}

.sidebar-link svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: rgba(255,255,255,.35);
    transition: color var(--transition);
}

.sidebar-link:hover svg {
    color: rgba(255,255,255,.65);
}

/* Footer / Logout */
.sidebar-footer {
    padding: 12px 10px 20px;
    border-top: 1px solid rgba(255,255,255,.06);
}

.sidebar-logout {
    color: rgba(255,255,255,.4);
}

.sidebar-logout:hover {
    color: #F87171;
    background: rgba(248,113,113,.08);
}

.sidebar-logout:hover svg {
    color: #F87171;
}

/* Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999;
}

.sidebar-overlay.is-visible {
    display: block;
}

/* ============================================================
   MAIN AREA
   ============================================================ */
.panel-main {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ── Top bar ──────────────────────────────────────────────── */
.panel-topbar {
    position: sticky;
    top: 0;
    height: 64px;
    background: var(--white);
    border-bottom: 1px solid rgba(0,0,0,.06);
    display: flex;
    align-items: center;
    padding: 0 28px;
    z-index: 100;
    gap: 16px;
}

.topbar-menu {
    display: none;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    color: var(--gray-700);
    transition: all var(--transition);
}

.topbar-menu:hover {
    background: var(--gray-100);
}

.topbar-menu svg {
    width: 22px;
    height: 22px;
}

.topbar-title {
    font-family: var(--font-head);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--dark);
}

.topbar-user {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-name {
    font-size: .85rem;
    font-weight: 500;
    color: var(--gray-700);
}

.topbar-avatar {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(237,50,55,.1);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.topbar-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.topbar-avatar span {
    font-size: .75rem;
    font-weight: 700;
    color: var(--red);
}

/* ── Content area ─────────────────────────────────────────── */
.panel-content {
    padding: 28px;
    flex: 1;
}

/* ── Sections (only one visible) ──────────────────────────── */
.panel-section {
    display: none;
}

.panel-section.is-active {
    display: block;
    animation: fadeInSection .3s ease;
}

@keyframes fadeInSection {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   STAT CARDS
   ============================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 22px;
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid rgba(0,0,0,.04);
    transition: all var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon svg {
    width: 22px;
    height: 22px;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-family: var(--font-head);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark);
    line-height: 1;
}

.stat-label {
    font-size: .78rem;
    color: var(--gray-500);
    margin-top: 4px;
}

/* ============================================================
   PANEL CARDS
   ============================================================ */
.panel-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(0,0,0,.04);
    overflow: hidden;
}

.card-header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3 {
    font-family: var(--font-head);
    font-size: .95rem;
    font-weight: 700;
    color: var(--dark);
}

.card-body {
    padding: 22px;
}

/* Overview grid */
.overview-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Quick actions */
.quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px 12px;
    border-radius: var(--radius);
    border: 1px solid var(--gray-100);
    cursor: pointer;
    transition: all var(--transition);
    font-size: .8rem;
    font-weight: 600;
    color: var(--gray-700);
    text-align: center;
}

.quick-action:hover {
    border-color: rgba(237,50,55,.2);
    background: rgba(237,50,55,.03);
    color: var(--red);
}

.quick-action svg {
    width: 24px;
    height: 24px;
    color: var(--gray-500);
    transition: color var(--transition);
}

.quick-action:hover svg {
    color: var(--red);
}

/* Empty state */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    text-align: center;
    color: var(--gray-500);
}

.empty-state svg {
    color: var(--gray-300);
    margin-bottom: 12px;
}

.empty-state p {
    font-size: .9rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 4px;
}

.empty-state small {
    font-size: .8rem;
    color: var(--gray-500);
}

/* Section placeholder (loading) */
.section-placeholder {
    color: var(--gray-500);
    font-size: .9rem;
    text-align: center;
    padding: 40px 20px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

@media (max-width: 768px) {
    .panel-sidebar {
        transform: translateX(-100%);
    }

    .panel-sidebar.is-open {
        transform: translateX(0);
    }

    .sidebar-close {
        display: flex;
    }

    .panel-main {
        margin-left: 0;
    }

    .topbar-menu {
        display: flex;
    }

    .panel-content {
        padding: 20px 16px;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .stat-card {
        padding: 16px;
        gap: 12px;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
        border-radius: 10px;
    }

    .stat-icon svg {
        width: 18px;
        height: 18px;
    }

    .stat-value {
        font-size: 1.2rem;
    }

    .quick-actions {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .panel-topbar {
        padding: 0 16px;
    }

    .topbar-name {
        display: none;
    }

    .stat-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* ============================================================
   SECTION-SPECIFIC STYLES
   ============================================================ */

/* ── Profile ──────────────────────────────────────────────── */
.profile-photo-row {
    display: flex;
    align-items: flex-start;
    gap: 28px;
    margin-bottom: 24px;
}

.profile-photo-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.profile-photo {
    width: 90px;
    height: 90px;
    border-radius: 16px;
    background: rgba(237,50,55,.1);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

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

.profile-photo span {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--red);
}

.profile-photo-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: .78rem;
    font-weight: 600;
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
    cursor: pointer;
    transition: all var(--transition);
}

.profile-photo-btn:hover {
    border-color: var(--red);
    color: var(--red);
}

.profile-info-side {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 6px;
}

.info-row {
    font-size: .875rem;
    color: var(--gray-700);
}

.info-label {
    font-weight: 600;
    color: var(--gray-900);
    margin-right: 6px;
}

.form-sep {
    height: 1px;
    background: var(--gray-100);
    margin: 24px 0;
}

.p-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

textarea.form-control {
    height: auto;
    padding: 12px 16px;
    resize: vertical;
    min-height: 100px;
}

/* ── Card header action button ────────────────────────────── */
.btn-card-action {
    padding: 8px 18px;
    border-radius: 6px;
    font-size: .8rem;
    font-weight: 600;
    background: var(--red);
    color: var(--white);
    cursor: pointer;
    transition: all var(--transition);
}

.btn-card-action:hover {
    background: var(--red-dark);
}

.card-hint {
    font-size: .85rem;
    color: var(--gray-500);
    margin-bottom: 20px;
}

/* ── Filter select ────────────────────────────────────────── */
.filter-select {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: .8rem;
    border: 1px solid var(--gray-300);
    color: var(--gray-700);
    cursor: pointer;
}

/* ── Services tree ────────────────────────────────────────── */
.services-tree .svc-category {
    margin-bottom: 20px;
    border: 1px solid var(--gray-100);
    border-radius: var(--radius);
    overflow: hidden;
}

.svc-cat-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--gray-100);
    cursor: pointer;
    font-size: .875rem;
    font-weight: 700;
    color: var(--dark);
    user-select: none;
}

.svc-cat-header .chevron {
    margin-left: auto;
    transition: transform var(--transition);
    width: 16px;
    height: 16px;
    color: var(--gray-500);
}

.svc-cat-header.is-open .chevron {
    transform: rotate(180deg);
}

.svc-cat-body {
    display: none;
    padding: 8px 0;
}

.svc-cat-body.is-open {
    display: block;
}

.svc-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    font-size: .85rem;
}

.svc-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--red);
    flex-shrink: 0;
    cursor: pointer;
}

.svc-item label {
    flex: 1;
    cursor: pointer;
    color: var(--gray-700);
}

.svc-item .svc-prices {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.svc-item .svc-prices input {
    width: 80px;
    height: 34px;
    padding: 0 8px;
    font-size: .8rem;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    text-align: right;
    color: var(--gray-700);
}

.svc-item .svc-prices input:focus {
    border-color: var(--red);
    outline: none;
}

.svc-item .svc-prices span {
    font-size: .75rem;
    color: var(--gray-500);
}

/* ── Schedule grid ────────────────────────────────────────── */
.schedule-grid .sched-day {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-100);
}

.schedule-grid .sched-day:last-child {
    border-bottom: none;
}

.sched-day-check {
    width: 18px;
    height: 18px;
    accent-color: var(--red);
    cursor: pointer;
}

.sched-day-name {
    width: 100px;
    font-size: .875rem;
    font-weight: 600;
    color: var(--dark);
}

.sched-times {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sched-times input[type="time"] {
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    font-size: .85rem;
    color: var(--gray-700);
}

.sched-times input[type="time"]:focus {
    border-color: var(--red);
    outline: none;
}

.sched-times span {
    font-size: .8rem;
    color: var(--gray-500);
}

/* ── Reviews ──────────────────────────────────────────────── */
.reviews-criteria {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
}

.criteria-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 20px;
    background: var(--gray-100);
    font-size: .8rem;
    font-weight: 600;
    color: var(--gray-700);
}

.criteria-badge .stars {
    color: #F59E0B;
    font-size: .85rem;
}

.review-item {
    padding: 16px 0;
    border-bottom: 1px solid var(--gray-100);
}

.review-item:last-child {
    border-bottom: none;
}

.review-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.review-avatar {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .7rem;
    font-weight: 700;
    color: var(--gray-500);
}

.review-meta {
    flex: 1;
}

.review-meta strong {
    font-size: .85rem;
    color: var(--dark);
}

.review-meta small {
    display: block;
    font-size: .75rem;
    color: var(--gray-500);
}

.review-stars {
    color: #F59E0B;
    font-size: .9rem;
}

.review-comment {
    font-size: .85rem;
    color: var(--gray-700);
    line-height: 1.5;
    margin-left: 46px;
}

/* ── Requests table ───────────────────────────────────────── */
.request-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid var(--gray-100);
}

.request-item:last-child {
    border-bottom: none;
}

.request-info {
    flex: 1;
    min-width: 0;
}

.request-info strong {
    font-size: .875rem;
    color: var(--dark);
    display: block;
}

.request-info small {
    font-size: .78rem;
    color: var(--gray-500);
}

.request-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
    flex-shrink: 0;
}

.status-requested  { background: #FEF3C7; color: #92400E; }
.status-accepted   { background: #DBEAFE; color: #1E40AF; }
.status-in_progress { background: #E0E7FF; color: #3730A3; }
.status-completed  { background: #D1FAE5; color: #065F46; }
.status-cancelled  { background: #FEE2E2; color: #991B1B; }
.status-rejected   { background: #F3F4F6; color: #6B7280; }

/* ── Loading state ────────────────────────────────────────── */
.section-loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray-500);
    font-size: .9rem;
}

/* ── Responsive sections ──────────────────────────────────── */
@media (max-width: 768px) {
    .profile-photo-row {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .p-form-grid {
        grid-template-columns: 1fr;
    }

    .svc-item {
        flex-wrap: wrap;
    }

    .svc-item .svc-prices {
        width: 100%;
        padding-left: 28px;
        margin-top: 4px;
    }

    .sched-day {
        flex-wrap: wrap;
    }

    .request-item {
        flex-wrap: wrap;
    }
}

/* ── Addresses ────────────────────────────────────────────── */
.address-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--gray-100);
}

.address-item:last-child {
    border-bottom: none;
}

.address-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.address-info strong {
    font-size: .875rem;
    color: var(--dark);
}

.address-info span {
    font-size: .85rem;
    color: var(--gray-700);
}

.address-info small {
    font-size: .78rem;
    color: var(--gray-500);
}

.addr-default {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: .68rem;
    font-weight: 600;
    background: rgba(34,197,94,.1);
    color: #16A34A;
    vertical-align: middle;
    margin-left: 6px;
}

.btn-delete-addr {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .85rem;
    color: var(--gray-500);
    cursor: pointer;
    transition: all var(--transition);
    flex-shrink: 0;
}

.btn-delete-addr:hover {
    background: #FEE2E2;
    color: #DC2626;
}

/* ── Cancel button ────────────────────────────────────────── */
.btn-cancel {
    padding: 10px 24px;
    border-radius: var(--radius);
    font-size: .875rem;
    font-weight: 600;
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
    cursor: pointer;
    transition: all var(--transition);
    background: transparent;
}

.btn-cancel:hover {
    border-color: var(--gray-500);
    background: var(--gray-100);
}

/* ============================================================
   PROFILE DROPDOWN
   ============================================================ */
.topbar-user {
    position: relative;
}

.topbar-user-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 4px;
    border-radius: 8px;
    transition: background var(--transition);
}

.topbar-user-btn:hover {
    background: var(--gray-100);
}

.topbar-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 280px;
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(0,0,0,.08);
    box-shadow: 0 12px 40px rgba(0,0,0,.12);
    z-index: 200;
    overflow: hidden;
}

.topbar-dropdown.is-open {
    display: block;
    animation: dropdownIn .15s ease;
}

@keyframes dropdownIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.dropdown-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid var(--gray-100);
}

.dropdown-avatar {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: rgba(237,50,55,.1);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.dropdown-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dropdown-avatar span {
    font-size: .85rem;
    font-weight: 700;
    color: var(--red);
}

.dropdown-header strong {
    font-size: .875rem;
    display: block;
    color: var(--dark);
}

.dropdown-header small {
    font-size: .75rem;
    color: var(--gray-500);
}

.dropdown-body {
    padding: 8px;
}

.dropdown-upload {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: .85rem;
    font-weight: 500;
    color: var(--gray-700);
    cursor: pointer;
    transition: all var(--transition);
}

.dropdown-upload:hover {
    background: var(--gray-100);
    color: var(--red);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: .85rem;
    font-weight: 500;
    color: var(--gray-700);
    cursor: pointer;
    transition: all var(--transition);
    text-align: left;
}

.dropdown-item:hover {
    background: var(--gray-100);
}

.dropdown-footer {
    padding: 8px;
    border-top: 1px solid var(--gray-100);
}

.dropdown-logout:hover {
    background: rgba(220,38,38,.06);
    color: #DC2626;
}

/* Progress bar */
.dropdown-progress {
    margin: 4px 12px 8px;
    height: 4px;
    background: var(--gray-100);
    border-radius: 2px;
    overflow: hidden;
}

.dropdown-progress-bar {
    height: 100%;
    background: var(--red);
    border-radius: 2px;
    width: 0%;
    transition: width .2s;
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    backdrop-filter: blur(4px);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-box {
    background: var(--white);
    border-radius: var(--radius-lg);
    width: 420px;
    max-width: 92vw;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
    animation: modalIn .2s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(.95) translateY(10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid var(--gray-100);
}

.modal-header h3 {
    font-family: var(--font-head);
    font-size: .95rem;
    font-weight: 700;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 1.2rem;
    color: var(--gray-500);
    cursor: pointer;
}

.modal-close:hover {
    background: var(--gray-100);
}

.modal-body {
    padding: 22px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 22px;
    border-top: 1px solid var(--gray-100);
}

/* ============================================================
   REQUEST CARDS
   ============================================================ */
.request-card {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid rgba(0,0,0,.06);
    margin-bottom: 12px;
    overflow: hidden;
}

.request-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--gray-100);
    border-bottom: 1px solid rgba(0,0,0,.04);
}

.request-code {
    font-family: var(--font-head);
    font-size: .8rem;
    font-weight: 700;
    color: var(--dark);
}

.request-body {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
}

.request-info {
    flex: 1;
}

.request-info strong {
    display: block;
    font-size: .9rem;
    color: var(--dark);
    margin-bottom: 4px;
}

.request-info small {
    display: block;
    font-size: .78rem;
    color: var(--gray-500);
    margin-top: 2px;
}

.request-desc {
    font-size: .82rem;
    color: var(--gray-600);
    margin-top: 6px;
    line-height: 1.4;
}

.request-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    align-items: flex-start;
}

@media (max-width: 600px) {
    .request-body {
        flex-direction: column;
    }
}

/* ── Action buttons (shared) ─────────────────────────────── */
.btn-row-action {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: .72rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    background: transparent;
    border: 1px solid transparent;
    transition: all .2s;
}
.btn-row-edit { color: #2563EB; border-color: rgba(37,99,235,.2); }
.btn-row-edit:hover { background: rgba(37,99,235,.08); }
.btn-row-delete { color: #DC2626; border-color: rgba(220,38,38,.2); }
.btn-row-delete:hover { background: rgba(220,38,38,.08); }

/* ── Province select-all header ──────────────────────────── */
.dist-prov-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    margin-top: 6px;
    background: rgba(0,0,0,.02);
    border-radius: 4px;
}

.dist-prov-header strong {
    font-size: .8rem;
    font-weight: 700;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: .03em;
}

.dist-prov-header input[type="checkbox"] {
    accent-color: var(--red);
}

/* ── Payment card items ──────────────────────────────────── */
.address-item .btn-delete-pm,
.btn-delete-pm {
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    font-size: 1rem;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all .2s;
}
.btn-delete-pm:hover {
    color: var(--red);
    background: rgba(237,50,55,.06);
}

/* ── 3-column grid for ubigeo selects ────────────────────── */
@media (max-width: 600px) {
    .p-form-grid[style*="grid-template-columns:1fr 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }
}
