/* ═══════════════════════════════════════════════════════════
   PASSWORD VAULT – Bitwarden-Style UI
   Uses existing theme design tokens from main.css
   ═══════════════════════════════════════════════════════════ */

/* ── Layout ── */
/* Override global overflow traps to allow position:sticky to work on the viewport */
.page-template-page-passwords,
.page-template-page-passwords body,
.page-template-page-passwords #page,
.page-template-page-passwords .site-main {
    overflow-x: visible !important;
    overflow-y: visible !important;
}

.pw-vault {
    display: flex;
    gap: 0;
    min-height: calc(100vh - 80px); /* Restored min-height */
    background: var(--bg-off);
    padding-top: 20px;
    padding-left: 20px;
    padding-right: 20px;
}

/* Force edge-to-edge for vault */
.home #primary.site-main,
.page-template-page-passwords #primary.site-main,
.pw-main {
    padding: 0 !important;
    max-width: none !important;
}

.pw-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 20px 16px;
    border-bottom: 1px solid var(--border-main);
}

.pw-sidebar-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pw-sidebar-title svg {
    width: 20px;
    height: 20px;
    color: var(--text-muted);
}

.pw-sidebar-title h2 {
    font-size: 16px;
    font-weight: 800;
    font-family: var(--font-heading);
}

.pw-btn-new {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--text-main);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.pw-btn-new:hover {
    background: var(--brand-primary);
    color: var(--text-main);
    transform: scale(1.05);
}

.pw-btn-new svg {
    width: 16px;
    height: 16px;
}

/* Filters */
.pw-filters {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.pw-filter-group {
    margin: 0;
    padding: 0;
}

.pw-filter-label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 800;
    color: var(--text-light);
    letter-spacing: 1px;
    padding: 0 8px;
    margin-bottom: 8px;
}

.pw-filter-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pw-filter-separated {
    margin: 20px 0;
}



.btn-crear-credencial {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    background: var(--text-main);
    color: #fff;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-primary);
}

.btn-crear-credencial:hover {
    background: #000;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.pw-empty-state .btn-crear-credencial {
    width: max-content;
    margin: 0 auto;
}

/* Ocultar elementos de contadores si estamos en "Mi Cuenta" */
.page-template-page-mi-cuenta .pw-count {
    display: none !important;
}

/* Rediseñar button-primary de Mi Cuenta al estilo Password */
.page-template-page-mi-cuenta .button-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    background: var(--text-main);
    color: #fff;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-primary);
}

.page-template-page-mi-cuenta .button-primary:hover {
    background: #000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-1px);
}

.pw-btn-new-icon {
    width: 28px;
    height: 28px;
    background: #000;
    color: #fff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.pw-btn-new-full:hover .pw-btn-new-icon {
    transform: scale(1.05);
}

.pw-filter-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border: none;
    background: transparent;
    transition: all 0.2s ease;
    text-align: left;
    font-family: var(--font-primary);
}

.pw-filter-btn:hover {
    background: rgba(0, 0, 0, 0.03);
    color: var(--text-main);
}

.pw-filter-btn.active {
    background: rgba(250, 202, 21, 0.1);
    color: var(--text-main);
    font-weight: 700;
}

.pw-filter-btn.active .pw-count {
    background: #fff;
}

.pw-filter-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.pw-filter-btn > span:not(.pw-count):not(.pw-dot) {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pw-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.pw-count {
    margin-left: auto;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-light);
    background: var(--bg-off);
    padding: 0 8px;
    border-radius: 20px;
    min-width: 24px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* Sidebar footer */
.pw-sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid var(--border-main);
}

.pw-btn-export {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--bg-off);
    border: 1px solid var(--border-main);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-primary);
}

.pw-btn-export:hover {
    background: var(--bg-paper);
    color: var(--text-main);
    border-color: var(--text-main);
}

.pw-btn-export svg {
    width: 16px;
    height: 16px;
}

/* ── Main Content ── */
.pw-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 0;
}

/* Topbar / Search */
.pw-topbar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.pw-search-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-paper);
    border: 1px solid var(--border-main);
    border-radius: 12px;
    padding: 0 16px;
    transition: all 0.2s ease;
}

.pw-search-wrap:focus-within {
    border-color: var(--text-main);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.pw-search-wrap svg {
    width: 18px;
    height: 18px;
    color: var(--text-light);
    flex-shrink: 0;
}

.pw-search-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 14px;
    padding: 12px 0;
    color: var(--text-main);
    font-family: var(--font-primary);
}

.pw-search-input::placeholder {
    color: var(--text-light);
}

.pw-topbar-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pw-results-count {
    font-size: 13px;
    color: var(--text-light);
    font-weight: 600;
    white-space: nowrap;
}

