/* CSS Variables */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --success: #16a34a;
    --warning: #ca8a04;
    --danger: #dc2626;
    --blocked: #9333ea;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --white: #ffffff;
    --shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
    --shadow-lg: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23);
    --radius: 8px;
    --radius-lg: 12px;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--gray-100);
    color: var(--gray-800);
    line-height: 1.6;
}

.app {
    min-height: 100vh;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 24px 32px;
    box-shadow: var(--shadow-lg);
}

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

.header-logo {
    height: 28px;
    width: auto;
    border-radius: 3px;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.header h1 {
    font-size: 1.75rem;
    font-weight: 700;
}

.case-info {
    display: flex;
    gap: 24px;
    font-size: 0.9rem;
    opacity: 0.9;
}

.case-info span {
    display: flex;
    gap: 6px;
}

.progress-summary {
    display: flex;
    align-items: center;
    gap: 16px;
}

.progress-bar {
    flex: 1;
    height: 12px;
    background: rgba(255,255,255,0.2);
    border-radius: 6px;
    overflow: hidden;
    min-width: 300px;
}

.progress-fill {
    height: 100%;
    background: var(--success);
    border-radius: 6px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-stats {
    font-size: 0.9rem;
    white-space: nowrap;
}

/* Stats Bar */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    padding: 16px 32px;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
}

.stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px;
    border-radius: var(--radius);
    background: var(--gray-50);
}

.stat-card.urgent {
    border-left: 4px solid var(--danger);
}

.stat-card.in-progress {
    border-left: 4px solid var(--primary);
}

.stat-card.blocked {
    border-left: 4px solid var(--blocked);
}

.stat-card.complete {
    border-left: 4px solid var(--success);
}

