/* Base Styles */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    background: #f3f4f6;
    color: #111827;
}

/* Loading Screen */
.loading-screen {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: #f3f4f6;
    color: #111827;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(79, 70, 229, 0.15);
    border-top-color: #4f46e5;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

.loading-screen p {
    font-size: 1.1rem;
    color: #6b7280;
}

/* Blazor Error UI */
#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* Prevent text selection when copy is disabled */
.no-select {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Print-blocked styles */
@media print {
    .print-blocked * {
        display: none !important;
    }

    .print-blocked::after {
        content: "Printing is not allowed for this document";
        display: block;
        text-align: center;
        font-size: 24px;
        margin-top: 100px;
    }
}

/* Screenshot protection overlay (limited effectiveness) */
.screenshot-protected {
    position: relative;
}

.screenshot-protected::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 9999;
}

/* Valid component input styles */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
    font-size: 0.85rem;
}

/* Blazored Toast overrides */
.blazored-toast {
    font-family: inherit;
}

/* Blazored Modal overrides */
.blazored-modal {
    font-family: inherit;
}

/* ===== ONLYOFFICE Viewer Styles ===== */

/* Main viewer container */
.viewer-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
    background: #1e1e1e;
    overflow: hidden;
}

/* Loading state */
.viewer-loading {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    color: #fff;
}

.viewer-loading .spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: #4a90d9;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

.viewer-loading p {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
}

/* Error state */
.viewer-error {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    color: #fff;
    text-align: center;
    padding: 2rem;
}

.viewer-error .error-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.viewer-error h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
    color: #ff6b6b;
}

.viewer-error p {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 0 0 1.5rem;
    max-width: 400px;
}

.viewer-error .btn-back {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    background: #4a90d9;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.viewer-error .btn-back:hover {
    background: #3a7dc9;
}

/* Minimal toolbar */
.viewer-toolbar-minimal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    background: #2d2d2d;
    border-bottom: 1px solid #3a3a3a;
    min-height: 48px;
}

.toolbar-left,
.toolbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.tool-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s;
}

.tool-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.doc-name {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Rights badges */
.rights-info {
    display: flex;
    gap: 0.5rem;
}

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

.right-badge.allowed {
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
    border: 1px solid rgba(46, 204, 113, 0.3);
}

.right-badge.denied {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, 0.3);
}

/* Session timer */
.session-timer {
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 500;
    background: rgba(52, 152, 219, 0.2);
    color: #3498db;
    border-radius: 4px;
}

/* Camera Detection Status Indicator */
.camera-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.85rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 20px;
    transition: all 0.3s ease;
    margin-right: 0.5rem;
}

.camera-status svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.camera-status .status-text {
    white-space: nowrap;
}

.camera-status .status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

/* Active state - green */
.camera-status.active {
    background: rgba(46, 204, 113, 0.15);
    color: #2ecc71;
    border: 1px solid rgba(46, 204, 113, 0.3);
}

.camera-status.active .status-dot {
    background: #2ecc71;
    box-shadow: 0 0 6px rgba(46, 204, 113, 0.6);
}

/* Degraded state - amber/orange */
.camera-status.degraded {
    background: rgba(241, 196, 15, 0.15);
    color: #f39c12;
    border: 1px solid rgba(241, 196, 15, 0.3);
}

.camera-status.degraded .status-dot {
    background: #f39c12;
    box-shadow: 0 0 6px rgba(241, 196, 15, 0.6);
}

/* Error state - red */
.camera-status.error {
    background: rgba(231, 76, 60, 0.15);
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, 0.3);
}

.camera-status.error .status-dot {
    background: #e74c3c;
    box-shadow: 0 0 6px rgba(231, 76, 60, 0.6);
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.9); }
}

/* ONLYOFFICE content area */
.viewer-content {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.viewer-content.onlyoffice-mode {
    display: flex;
    flex-direction: column;
}

.onlyoffice-editor {
    flex: 1;
    width: 100%;
    height: 100%;
    min-height: 0;
    background: #111827;  /* Dark background to prevent white flash */
}

/* ONLYOFFICE iframe styling */
.onlyoffice-editor iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #111827;  /* Dark background during iframe load */
}

/* ===== Camera Permission Modal Styles (Dark Theme) ===== */