.pw-table-wrap {
    flex: 1;
    background: var(--bg-paper);
    border-radius: 16px;
    border: 1px solid var(--border-main);
    overflow: visible;
    position: relative;
    /* Removed overflow:auto, min-height, margin-bottom */
}

.pw-table-wrap .pw-table th:first-child {
    border-top-left-radius: 16px;
}

.pw-table-wrap .pw-table th:last-child {
    border-top-right-radius: 16px;
}

.pw-table-wrap .pw-table tr:last-child td:first-child {
    border-bottom-left-radius: 16px;
}

.pw-table-wrap .pw-table tr:last-child td:last-child {
    border-bottom-right-radius: 16px;
}

.pw-table {
    width: 100%;
    border-collapse: collapse;
}

.pw-table thead {
    background: var(--bg-off);
}

.pw-table th {
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    text-align: left;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 100;
    
    /* Glassmorphism styling */
    background: rgba(244, 245, 247, 0.75); /* Translucent version of bg-off */
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02), inset 0px -1px 0px rgba(0, 0, 0, 0.06);
}

.admin-bar .pw-table th {
    top: 32px;
}

@media screen and (max-width: 782px) {
    .admin-bar .pw-table th {
        top: 46px;
    }
}

.pw-th-fav {
    width: 48px;
    text-align: center !important;
}

.pw-th-name {
    width: 31%;
}

.pw-th-user {
    width: 26%;
}

.pw-th-pass {
    width: 20%;
}

.pw-th-client {
    width: 15%;
}

.pw-th-type {
    width: 8%;
}

/* ── Sort buttons ── */
.pw-sort-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    padding: 0;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
    cursor: pointer;
    font-family: var(--font-primary);
    transition: color 0.15s ease;
}

.pw-sort-btn:hover {
    color: var(--text-main);
}

.pw-sort-btn.sort-active {
    color: var(--text-main);
}

.pw-sort-icon {
    width: 10px;
    height: 14px;
    opacity: 0.35;
    transition: opacity 0.15s ease, transform 0.2s ease;
    flex-shrink: 0;
}

.pw-sort-btn:hover .pw-sort-icon,
.pw-sort-btn.sort-active .pw-sort-icon {
    opacity: 1;
}

.pw-sort-btn.sort-desc .pw-sort-icon {
    transform: scaleY(-1);
}


.pw-table tbody tr {
    border-bottom: 1px solid var(--border-main);
    transition: all 0.1s ease;
    cursor: pointer;
}

.pw-table tbody tr:last-child {
    border-bottom: none;
}

.pw-table tbody tr:hover {
    background: rgba(0, 0, 0, 0.015);
}

.pw-table td {
    padding: 14px 16px;
    vertical-align: middle;
}

/* User & Pass Wraps */
.pw-cell-user-wrap,
.pw-cell-pass-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    max-width: 220px;
}

.pw-cell-user,
.pw-cell-pass-text {
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.pw-cell-user {
    color: var(--text-muted);
    font-weight: 500;
}

.pw-cell-pass-text {
    color: var(--text-light);
    letter-spacing: 2px;
}

.pw-cell-pass-text.is-visible {
    letter-spacing: normal;
    font-family: ui-monospace, monospace;
    color: var(--text-main);
    font-weight: 600;
}

/* Row Action Buttons (Inline) */
.pw-cell-pass-actions {
    display: flex;
    align-items: center;
    gap: 2px;
}

.pw-row-copy,
.pw-row-toggle-pass {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.1; /* Very subtle until hover */
}

tr:hover .pw-row-copy,
tr:hover .pw-row-toggle-pass {
    opacity: 0.8;
}

.pw-row-copy:hover,
.pw-row-toggle-pass:hover {
    background: var(--bg-off);
    color: var(--text-main);
    opacity: 1 !important;
}

.pw-row-copy svg,
.pw-row-toggle-pass svg {
    width: 14px;
    height: 14px;
}

.pw-row-copy.copied {
    background: #10b981 !important;
    color: #fff !important;
    opacity: 1 !important;
}

/* Favorite star in table */
.pw-fav-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    color: var(--text-light);
}

.pw-fav-btn:hover {
    background: rgba(250, 202, 21, 0.15);
    color: #FACA15;
}

.pw-fav-btn.is-fav {
    color: #FACA15;
}

.pw-fav-btn.is-fav svg {
    fill: #FACA15;
}

.pw-fav-btn svg {
    width: 16px;
    height: 16px;
}

