/* =========================================================
   ENCBYT SHARED WORKSPACE & MODAL ENGINE
   Path: css/share.css
   ========================================================= */

.shared-top-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 8px 24px 16px 24px;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 24px;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toolbar-left h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.02em;
    margin: 0;
}

.shared-badge-count {
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
}

.toolbar-center {
    flex: 1;
    max-width: 420px;
}

.shared-search-box {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.shared-search-box i {
    position: absolute;
    left: 12px;
    color: #94a3b8;
    font-size: 0.85rem;
    pointer-events: none;
}

.shared-search-box input {
    width: 100%;
    height: 38px;
    padding: 0 14px 0 34px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #0f172a;
    outline: none;
    transition: all 0.2s ease;
}

.shared-search-box input:focus {
    background: #ffffff;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.shared-tabs-filter {
    display: flex;
    background: #f1f5f9;
    padding: 3px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.tab-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #64748b;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-pill.active {
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.btn-share-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 38px;
    padding: 0 14px;
    background: #2563eb;
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-share-trigger:hover {
    background: #1d4ed8;
}

/* Metrics KPI Cards */
.shared-metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding: 0 24px;
    margin-bottom: 24px;
}

.shared-metric-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.metric-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.metric-icon.blue { background: #eff6ff; color: #2563eb; }
.metric-icon.green { background: #ecfdf5; color: #059669; }
.metric-icon.purple { background: #f5f3ff; color: #7c3aed; }
.metric-icon.amber { background: #fffbeb; color: #d97706; }

.metric-meta {
    display: flex;
    flex-direction: column;
}

.metric-title {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 600;
    margin-bottom: 2px;
}

.metric-value {
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
}

/* Data Table Panel */
.shared-data-panel {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin: 0 24px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.premium-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.85rem;
}

.premium-table th {
    background: #f8fafc;
    color: #475569;
    font-weight: 600;
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
}

.premium-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #f1f5f9;
    color: #1e293b;
    vertical-align: middle;
}

.premium-table tr:hover td {
    background: #f8fafc;
}

.align-right { text-align: right; }

.file-name-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.file-icon-lead {
    color: #2563eb;
    font-size: 1rem;
}

.file-title {
    font-weight: 600;
    color: #0f172a;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pill-security {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.pill-security.zero { background: #eff6ff; color: #2563eb; border: 1px solid #dbeafe; }
.pill-security.pass { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }

.badge-status {
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-status.active { background: #ecfdf5; color: #059669; }
.badge-status.revoked { background: #fef2f2; color: #dc2626; }
.badge-status.expired { background: #f1f5f9; color: #64748b; }

.actions-cell {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}

.btn-action-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-action-icon:hover {
    border-color: #cbd5e1;
    color: #0f172a;
    background: #f8fafc;
}

.btn-action-icon.danger:hover {
    border-color: #fecaca;
    color: #dc2626;
    background: #fef2f2;
}

.table-skeleton-loader {
    text-align: center;
    padding: 40px;
    color: #64748b;
    font-weight: 500;
}

.shared-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.empty-icon-wrap {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: #eff6ff;
    color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 16px;
}

.shared-empty-state h3 {
    font-size: 1.1rem;
    color: #0f172a;
    margin-bottom: 6px;
}

.shared-empty-state p {
    font-size: 0.85rem;
    color: #64748b;
    max-width: 380px;
    margin-bottom: 20px;
    line-height: 1.4;
}

.btn-primary-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    background: #2563eb;
    color: #ffffff;
    border: none;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-primary-action:hover {
    background: #1d4ed8;
}

/* =========================================================
   SHARE DIALOG MODAL (Clean Center Overlay)
   ========================================================= */

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}

.share-modal-dialog {
    width: 90%;
    max-width: 480px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border: 1px solid #e2e8f0;
    overflow: hidden;
    animation: modalPopIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPopIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
}

.modal-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #0f172a;
}

.modal-title-wrap i {
    color: #2563eb;
    font-size: 1.1rem;
}

.modal-title-wrap h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
}

.btn-modal-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: #94a3b8;
    cursor: pointer;
    padding: 0 4px;
}

.btn-modal-close:hover {
    color: #0f172a;
}

.modal-body {
    padding: 20px;
}

.share-file-pill {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 18px;
}

.file-icon-box {
    width: 38px;
    height: 38px;
    background: #eff6ff;
    color: #2563eb;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.file-details {
    display: flex;
    flex-direction: column;
}

.file-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: #0f172a;
}

.file-size {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 1px;
}

.modal-mode-tabs {
    display: flex;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 8px;
    margin-bottom: 18px;
}

.modal-mode-tabs .tab-btn {
    flex: 1;
    padding: 7px 0;
    font-size: 0.85rem;
    font-weight: 600;
    border: none;
    background: transparent;
    color: #64748b;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-mode-tabs .tab-btn.active {
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.modal-form-view {
    display: none;
}

.modal-form-view.active {
    display: block;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
}

.input-icon-box {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon-box i {
    position: absolute;
    left: 12px;
    color: #94a3b8;
    font-size: 0.85rem;
    pointer-events: none;
}

.input-icon-box input {
    width: 100%;
    height: 38px;
    padding: 0 12px 0 34px;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #0f172a;
    outline: none;
    transition: border-color 0.2s ease;
}

.input-icon-box input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-select {
    width: 100%;
    height: 38px;
    padding: 0 12px;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #0f172a;
    outline: none;
    cursor: pointer;
}

.btn-submit-share {
    width: 100%;
    height: 40px;
    background: #2563eb;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    transition: background 0.2s ease;
}

.btn-submit-share:hover {
    background: #1d4ed8;
}

@media (max-width: 1024px) {
    .shared-metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
/* =========================================================
   PASSWORD EYE TOGGLE
   ========================================================= */

.input-icon-box {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon-box input {
    padding-right: 40px !important;
}

.cv-pwd-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: background 0.15s ease, color 0.15s ease;
    padding: 0;
    outline: none;
}

.cv-pwd-toggle:hover {
    background: #f1f5f9;
    color: #475569;
}

.cv-pwd-toggle.is-active {
    color: #2563eb;
}

/* ✅ Top gap for shared page (12px from header) */
.shared-workspace-wrapper {
    padding-top: 12px;
}

/* ✅ Reduce main-content left/right padding on shared page */
body:has(.cv-shared-page) .main-content {
    padding-left: 12px !important;
    padding-right: 12px !important;
}

body:has(.cv-shared-page) .cv-shared-page {
    padding-left: 0 !important;
    padding-right: 0 !important;
}