.camera-permission-modal {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    background: #1e1e1e;
    padding: 2rem;
}

.camera-permission-content {
    background: rgba(45, 45, 45, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 2.5rem;
    max-width: 480px;
    width: 100%;
    text-align: center;
    box-shadow: 0 0 40px rgba(74, 144, 217, 0.15),
                0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Camera icon with SVG styling */
.camera-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.5rem;
}

.camera-icon svg {
    width: 64px;
    height: 64px;
    color: #4a90d9;
    filter: drop-shadow(0 0 20px rgba(74, 144, 217, 0.4));
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        filter: drop-shadow(0 0 20px rgba(74, 144, 217, 0.4));
    }
    50% {
        filter: drop-shadow(0 0 30px rgba(74, 144, 217, 0.6));
    }
}

.camera-permission-content h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    margin: 0 0 0.75rem;
}

.camera-permission-content > p {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 0 0 1.5rem;
    line-height: 1.6;
}

.camera-permission-info {
    background: rgba(30, 30, 30, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    text-align: left;
}

.camera-permission-info ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.camera-permission-info li {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    padding: 0.5rem 0;
    padding-left: 1.75rem;
    position: relative;
}

.camera-permission-info li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    background: rgba(46, 204, 113, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.camera-permission-info li::after {
    content: "✓";
    position: absolute;
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
    color: #2ecc71;
    font-size: 0.7rem;
    font-weight: 700;
}

.camera-permission-buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.camera-permission-buttons .btn-primary {
    flex: 1;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    background: linear-gradient(135deg, #4a90d9 0%, #3a7dc9 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(74, 144, 217, 0.3);
}

.camera-permission-buttons .btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #5a9de9 0%, #4a8dd9 100%);
    box-shadow: 0 6px 20px rgba(74, 144, 217, 0.4);
    transform: translateY(-1px);
}

.camera-permission-buttons .btn-primary:active:not(:disabled) {
    transform: translateY(0) scale(0.98);
}

.camera-permission-buttons .btn-primary:disabled {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.4);
    box-shadow: none;
    cursor: not-allowed;
}

.camera-permission-buttons .btn-secondary {
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.camera-permission-buttons .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.9);
}

.camera-error {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(231, 76, 60, 0.15);
    border: 1px solid rgba(231, 76, 60, 0.3);
    border-radius: 8px;
    color: #ff6b6b;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.camera-error svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ========================================
   Dark Mode Input Styling (Global)
   ======================================== */

/* Datetime picker - custom calendar icon for dark mode */
input[type="datetime-local"],
input[type="date"],
input[type="time"] {
    color-scheme: dark;
    position: relative;
}

/* Hide default calendar icon and replace with custom white SVG */
input[type="datetime-local"]::-webkit-calendar-picker-indicator,
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 1;
    width: 20px;
    height: 20px;
    /* White calendar icon as data URI */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 18px 18px;
}

input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover,
input[type="date"]::-webkit-calendar-picker-indicator:hover,
input[type="time"]::-webkit-calendar-picker-indicator:hover {
    opacity: 0.8;
}

/* Number input spinner buttons */
input[type="number"] {
    color-scheme: dark;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   EMAIL VIEWER STYLES — Light Professional Enterprise Theme
   ═══════════════════════════════════════════════════════════════════════════════ */

/* Email Viewer Container */
.email-viewer-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: #f3f4f6;
    color: #111827;
}

/* Loading State */
.email-viewer-loading {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    gap: 1rem;
    background: #f3f4f6;
}

.email-viewer-loading .loading-spinner {
    border-color: rgba(79, 70, 229, 0.15);
    border-top-color: #4f46e5;
}

.email-viewer-loading p {
    color: #6b7280;
    font-size: 1rem;
}

/* Error State */
.email-viewer-error {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    text-align: center;
    padding: 2rem;
    background: #f3f4f6;
}

.email-viewer-error .error-icon {
    width: 64px;
    height: 64px;
    color: #dc2626;
    margin-bottom: 1.5rem;
}

.email-viewer-error .error-icon svg {
    width: 100%;
    height: 100%;
}

.email-viewer-error h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 0.5rem;
}

.email-viewer-error p {
    color: #6b7280;
    margin: 0 0 0.5rem;
    max-width: 400px;
}