/* Name cell */
.pw-cell-name {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pw-cell-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

/* Cuando hay favicon: ocupa todo el contenedor */
.pw-cell-favicon {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pw-cell-icon svg {
    width: 18px;
    height: 18px;
    color: #6366f1;
}

.pw-cell-icon-fallback svg {
    width: 18px;
    height: 18px;
    color: #6366f1;
}

.pw-cell-name-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.pw-cell-title {
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 250px;
}

.pw-cell-url {
    font-size: 12px;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 250px;
}

.pw-cell-user {
    font-family: 'Manrope', monospace;
    font-size: 13px;
    color: var(--text-muted);
}

.pw-cell-tag {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.pw-tag-cliente {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.pw-tag-tipo {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

/* Action buttons in table */
.pw-cell-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
}

.pw-action-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--text-light);
    transition: all 0.15s ease;
}

.pw-action-btn:hover {
    background: var(--bg-off);
    color: var(--text-main);
}

.pw-action-btn svg {
    width: 16px;
    height: 16px;
}

.pw-action-btn.pw-copy-user:hover {
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.08);
}

.pw-action-btn.pw-copy-pass:hover {
    color: #10b981;
    background: rgba(16, 185, 129, 0.08);
}

/* ── Empty State ── */
.pw-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 40px;
    text-align: center;
}

.pw-empty-icon {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.08));
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

.pw-empty-icon svg {
    width: 36px;
    height: 36px;
    color: #6366f1;
}

.pw-empty-state h3 {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--text-main);
}

.pw-empty-state p {
    font-size: 14px;
    color: var(--text-muted);
    max-width: 320px;
    margin-bottom: 24px;
}

/* Loading */
.pw-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px;
    gap: 16px;
}

.pw-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-main);
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: pw-spin 0.8s linear infinite;
}

@keyframes pw-spin {
    to { transform: rotate(360deg); }
}

.pw-loading span {
    font-size: 13px;
    color: var(--text-light);
    font-weight: 600;
}

/* ── Detail Panel ── */
.pw-detail-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.pw-detail-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.pw-detail-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 480px;
    max-width: 90vw;
    height: 100vh;
    background: var(--bg-paper);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.1);
    z-index: 2001;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.pw-detail-panel.active {
    transform: translateX(0);
}

/* Base Panel Width: 480px max by default */

/* Tablet & Smaller: ensure standard rows collapse */
@media (max-width: 767px) {
    .pw-form-row {
        flex-direction: column;
        gap: 16px;
    }
}

/* Our special collapse classes: by default 1 column */
.pw-form-row.pw-form-collapse {
    flex-direction: column;
}

/* Laptops where height is small (960px - 1400px): 50% width & 2 columns, compact gaps */
@media (min-width: 960px) and (max-width: 1400px) {
    .pw-detail-panel {
        width: 50vw;
        max-width: 50vw;
    }
    
    .pw-form-row.pw-form-collapse {
        flex-direction: row;
    }

    .pw-form {
        gap: 16px !important;
    }

    .pw-form-group {
        gap: 4px !important;
    }

    .pw-form-group label {
        font-size: 10px !important;
    }
}

/* Desktops (>1400px): 33% width, 1 column again, normal gaps */
@media (min-width: 1401px) {
    .pw-detail-panel {
        width: 33vw;
        max-width: 33vw;
    }
}

.admin-bar .pw-detail-panel {
    top: 32px;
    height: calc(100vh - 32px);
}

.pw-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 28px;
    border-bottom: 1px solid var(--border-main);
}

.pw-detail-header h3 {
    font-size: 18px;
    font-weight: 800;
}

.pw-detail-close {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: var(--bg-off);
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.pw-detail-close:hover {
    background: var(--text-main);
    color: #fff;
}

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

.pw-detail-body {
    flex: 1;
    overflow-y: auto;
    padding: 28px;
}

/* ── Form ── */
.pw-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.pw-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pw-form-group label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-light);
    letter-spacing: 0.5px;
}

.pw-form-group input[type="text"],
.pw-form-group input[type="url"],
.pw-form-group input[type="password"],
.pw-form-group textarea,
.pw-form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-main);
    border-radius: 10px;
    font-size: 14px;
    background: var(--bg-off);
    color: var(--text-main);
    transition: all 0.2s ease;
    font-family: var(--font-primary);
    resize: vertical; /* Only allow vertical resizing */
}

.pw-form-group input:focus,
.pw-form-group textarea:focus,
.pw-form-group select:focus {
    outline: none;
    border-color: var(--text-main);
    background: var(--bg-paper);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.pw-form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%235B6B7C' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.pw-form-row {
    display: flex;
    gap: 12px;
}

.pw-form-half {
    flex: 1;
}

.pw-input-with-action {
    display: flex;
    gap: 0;
    align-items: stretch;
}

.pw-input-with-action input {
    flex: 1;
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

.pw-input-action {
    width: 40px;
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-main);
    border-left: none;
    background: var(--bg-off);
    cursor: pointer;
    color: var(--text-light);
    transition: all 0.15s ease;
}

.pw-input-action:last-child {
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
}

