:root {
    --bg-light: #f4f7f9;
    --surface: #ffffff;
    --primary: #007b8a;
    /* Deep Ocean Teal */
    --accent: #2e94a5;
    /* Light Teal */
    --navy: #0b3d59;
    /* Deep Navy */
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --status-active: #10b981;
    --status-pending: #f59e0b;
    --status-processing: #0ea5e9;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-light);
    color: var(--text);
    font-family: 'Outfit', 'Inter', -apple-system, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1360px;
    margin: 0 auto;
    padding: 0 0 0 2rem;
}

.auth-hero {
    text-align: center;
    padding: 4rem 0;
}

.auth-hero h2 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--navy);
    font-weight: 700;
}

.auth-hero p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.info-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2rem;
}

.info-panel h3 {
    color: var(--navy);
}

.info-panel p {
    color: var(--text-muted);
    font-size: 1rem;
    margin-top: 1rem;
}

/* Header & Logo */
header {
    height: 80px;
    display: flex;
    align-items: center;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.logo span {
    color: var(--navy);
    font-weight: 300;
    margin-left: 2px;
}

/* Dashboard Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

/* Login Card / Profile Area */
.sidebar-card {
    background: var(--surface);
    border-radius: 12px;
    padding: 2rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.clinic-badge {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    background: rgba(0, 123, 138, 0.05);
    border: 1px solid var(--primary);
    border-radius: 6px;
    color: var(--primary);
    font-size: 0.7rem;
    font-weight: 600;
    margin-bottom: 2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Main Content Area */
.main-panel {
    background: var(--surface);
    border-radius: 12px;
    padding: 2.5rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    overflow: hidden;
    /* Contain table scroll within card bounds */
}

/* Status Table */
.status-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.5rem;
}

.status-table th {
    text-align: left;
    color: var(--text-muted);
    font-size: 0.7rem;
    text-transform: uppercase;
    padding: 0 0.4rem 0.65rem 0.4rem;
    border-bottom: 1px solid var(--border);
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.status-table td {
    padding: 0.6rem 0.4rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    /* Extend to card edges, table scrolls within */
    margin-left: -2.5rem;
    margin-right: -2.5rem;
    padding-left: 2.5rem;
    padding-right: 2.5rem;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border);
}

.dot.active {
    background: var(--status-active);
}

/* Upload Zone */
#upload-zone {
    height: 250px;
    border: 2px dashed var(--border);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: #fcfdfe;
    transition: all 0.2s ease;
    cursor: pointer;
    margin-top: 1.5rem;
}

#upload-zone:hover {
    border-color: var(--primary);
    background: #f0f7f8;
}

.button-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: background 0.2s ease;
}

.button-primary:hover {
    background: var(--navy);
}

.status-msg {
    font-size: 0.85rem;
    margin-bottom: 1rem;
    min-height: 1.2rem;
}

.form-help {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 1rem;
    text-align: center;
}

/* 2FA Enrollment Styles */
#qrcode-container canvas,
#qrcode-container img {
    margin: 0 auto;
    display: block;
}

.settings-widget h4 {
    color: var(--navy);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.settings-widget .dot {
    display: inline-block;
    vertical-align: middle;
    margin-right: 4px;
}

/* Switch Styling */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch input:disabled+.slider {
    background-color: #cbd5e1;
    cursor: not-allowed;
    opacity: 0.6;
    filter: grayscale(1);
}

.switch input:disabled:checked+.slider {
    background-color: #94a3b8;
    opacity: 0.6;
    filter: grayscale(1);
}

.switch input:disabled+.slider:before {
    background-color: #f1f5f9;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked+.slider {
    background-color: var(--primary);
}

input:focus+.slider {
    box-shadow: 0 0 1px var(--primary);
}

input:checked+.slider:before {
    transform: translateX(26px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

.settings-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.settings-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    height: 46px;
    /* Explicit height to match */
    border: 1px solid var(--border);
    border-radius: 8px;
    background: white;
    font-family: inherit;
    font-size: 0.9rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 123, 138, 0.1);
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3Csvg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
    padding-right: 2.5rem;
}

/* Modal Overlay Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(11, 61, 89, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.progress-card {
    background: white;
    padding: 2.5rem;
    border-radius: 20px;
    width: 450px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.progress-card h3 {
    margin-bottom: 1rem;
    color: var(--navy);
}

.progress-container {
    height: 8px;
    background: #f1f5f9;
    border-radius: 10px;
    margin: 2rem 0;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--status-processing));
    width: 0%;
    transition: width 0.4s ease;
    box-shadow: 0 0 10px rgba(0, 123, 138, 0.3);
}

.progress-subtext {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Pulse animation for the progress bar while waiting */
.progress-bar.pulse {
    animation: progressPulse 2s infinite ease-in-out;
}

@keyframes progressPulse {
    0% {
        opacity: 0.7;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.7;
    }
}

/* Modal Drop Zone Styles */
.modal-drop-zone {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 2.5rem;
    margin-bottom: 1.5rem;
    background: #fcfdfe;
    transition: all 0.2s ease;
    cursor: pointer;
    color: var(--navy);
    text-align: center;
}

.modal-drop-zone.dragover {
    border-color: var(--primary);
    background: #f0f7f8;
    transform: scale(1.02);
}

/* 3D Viewer Styles */
.loader-spin {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 1);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin-3d 1s linear infinite;
}

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

model-viewer {
    background: radial-gradient(circle at center, #0b3d59 0%, #082f44 100%);
    width: 100%;
    height: 100%;
}

.modal-drop-zone p {
    font-weight: 500;
    margin: 0.5rem 0;
}