.email-viewer-error .error-detail {
    color: #9ca3af;
    font-size: 0.875rem;
}

/* ═══════════════════════════════════════════════════════
   Access Denied / Request Access — Premium Enterprise
   ═══════════════════════════════════════════════════════ */

.email-access-denied {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem;
    background: #f3f4f6;
}

.access-denied-card {
    background: #ffffff;
    border-radius: 16px;
    border-top: 3px solid #4f46e5;
    padding: 2.5rem 2rem 2rem;
    max-width: 480px;
    width: 100%;
    text-align: center;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1),
                0 2px 4px -2px rgba(0,0,0,0.1);
}

/* ── Shield Icon ── */
.ad-icon-wrapper {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #eef2ff;
    color: #4f46e5;
}
.ad-icon-wrapper svg {
    width: 32px;
    height: 32px;
}

/* ── Heading ── */
.access-denied-card h2 {
    font-size: 1.375rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 0.375rem;
    letter-spacing: -0.01em;
}

.ad-subtitle {
    color: #6b7280;
    font-size: 0.9rem;
    margin: 0 0 1.5rem;
    line-height: 1.5;
}

/* ── Email Info Preview ── */
.ad-email-info {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 0.875rem 1rem;
    margin-bottom: 1.25rem;
    text-align: left;
}

.ad-info-row {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    color: #6b7280;
    font-size: 0.8125rem;
}
.ad-info-row + .ad-info-row {
    margin-top: 0.5rem;
}
.ad-info-row svg {
    flex-shrink: 0;
    color: #9ca3af;
}
.ad-info-text {
    color: #374151;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Status Banner ── */
.ad-status-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: 10px;
    margin-bottom: 1.25rem;
    text-align: left;
    font-size: 0.8125rem;
    line-height: 1.5;
}
.ad-status-banner > svg {
    flex-shrink: 0;
    margin-top: 1px;
}
.ad-status-content {
    flex: 1;
    min-width: 0;
}
.ad-status-content p {
    margin: 0;
}

/* Status variants */
.ad-status-pending {
    background: #fffbeb;
    border-left: 3px solid #f59e0b;
    color: #92400e;
}
.ad-status-approved {
    background: #f0fdf4;
    border-left: 3px solid #22c55e;
    color: #166534;
}
.ad-status-denied {
    background: #fef2f2;
    border-left: 3px solid #ef4444;
    color: #991b1b;
}

.ad-btn-verify {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    margin-top: 0.625rem;
    padding: 0.375rem 0.875rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #ffffff;
    background: #4f46e5;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
}
.ad-btn-verify:hover {
    background: #4338ca;
}

/* ── CTA Button ── */
.ad-btn-request {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.8rem 1.25rem;
    margin-top: 0.25rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #ffffff;
    background: #4f46e5;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(79,70,229,0.3);
    transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}
.ad-btn-request:hover {
    background: #4338ca;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79,70,229,0.3);
}
.ad-btn-request:active {
    transform: translateY(0);
}

/* ── Request Access Form ── */
.ad-form {
    text-align: left;
    margin-top: 1.25rem;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
}

.ad-form-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.125rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #111827;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}
.ad-form-header svg {
    color: #4f46e5;
}

.ad-form-body {
    padding: 1.125rem;
}

.ad-field {
    margin-bottom: 1rem;
}
.ad-field:last-child {
    margin-bottom: 0;
}

.ad-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.375rem;
}

.ad-required {
    color: #ef4444;
    margin-left: 2px;
}

.ad-input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    color: #111827;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}
.ad-input:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79,70,229,0.08);
}
.ad-input::placeholder {
    color: #9ca3af;
}
.ad-input:disabled {
    background: #f9fafb;
    color: #6b7280;
}

/* Verified email */
.ad-input-verified {
    background: #f0fdf4 !important;
    border-color: #86efac !important;
}

.ad-input-wrapper {
    position: relative;
}

.ad-verified-tag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-top: 4px;
    font-size: 0.6875rem;
    font-weight: 600;
    color: #16a34a;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* ── Divider ── */
.ad-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 0.75rem 0;
}