.pw-input-action:not(:last-child) {
    border-radius: 0;
}

.pw-input-action:hover {
    background: var(--text-main);
    color: #fff;
    border-color: var(--text-main);
}

.pw-input-action svg {
    width: 16px;
    height: 16px;
}

/* Password field */
.pw-password-field .pw-input-action:first-of-type {
    border-left: none;
}

/* Toggle */
.pw-form-toggle {
    padding-top: 4px;
}

.pw-toggle-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: none !important;
    letter-spacing: 0 !important;
}

.pw-toggle-label input {
    display: none;
}

.pw-toggle-switch {
    width: 40px;
    height: 22px;
    border-radius: 11px;
    background: var(--border-main);
    position: relative;
    transition: all 0.25s ease;
    flex-shrink: 0;
}

.pw-toggle-switch::after {
    content: '';
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    position: absolute;
    top: 3px;
    left: 3px;
    transition: all 0.25s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.pw-toggle-label input:checked + .pw-toggle-switch {
    background: #FACA15;
}

.pw-toggle-label input:checked + .pw-toggle-switch::after {
    transform: translateX(18px);
}

/* Form Actions */
.pw-form-actions {
    display: flex;
    gap: 12px;
    padding-top: 8px;
}

.pw-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    background: var(--text-main);
    color: #fff;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-primary);
}

.pw-btn-primary:hover {
    background: var(--brand-primary);
    color: var(--text-main);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.pw-btn-primary svg {
    width: 18px;
    height: 18px;
}

.pw-btn-danger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    background: transparent;
    color: var(--status-error);
    border: 1px solid rgba(239, 68, 68, 0.2);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-primary);
}

.pw-btn-danger:hover {
    background: var(--status-error);
    color: #fff;
    border-color: var(--status-error);
}

.pw-btn-danger svg {
    width: 16px;
    height: 16px;
}

/* Form Meta */
.pw-form-meta {
    display: flex;
    gap: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border-main);
    font-size: 12px;
    color: var(--text-light);
}

.pw-form-meta strong {
    color: var(--text-muted);
}

/* ── Toast ── */
.pw-toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pw-toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: var(--text-main);
    color: #fff;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    animation: pw-toast-in 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    font-family: var(--font-primary);
}

.pw-toast.success {
    background: #059669;
}

.pw-toast.error {
    background: #dc2626;
}

.pw-toast svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.pw-toast.removing {
    animation: pw-toast-out 0.25s ease forwards;
}

@keyframes pw-toast-in {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes pw-toast-out {
    to {
        opacity: 0;
        transform: translateY(12px) scale(0.95);
    }
}

/* ── Responsive ── */
@media (max-width: 1024px) {
    .pw-sidebar {
        width: 220px;
        min-width: 220px;
    }
}

@media (max-width: 768px) {
    .pw-vault {
        flex-direction: column;
        margin: -20px -20px -20px -20px;
    }

    .pw-sidebar {
        width: 100%;
        min-width: 100%;
        height: auto;
        position: static;
        border-right: none;
        border-bottom: 1px solid var(--border-main);
        max-height: 50vh;
    }

    .pw-main {
        padding: 16px;
    }

    .pw-table th:nth-child(4),
    .pw-table td:nth-child(4),
    .pw-table th:nth-child(5),
    .pw-table td:nth-child(5) {
        display: none;
    }

    .pw-detail-panel {
        width: 100%;
        max-width: 100vw;
    }

    .pw-cell-title {
        max-width: 150px;
    }

    .pw-cell-url {
        max-width: 150px;
    }
}

/* ── Copy feedback animation ── */
.pw-action-btn.copied {
    color: #10b981 !important;
    background: rgba(16, 185, 129, 0.12) !important;
}

.pw-action-btn.copied svg {
    animation: pw-pop 0.3s ease;
}

@keyframes pw-pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* Row highlight when selected */
.pw-table tbody tr.pw-row-active {
    background: rgba(99, 102, 241, 0.04);
    border-left: 3px solid #6366f1;
}

/* ── Specific styling for the Client Tag ── */
.pw-cell-tag.pw-tag-cliente {
    background: #f3f4f6;
    color: #000;
    border: 1px solid #e5e7eb;
}

/* ── Active style for Tipologias Sidebar Filter ── */
.pw-filter-btn.pw-filter-tipo {
    transition: all 0.2s ease;
}

.pw-filter-btn.pw-filter-tipo.active {
    color: var(--tipo-color) !important;
    background-color: var(--tipo-bg) !important;
    border-color: transparent !important;
}

.pw-filter-btn.pw-filter-tipo.active span {
    font-weight: 600;
}

.pw-filter-btn.pw-filter-tipo.active .pw-count {
    color: var(--tipo-color) !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    font-weight: 700;
}
