 /* Catapult Drive — Global Stylesheet */
 :root {
     --brand-primary: #E51B73;
     --brand-primary-hover: #c91463;
     --brand-primary-light: #fdf2f8;
     --brand-primary-ring: rgba(229, 27, 115, 0.15);
     --bg-page: #f4f6f8;
     --text-main: #0f172a;
     --text-muted: #64748b;
     --border-color: #e2e8f0;
     --border-radius-capsule: 9999px;
     --border-radius-card: 14px;
 }

 * {
     box-sizing: border-box;
 }

 body {
     margin: 0;
     font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
     background: var(--bg-page);
     color: var(--text-main);
     line-height: 1.5;
 }

 /* Typography & Helpers */
 h1,
 h2,
 h3,
 h4 {
     color: var(--text-main);
     margin-top: 0;
     font-weight: 700;
 }

 .muted {
     color: var(--text-muted);
 }

 .small {
     font-size: 13px;
 }

 /* Buttons & Capsule Elements */
 button,
 .btn {
     font-family: inherit;
     font-size: 14px;
     font-weight: 600;
     border-radius: var(--border-radius-capsule);
     border: none;
     cursor: pointer;
     display: inline-flex;
     align-items: center;
     justify-content: center;
     gap: 6px;
     padding: 9px 20px;
     transition: all 0.15s ease;
     text-decoration: none;
     line-height: 1.3;
 }

 button:active,
 .btn:active {
     transform: scale(0.99);
 }

 .btn-primary,
 button[type="submit"].btn-primary,
 .btn-brand {
     background: var(--brand-primary);
     color: #ffffff;
     border: 1px solid var(--brand-primary);
 }

 .btn-primary:hover,
 button[type="submit"].btn-primary:hover,
 .btn-brand:hover {
     background: var(--brand-primary-hover);
     border-color: var(--brand-primary-hover);
     color: #ffffff;
 }

 .btn-secondary {
     background: #f1f5f9;
     color: #334155;
     border: 1px solid #cbd5e1;
 }

 .btn-secondary:hover {
     background: #e2e8f0;
     color: #0f172a;
 }

 .btn-danger {
     background: #dc2626;
     color: #ffffff;
     border: 1px solid #dc2626;
 }

 .btn-danger:hover {
     background: #b91c1c;
     border-color: #b91c1c;
     color: #ffffff;
 }

 .btn-sm,
 .btn-secondary-sm,
 .btn-brand-sm {
     padding: 6px 14px;
     font-size: 12px;
     font-weight: 600;
     border-radius: var(--border-radius-capsule);
     text-decoration: none;
     display: inline-flex;
     align-items: center;
     gap: 4px;
     cursor: pointer;
     border: 1px solid transparent;
 }

 .btn-brand-sm {
     background: var(--brand-primary);
     color: #ffffff;
     border-color: var(--brand-primary);
 }

 .btn-brand-sm:hover {
     background: var(--brand-primary-hover);
     color: #ffffff;
 }

 .btn-secondary-sm {
     background: #f1f5f9;
     color: #334155;
     border-color: #cbd5e1;
 }

 .btn-secondary-sm:hover {
     background: #e2e8f0;
     color: #0f172a;
 }

 /* Header & Topbar */
 .topbar {
     height: 64px;
     background: #ffffff;
     border-bottom: 1px solid var(--border-color);
     padding: 0 28px;
     display: flex;
     align-items: center;
     justify-content: space-between;
 }

 .topbar .brand {
     display: flex;
     align-items: center;
     text-decoration: none;
 }

 .app-logo {
     height: 34px;
     max-width: 220px;
     object-fit: contain;
     vertical-align: middle;
     display: inline-block;
 }

 .topbar .nav-actions {
     display: flex;
     align-items: center;
     gap: 10px;
 }

 .topbar .nav-user {
     font-size: 14px;
     font-weight: 600;
     color: var(--text-main);
     margin-right: 6px;
 }

 /* Containers */
 .page {
     max-width: 1100px;
     margin: 28px auto;
     padding: 0 20px;
 }

 .card {
     background: #ffffff;
     border: 1px solid var(--border-color);
     border-radius: var(--border-radius-card);
     padding: 24px;
     box-shadow: 0 4px 18px rgba(0, 0, 0, 0.03);
 }

 /* Tabs */
 .tabs-nav {
     display: flex;
     gap: 12px;
     border-bottom: 2px solid var(--border-color);
     margin-bottom: 20px;
 }

 .tab-btn {
     background: transparent;
     border: none;
     border-bottom: 3px solid transparent;
     padding: 10px 18px;
     font-size: 13px;
     font-weight: 700;
     color: var(--text-muted);
     cursor: pointer;
     border-radius: 0;
     margin-bottom: -2px;
     transition: all 0.15s ease;
     letter-spacing: 0.4px;
 }

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

 .tab-btn.active {
     color: var(--brand-primary);
     border-bottom-color: var(--brand-primary);
 }

 .tab-pane {
     display: none;
 }

 .tab-pane.active {
     display: block;
 }

 /* Search and Filter Controls */
 .filter-bar {
     display: flex;
     gap: 10px;
     margin-bottom: 16px;
     flex-wrap: wrap;
     align-items: center;
 }

 .search-input {
     flex: 1;
     min-width: 220px;
     height: 40px;
     padding: 0 16px;
     border: 1px solid #cbd5e1;
     border-radius: var(--border-radius-capsule);
     font-size: 13px;
     outline: none;
     background: #ffffff;
     color: var(--text-main);
     transition: border-color 0.15s, box-shadow 0.15s;
 }

 .search-input:focus {
     border-color: var(--brand-primary);
     box-shadow: 0 0 0 3px var(--brand-primary-ring);
 }

 .status-select {
     height: 40px;
     padding: 0 28px 0 14px;
     border: 1px solid #cbd5e1;
     border-radius: var(--border-radius-capsule);
     font-size: 13px;
     outline: none;
     background: #ffffff;
     color: var(--text-main);
     cursor: pointer;
     transition: border-color 0.15s, box-shadow 0.15s;
 }

 .status-select:focus {
     border-color: var(--brand-primary);
     box-shadow: 0 0 0 3px var(--brand-primary-ring);
 }

 /* Tables */
 .table-wrap {
     overflow-x: auto;
     width: 100%;
     -webkit-overflow-scrolling: touch;
 }

 table {
     width: 100%;
     border-collapse: collapse;
     font-size: 13px;
     table-layout: fixed;
 }

 th,
 td {
     text-align: left;
     padding: 12px 10px;
     border-bottom: 1px solid #f1f5f9;
     vertical-align: middle;
     box-sizing: border-box;
 }

 th {
     font-weight: 700;
     color: #475569;
     background: #f8fafc;
     border-bottom: 1px solid var(--border-color);
     font-size: 11px;
     text-transform: uppercase;
     letter-spacing: 0.5px;
     white-space: nowrap;
 }

 .cell-date {
     white-space: nowrap;
     line-height: 1.3;
     font-size: 12px;
 }

 .cell-sender {
     word-break: break-word;
     overflow-wrap: anywhere;
     line-height: 1.35;
     font-size: 12px;
 }

 .cell-recipients {
     word-break: break-word;
     overflow-wrap: anywhere;
     line-height: 1.35;
     font-size: 12px;
 }

 .cell-subject-file {
     word-break: break-word;
     overflow-wrap: anywhere;
     line-height: 1.4;
 }

 .cell-subject-file strong {
     display: block;
     color: var(--text-main);
     margin-bottom: 3px;
     font-size: 13px;
     font-weight: 700;
     word-break: break-word;
     overflow-wrap: anywhere;
 }

 .cell-subject-file .file-meta {
     font-size: 12px;
     color: var(--text-muted);
     word-break: break-word;
     overflow-wrap: anywhere;
 }

 .cell-expiry {
     white-space: nowrap;
     line-height: 1.3;
     font-size: 12px;
 }

 .cell-status {
     line-height: 1.25;
 }

 .cell-status .download-subtext {
     font-size: 11px;
     color: var(--text-muted);
     margin-top: 4px;
     white-space: nowrap;
 }

 .actions-cell {
     display: inline-flex;
     align-items: center;
     gap: 6px;
     white-space: nowrap;
 }

 .btn-download-capsule {
     display: inline-flex;
     align-items: center;
     justify-content: center;
     padding: 5px 14px;
     font-size: 12px;
     font-weight: 600;
     line-height: 1.4;
     border-radius: var(--border-radius-capsule);
     text-decoration: none;
     background: var(--brand-primary);
     color: #ffffff;
     border: 1px solid var(--brand-primary);
     cursor: pointer;
     white-space: nowrap;
     transition: background-color 0.15s ease, border-color 0.15s ease;
 }

 .btn-download-capsule:hover {
     background: var(--brand-primary-hover);
     border-color: var(--brand-primary-hover);
     color: #ffffff;
 }

 .btn-download-capsule.btn-disabled,
 .btn-download-capsule:disabled {
     background: #f1f5f9;
     border-color: #e2e8f0;
     color: #94a3b8;
     cursor: not-allowed;
     pointer-events: none;
     text-decoration: none;
     box-shadow: none;
 }

 /* Capsule Badges */
 .badge {
     display: inline-block;
     padding: 3px 10px;
     border-radius: var(--border-radius-capsule);
     font-size: 11px;
     font-weight: 700;
     text-transform: uppercase;
     letter-spacing: 0.3px;
     border: 1px solid transparent;
 }

 .badge-admin {
     background: #fdf2f8;
     color: #be185d;
     border-color: #fbcfe8;
 }

 .badge-user {
     background: #f1f5f9;
     color: #475569;
     border-color: #e2e8f0;
 }

 .badge-active {
     background: #ecfdf5;
     color: #047857;
     border-color: #a7f3d0;
 }

 .badge-disabled {
     background: #fef2f2;
     color: #b91c1c;
     border-color: #fecaca;
 }

 .badge-pending {
     background: #fffbeb;
     color: #b45309;
     border-color: #fde68a;
 }

 .badge-sent {
     background: #eff6ff;
     color: #1d4ed8;
     border-color: #bfdbfe;
 }

 .badge-downloaded {
     background: #ecfdf5;
     color: #047857;
     border-color: #a7f3d0;
 }

 .badge-expired {
     background: #f8fafc;
     color: #64748b;
     border-color: #e2e8f0;
 }

 .badge-deleted {
     background: #fef2f2;
     color: #991b1b;
     border-color: #fecaca;
 }

 .badge-permanent {
     background: #fdf2f8;
     color: #be185d;
     border-color: #fbcfe8;
 }

 /* Stats Grid */
 .stats-grid {
     display: grid;
     grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
     gap: 16px;
     margin-bottom: 24px;
 }

 .stat-card {
     background: #ffffff;
     border: 1px solid var(--border-color);
     border-radius: var(--border-radius-card);
     padding: 18px;
     text-align: center;
     box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
 }

 .stat-value {
     font-size: 24px;
     font-weight: 700;
     margin-top: 6px;
     color: var(--text-main);
 }

 /* Modals */
 .modal-overlay {
     position: fixed;
     inset: 0;
     background: rgba(15, 23, 42, 0.5);
     backdrop-filter: blur(4px);
     z-index: 9999;
     display: flex;
     align-items: center;
     justify-content: center;
     padding: 16px;
     animation: modalFadeIn 0.2s ease;
 }

 .modal-card {
     width: min(480px, 96vw);
     background: #ffffff;
     border-radius: 16px;
     box-shadow: 0 20px 45px rgba(0, 0, 0, 0.15);
     border: 1px solid var(--border-color);
     overflow: hidden;
     animation: modalPopUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
 }

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

 .modal-header h3 {
     margin: 0;
     font-size: 17px;
     font-weight: 700;
     color: var(--text-main);
 }

 .modal-close {
     background: none;
     border: none;
     font-size: 22px;
     cursor: pointer;
     color: #64748b;
     line-height: 1;
     padding: 4px;
     border-radius: 6px;
 }

 .modal-close:hover {
     color: var(--text-main);
     background: #f1f5f9;
 }

 .modal-body {
     padding: 20px 24px;
 }

 .modal-body label {
     display: block;
     margin: 12px 0 5px;
     font-size: 13px;
     font-weight: 600;
     color: #334155;
 }

 .modal-body label:first-child {
     margin-top: 0;
 }

 .modal-body input {
     width: 100%;
     height: 42px;
     padding: 0 14px;
     border: 1px solid #cbd5e1;
     border-radius: 8px;
     font-size: 14px;
     outline: none;
     box-sizing: border-box;
 }

 .modal-body input:focus {
     border-color: var(--brand-primary);
     box-shadow: 0 0 0 3px var(--brand-primary-ring);
 }

 .modal-footer {
     padding: 14px 24px;
     background: #f8fafc;
     border-top: 1px solid #f1f5f9;
     display: flex;
     justify-content: flex-end;
     gap: 10px;
 }

 /* Toast Notifications */
 .toast-container {
     position: fixed;
     top: 20px;
     right: 20px;
     z-index: 999999;
     display: flex;
     flex-direction: column;
     gap: 10px;
     max-width: 380px;
     pointer-events: none;
 }

 .toast {
     pointer-events: auto;
     background: #ffffff;
     border-left: 4px solid var(--brand-primary);
     box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
     border-radius: 8px;
     padding: 12px 18px;
     font-size: 14px;
     font-weight: 500;
     color: var(--text-main);
     display: flex;
     align-items: center;
     justify-content: space-between;
     gap: 12px;
     animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
     transition: opacity 0.3s ease, transform 0.3s ease;
 }

 .toast-success {
     border-left-color: var(--brand-primary);
 }

 .toast-error {
     border-left-color: #dc2626;
     color: #991b1b;
     background: #fff5f5;
 }

 .toast-close {
     background: transparent;
     border: none;
     font-size: 18px;
     line-height: 1;
     cursor: pointer;
     color: #94a3b8;
     padding: 0 4px;
     border-radius: 4px;
 }

 .toast-close:hover {
     color: var(--text-main);
 }

 @keyframes toastSlideIn {
     from {
         opacity: 0;
         transform: translateY(-12px);
     }

     to {
         opacity: 1;
         transform: translateY(0);
     }
 }

 @keyframes modalFadeIn {
     from {
         opacity: 0;
     }

     to {
         opacity: 1;
     }
 }

 @keyframes modalPopUp {
     from {
         opacity: 0;
         transform: scale(0.95);
     }

     to {
         opacity: 1;
         transform: scale(1);
     }
 }

 /* Send File Page Styles */
 .send-card {
     max-width: 740px;
     margin: 28px auto;
     background: #ffffff;
     border: 1px solid var(--border-color);
     border-radius: var(--border-radius-card);
     box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
     padding: 28px 32px;
 }

 .send-header {
     margin-bottom: 18px;
     border-bottom: 1px solid #f1f5f9;
     padding-bottom: 14px;
 }

 .send-header h1 {
     margin: 0 0 4px 0;
     font-size: 22px;
     font-weight: 700;
     color: var(--text-main);
 }

 .send-form {
     display: flex;
     flex-direction: column;
     gap: 14px;
     max-width: 100%;
     width: 100%;
 }

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

 .form-group label {
     margin: 0;
     font-size: 13px;
     font-weight: 600;
     color: #334155;
 }

 .form-row-2 {
     display: grid;
     grid-template-columns: 1fr 180px;
     gap: 16px;
     align-items: flex-start;
 }

 .send-form input[type="text"],
 .send-form select {
     height: 44px;
     padding: 0 14px;
     font-size: 14px;
     border: 1px solid #cbd5e1;
     border-radius: 8px;
     background: #ffffff;
     color: #1e293b;
     box-sizing: border-box;
     transition: border-color 0.15s, box-shadow 0.15s;
 }

 .send-form select {
     padding-right: 28px;
 }

 .send-form textarea {
     height: 96px;
     min-height: 80px;
     max-height: 160px;
     padding: 10px 14px;
     font-size: 14px;
     border: 1px solid #cbd5e1;
     border-radius: 8px;
     resize: vertical;
     font-family: inherit;
     box-sizing: border-box;
     transition: border-color 0.15s, box-shadow 0.15s;
 }

 .send-form input[type="text"]:focus,
 .send-form select:focus,
 .send-form textarea:focus {
     border-color: var(--brand-primary);
     outline: none;
     box-shadow: 0 0 0 3px var(--brand-primary-ring);
 }

 .file-drop-zone {
     position: relative;
     border: 2px dashed #cbd5e1;
     border-radius: 8px;
     background: #f8fafc;
     min-height: 100px;
     display: flex;
     flex-direction: column;
     align-items: center;
     justify-content: center;
     text-align: center;
     padding: 16px;
     cursor: pointer;
     box-sizing: border-box;
     transition: border-color 0.15s, background-color 0.15s;
 }

 .file-drop-zone:hover {
     border-color: var(--brand-primary);
     background: var(--brand-primary-light);
 }

 .file-drop-zone input[type="file"] {
     position: absolute;
     inset: 0;
     width: 100%;
     height: 100%;
     opacity: 0;
     cursor: pointer;
     z-index: 2;
 }

 .file-drop-title {
     font-weight: 600;
     font-size: 14px;
     color: #1e293b;
     margin-bottom: 2px;
 }

 .file-drop-hint {
     font-size: 12px;
     color: #64748b;
 }

 .file-drop-name {
     font-size: 13px;
     font-weight: 600;
     color: var(--brand-primary);
     margin-top: 6px;
     word-break: break-all;
 }

 .retention-group {
     padding: 2px 0;
 }

 .check-row {
     display: flex;
     align-items: center;
     gap: 8px;
     font-weight: 600;
     font-size: 14px;
     cursor: pointer;
 }

 .check-row input {
     width: auto;
     accent-color: var(--brand-primary);
 }

 .form-actions {
     display: flex;
     justify-content: flex-end;
     margin-top: 4px;
     padding-top: 6px;
 }

 /* Upload Progress Bar */
 .upload-progress-wrap {
     display: none;
     margin-top: 14px;
     background: #f8fafc;
     border: 1px solid var(--border-color);
     border-radius: 10px;
     padding: 14px 16px;
 }

 .upload-progress-header {
     display: flex;
     justify-content: space-between;
     align-items: center;
     font-size: 13px;
     font-weight: 600;
     color: #334155;
     margin-bottom: 8px;
 }

 .upload-progress-bar-bg {
     width: 100%;
     height: 8px;
     background: #e2e8f0;
     border-radius: var(--border-radius-capsule);
     overflow: hidden;
 }

 .upload-progress-bar-fill {
     width: 0%;
     height: 100%;
     background: var(--brand-primary);
     border-radius: var(--border-radius-capsule);
     transition: width 0.15s ease;
 }

 .upload-progress-stats {
     font-size: 12px;
     color: #64748b;
     margin-top: 6px;
     text-align: right;
 }

 /* Auth Cards (Login) */
 .auth-card {
     width: min(420px, 92vw);
     margin: 10vh auto;
     background: #ffffff;
     padding: 36px 32px;
     border: 1px solid var(--border-color);
     border-radius: 16px;
     box-shadow: 0 8px 30px rgba(0, 0, 0, .06);
 }

 .auth-card h1 {
     margin-top: 12px;
     font-size: 22px;
 }

 .auth-card label {
     display: block;
     margin: 16px 0 6px;
     font-weight: 600;
     font-size: 13px;
     color: #334155;
 }

 .auth-card input {
     width: 100%;
     height: 44px;
     padding: 0 14px;
     border: 1px solid #cbd5e1;
     border-radius: 8px;
     font-size: 14px;
     box-sizing: border-box;
     outline: none;
 }

 .auth-card input:focus {
     border-color: var(--brand-primary);
     box-shadow: 0 0 0 3px var(--brand-primary-ring);
 }

 .auth-card button[type="submit"] {
     margin-top: 22px;
     width: 100%;
     height: 44px;
     background: var(--brand-primary);
     color: #ffffff;
     border: none;
     border-radius: var(--border-radius-capsule);
     font-weight: 700;
     font-size: 14px;
     cursor: pointer;
     transition: background 0.15s ease;
 }

 .auth-card button[type="submit"]:hover {
     background: var(--brand-primary-hover);
 }

 /* Download Page Layout (Left-Aligned, Vertically Centered) */
 .download-page-layout {
     min-height: 100vh;
     display: flex;
     align-items: center;
     justify-content: flex-start;
     padding: 40px 60px;
     box-sizing: border-box;
 }

 .download-card {
     width: min(440px, 92vw);
     margin-left: clamp(16px, 6vw, 80px);
     background: rgba(255, 255, 255, 0.96);
     backdrop-filter: blur(10px);
     border: 1px solid rgba(226, 232, 240, 0.85);
     border-radius: 16px;
     box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
     padding: 36px 32px;
     box-sizing: border-box;
 }

 .download-card h2 {
     font-size: 20px;
     margin: 16px 0 12px;
     word-break: break-all;
 }

 .download-card .download-meta {
     margin: 16px 0 24px;
     display: flex;
     flex-direction: column;
     gap: 8px;
     font-size: 14px;
 }

 .download-card .download-meta-row {
     display: flex;
     justify-content: space-between;
     padding-bottom: 6px;
     border-bottom: 1px solid #f1f5f9;
 }

 .download-card .btn-download {
     width: 100%;
     height: 46px;
     font-size: 15px;
     font-weight: 700;
     background: var(--brand-primary);
     color: #ffffff;
     border-radius: var(--border-radius-capsule);
     border: none;
     cursor: pointer;
     transition: background 0.15s ease;
 }

 .download-card .btn-download:hover {
     background: var(--brand-primary-hover);
 }

 /* Media Queries */
 @media (max-width: 900px) {
     .table-wrap table {
         min-width: 720px;
     }
 }

 @media (max-width: 768px) {
     .download-page-layout {
         justify-content: center;
         padding: 20px 16px;
     }

     .download-card {
         margin-left: 0;
         width: 100%;
     }

     .topbar {
         padding: 0 16px;
     }

     .topbar .nav-user {
         display: none;
     }
 }

 @media (max-width: 640px) {
     .send-card {
         margin: 16px 12px;
         padding: 20px 16px;
         border-radius: 12px;
     }

     .form-row-2 {
         grid-template-columns: 1fr;
         gap: 12px;
     }

     .form-actions {
         justify-content: stretch;
     }

     .form-actions button {
         width: 100%;
     }
 }.page-admin {
    width: calc(100% - 40px);
    max-width: none;
    margin-left: 20px;
    margin-right: 20px;
    box-sizing: border-box;
    padding: 0;
}
.page-admin .card {
    width: 100%;
    max-width: none;
    box-sizing: border-box;
}
.page-admin table {
    width: 100%;
    max-width: none;
}

/* Pagination Controls */
.pagination-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 20px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.pagination-btn {
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: var(--border-radius-capsule);
    border: 1px solid var(--border-color);
    background: #ffffff;
    color: var(--text-main);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
    user-select: none;
}
.pagination-btn:hover:not(.disabled):not(.active) {
    background: #f1f5f9;
    border-color: #cbd5e1;
}
.pagination-btn.active {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: #ffffff;
}
.pagination-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #f8fafc;
    border-color: var(--border-color);
    color: var(--text-muted);
}