.stat-card.evidence {
    border-left: 4px solid var(--info, #0ea5e9);
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-800);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Filter Bar */
.filter-bar {
    display: flex;
    gap: 24px;
    padding: 16px 32px;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    flex-wrap: wrap;
    align-items: center;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group label {
    font-size: 0.85rem;
    color: var(--gray-600);
    font-weight: 500;
}

.filter-group select {
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.9rem;
    background: var(--white);
    cursor: pointer;
}

.btn-export {
    margin-left: auto;
    padding: 10px 20px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-export:hover {
    background: var(--primary-dark);
}

.btn-affidavit {
    padding: 10px 20px;
    background: var(--success);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-affidavit:hover {
    background: #15803d;
}

.btn-affidavit::before {
    content: "\270E";
    font-size: 1.1rem;
}

/* Main Content */
.main-content {
    padding: 24px 32px;
}

/* Tab Navigation */
.tab-nav {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 10px 20px;
    background: var(--white);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--gray-600);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.tab-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
}

.tab-btn .count {
    font-size: 0.75rem;
    background: rgba(0,0,0,0.1);
    padding: 2px 8px;
    border-radius: 10px;
}

.tab-btn.active .count {
    background: rgba(255,255,255,0.2);
}

/* Cards Container */
.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

/* Item Card */
.item-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

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

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
    flex: 1;
}

.card-badges {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge.status-not_started {
    background: var(--gray-200);
    color: var(--gray-600);
}

.badge.status-in_progress {
    background: #dbeafe;
    color: var(--primary);
}

.badge.status-blocked {
    background: #f3e8ff;
    color: var(--blocked);
}

.badge.status-complete {
    background: #dcfce7;
    color: var(--success);
}

.badge.priority-urgent {
    background: #fee2e2;
    color: var(--danger);
}

.badge.priority-normal {
    background: var(--gray-100);
    color: var(--gray-500);
}

.badge.priority-on_hold {
    background: #fef3c7;
    color: var(--warning);
}

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

.card-description {
    font-size: 0.9rem;
    color: var(--gray-600);
    margin-bottom: 12px;
}

.card-insights {
    background: #eff6ff;
    border-left: 3px solid var(--primary);
    padding: 10px 14px;
    border-radius: 0 var(--radius) var(--radius) 0;
    margin-bottom: 12px;
}

.card-insights-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.card-insights-text {
    font-size: 0.85rem;
    color: var(--gray-700);
}

.card-next-steps {
    background: #f0fdf4;
    border-left: 3px solid var(--success);
    padding: 10px 14px;
    border-radius: 0 var(--radius) var(--radius) 0;
}

.card-next-steps-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--success);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.card-next-steps-text {
    font-size: 0.85rem;
    color: var(--gray-700);
}

.card-footer {
    padding: 12px 20px;
    background: var(--gray-50);
    border-top: 1px solid var(--gray-100);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-category {
    font-size: 0.75rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-actions {
    display: flex;
    gap: 8px;
}

.btn-status {
    padding: 6px 12px;
    border: none;
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-status.complete {
    background: var(--success);
    color: var(--white);
}

.btn-status.in-progress {
    background: var(--primary);
    color: var(--white);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-content.modal-wide {
    max-width: 800px;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: var(--white);
    z-index: 1;
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray-400);
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.modal-close:hover {
    color: var(--gray-600);
}

.modal-body {
    padding: 24px;
}

.modal-section {
    margin-bottom: 20px;
}

.modal-section label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.modal-section p {
    color: var(--gray-700);
    font-size: 0.95rem;
}

.modal-section ul {
    list-style: none;
    padding: 0;
}

.modal-section ul li {
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.9rem;
    color: var(--gray-700);
}

.modal-section ul li:before {
    content: "•";
    color: var(--primary);
    margin-right: 8px;
}

.modal-section select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.95rem;
    background: var(--white);
}

.modal-section textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px 14px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.95rem;
    resize: vertical;
    font-family: inherit;
}

.modal-section.insights {
    background: #eff6ff;
    padding: 16px;
    border-radius: var(--radius);
    border-left: 4px solid var(--primary);
}

.modal-section.insights label {
    color: var(--primary);
}

.modal-section.next-steps {
    background: #f0fdf4;
    padding: 16px;
    border-radius: var(--radius);
    border-left: 4px solid var(--success);
}

.modal-section.next-steps label {
    color: var(--success);
}

.modal-section.export-comment {
    background: #fef3c7;
    padding: 16px;
    border-radius: var(--radius);
    border-left: 4px solid #f59e0b;
}

.modal-section.export-comment label {
    color: #b45309;
}

.modal-section.export-comment textarea {
    min-height: 80px;
    background: #fffbeb;
    border-color: #fcd34d;
}

.modal-section.export-comment textarea:focus {
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

.label-hint {
    font-weight: 400;
    font-size: 0.75rem;
    color: var(--gray-500);
}

.template-link {
    display: inline-block;
    padding: 10px 16px;
    background: var(--primary);
    color: var(--white);
    text-decoration: none;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
}

.template-link:hover {
    background: var(--primary-dark);
}

/* Affidavit Wizard */
#affidavitWizard {
    min-height: 400px;
}

.wizard-step {
    display: none;
}

.wizard-step.active {
    display: block;
}

.wizard-question {
    margin-bottom: 24px;
}

.wizard-question label {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 12px;
}

.wizard-question input,
.wizard-question select,
.wizard-question textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 1rem;
}

.wizard-question textarea {
    min-height: 100px;
}

.wizard-nav {
    display: flex;
    justify-content: space-between;
    padding-top: 20px;
    border-top: 1px solid var(--gray-200);
}

.wizard-btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
}

.wizard-btn.prev {
    background: var(--gray-200);
    color: var(--gray-700);
}

.wizard-btn.next {
    background: var(--primary);
    color: var(--white);
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .case-info {
        flex-direction: column;
        gap: 8px;
    }

    .progress-bar {
        min-width: 100%;
    }

    .stats-bar {
        grid-template-columns: repeat(2, 1fr);
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-export {
        margin-left: 0;
    }

    .cards-container {
        grid-template-columns: 1fr;
    }
}

/* Notes indicator */
.has-notes {
    position: relative;
}

.has-notes::after {
    content: "";
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: var(--warning);
    border-radius: 50%;
}

/* ===== AUTH STYLES ===== */

/* User Controls in Header */
.user-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-email {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.85rem;
}

.btn-logout {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.2);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Login Modal */
.modal-login {
    max-width: 400px;
}

.modal-login input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.95rem;
}

.modal-login input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.auth-error {
    background: #fee2e2;
    color: var(--danger);
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.auth-actions {
    margin-top: 24px;
}

.btn-primary {
    padding: 12px 24px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-full {
    width: 100%;
}

.auth-switch {
    margin-top: 20px;
    text-align: center;
    padding-top: 16px;
    border-top: 1px solid var(--gray-200);
    color: var(--gray-500);
    font-size: 0.9rem;
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-size: 0.9rem;
    text-decoration: underline;
}

.btn-link:hover {
    color: var(--primary-dark);
}

/* ===== ATTACHMENT STYLES ===== */

/* Attachments Section */
.attachments-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-200);
}

.attachments-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
    min-height: 40px;
}

.no-attachments {
    grid-column: 1 / -1;
    color: var(--gray-400);
    font-size: 0.9rem;
    font-style: italic;
}

.attachment-item {
    position: relative;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 12px;
    cursor: grab;
    transition: all 0.2s;
}

.attachment-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.attachment-item.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.attachment-item.drag-over {
    border-color: var(--primary);
    background: #eff6ff;
}

.attachment-preview {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 8px;
    background: var(--gray-100);
    cursor: pointer;
}

.attachment-preview.pdf-thumbnail {
    width: 100%;
    height: auto;
    max-height: 120px;
    object-fit: contain;
    background: white;
    border: 1px solid var(--gray-200);
}

.attachment-pdf-icon,
.attachment-file-icon {
    width: 100%;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fef3c7;
    border-radius: 4px;
    margin-bottom: 8px;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--warning);
    cursor: pointer;
}