/* ── Permission pills ── */
.ad-permissions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.ad-perm-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #6b7280;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
}
.ad-perm-pill input[type="checkbox"] {
    display: none;
}
.ad-perm-pill svg {
    display: none;
}
.ad-perm-pill:hover {
    border-color: #c7d2fe;
    background: #eef2ff;
}

.ad-perm-active {
    color: #ffffff;
    background: #4f46e5;
    border-color: #4f46e5;
}
.ad-perm-active svg {
    display: inline;
}
.ad-perm-active:hover {
    background: #4338ca;
    border-color: #4338ca;
}

/* ── Textarea + char count ── */
.ad-textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    font-family: inherit;
    color: #111827;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    resize: vertical;
    min-height: 80px;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}
.ad-textarea:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79,70,229,0.08);
}
.ad-textarea::placeholder {
    color: #9ca3af;
}

.ad-char-count {
    text-align: right;
    font-size: 0.6875rem;
    color: #9ca3af;
    margin-top: 3px;
}

/* ── Urgency radio group ── */
.ad-urgency-group {
    display: flex;
    gap: 0.5rem;
}

.ad-urgency-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #6b7280;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
}
.ad-urgency-option input[type="radio"] {
    display: none;
}
.ad-urgency-option:hover {
    border-color: #c7d2fe;
    background: #eef2ff;
}

.ad-urgency-active {
    color: #4f46e5;
    background: #eef2ff;
    border-color: #4f46e5;
    font-weight: 600;
}

/* ── Form error ── */
.ad-form-error {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-top: 0.75rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    color: #dc2626;
    background: rgba(220,38,38,0.04);
    border: 1px solid rgba(220,38,38,0.12);
    border-radius: 8px;
}
.ad-form-error svg {
    flex-shrink: 0;
}

/* ── Form footer ── */
.ad-form-footer {
    display: flex;
    gap: 0.75rem;
    padding: 0.875rem 1.125rem;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

.ad-btn-cancel {
    flex: 1;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.ad-btn-cancel:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.ad-btn-submit {
    flex: 2;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #ffffff;
    background: #4f46e5;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
    box-shadow: 0 1px 2px rgba(79,70,229,0.2);
}
.ad-btn-submit:hover:not(:disabled) {
    background: #4338ca;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(79,70,229,0.25);
}
.ad-btn-submit:active:not(:disabled) {
    transform: translateY(0);
}
.ad-btn-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

/* ── Success block ── */
.ad-success-block {
    text-align: center;
    margin-top: 1.25rem;
    animation: adFadeIn 0.35s ease;
}

@keyframes adFadeIn {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

.ad-success-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #ecfdf5;
    color: #059669;
}
.ad-success-icon svg {
    width: 26px;
    height: 26px;
}

.ad-success-block h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #059669;
    margin: 0 0 0.375rem;
}

.ad-success-block p {
    color: #6b7280;
    font-size: 0.875rem;
    margin: 0 0 0.25rem;
    line-height: 1.5;
}

.ad-success-detail {
    margin-top: 0.75rem;
}

.ad-request-id {
    display: inline-block;
    font-family: monospace;
    font-size: 0.75rem;
    color: #6b7280;
    background: #f3f4f6;
    padding: 0.25rem 0.625rem;
    border-radius: 4px;
}

.ad-success-info {
    font-size: 0.8125rem !important;
    color: #9ca3af !important;
    margin-top: 0.625rem !important;
}

/* ── Footer ── */
.ad-footer {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #f3f4f6;
    font-size: 0.6875rem;
    color: #9ca3af;
    letter-spacing: 0.02em;
}

/* ── Responsive ── */
@media (max-width: 520px) {
    .access-denied-card {
        padding: 2rem 1.25rem 1.5rem;
        border-radius: 12px;
    }
    .ad-form-footer {
        flex-direction: column;
    }
    .ad-btn-cancel, .ad-btn-submit {
        flex: unset;
        width: 100%;
    }
    .ad-urgency-group {
        flex-direction: column;
    }
}

/* Authentication State */
.email-auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem;
    background: #f3f4f6;
}

.email-auth-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 2.5rem;
    max-width: 450px;
    width: 100%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header .email-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 1rem;
    color: #4f46e5;
}

.auth-header .email-icon svg { width: 100%; height: 100%; }