.attachment-file-icon {
    background: var(--gray-100);
    color: var(--gray-500);
}

.attachment-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.attachment-name {
    font-size: 0.75rem;
    color: var(--gray-600);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attachment-type-select {
    font-size: 0.65rem;
    padding: 2px 4px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm, 4px);
    background: var(--white);
    color: var(--gray-600);
    cursor: pointer;
    width: 100%;
}

.attachment-type-select:hover {
    border-color: var(--primary);
}

.attachment-type-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.attachment-delete {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    background: var(--danger);
    color: var(--white);
    border: none;
    border-radius: 50%;
    font-size: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
    line-height: 1;
}

.attachment-item:hover .attachment-delete {
    opacity: 1;
}

/* Dropzone */
.attachment-dropzone {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.attachment-dropzone:hover,
.attachment-dropzone.drag-active {
    border-color: var(--primary);
    background: #eff6ff;
}

.dropzone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.dropzone-icon {
    font-size: 2rem;
    color: var(--gray-400);
    line-height: 1;
}

.dropzone-text {
    color: var(--gray-600);
    font-size: 0.9rem;
}

.dropzone-hint {
    color: var(--gray-400);
    font-size: 0.75rem;
}

/* Attachment Badge on Cards */
.attachment-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: var(--gray-100);
    color: var(--gray-600);
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
}

.attachment-badge::before {
    content: "\1F4CE";
    font-size: 0.75rem;
}

/* Upload Progress */
.upload-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gray-200);
    border-radius: 0 0 var(--radius) var(--radius);
}

.upload-progress-bar {
    height: 100%;
    background: var(--primary);
    border-radius: 0 0 var(--radius) var(--radius);
    transition: width 0.2s;
}

/* Export Package Dropdown */
.export-dropdown {
    position: relative;
    display: inline-block;
}

.btn-export-package {
    padding: 10px 20px;
    background: var(--success);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-export-package:hover {
    background: #15803d;
}

.btn-export-package:disabled {
    background: var(--gray-400);
    cursor: not-allowed;
}

.export-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    min-width: 200px;
    overflow: hidden;
}

.export-menu button {
    display: block;
    width: 100%;
    padding: 12px 16px;
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--gray-700);
    transition: background 0.15s;
}

.export-menu button:hover {
    background: var(--gray-50);
}

.export-menu button:not(:last-child) {
    border-bottom: 1px solid var(--gray-100);
}

/* Invite Button */
.btn-invite {
    padding: 8px 16px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    margin-right: 8px;
    transition: background 0.2s;
}

.btn-invite:hover {
    background: var(--primary-dark);
}

/* Invite Result */
.invite-result {
    margin-top: 20px;
    padding: 16px;
    background: var(--gray-50);
    border-radius: var(--radius);
}

.invite-result label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--gray-700);
}

.invite-link-container {
    display: flex;
    gap: 8px;
}

.invite-link-container input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.85rem;
    background: var(--white);
}

.btn-copy {
    padding: 10px 16px;
    background: var(--success);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
}

.btn-copy:hover {
    background: #15803d;
}

.invite-hint {
    margin-top: 12px;
    font-size: 0.8rem;
    color: var(--gray-500);
}

/* Active Invites List */
.active-invites {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-200);
}

.active-invites > label {
    display: block;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--gray-700);
    font-size: 0.9rem;
}

.active-invites-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.no-invites,
.loading-invites {
    color: var(--gray-400);
    font-size: 0.85rem;
    font-style: italic;
}

.invite-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
}

.invite-item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.invite-item-email {
    font-size: 0.85rem;
    color: var(--gray-700);
    font-weight: 500;
}

.invite-item-expires {
    font-size: 0.75rem;
    color: var(--gray-400);
}

.invite-item-actions {
    display: flex;
    gap: 6px;
}

.btn-copy-sm {
    padding: 6px 12px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-copy-sm:hover {
    background: var(--primary-dark);
}

.btn-delete-sm {
    padding: 6px 10px;
    background: var(--gray-200);
    color: var(--gray-600);
    border: none;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
}

.btn-delete-sm:hover {
    background: var(--danger);
    color: var(--white);
}

.btn-revoke-sm {
    padding: 6px 12px;
    background: var(--warning);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-revoke-sm:hover {
    background: var(--danger);
}

.btn-restore-sm {
    padding: 6px 12px;
    background: var(--success);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-restore-sm:hover {
    background: #15803d;
}

/* Access Management Sections */
.access-section {
    margin-bottom: 16px;
}

.access-section:last-child {
    margin-bottom: 0;
}

.access-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.user-active {
    border-left: 3px solid var(--success);
}

.invite-pending {
    border-left: 3px solid var(--warning);
}

.user-disabled {
    border-left: 3px solid var(--gray-400);
    opacity: 0.7;
}

.invite-item-status {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-active {
    color: var(--success);
}

.status-disabled {
    color: var(--gray-400);
}

/* ===== AFFIDAVITS ADMIN STYLES ===== */

/* Admin Tab Content Layout */
.admin-content {
    display: flex;
    gap: 24px;
    min-height: 500px;
}

.admin-list {
    flex: 1;
    min-width: 0;
}

.admin-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.admin-list-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-700);
}

.admin-list-hint {
    font-size: 0.85rem;
    color: var(--gray-400);
}

/* Session Cards */
.session-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.session-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.session-card.selected {
    border-color: var(--primary);
    background: #eff6ff;
}

.session-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.session-name {
    font-weight: 600;
    color: var(--gray-800);
    font-size: 1rem;
}

.session-name.empty {
    color: var(--gray-400);
    font-style: italic;
}

.session-card-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 0.8rem;
    color: var(--gray-500);
}

.session-type-badge {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.session-type-badge.spouse { background: #fce7f3; color: #be185d; }
.session-type-badge.family { background: #dbeafe; color: #1d4ed8; }
.session-type-badge.friend { background: #dcfce7; color: #16a34a; }
.session-type-badge.professional { background: #fef3c7; color: #b45309; }

/* Side Panel */
.admin-panel {
    width: 400px;
    flex-shrink: 0;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    display: none;
    flex-direction: column;
    max-height: calc(100vh - 300px);
    position: sticky;
    top: 24px;
}

.admin-panel.open {
    display: flex;
}

.admin-panel-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.admin-panel-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-800);
}

.admin-panel-subtitle {
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-top: 4px;
}

.admin-panel-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray-400);
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.admin-panel-close:hover {
    color: var(--gray-600);
}

.admin-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.admin-panel-section {
    margin-bottom: 20px;
}

.admin-panel-section:last-child {
    margin-bottom: 0;
}

.admin-panel-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.admin-panel-progress {
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-panel-progress-bar {
    flex: 1;
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
}

.admin-panel-progress-fill {
    height: 100%;
    background: var(--success);
    border-radius: 4px;
    transition: width 0.3s;
}

.admin-panel-progress-text {
    font-size: 0.85rem;
    color: var(--gray-600);
    white-space: nowrap;
}

.admin-panel-field {
    font-size: 0.9rem;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.admin-panel-field strong {
    color: var(--gray-500);
    font-weight: 500;
}

.admin-notes-textarea {
    width: 100%;
    min-height: 80px;
    padding: 10px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-family: inherit;
    resize: vertical;
}

.admin-notes-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.admin-notes-status {
    font-size: 0.75rem;
    color: var(--gray-400);
    margin-top: 4px;
}

.admin-panel-actions {
    padding: 16px 20px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-admin {
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-admin-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-admin-primary:hover {
    background: var(--primary-dark);
}

.btn-admin-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-admin-secondary:hover {
    background: var(--gray-300);
}

.btn-admin-danger {
    background: var(--gray-200);
    color: var(--danger);
}

.btn-admin-danger:hover {
    background: var(--danger);
    color: var(--white);
}

/* Admin Stats Bar */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.admin-stat {
    background: var(--gray-50);
    border-radius: var(--radius);
    padding: 12px 16px;
    text-align: center;
}

.admin-stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-800);
}

.admin-stat-label {
    font-size: 0.75rem;
    color: var(--gray-500);
    text-transform: uppercase;
}

.admin-stat.complete { border-left: 3px solid var(--success); }
.admin-stat.in-progress { border-left: 3px solid var(--primary); }
.admin-stat.incomplete { border-left: 3px solid var(--gray-400); }

/* Empty State */
.admin-empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--gray-400);
}

.admin-empty-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.admin-empty-text {
    font-size: 1rem;
    margin-bottom: 16px;
}

/* Delete Confirmation Modal */
.delete-confirm-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.9rem;
    margin-top: 12px;
}