.auth-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 0.5rem;
}

.auth-header .email-subject { color: #374151; font-size: 0.9rem; margin: 0 0 0.25rem; }
.auth-header .email-sender { color: #6b7280; font-size: 0.875rem; margin: 0; }

/* Verification Options */
.verification-options { text-align: center; }
.verification-options .verification-prompt { color: #374151; margin: 0 0 1rem; }
.verification-options .recipient-info { color: #6b7280; font-size: 0.875rem; margin: 0 0 1.5rem; }
.verification-options .recipient-info strong { color: #111827; }

/* Email Input Section */
.email-input-section { margin-bottom: 1.5rem; }
.email-input-section .verification-intro { color: #374151; font-size: 0.9rem; margin: 0 0 1rem; line-height: 1.5; }

.email-form-group { margin-top: 0.75rem; }
.email-form-group .email-input {
    width: 100%; padding: 0.875rem 1rem; border: 1px solid #d1d5db;
    border-radius: 8px; font-size: 1rem; transition: all 0.2s ease;
    background: #fff; color: #111827;
}
.email-form-group .email-input::placeholder { color: #9ca3af; }
.email-form-group .email-input:focus { outline: none; border-color: #4f46e5; box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1); }
.email-form-group .email-input.input-error { border-color: #dc2626; }
.email-form-group .email-input:disabled { background: #f3f4f6; cursor: not-allowed; opacity: 0.7; }

.input-error-message { display: block; color: #dc2626; font-size: 0.875rem; margin-top: 0.5rem; }
.recipient-email { color: #111827; font-weight: 600; }

.btn-spinner {
    display: inline-block; width: 16px; height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3); border-top-color: #ffffff;
    border-radius: 50%; animation: spin 0.8s linear infinite; margin-right: 0.5rem;
}

.btn-send-code {
    display: flex; align-items: center; justify-content: center; gap: 0.5rem;
    width: 100%; padding: 0.875rem 1.5rem; font-size: 1rem; font-weight: 600;
    background: #4f46e5; color: #fff; border: none; border-radius: 10px;
    cursor: pointer; transition: all 0.2s; box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
}
.btn-send-code:hover:not(:disabled) { background: #4338ca; box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35); transform: translateY(-1px); }
.btn-send-code:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-send-code svg { width: 20px; height: 20px; }

.auth-divider { display: flex; align-items: center; gap: 1rem; margin: 1.5rem 0; color: #9ca3af; font-size: 0.875rem; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: #e5e7eb; }

.btn-uaepass {
    display: flex; align-items: center; justify-content: center; gap: 0.75rem;
    width: 100%; padding: 0.875rem 1.5rem; font-size: 1rem; font-weight: 600;
    background: #fff; color: #1e3a5f; border: 1px solid #d1d5db; border-radius: 10px;
    cursor: pointer; transition: all 0.2s;
}
.btn-uaepass:hover:not(:disabled) { background: #f9fafb; border-color: #9ca3af; }
.btn-uaepass:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-uaepass .uaepass-logo { height: 24px; width: auto; }

/* Code Entry Section */
.code-entry-section { text-align: center; }
.code-sent-message { display: flex; align-items: center; justify-content: center; gap: 0.5rem; color: #059669; font-size: 0.875rem; margin: 0 0 1.5rem; }
.code-sent-message svg { width: 18px; height: 18px; }
.code-instruction { color: #374151; font-size: 0.9rem; margin: 0 0 1rem; }

.code-inputs { display: flex; justify-content: center; gap: 0.5rem; margin-bottom: 1rem; }
.code-input {
    width: 48px; height: 56px; font-size: 1.5rem; font-weight: 600; text-align: center;
    background: #fff; border: 1px solid #d1d5db; border-radius: 8px; color: #111827; transition: all 0.2s;
}
.code-input:focus { outline: none; border-color: #4f46e5; box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15); }
.code-inputs.has-error .code-input { border-color: rgba(220, 38, 38, 0.5); }
.code-error-message { color: #dc2626; font-size: 0.875rem; margin: 0 0 1rem; }

.btn-verify {
    width: 100%; padding: 0.875rem 1.5rem; font-size: 1rem; font-weight: 600;
    background: #059669; color: #fff; border: none; border-radius: 10px;
    cursor: pointer; transition: all 0.2s; box-shadow: 0 2px 8px rgba(5, 150, 105, 0.25);
}
.btn-verify:hover:not(:disabled) { background: #047857; box-shadow: 0 4px 12px rgba(5, 150, 105, 0.35); transform: translateY(-1px); }
.btn-verify:disabled { opacity: 0.6; cursor: not-allowed; }

.resend-section { margin-top: 1.5rem; }
.resend-countdown { color: #9ca3af; font-size: 0.875rem; margin: 0; }
.btn-link { background: none; border: none; color: #4f46e5; font-size: 0.875rem; cursor: pointer; text-decoration: underline; transition: color 0.2s; }
.btn-link:hover { color: #4338ca; }
.btn-link:disabled { color: #9ca3af; cursor: not-allowed; }

.uaepass-verifying { display: flex; flex-direction: column; align-items: center; gap: 1rem; padding: 2rem; }
.uaepass-verifying p { color: #6b7280; margin: 0; }

.auth-error {
    display: flex; align-items: center; gap: 0.5rem; margin-top: 1.5rem;
    padding: 0.75rem 1rem; background: rgba(220, 38, 38, 0.05); border: 1px solid rgba(220, 38, 38, 0.2);
    border-radius: 8px; color: #dc2626; font-size: 0.875rem;
}
.auth-error svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════════════════════════════
   EMAIL CONTENT — Premium Enterprise Layout
   ═══════════════════════════════════════════════════════════════════════════════ */

.email-viewer-content {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: #f3f4f6;
}

/* ── TOP BAR ── */
.ev-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.5rem;
    height: 52px;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 100;
}

.ev-topbar-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.ev-btn-back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.15s;
}
.ev-btn-back:hover { background: #f3f4f6; color: #111827; }
.ev-btn-back svg { width: 18px; height: 18px; }

.ev-topbar-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #111827;
}

.ev-shield-icon {
    width: 18px;
    height: 18px;
    color: #059669;
}

.ev-topbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.ev-user-email {
    font-size: 0.8rem;
    color: #6b7280;
}

.ev-expiry-badge {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 12px;
}
.ev-expiry-badge svg { width: 12px; height: 12px; }
.ev-expiry-ok { background: rgba(5, 150, 105, 0.08); color: #059669; }
.ev-expiry-warning { background: rgba(217, 119, 6, 0.08); color: #d97706; }

/* ── PAGE BACKGROUND ── */
.ev-page-bg {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
}

/* ── EMAIL CARD ── */
.ev-email-card {
    max-width: 900px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

/* ── SENDER AREA ── */
.ev-sender-area {
    padding: 1.25rem 1.5rem;
}

.ev-sender-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.ev-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    flex-shrink: 0;
    letter-spacing: 0.5px;
}

.ev-sender-details {
    flex: 1;
    min-width: 0;
}

.ev-sender-line {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.ev-sender-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #111827;
}

.ev-sender-email-addr {
    font-size: 0.8rem;
    color: #6b7280;
}

.ev-recipients-line {
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: 0.2rem;
    line-height: 1.4;
}

.ev-recipients-label {
    color: #9ca3af;
    margin-right: 0.25rem;
}

.ev-recipients-undisclosed {
    font-style: italic;
    color: #9ca3af;
}

.ev-btn-more-recipients {
    background: none;
    border: none;
    color: #4f46e5;
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0;
    margin-left: 0.25rem;
}
.ev-btn-more-recipients:hover { text-decoration: underline; }

.ev-date-col {
    font-size: 0.8rem;
    color: #6b7280;
    white-space: nowrap;
    flex-shrink: 0;
    padding-top: 0.15rem;
}

/* ── SUBJECT ── */
.ev-subject-area {
    padding: 0 1.5rem 1.25rem;
    border-bottom: 1px solid #e5e7eb;
}

.ev-subject {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ev-subject-empty {
    font-style: italic;
    color: #9ca3af;
    font-weight: 400;
}

/* ── EMAIL BODY (iframe) ── */
.ev-body-area {
    position: relative;
    min-height: 200px;
}

.ev-body-iframe {
    width: 100%;
    min-height: 200px;
    border: none;
    display: block;
    background: #fff;
}

.ev-body-empty {
    padding: 3rem 1.5rem;
    text-align: center;
    color: #9ca3af;
    font-size: 0.9rem;
}

/* ── ATTACHMENTS ── */
.ev-attachments {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.ev-attachments-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #374151;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
}

.ev-attachments-header svg { width: 16px; height: 16px; color: #6b7280; }

.ev-attachments-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.ev-attachment-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.85rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    min-width: 180px;
}

.ev-attachment-icon { width: 28px; height: 28px; color: #6b7280; }
.ev-attachment-icon svg { width: 100%; height: 100%; }

.ev-attachment-info { flex: 1; min-width: 0; }
.ev-attachment-name { display: block; color: #111827; font-size: 0.8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-attachment-size { display: block; color: #9ca3af; font-size: 0.7rem; }

.ev-btn-attachment {
    display: flex; align-items: center; gap: 0.3rem;
    padding: 0.3rem 0.6rem; background: transparent;
    border: 1px solid #d1d5db; border-radius: 4px;
    color: #4f46e5; font-size: 0.7rem; cursor: pointer; transition: all 0.15s;
}
.ev-btn-attachment:hover { background: rgba(79, 70, 229, 0.05); border-color: #4f46e5; }
.ev-btn-attachment svg { width: 12px; height: 12px; }

/* ── ACTION BAR ── */
.ev-actionbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.5rem;
    height: 56px;
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
    position: sticky;
    bottom: 0;
    z-index: 100;
}

.ev-actionbar-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ev-actionbar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}

.ev-btn-action {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.85rem;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    border: none;
}
.ev-btn-action svg { width: 16px; height: 16px; }

.ev-btn-action-primary {
    background: #4f46e5;
    color: #fff;
}
.ev-btn-action-primary:hover { background: #4338ca; }

.ev-btn-action-outline {
    background: transparent;
    color: #4f46e5;
    border: 1px solid #d1d5db;
}
.ev-btn-action-outline:hover { background: rgba(79, 70, 229, 0.05); border-color: #4f46e5; }

.ev-btn-action-subtle {
    background: transparent;
    color: #6b7280;
}
.ev-btn-action-subtle:hover { background: #f3f4f6; color: #111827; }

/* Security Status + Permissions Popover */
.ev-security-status {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: #059669;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.15s;
}
.ev-security-status:hover { background: rgba(5, 150, 105, 0.05); }

.ev-shield-icon-sm { width: 16px; height: 16px; color: #059669; }

.ev-btn-perms-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: none;
    border: none;
    color: #059669;
    cursor: pointer;
    padding: 0;
}
.ev-btn-perms-toggle svg { width: 14px; height: 14px; transition: transform 0.2s; }
.ev-chevron-up { transform: rotate(180deg); }

.ev-permissions-popover {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 1rem;
    min-width: 220px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.06);
    z-index: 200;
}

.ev-popover-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.ev-popover-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.ev-perm-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: #374151;
}

.ev-perm-icon {
    font-weight: 700;
    font-size: 0.85rem;
}
.ev-perm-yes { color: #059669; }
.ev-perm-no { color: #dc2626; }

.ev-popover-footer {
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid #e5e7eb;
    font-size: 0.7rem;
    color: #9ca3af;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

/* ── MODAL STYLES (light theme) ── */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 1rem;
}

.smart-share-modal,
.reply-modal {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h3 { font-size: 1.125rem; font-weight: 600; color: #111827; margin: 0; }

.btn-close {
    width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
    background: transparent; border: none; color: #9ca3af; cursor: pointer; border-radius: 6px; transition: all 0.2s;
}
.btn-close:hover { background: #f3f4f6; color: #111827; }
.btn-close svg { width: 18px; height: 18px; }

.modal-body { padding: 1.5rem; }
.modal-body .form-group { margin-bottom: 1.25rem; }
.modal-body .form-group:last-child { margin-bottom: 0; }
.modal-body label { display: block; font-size: 0.875rem; color: #6b7280; margin-bottom: 0.5rem; }

.modal-body input,
.modal-body textarea {
    width: 100%; padding: 0.75rem 1rem; font-size: 0.875rem;
    background: #fff; border: 1px solid #d1d5db; border-radius: 8px;
    color: #111827; transition: border-color 0.2s;
}
.modal-body input:focus, .modal-body textarea:focus { outline: none; border-color: #4f46e5; box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1); }
.modal-body input:disabled { opacity: 0.6; cursor: not-allowed; background: #f3f4f6; }

.recipients-input-container {
    background: #fff; border: 1px solid #d1d5db; border-radius: 8px; padding: 0.5rem;
}
.recipients-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.5rem; }
.recipients-tags:empty { display: none; }

.recipient-tag {
    display: flex; align-items: center; gap: 0.25rem; padding: 0.25rem 0.5rem;
    background: rgba(79, 70, 229, 0.08); border-radius: 4px; color: #4f46e5; font-size: 0.8rem;
}
.btn-remove-tag {
    width: 16px; height: 16px; display: flex; align-items: center; justify-content: center;
    background: transparent; border: none; color: currentColor; cursor: pointer; padding: 0; opacity: 0.7; transition: opacity 0.2s;
}
.btn-remove-tag:hover { opacity: 1; }
.btn-remove-tag svg { width: 12px; height: 12px; }

.recipients-input-container input { background: transparent; border: none; padding: 0.5rem; }
.recipients-input-container input:focus { border: none; box-shadow: none; }

.share-notice {
    display: flex; gap: 0.75rem; padding: 0.75rem 1rem;
    background: rgba(217, 119, 6, 0.05); border: 1px solid rgba(217, 119, 6, 0.15);
    border-radius: 8px; margin-top: 1rem;
}
.share-notice svg { width: 18px; height: 18px; color: #d97706; flex-shrink: 0; margin-top: 0.15rem; }
.share-notice p { color: #92400e; font-size: 0.8rem; margin: 0; line-height: 1.5; }

.modal-footer {
    display: flex; justify-content: flex-end; gap: 0.75rem;
    padding: 1rem 1.5rem; border-top: 1px solid #e5e7eb;
}

/* Success State in Modals */
.share-success { text-align: center; padding: 2rem 1.5rem; }
.share-success .success-icon { width: 56px; height: 56px; color: #059669; margin: 0 auto 1rem; }
.share-success .success-icon svg { width: 100%; height: 100%; }
.share-success h3 { font-size: 1.25rem; font-weight: 600; color: #059669; margin: 0 0 0.5rem; }
.share-success p { color: #6b7280; margin: 0 0 1.5rem; }

/* Button Styles */
.btn-primary {
    padding: 0.75rem 1.5rem; font-size: 0.9rem; font-weight: 600;
    background: #4f46e5; color: #fff; border: none; border-radius: 8px;
    cursor: pointer; transition: all 0.2s;
}
.btn-primary:hover:not(:disabled) { background: #4338ca; box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-secondary {
    padding: 0.75rem 1.5rem; font-size: 0.9rem; font-weight: 500;
    background: transparent; color: #6b7280; border: 1px solid #d1d5db;
    border-radius: 8px; cursor: pointer; transition: all 0.2s;
}
.btn-secondary:hover:not(:disabled) { background: #f9fafb; border-color: #9ca3af; color: #374151; }
.btn-secondary:disabled { opacity: 0.6; cursor: not-allowed; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
    .ev-topbar { padding: 0 1rem; }
    .ev-topbar-title span { display: none; }
    .ev-user-email { display: none; }

    .ev-page-bg { padding: 0.75rem; }
    .ev-email-card { border-radius: 8px; }
    .ev-sender-area { padding: 1rem; }
    .ev-subject-area { padding: 0 1rem 1rem; }
    .ev-attachments { padding: 1rem; }

    .ev-actionbar { padding: 0 1rem; }
    .ev-action-label { display: none; }
    .ev-btn-action { padding: 0.5rem; }

    .ev-date-col { display: none; }
}

@media (max-width: 480px) {
    .ev-sender-row { flex-direction: column; }
    .ev-sender-row .ev-avatar { margin-bottom: 0.25rem; }

    .ev-permissions-popover {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        border-radius: 16px 16px 0 0;
        min-width: 100%;
    }

    .code-inputs { gap: 0.35rem; }
    .code-input { width: 40px; height: 48px; font-size: 1.25rem; }

    .email-auth-card, .access-denied-card { padding: 1.5rem; }
}
