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

:root {
    --brand-blue: #42b8ff;
    --brand-blue-dark: #2e8dff;
    --brand-violet: #7a5cff;
    --brand-violet-dark: #7a5cff;
    --brand-accent: #ea1616;
    --brand-ink: #090d1c;
    --brand-muted: #5e6477;
    --teal: var(--brand-blue);
    --teal-dark: var(--brand-blue-dark);
    --violet: var(--brand-violet);
    --violet-dark: var(--brand-violet-dark);
    --brand-gradient: linear-gradient(135deg, var(--brand-blue) 0%, var(--brand-violet) 50%, var(--brand-accent) 100%);
    --brand-gradient-soft: linear-gradient(135deg, rgba(66, 184, 255, 0.14) 0%, rgba(122, 92, 255, 0.14) 50%, rgba(234, 22, 22, 0.12) 100%);
    --white: #ffffff;
    --gray-50: #f8f9ff;
    --gray-100: #eef2fb;
    --gray-200: #d9dfef;
    --gray-300: #c2cada;
    --gray-600: var(--brand-muted);
    --gray-700: #40465b;
    --gray-900: var(--brand-ink);
    --glass-surface: rgba(255, 255, 255, 0.38);
    --glass-surface-strong: rgba(255, 255, 255, 0.56);
    --glass-surface-soft: rgba(255, 255, 255, 0.24);
    --glass-surface-dark: rgba(9, 13, 28, 0.42);
    --glass-surface-dark-soft: rgba(9, 13, 28, 0.28);
    --glass-border: rgba(255, 255, 255, 0.56);
    --glass-border-subtle: rgba(255, 255, 255, 0.34);
    --glass-shadow: 0 30px 70px rgba(15, 23, 42, 0.16);
    --glass-shadow-soft: 0 18px 40px rgba(15, 23, 42, 0.1);
    --glass-backdrop: blur(34px) saturate(210%);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: var(--gray-900);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 14% 16%, rgba(66, 184, 255, 0.12), transparent 30%),
        radial-gradient(circle at 84% 10%, rgba(122, 92, 255, 0.12), transparent 34%),
        radial-gradient(circle at 78% 72%, rgba(234, 22, 22, 0.07), transparent 28%),
        linear-gradient(180deg, #fbfcff 0%, #eff4ff 48%, #f8fbff 100%);
}

.background-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #42b8ff 0%, #7a5cff 50%, #ea1616 100%);
    opacity: 0.07;
    z-index: -1;
}

.background-gradient::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(234, 22, 22, 0.2) 0%, transparent 72%);
    border-radius: 50%;
    animation: float 20s ease-in-out infinite;
}

.background-gradient::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(66, 184, 255, 0.28) 0%, transparent 72%);
    border-radius: 50%;
    animation: float 15s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(50px, 50px) scale(1.1);
    }
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 5%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-link,
.tracking-brand,
.sidebar-brand,
.footer-brand {
    text-decoration: none;
}

.brand-logo {
    display: block;
    width: auto;
    max-width: 100%;
    height: 3.8rem;
}

.brand-logo.sidebar-logo {
    height: 4.4rem;
}

.brand-logo.tracking-logo {
    height: 3.3rem;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--gray-700);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-links a:hover {
    color: var(--violet);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--teal), var(--violet));
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 3rem 5%;
}

/* Hero Section */
.hero-section {
    display: flex;
    align-items: stretch;
    justify-content: center;
    max-width: 1200px;
    margin: 0 auto;
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
}

.hero-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(380px, 460px);
    align-items: center;
    gap: 4rem;
    width: 100%;
}

.hero-content {
    text-align: left;
    width: 100%;
    animation: fadeInLeft 0.8s ease-out;
}

.hero-copy-column {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-width: 640px;
}

.hero-brand-row {
    display: flex;
    align-items: center;
}

.hero-copy-stack {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.hero-login-title {
    margin-bottom: 0;
}

.hero-login-subtitle {
    margin-bottom: 0;
    max-width: 580px;
}

.hero-login-pills {
    gap: 0.75rem;
}

.hero-support-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.hero-support-card {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: 1.2rem;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(209, 213, 219, 0.85);
    border-radius: 1.2rem;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(10px);
}

.hero-support-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.9rem;
    color: var(--violet-dark);
    background: linear-gradient(135deg, rgba(66, 184, 255, 0.14) 0%, rgba(122, 92, 255, 0.16) 100%);
}

.hero-support-body {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.hero-support-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-900);
}

.hero-support-copy {
    font-size: 0.92rem;
    line-height: 1.55;
    color: var(--gray-600);
}

.hero-form-column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    justify-self: end;
    width: 100%;
    max-width: 460px;
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--gray-600);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.feature-pills {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.pill {
    padding: 0.5rem 1.25rem;
    background: linear-gradient(135deg, rgba(66, 184, 255, 0.1) 0%, rgba(234, 22, 22, 0.08) 100%);
    border: 1px solid rgba(122, 92, 255, 0.24);
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--violet-dark);
}

/* Login Card */
.login-card {
    background: white;
    border-radius: 1.5rem;
    padding: 3rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    animation: fadeInRight 0.8s ease-out;
    position: relative;
    overflow: hidden;
    width: 100%;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--brand-gradient);
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

.card-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.card-header p {
    color: var(--gray-600);
    font-size: 0.95rem;
}

/* Form */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.9rem;
}

.form-group input {
    padding: 0.875rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: 0.75rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
}

.form-group input:focus {
    border-color: var(--violet);
    box-shadow: 0 0 0 3px rgba(122, 92, 255, 0.1);
}

.form-group input::placeholder {
    color: var(--gray-300);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: -0.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--gray-600);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--violet);
}

.forgot-link {
    color: var(--violet);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: color 0.3s ease;
}

.forgot-link:hover {
    color: var(--violet-dark);
}

.btn-primary {
    padding: 1rem;
    background: var(--brand-gradient);
    color: white;
    border: none;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 24px rgba(242, 85, 150, 0.22);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(122, 92, 255, 0.26);
}

.btn-primary:active {
    transform: translateY(0);
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 0.5rem 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--gray-200);
}

.divider span {
    padding: 0 1rem;
    color: var(--gray-600);
    font-size: 0.9rem;
}

.btn-secondary {
    padding: 1rem;
    background: white;
    color: var(--gray-700);
    border: 2px solid var(--gray-200);
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.btn-secondary:hover {
    border-color: var(--violet);
    color: var(--violet);
    background: rgba(122, 92, 255, 0.05);
}

.signup-text {
    text-align: center;
    color: var(--gray-600);
    font-size: 0.95rem;
    margin-top: 0.5rem;
}

.signup-link {
    color: var(--violet);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.signup-link:hover {
    color: var(--violet-dark);
}

/* Features Section */
.features-section {
    margin-top: 6rem;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 3rem;
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: white;
    padding: 2.5rem;
    border-radius: 1.25rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid var(--gray-100);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(122, 92, 255, 0.15);
    border-color: var(--violet);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
}

.feature-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--gray-900);
}

.feature-card p {
    color: var(--gray-600);
    line-height: 1.6;
}

/* Test Credentials */
.test-credentials {
    margin-top: 2rem;
    padding: 1.25rem;
    background: linear-gradient(135deg, rgba(66, 184, 255, 0.05) 0%, rgba(122, 92, 255, 0.05) 100%);
    border: 1px solid rgba(122, 92, 255, 0.2);
    border-radius: 0.75rem;
}

.test-credentials-header {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--violet);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.credential-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    font-size: 0.9rem;
}

.credential-label {
    color: var(--gray-600);
    font-weight: 600;
}

.credential-value {
    color: var(--gray-900);
    font-weight: 500;
    font-family: 'Courier New', monospace;
    background: rgba(255, 255, 255, 0.8);
    padding: 0.25rem 0.75rem;
    border-radius: 0.375rem;
    user-select: all;
}

/* Dashboard */
.dashboard-container {
    height: 100vh;
    background: var(--gray-50);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    background: white;
    border-right: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.sidebar-brand {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.sidebar-brand-subtitle {
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--gray-600);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--brand-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.25rem;
}

.user-info {
    flex: 1;
}

.user-name {
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.user-role {
    font-size: 0.875rem;
    color: var(--gray-600);
}

.sidebar-nav {
    flex: 1;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    color: var(--gray-700);
    text-decoration: none;
    border-radius: 0.75rem;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-item:hover {
    background: var(--gray-100);
    color: var(--violet);
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(66, 184, 255, 0.1) 0%, rgba(234, 22, 22, 0.08) 100%);
    color: var(--violet);
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--gray-200);
}

.sidebar-footer .user-profile {
    margin-bottom: 1rem;
}

.logout-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: transparent;
    color: #dc2626;
    border: 1px solid #dc2626;
    border-radius: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: #dc2626;
    color: white;
    border-color: #dc2626;
}

/* Dashboard Main */
.dashboard-main {
    padding: 2rem 3rem;
    overflow-y: auto;
    height: 100vh;
    margin-left: 280px;
    box-sizing: border-box;
}

.dashboard-main.dashboard-main-chat {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 1rem 1.25rem;
}

.dashboard-main.dashboard-main-chat .dashboard-header {
    flex-shrink: 0;
    margin-bottom: 0.75rem;
}

.dashboard-main.dashboard-main-chat .dashboard-title {
    font-size: 1.75rem;
}

.dashboard-main.dashboard-main-chat #chat-content {
    flex: 1 1 auto;
    min-height: 0;
}

.dashboard-top-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 1rem 0;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--gray-200);
}

.dashboard-user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1.25rem;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 0.75rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    width: 100%;
}

.dashboard-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--brand-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1rem;
}

.dashboard-user-name {
    font-weight: 600;
    color: var(--gray-900);
    font-size: 0.95rem;
}

.dashboard-title {
    font-size: 2rem;
    font-weight: 700;
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.btn-primary-small {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--brand-gradient);
    color: white;
    border: none;
    border-radius: 0.75rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 24px rgba(242, 85, 150, 0.22);
}

.btn-primary-small:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(122, 92, 255, 0.26);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
    width: 100%;
}

@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .table-pagination {
        flex-direction: column;
        align-items: stretch;
    }

    .table-pagination-controls {
        justify-content: space-between;
    }

    .table-pagination-pages {
        justify-content: center;
    }
}

.stat-card {
    background: white;
    padding: 1.75rem;
    border-radius: 1rem;
    border: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--gray-600);
}

/* Table */
.table-container {
    background: white;
    border-radius: 1rem;
    border: 1px solid var(--gray-200);
    overflow: hidden;
    width: 100%;
}

.table-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1rem 0 0;
}

.table-pagination[hidden] {
    display: none;
}

.table-pagination-summary {
    color: var(--gray-600);
    font-size: 0.9rem;
    font-weight: 500;
}

.table-pagination-controls {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.table-pagination-pages {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.table-pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    padding: 0.55rem 0.8rem;
    border-radius: 0.7rem;
    border: 1px solid var(--gray-200);
    background: white;
    color: var(--gray-700);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.table-pagination-btn:hover:not(:disabled) {
    border-color: rgba(66, 184, 255, 0.32);
    color: var(--teal-dark);
    transform: translateY(-1px);
}

.table-pagination-btn.active {
    border-color: transparent;
    background: var(--brand-gradient);
    color: white;
    box-shadow: 0 8px 18px rgba(66, 184, 255, 0.18);
}

.table-pagination-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: var(--gray-50);
    border-bottom: 2px solid var(--gray-200);
}

.data-table th {
    padding: 1rem 1.5rem;
    text-align: left;
    font-weight: 700;
    color: var(--gray-700);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table tbody tr {
    border-bottom: 1px solid var(--gray-200);
    transition: background 0.2s ease;
}

.data-table tbody tr:hover {
    background: var(--gray-50);
}

.data-table tbody tr:last-child {
    border-bottom: none;
}

.data-table td {
    padding: 1.25rem 1.5rem;
    color: var(--gray-900);
}

.table-section-row td {
    padding: 0.9rem 1.5rem;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

.table-section-row:hover {
    background: transparent;
}

.table-section-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gray-600);
}

.table-section-row-inactive td {
    background: rgba(239, 68, 68, 0.06);
    border-top: 2px solid rgba(239, 68, 68, 0.18);
}

.table-section-row-active td {
    background: rgba(66, 184, 255, 0.07);
    border-top: 2px solid rgba(66, 184, 255, 0.18);
}

.table-section-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.8rem;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.85);
    color: var(--gray-700);
    font-size: 0.72rem;
    font-weight: 700;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 0.375rem 0.875rem;
    border-radius: 1rem;
    font-size: 0.8125rem;
    font-weight: 600;
}

.status-onboarded {
    background: rgba(34, 197, 94, 0.1);
    color: #15803d;
}

.status-onboarding {
    background: rgba(234, 179, 8, 0.1);
    color: #a16207;
}

.status-issues {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.status-inactive {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

/* Granular Request Status Badges */
.status-scheduled {
    background: rgba(59, 130, 246, 0.1) !important;
    color: #1e40af !important;
}

.status-administered {
    background: rgba(16, 185, 129, 0.1) !important;
    color: #047857 !important;
}

.status-patient-declined {
    background: rgba(239, 68, 68, 0.1) !important;
    color: #dc2626 !important;
}

.status-pending-scheduling {
    background: rgba(245, 158, 11, 0.1) !important;
    color: #d97706 !important;
}

.status-cancelled-by-provider {
    background: rgba(107, 114, 128, 0.1) !important;
    color: #374151!important;
}

/* Action Button */
.patient-row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.btn-action {
    padding: 0.5rem 1.25rem;
    background: transparent;
    color: var(--violet);
    border: 1px solid var(--violet);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-action:hover {
    background: var(--violet);
    color: white;
}

.btn-remove {
    color: #b42318;
    border-color: rgba(180, 35, 24, 0.35);
}

.btn-remove:hover {
    background: #b42318;
    color: white;
    border-color: #b42318;
}

.btn-reactivate {
    color: #2E8DFF;
    border-color: rgba(15, 118, 110, 0.3);
}

.btn-reactivate:hover {
    background: #2E8DFF;
    color: white;
    border-color: #2E8DFF;
}

/* Expandable Rows */
.expand-arrow {
    background: transparent;
    border: none;
    color: var(--gray-600);
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border-radius: 0.375rem;
}

.expand-arrow:hover {
    background: var(--gray-100);
    color: var(--violet);
}

.expand-arrow svg {
    transition: transform 0.3s ease;
}

.expandable-row.expanded .expand-arrow svg {
    transform: rotate(180deg);
}

.expanded-content {
    display: none;
    background: var(--gray-50);
}

.expanded-content.show {
    display: table-row;
    animation: expandRow 0.3s ease;
}

@keyframes expandRow {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.expanded-details {
    padding: 1.5rem 2rem;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.25rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.detail-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-value {
    font-size: 0.9375rem;
    color: var(--gray-900);
    font-weight: 500;
}

.detail-section {
    margin-bottom: 2rem;
}

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

.section-title-detail {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--gray-200);
}

.detail-item-full {
    grid-column: 1 / -1;
}

.request-expanded-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.request-expanded-grid .detail-section {
    margin-bottom: 0;
}

.request-timeline {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.75rem;
}

.request-timeline-item {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 0.85rem 1rem;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 0.85rem;
}

.request-timeline-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--brand-gradient);
    margin-top: 0.45rem;
    box-shadow: 0 8px 18px rgba(122, 92, 255, 0.18);
    flex-shrink: 0;
}

.request-timeline-title {
    font-weight: 700;
    color: var(--gray-900);
    font-size: 0.95rem;
}

.request-timeline-date {
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.request-timeline-meta {
    color: var(--gray-600);
    font-size: 0.85rem;
    margin-top: 0.35rem;
}

.request-notes {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.75rem;
}

.request-note-item {
    padding: 0.85rem 1rem;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 0.85rem;
}

.request-note-date {
    font-size: 0.75rem;
    color: var(--gray-600);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.request-note-text {
    margin-top: 0.35rem;
    color: var(--gray-800);
    font-size: 0.9rem;
    line-height: 1.4;
}

.request-empty {
    padding: 0.85rem 1rem;
    background: var(--gray-100);
    border-radius: 0.85rem;
    color: var(--gray-600);
    border: 1px dashed var(--gray-300);
    font-size: 0.9rem;
}

.detail-footer {
    margin-top: 1.5rem;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.tracking-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border-radius: 999px;
    border: none;
    background: var(--brand-gradient);
    color: var(--white);
    font-family: inherit;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tracking-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 26px rgba(122, 92, 255, 0.22);
}

.tracking-link-secondary {
    border: 1px solid rgba(66, 184, 255, 0.45);
    background: white;
    color: var(--teal-dark);
}

.tracking-link-secondary:hover {
    background: rgba(66, 184, 255, 0.1);
    box-shadow: 0 10px 24px rgba(66, 184, 255, 0.18);
}

/* Tab Content */
.tab-content {
    animation: fadeIn 0.3s ease;
    width: 100%;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Footer */
.footer {
    margin-top: 6rem;
    padding: 2rem 5%;
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer p {
    color: var(--gray-600);
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    color: var(--gray-600);
    text-decoration: none;
    transition: color 0.3s ease;
}

/* Patient Tracking Page */
.tracking-body {
    background: var(--gray-50);
}

.tracking-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 5%;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.tracking-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.5rem 2rem;
    background: var(--white);
    border-radius: 1.25rem;
    border: 1px solid var(--gray-200);
    box-shadow: 0 12px 30px rgba(17, 24, 39, 0.08);
}

.tracking-back {
    color: var(--gray-700);
    text-decoration: none;
    font-weight: 600;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: var(--gray-100);
    transition: background 0.2s ease, color 0.2s ease;
}

.tracking-back:hover {
    background: var(--gray-200);
    color: var(--gray-900);
}

.tracking-title-block h1 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--gray-900);
}

.tracking-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    text-decoration: none;
    margin-bottom: 0.35rem;
}

.tracking-brand-text {
    display: none;
}

.tracking-meta {
    color: var(--gray-600);
    margin-top: 0.25rem;
    font-weight: 500;
}

.tracking-status {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Copy Button Styles */
.tracking-header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-copy-link {
    padding: 0.65rem 1.25rem;
    background: var(--white);
    color: var(--gray-700);
    border: 2px solid var(--gray-300);
    border-radius: 0.75rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: inherit;
}

.btn-copy-link svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.btn-copy-link:hover {
    border-color: var(--teal);
    color: var(--teal);
    background: rgba(66, 184, 255, 0.05);
}

.btn-copy-link:active {
    transform: scale(0.98);
}

.btn-copy-link.copied {
    border-color: var(--teal);
    background: var(--teal);
    color: var(--white);
}

.tracking-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.tracking-card {
    background: var(--white);
    border-radius: 1.25rem;
    border: 1px solid var(--gray-200);
    box-shadow: 0 10px 24px rgba(17, 24, 39, 0.06);
    padding: 1.5rem;
}

.tracking-card h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 1rem;
}

/* Enhanced Timeline Styles */
.tracking-timeline {
    list-style: none;
    display: grid;
    gap: 1rem;
    padding: 0;
    margin: 0;
}

.tracking-timeline-item {
    display: flex;
    gap: 1.25rem;
    align-items: stretch;
    padding: 1.25rem;
    border-radius: 1rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    transition: all 0.2s ease;
}

.tracking-timeline-item:hover {
    background: var(--white);
    box-shadow: 0 4px 12px rgba(17, 24, 39, 0.08);
}

/* Timeline indicator container */
.tracking-timeline-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

/* Enhanced timeline dots with icons */
.tracking-timeline-dot {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--brand-gradient);
    box-shadow: 0 8px 18px rgba(122, 92, 255, 0.22);
}

.tracking-timeline-dot svg {
    width: 20px;
    height: 20px;
    fill: white;
}

/* Category-specific dot colors */
.dot-request {
    background: linear-gradient(135deg, #42b8ff 0%, #7a5cff 100%);
    box-shadow: 0 6px 14px rgba(66, 184, 255, 0.22);
}

.dot-clinical {
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.dot-care {
    background: linear-gradient(135deg, #10b981 0%, #047857 100%);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.dot-scheduling {
    background: linear-gradient(135deg, #7a5cff 0%, #ea1616 100%);
    box-shadow: 0 6px 14px rgba(122, 92, 255, 0.22);
}

.dot-logistics {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.dot-issue {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.dot-communication {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    box-shadow: 0 2px 8px rgba(6, 182, 212, 0.3);
}

.dot-administrative {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.dot-default {
    background: var(--brand-gradient);
    box-shadow: 0 8px 18px rgba(122, 92, 255, 0.22);
}

/* Timeline connector line */
.tracking-timeline-line {
    width: 2px;
    flex-grow: 1;
    min-height: 40px;
    background: linear-gradient(to bottom, var(--gray-300), transparent);
    margin: 0.5rem 0;
}

/* Timeline content */
.tracking-timeline-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.tracking-timeline-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.tracking-timeline-title {
    font-weight: 700;
    color: var(--gray-900);
    font-size: 1rem;
}

.tracking-timeline-date {
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.tracking-timeline-meta {
    color: var(--gray-600);
    font-size: 0.9rem;
}

.tracking-timeline-description {
    display: block;
    color: var(--gray-600);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--gray-200);
}

.tracking-visit-box {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    border: 0;
    background: transparent;
    padding: 0;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.tracking-visit-box:focus-visible {
    outline: 3px solid rgba(66, 184, 255, 0.45);
    outline-offset: 4px;
    border-radius: 0.5rem;
}

.tracking-visit-toggle-text {
    align-self: flex-start;
    margin-top: 0.75rem;
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 700;
}

.tracking-visit-notes {
    display: grid;
    gap: 0.85rem;
    margin-top: 1.1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
}

.tracking-visit-notes h3 {
    margin: 0;
    color: var(--gray-900);
    font-size: 1rem;
}

.tracking-visit-notes-inline {
    margin-top: 0.95rem;
    padding: 1rem;
    border: 1px solid var(--gray-200);
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.62);
}

.tracking-note-fallback {
    white-space: pre-wrap;
    color: var(--gray-700);
    line-height: 1.5;
}

/* Timeline status badges */
.timeline-status {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    white-space: nowrap;
}

.timeline-status.status-completed {
    background: rgba(16, 185, 129, 0.1);
    color: #047857;
}

.timeline-status.status-pending {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.timeline-status.status-in_progress {
    background: rgba(122, 92, 255, 0.1);
    color: #7A5CFF;
}

.tracking-empty {
    padding: 1rem;
    background: var(--gray-100);
    border-radius: 0.75rem;
    color: var(--gray-600);
    border: 1px dashed var(--gray-300);
}

@media (max-width: 768px) {
    .tracking-header {
        padding: 1.25rem 1.5rem;
        flex-direction: column;
        align-items: flex-start;
    }

    .tracking-title-block h1 {
        font-size: 1.6rem;
    }

    .tracking-brand-text {
        font-size: 1rem;
    }

    .tracking-header-actions {
        width: 100%;
        flex-direction: column;
        gap: 0.75rem;
    }

    .btn-copy-link {
        width: 100%;
        justify-content: center;
    }

    .tracking-timeline-dot {
        width: 32px;
        height: 32px;
    }

    .tracking-timeline-dot svg {
        width: 16px;
        height: 16px;
    }
}

.footer-links a:hover {
    color: var(--violet);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .hero-section {
        max-width: 100%;
    }

    .hero-layout {
        grid-template-columns: minmax(0, 1fr) minmax(360px, 420px);
        gap: 2.5rem;
    }

    .hero-support-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hero-title {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {
    .nav-links {
        gap: 1rem;
    }

    .hero-section {
        max-width: 100%;
        padding: 1rem 0;
    }

    .hero-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .hero-content {
        margin-bottom: 2rem;
        text-align: center;
    }

    .login-card {
        padding: 2rem;
    }

    .hero-copy-column {
        max-width: 100%;
        align-items: center;
        text-align: center;
    }

    .hero-brand-row {
        justify-content: center;
    }

    .hero-login-subtitle {
        max-width: 100%;
    }

    .hero-login-pills {
        justify-content: center;
    }

    .hero-support-grid {
        grid-template-columns: 1fr;
        width: 100%;
    }

    .hero-form-column {
        justify-self: stretch;
        max-width: 100%;
    }

    .section-title {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .navbar {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .nav-links {
        font-size: 0.9rem;
    }

    .hero-section {
        padding: 0.5rem 0;
    }

    .hero-title {
        font-size: 1.75rem;
    }

    .hero-content {
        margin-bottom: 1.5rem;
    }

    .login-card {
        padding: 1.5rem;
    }

    .hero-support-card {
        padding: 1rem;
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow-y: auto;
}

.modal.show {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 2rem 1rem;
}

.modal-content {
    background: white;
    border-radius: 1rem;
    width: 100%;
    max-width: 900px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
    margin: auto;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--gray-200);
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--gray-600);
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.patient-form {
    padding: 2rem;
}

.form-sections {
    max-height: calc(100vh - 300px);
    overflow-y: auto;
}

.form-section {
    margin-bottom: 2rem;
}

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

.form-section-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--gray-200);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

.form-row:last-child {
    margin-bottom: 0;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group-full {
    grid-column: 1 / -1;
}

.form-group label {
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.875rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.75rem;
    border: 2px solid var(--gray-200);
    border-radius: 0.5rem;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--violet);
    box-shadow: 0 0 0 3px rgba(122, 92, 255, 0.1);
}

.form-group input:disabled,
.form-group select:disabled {
    background-color: var(--gray-100);
    color: var(--gray-500);
    cursor: not-allowed;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
    border-radius: 0 0 1rem 1rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
}

.modal-actions-right {
    width: 100%;
    justify-content: flex-end;
}

#patientModal .modal-actions {
    flex: 1;
    justify-content: flex-end;
}

.btn-inactivate {
    padding: 0.75rem 1.5rem;
    background: transparent;
    color: #dc2626;
    border: 2px solid #dc2626;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-inactivate:hover {
    background: #dc2626;
    color: white;
}

.btn-cancel {
    padding: 0.75rem 1.5rem;
    background: white;
    color: var(--gray-700);
    border: 2px solid var(--gray-300);
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-cancel:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
}

.btn-ai {
    padding: 0.75rem 1.5rem;
    background: rgba(66, 184, 255, 0.08);
    color: var(--teal-dark);
    border: 2px solid rgba(122, 92, 255, 0.32);
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.btn-ai:hover {
    background: rgba(66, 184, 255, 0.16);
    border-color: var(--teal);
    box-shadow: 0 6px 14px rgba(66, 184, 255, 0.2);
    transform: translateY(-1px);
}

.btn-save {
    padding: 0.75rem 1.5rem;
    background: var(--brand-gradient);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 10px 24px rgba(242, 85, 150, 0.22);
}

.btn-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(122, 92, 255, 0.26);
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .modal-content {
        max-width: 100%;
    }

    .patient-form {
        padding: 1.5rem;
    }

    .modal-footer {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .modal-actions {
        width: 100%;
        justify-content: stretch;
    }

    .modal-actions button {
        flex: 1;
    }
}

/* Chat Styles */
.chat-container {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    height: calc(100vh - 130px);
    background: white;
    border-radius: 1rem;
    border: 1px solid var(--gray-200);
    overflow: hidden;
}

.dashboard-main.dashboard-main-chat .chat-container {
    height: 100%;
}

.chat-thread-sidebar {
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--gray-200);
    background: rgba(248, 250, 252, 0.95);
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.chat-thread-sidebar-header {
    padding: 1rem 1rem 0;
}

.chat-sidebar-action {
    width: 100%;
    border: none;
    border-radius: 0.9rem;
    background: var(--brand-gradient);
    color: white;
    font: inherit;
    font-size: 0.84rem;
    font-weight: 700;
    padding: 0.8rem 1rem;
    cursor: pointer;
    box-shadow: 0 14px 26px rgba(122, 92, 255, 0.22);
}

.chat-new-thread-form {
    margin: 0.9rem 1rem 0;
    padding: 0.95rem;
    border-radius: 0.95rem;
    background: white;
    border: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: 0 10px 18px rgba(15, 23, 42, 0.06);
}

.chat-new-thread-label {
    display: block;
    margin-bottom: 0.45rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--gray-700);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.chat-new-thread-select {
    width: 100%;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 0.8rem;
    padding: 0.72rem 0.85rem;
    font: inherit;
    background: rgba(248, 250, 252, 0.92);
    color: var(--gray-900);
}

.chat-new-thread-actions {
    display: flex;
    gap: 0.6rem;
    margin-top: 0.75rem;
}

.chat-new-thread-submit,
.chat-new-thread-cancel,
.chat-thread-action-btn {
    border-radius: 999px;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.58rem 0.95rem;
    cursor: pointer;
}

.chat-new-thread-submit,
.chat-thread-action-btn {
    border: 1px solid rgba(66, 184, 255, 0.3);
    background: rgba(66, 184, 255, 0.14);
    color: #2E8DFF;
}

.chat-new-thread-cancel,
.chat-thread-action-btn.secondary {
    border: 1px solid rgba(148, 163, 184, 0.24);
    background: rgba(241, 245, 249, 0.92);
    color: var(--gray-700);
}

.chat-thread-action-btn.danger {
    border: 1px solid rgba(220, 38, 38, 0.22);
    background: rgba(254, 226, 226, 0.9);
    color: #b91c1c;
}

.chat-thread-section {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1;
}

.chat-thread-section-label {
    padding: 1rem 1rem 0.25rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.chat-thread-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding: 1rem;
    overflow-y: auto;
    min-height: 0;
}

.chat-thread-section > .chat-thread-list {
    flex: 1 1 auto;
}

.chat-thread-list-archived {
    padding-top: 0.75rem;
}

.chat-thread-list-empty {
    border: 1px dashed rgba(148, 163, 184, 0.3);
    border-radius: 0.9rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.72);
    color: var(--gray-600);
    font-size: 0.8rem;
    text-align: center;
}

.chat-thread-folder {
    border-top: 1px solid rgba(148, 163, 184, 0.16);
    padding: 0.25rem 0 1rem;
    flex-shrink: 0;
}

.chat-folder-toggle {
    width: calc(100% - 2rem);
    margin: 0.6rem 1rem 0;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 0.85rem;
    background: white;
    padding: 0.78rem 0.9rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--gray-800);
    cursor: pointer;
}

.chat-folder-toggle.is-empty {
    opacity: 0.55;
    cursor: not-allowed;
}

.chat-folder-count {
    min-width: 1.4rem;
    height: 1.4rem;
    border-radius: 999px;
    background: rgba(226, 232, 240, 0.9);
    color: var(--gray-700);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
}

.chat-thread-item {
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 0.9rem;
    background: white;
    padding: 0.75rem;
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    text-align: left;
    width: 100%;
    font: inherit;
    color: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chat-thread-item:hover {
    border-color: rgba(66, 184, 255, 0.35);
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.chat-thread-item.active {
    border-color: rgba(66, 184, 255, 0.58);
    background: linear-gradient(135deg, rgba(66, 184, 255, 0.1) 0%, rgba(122, 92, 255, 0.08) 100%);
    box-shadow: 0 12px 22px rgba(15, 23, 42, 0.1);
}

.chat-thread-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--brand-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
    flex-shrink: 0;
}

.chat-thread-content {
    min-width: 0;
    flex: 1;
}

.chat-thread-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.3rem;
}

.chat-thread-status-group {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    flex-shrink: 0;
}

.chat-thread-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--gray-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-thread-time {
    font-size: 0.74rem;
    color: var(--gray-500);
    flex-shrink: 0;
}

.chat-thread-unread {
    min-width: 1.35rem;
    height: 1.35rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: var(--brand-gradient);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
}

.chat-thread-meta {
    font-size: 0.76rem;
    color: var(--gray-600);
    margin-bottom: 0.35rem;
}

.chat-thread-preview {
    font-size: 0.8rem;
    color: var(--gray-700);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-thread-panel {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-thread-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-200);
    background: rgba(255, 255, 255, 0.96);
    flex-shrink: 0;
}

.chat-thread-patient h3 {
    margin: 0 0 0.2rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-900);
}

.chat-thread-patient > div {
    margin: 0;
}

.chat-realtime-status {
    display: inline-flex;
    align-items: center;
    margin-top: 0.35rem;
    padding: 0.28rem 0.65rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.48);
    background: rgba(255, 255, 255, 0.52);
    color: var(--gray-700);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    box-shadow: var(--glass-shadow-soft);
}

.chat-realtime-status[data-state='live'] {
    color: #047857;
    background: rgba(220, 252, 231, 0.62);
    border-color: rgba(16, 185, 129, 0.28);
}

.chat-realtime-status[data-state='connecting'],
.chat-realtime-status[data-state='reconnecting'] {
    color: #1d4ed8;
    background: rgba(219, 234, 254, 0.62);
    border-color: rgba(59, 130, 246, 0.28);
}

.chat-realtime-status[data-state='idle'] {
    color: #9f1239;
    background: rgba(255, 241, 242, 0.62);
    border-color: rgba(244, 63, 94, 0.22);
}

.chat-thread-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.chat-patient-meta-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.35rem;
}

.chat-patient-detail {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.55rem;
    border-radius: 999px;
    background: rgba(241, 245, 249, 0.92);
    color: var(--gray-700);
    font-size: 0.78rem;
    font-weight: 600;
}

.chat-patient-detail-label {
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.68rem;
}

.chat-patient-link {
    display: inline-flex;
    align-items: center;
    margin-top: 0.7rem;
    color: #2E8DFF;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
}

.chat-patient-link:hover {
    text-decoration: underline;
}

.chat-messages {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.chat-empty-state {
    margin: auto;
    text-align: center;
    color: var(--gray-600);
    font-size: 0.95rem;
    max-width: 320px;
}

.chat-load-more-row {
    display: flex;
    justify-content: center;
    margin-bottom: 0.25rem;
}

.chat-load-more-btn {
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(248, 250, 252, 0.92);
    color: var(--gray-700);
    border-radius: 999px;
    padding: 0.48rem 0.9rem;
    font: inherit;
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.18s ease;
}

.chat-load-more-btn:hover {
    border-color: rgba(66, 184, 255, 0.34);
    color: #2E8DFF;
    background: rgba(236, 253, 245, 0.92);
}

.chat-load-more-btn:disabled {
    opacity: 0.65;
    cursor: wait;
}

.message {
    display: flex;
    gap: 0.75rem;
    max-width: 70%;
    animation: messageSlideIn 0.3s ease-out;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-received {
    align-self: flex-start;
}

.message-sent {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--brand-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.message-sent .message-avatar {
    background: linear-gradient(135deg, var(--brand-accent) 0%, var(--brand-violet) 52%, var(--brand-blue) 100%);
}

.message-content {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.message-sender {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--gray-700);
}

.message-time {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.message-text {
    background: var(--gray-100);
    padding: 0.875rem 1rem;
    border-radius: 1rem;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--gray-900);
}

.message-sent .message-text {
    background: var(--brand-gradient);
    color: white;
}

.chat-input-container {
    display: flex;
    gap: 0.75rem;
    padding: 1.5rem;
    border-top: 1px solid var(--gray-200);
    background: white;
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
    z-index: 1;
}

.chat-input {
    flex: 1;
    padding: 0.875rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: 2rem;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
    outline: none;
}

.chat-input:focus {
    border-color: var(--violet);
    box-shadow: 0 0 0 3px rgba(122, 92, 255, 0.1);
}

.chat-input:disabled {
    background: var(--gray-100);
    cursor: not-allowed;
}

.chat-send-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--brand-gradient);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 10px 22px rgba(122, 92, 255, 0.24);
}

.chat-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 14px 26px rgba(122, 92, 255, 0.28);
}

.chat-send-btn:active {
    transform: scale(0.95);
}

.chat-send-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

@media (max-width: 1024px) {
    .chat-container {
        grid-template-columns: 1fr;
        height: calc(100vh - 150px);
    }

    .chat-thread-sidebar {
        border-right: none;
        border-bottom: 1px solid var(--gray-200);
    }

    .chat-thread-list {
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 0.85rem;
    }

    .chat-thread-list-archived {
        padding-top: 0.85rem;
    }

    .chat-thread-item {
        min-width: 230px;
    }
}

@media (max-width: 768px) {
    .message {
        max-width: 85%;
    }

    .chat-container {
        height: calc(100vh - 160px);
    }

    .chat-thread-list,
    .chat-new-thread-form {
        padding: 0.75rem;
    }

    .chat-thread-item {
        min-width: 205px;
    }

    .chat-thread-header {
        padding: 0.85rem 1rem;
        flex-direction: column;
        align-items: stretch;
    }

    .chat-messages,
    .chat-input-container {
        padding: 1rem;
    }
}

.roster-focus {
    animation: rosterPulse 1.6s ease;
}

@keyframes rosterPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(66, 184, 255, 0.28);
        background: rgba(66, 184, 255, 0.08);
    }
    100% {
        box-shadow: 0 0 0 18px rgba(66, 184, 255, 0);
        background: transparent;
    }
}

/* Search Bar Styles */
.search-bar-container {
    margin-bottom: 1.5rem;
}

.search-bar {
    position: relative;
    display: flex;
    align-items: center;
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.search-bar:focus-within {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(66, 184, 255, 0.1);
}

.search-icon {
    color: var(--gray-600);
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1rem;
    color: var(--gray-900);
    background: transparent;
}

.search-input::placeholder {
    color: var(--gray-600);
}

.clear-search-btn {
    background: var(--gray-200);
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--gray-600);
    margin-left: 0.5rem;
}

.clear-search-btn:hover {
    background: var(--gray-300);
    color: var(--gray-900);
}

.clear-search-btn:active {
    transform: scale(0.9);
}

/* ===== 2026 Cross-Page Visual Refresh ===== */

body {
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(180deg, #f8fafc 0%, #eef4f7 100%);
}

.background-gradient {
    opacity: 0.08;
}

.navbar {
    padding: 1rem 5%;
    background: rgba(255, 255, 255, 0.84);
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(16px);
}

.nav-links a {
    font-weight: 600;
    color: #475569;
}

.footer {
    background: rgba(248, 250, 252, 0.82);
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(148, 163, 184, 0.22);
}

.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
}

.footer-brand-copy {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.footer-brand-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--brand-ink);
}

.footer-brand-text {
    color: var(--gray-600);
    font-size: 0.92rem;
}

.dashboard-container {
    background:
        radial-gradient(circle at 14% 18%, rgba(66, 184, 255, 0.12), transparent 34%),
        radial-gradient(circle at 88% 12%, rgba(122, 92, 255, 0.1), transparent 36%),
        linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
}

.sidebar {
    width: 296px;
    background: rgba(255, 255, 255, 0.88);
    border-right: 1px solid rgba(148, 163, 184, 0.22);
    box-shadow: 20px 0 45px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(16px);
}

.sidebar-header {
    padding: 1.75rem 1.5rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.sidebar-nav {
    gap: 0.4rem;
    padding: 1rem 0.8rem 1.25rem;
}

.nav-item {
    border: 1px solid transparent;
    color: #475569;
    font-weight: 600;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.75);
    border-color: rgba(148, 163, 184, 0.25);
    color: var(--violet-dark);
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(66, 184, 255, 0.18) 0%, rgba(122, 92, 255, 0.16) 100%);
    border-color: rgba(125, 107, 255, 0.26);
    color: #5b21b6;
    box-shadow: 0 10px 24px rgba(124, 58, 237, 0.15);
}

.sidebar-footer {
    border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.dashboard-main {
    margin-left: 296px;
    padding: 2rem 2.25rem 3rem;
}

.dashboard-top-bar {
    border-bottom: none;
    margin-bottom: 0.5rem;
    padding: 0.25rem 0;
}

.dashboard-user-info {
    background: rgba(255, 255, 255, 0.86);
    border-color: rgba(148, 163, 184, 0.24);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(12px);
}

.dashboard-title {
    letter-spacing: -0.02em;
}

.btn-primary-small {
    border-radius: 0.9rem;
}

.search-bar {
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 0.9rem;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 8px 26px rgba(15, 23, 42, 0.05);
    backdrop-filter: blur(10px);
}

.search-bar:focus-within {
    border-color: rgba(66, 184, 255, 0.7);
    box-shadow: 0 0 0 3px rgba(66, 184, 255, 0.12), 0 8px 26px rgba(15, 23, 42, 0.06);
}

.table-container {
    border-radius: 1.1rem;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.07);
    backdrop-filter: blur(12px);
}

.data-table thead {
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.98) 0%, rgba(241, 245, 249, 0.98) 100%);
    border-bottom: 1px solid rgba(148, 163, 184, 0.28);
}

.data-table th {
    color: #475569;
    font-size: 0.8rem;
    font-weight: 700;
}

.data-table tbody tr {
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.data-table tbody tr:hover {
    background: linear-gradient(90deg, rgba(66, 184, 255, 0.07) 0%, rgba(122, 92, 255, 0.06) 100%);
}

.data-table td {
    color: #0f172a;
}

.expanded-content {
    background: linear-gradient(180deg, rgba(250, 250, 255, 0.96) 0%, rgba(243, 247, 252, 0.96) 100%);
}

.request-timeline-item,
.request-note-item {
    border-color: rgba(148, 163, 184, 0.26);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.04);
}

.chat-container {
    border-radius: 1.1rem;
    border: 1px solid rgba(148, 163, 184, 0.26);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(12px);
}

.message-text {
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.chat-input-container {
    border-top: 1px solid rgba(148, 163, 184, 0.24);
}

.chat-input {
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(248, 250, 252, 0.9);
}

.tracking-body {
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background:
        radial-gradient(circle at 14% 12%, rgba(66, 184, 255, 0.15), transparent 30%),
        radial-gradient(circle at 86% 8%, rgba(122, 92, 255, 0.15), transparent 34%),
        linear-gradient(180deg, #f8fafc 0%, #eef4ff 100%);
}

.tracking-page {
    max-width: 1260px;
}

.tracking-header,
.tracking-card {
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(148, 163, 184, 0.24);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(14px);
}

.tracking-title-block h1 {
    background: linear-gradient(135deg, var(--teal) 0%, var(--violet) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tracking-back {
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.24);
}

.tracking-back:hover {
    background: rgba(66, 184, 255, 0.08);
    color: var(--teal-dark);
}

.btn-copy-link {
    border: 1px solid rgba(148, 163, 184, 0.34);
    background: rgba(255, 255, 255, 0.84);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
}

.btn-copy-link:hover {
    border-color: rgba(66, 184, 255, 0.7);
    box-shadow: 0 10px 22px rgba(66, 184, 255, 0.15);
}

.tracking-timeline-item {
    border: 1px solid rgba(148, 163, 184, 0.24);
    background: rgba(255, 255, 255, 0.84);
}

.tracking-timeline-item:hover {
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.09);
}

.modal {
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
}

.modal-content {
    border: 1px solid rgba(148, 163, 184, 0.28);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25);
}

.modal-header,
.modal-footer {
    border-color: rgba(148, 163, 184, 0.24);
}

.form-group input,
.form-group select,
.form-group textarea {
    border: 1px solid rgba(148, 163, 184, 0.36);
    border-radius: 0.75rem;
    background: rgba(248, 250, 252, 0.85);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: rgba(66, 184, 255, 0.75);
    box-shadow: 0 0 0 3px rgba(66, 184, 255, 0.12);
}

@media (max-width: 1024px) {
    .sidebar {
        width: 248px;
    }

    .dashboard-main {
        margin-left: 248px;
        padding: 1.5rem;
    }
}

@media (max-width: 860px) {
    .dashboard-container {
        position: static;
        min-height: 100vh;
        overflow: visible;
    }

    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        box-shadow: none;
        border-right: none;
        border-bottom: 1px solid rgba(148, 163, 184, 0.24);
    }

    .sidebar-nav {
        flex-direction: row;
        overflow-x: auto;
        padding: 0.8rem;
    }

    .nav-item {
        white-space: nowrap;
    }

    .dashboard-main {
        margin-left: 0;
        height: auto;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.9rem;
    }
}

/* Glass Morphism Refinements */
.navbar,
.footer,
.hero-support-card,
.login-card,
.feature-card,
.test-credentials,
.sidebar,
.dashboard-user-info,
.stat-card,
.search-bar,
.table-container,
.expanded-content,
.request-timeline-item,
.request-note-item,
.chat-container,
.chat-thread-sidebar,
.chat-new-thread-form,
.chat-folder-toggle,
.chat-thread-item,
.chat-thread-header,
.chat-patient-detail,
.chat-load-more-btn,
.chat-input-container,
.tracking-header,
.tracking-card,
.tracking-timeline-item,
.modal-content,
.btn-copy-link,
.btn-secondary,
.btn-cancel {
    background: var(--glass-surface-strong);
    border: 1px solid var(--glass-border-subtle);
    box-shadow: var(--glass-shadow-soft);
    backdrop-filter: var(--glass-backdrop);
    -webkit-backdrop-filter: var(--glass-backdrop);
}

.navbar,
.footer,
.sidebar,
.chat-thread-sidebar,
.chat-thread-header,
.chat-input-container,
.tracking-header,
.tracking-card,
.modal-content,
.login-card {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.66) 0%, rgba(255, 255, 255, 0.42) 100%);
    border-color: var(--glass-border);
    box-shadow: var(--glass-shadow);
}

.navbar {
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.08);
}

.pill,
.tracking-back,
.chat-thread-list-empty,
.request-empty,
.credential-value {
    background: var(--glass-surface);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow-soft);
    backdrop-filter: blur(26px) saturate(210%);
    -webkit-backdrop-filter: blur(26px) saturate(210%);
}

.login-card {
    position: relative;
}

.login-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at top right, rgba(66, 184, 255, 0.24), transparent 30%),
        radial-gradient(circle at bottom left, rgba(122, 92, 255, 0.2), transparent 34%);
    pointer-events: none;
}

.card-header,
.login-form,
.test-credentials {
    position: relative;
    z-index: 1;
}

.feature-card:hover,
.stat-card:hover,
.chat-thread-item:hover,
.tracking-timeline-item:hover {
    box-shadow: 0 22px 42px rgba(15, 23, 42, 0.12);
}

.test-credentials {
    background:
        linear-gradient(135deg, rgba(66, 184, 255, 0.12) 0%, rgba(122, 92, 255, 0.1) 58%, rgba(234, 22, 22, 0.08) 100%);
}

.form-group input,
.form-group select,
.form-group textarea,
.chat-input,
.chat-new-thread-select {
    background: rgba(255, 255, 255, 0.36);
    border: 1px solid rgba(255, 255, 255, 0.42);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.54), 0 10px 24px rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(22px) saturate(210%);
    -webkit-backdrop-filter: blur(22px) saturate(210%);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.chat-input:focus,
.chat-new-thread-select:focus {
    background: rgba(255, 255, 255, 0.54);
}

.btn-secondary,
.btn-cancel,
.btn-copy-link,
.chat-load-more-btn,
.chat-thread-action-btn.secondary,
.chat-new-thread-cancel {
    color: var(--gray-700);
}

.btn-secondary:hover,
.btn-cancel:hover,
.btn-copy-link:hover,
.chat-load-more-btn:hover,
.chat-thread-action-btn.secondary:hover,
.chat-new-thread-cancel:hover {
    background: rgba(255, 255, 255, 0.68);
    border-color: rgba(66, 184, 255, 0.3);
    box-shadow: 0 20px 38px rgba(15, 23, 42, 0.14);
}

.dashboard-container,
.tracking-body {
    background:
        radial-gradient(circle at 12% 16%, rgba(66, 184, 255, 0.15), transparent 30%),
        radial-gradient(circle at 85% 10%, rgba(122, 92, 255, 0.14), transparent 34%),
        radial-gradient(circle at 76% 74%, rgba(234, 22, 22, 0.08), transparent 28%),
        linear-gradient(180deg, rgba(251, 252, 255, 0.92) 0%, rgba(238, 244, 255, 0.96) 100%);
}

.table-container,
.chat-container {
    overflow: hidden;
}

.expanded-content {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.44) 0%, rgba(244, 247, 255, 0.28) 100%);
}

.request-timeline-item,
.request-note-item,
.tracking-timeline-item {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.5) 0%, rgba(248, 250, 255, 0.28) 100%);
}

.chat-thread-sidebar {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.54) 0%, rgba(247, 250, 255, 0.34) 100%);
}

.chat-thread-item {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.46) 0%, rgba(248, 250, 255, 0.26) 100%);
}

.chat-thread-item.active {
    background:
        linear-gradient(135deg, rgba(66, 184, 255, 0.16) 0%, rgba(122, 92, 255, 0.15) 58%, rgba(234, 22, 22, 0.08) 100%);
    border-color: rgba(122, 92, 255, 0.32);
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.12);
}

.chat-thread-header,
.chat-input-container {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.58) 0%, rgba(248, 250, 255, 0.36) 100%);
}

.chat-thread-panel,
.chat-messages {
    background:
        radial-gradient(circle at top right, rgba(66, 184, 255, 0.05), transparent 26%),
        radial-gradient(circle at bottom left, rgba(122, 92, 255, 0.05), transparent 28%),
        transparent;
}

.message-text {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.56) 0%, rgba(248, 250, 255, 0.3) 100%);
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.1);
    backdrop-filter: blur(24px) saturate(210%);
    -webkit-backdrop-filter: blur(24px) saturate(210%);
}

.message-sent .message-text {
    background: linear-gradient(135deg, rgba(66, 184, 255, 0.9) 0%, rgba(122, 92, 255, 0.88) 52%, rgba(234, 22, 22, 0.86) 100%);
}

.modal {
    background: rgba(15, 23, 42, 0.42);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.modal-footer {
    background: rgba(255, 255, 255, 0.28);
    backdrop-filter: blur(28px) saturate(210%);
    -webkit-backdrop-filter: blur(28px) saturate(210%);
}

.footer {
    background: rgba(255, 255, 255, 0.58);
}

.glass-panel {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.58) 0%, rgba(248, 250, 255, 0.34) 100%);
    border: 1px solid rgba(255, 255, 255, 0.42);
    box-shadow: var(--glass-shadow);
    backdrop-filter: var(--glass-backdrop);
    -webkit-backdrop-filter: var(--glass-backdrop);
}

.admin-portal-body {
    min-height: 100vh;
}

.admin-login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
}

.admin-login-card {
    width: min(100%, 540px);
    padding: 2rem;
    border-radius: 1.5rem;
    display: grid;
    gap: 1.5rem;
}

.admin-login-brand {
    display: inline-flex;
    align-items: center;
}

.admin-login-logo {
    height: 4.2rem;
}

.admin-login-copy {
    display: grid;
    gap: 0.75rem;
}

.admin-login-copy h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.02;
}

.admin-eyebrow {
    display: inline-flex;
    width: fit-content;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: var(--brand-violet);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.admin-demo-card {
    padding: 1rem 1.1rem;
    border-radius: 1.1rem;
    background: rgba(255, 255, 255, 0.52);
    border: 1px solid rgba(255, 255, 255, 0.48);
}

.admin-demo-title {
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gray-700);
    margin-bottom: 0.9rem;
}

.admin-demo-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
}

.admin-demo-grid span {
    display: block;
    font-size: 0.72rem;
    color: var(--gray-600);
    margin-bottom: 0.25rem;
}

.admin-demo-grid strong {
    display: block;
    font-size: 0.95rem;
    word-break: break-word;
}

.admin-login-form {
    display: grid;
    gap: 0.95rem;
}

.admin-login-form label {
    display: grid;
    gap: 0.4rem;
}

.admin-login-form label span {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--gray-700);
}

.admin-login-form input,
.admin-chat-composer textarea {
    width: 100%;
    padding: 0.9rem 1rem;
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.5);
    color: var(--gray-900);
    font: inherit;
    backdrop-filter: blur(24px) saturate(210%);
    -webkit-backdrop-filter: blur(24px) saturate(210%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.56), 0 12px 28px rgba(15, 23, 42, 0.08);
}

.admin-login-form input:focus,
.admin-chat-composer textarea:focus {
    outline: none;
    border-color: rgba(122, 92, 255, 0.4);
    background: rgba(255, 255, 255, 0.64);
}

.admin-remember-row {
    display: flex !important;
    align-items: center;
    gap: 0.7rem !important;
}

.admin-remember-row input {
    width: auto;
}

.admin-login-error {
    min-height: 1.2rem;
    color: #b91c1c;
    font-size: 0.85rem;
    font-weight: 600;
}

.admin-dashboard {
    min-height: 100vh;
}

.admin-main {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.admin-dashboard-header {
    align-items: flex-start;
}

.admin-page-subtitle {
    margin-top: 0.4rem;
    color: var(--gray-600);
    max-width: 760px;
}

.admin-sidebar-nav {
    gap: 0.45rem;
}

.admin-operator-link {
    width: 100%;
    margin-bottom: 1rem;
}

.admin-metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.admin-metric-card {
    border-radius: 1.2rem;
    padding: 1.1rem 1.15rem;
    display: grid;
    gap: 0.45rem;
}

.admin-metric-label {
    font-size: 0.78rem;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 800;
}

.admin-metric-value {
    font-size: 2rem;
    line-height: 1;
}

.admin-overview-table,
.admin-thread-panel,
.admin-conversation-panel {
    border-radius: 1.35rem;
}

.admin-section-header {
    padding: 1rem 1rem 0.2rem;
}

.admin-intake-email-detail-panel .admin-section-header {
    align-items: flex-start;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.admin-header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
}

.admin-section-header h2 {
    font-size: 1rem;
    margin-bottom: 0.3rem;
}

.admin-section-header p {
    color: var(--gray-600);
    font-size: 0.92rem;
}

.admin-status-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.54);
    font-size: 0.78rem;
    font-weight: 700;
}

.admin-empty-row,
.admin-empty-state {
    text-align: center;
    color: var(--gray-600);
    padding: 1rem;
}

.admin-scheduling-layout {
    display: grid;
    gap: 1rem;
    align-items: start;
}

.admin-scheduling-main {
    display: grid;
    gap: 1rem;
    min-width: 0;
}

.admin-scheduling-main > .search-bar-container {
    display: flex;
    gap: 0.8rem;
    align-items: stretch;
}

.admin-scheduling-main > .search-bar-container .search-bar {
    flex: 1;
    min-width: 0;
}

.admin-add-nurse-btn {
    white-space: nowrap;
}

.admin-table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.admin-availability-panel {
    border-radius: 1.35rem;
    display: grid;
    gap: 1rem;
    padding-bottom: 1rem;
}

.admin-intake-check-panel {
    grid-template-columns: minmax(220px, 0.8fr) minmax(360px, 1.4fr) minmax(260px, 1fr);
    align-items: center;
    padding: 0.2rem 0 1rem;
}

.admin-intake-check-panel .admin-section-header {
    padding-bottom: 0;
}

.admin-availability-form {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) minmax(150px, 1fr) auto;
    align-items: end;
    gap: 0.85rem;
    padding: 0 1rem;
}

.admin-availability-form label {
    display: grid;
    gap: 0.35rem;
    font-weight: 700;
    color: var(--gray-700);
}

.admin-availability-form label span {
    font-size: 0.82rem;
}

.admin-availability-form input {
    width: 100%;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 0.9rem;
    padding: 0.75rem 0.85rem;
    font: inherit;
    background: rgba(255, 255, 255, 0.74);
    color: var(--gray-900);
}

.admin-availability-decision {
    padding: 0 1rem 0 0;
}

.admin-decision-card {
    border-radius: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(148, 163, 184, 0.22);
}

.admin-decision-card strong {
    display: block;
    font-size: 1.6rem;
    margin-top: 0.25rem;
}

.admin-decision-card p {
    color: var(--gray-600);
    margin-top: 0.5rem;
}

.admin-decision-card-accept {
    border-color: rgba(22, 163, 74, 0.28);
    background: rgba(220, 252, 231, 0.76);
}

.admin-decision-card-cannot-accept {
    border-color: rgba(220, 38, 38, 0.24);
    background: rgba(254, 226, 226, 0.76);
}

.admin-decision-matches {
    display: grid;
    gap: 0.65rem;
    margin-top: 0.85rem;
}

.admin-decision-match {
    display: grid;
    gap: 0.2rem;
    padding: 0.75rem 0.85rem;
    border-radius: 0.85rem;
    background: rgba(255, 255, 255, 0.58);
}

.admin-decision-match span {
    color: var(--gray-600);
    font-size: 0.86rem;
}

.admin-modal .modal-content {
    background: rgba(255, 255, 255, 0.96);
}

.admin-nurse-modal-content {
    max-width: 760px;
}

.admin-availability-modal-content {
    max-width: 1120px;
}

.admin-modal-subtitle {
    margin-top: 0.35rem;
    color: var(--gray-600);
    font-size: 0.9rem;
}

.admin-modal-form {
    display: grid;
}

.admin-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    padding: 1.5rem 2rem;
}

.admin-form-grid label,
.admin-calendar-day label {
    display: grid;
    gap: 0.4rem;
    font-weight: 700;
    color: var(--gray-700);
}

.admin-form-grid label span,
.admin-calendar-day label span {
    font-size: 0.8rem;
}

.admin-form-grid input,
.admin-form-grid select,
.admin-form-grid textarea,
.admin-calendar-day input,
.admin-calendar-day select {
    width: 100%;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 0.85rem;
    padding: 0.75rem 0.85rem;
    font: inherit;
    background: rgba(255, 255, 255, 0.82);
    color: var(--gray-900);
}

.admin-form-grid textarea {
    min-height: 7rem;
    resize: vertical;
}

.admin-field-full {
    grid-column: 1 / -1;
}

.admin-calendar-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.8rem;
    max-height: min(68vh, 760px);
    overflow-y: auto;
    padding: 1.5rem 2rem;
}

.admin-calendar-day {
    display: grid;
    gap: 0.75rem;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 1rem;
    padding: 0.85rem;
    background: rgba(255, 255, 255, 0.64);
}

.admin-calendar-day-available {
    border-color: rgba(22, 163, 74, 0.3);
    background: rgba(220, 252, 231, 0.58);
}

.admin-calendar-day-unavailable {
    border-color: rgba(148, 163, 184, 0.24);
    background: rgba(248, 250, 252, 0.76);
}

.admin-calendar-ranges {
    display: grid;
    gap: 0.65rem;
}

.admin-calendar-range-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    align-items: end;
    padding: 0.65rem;
    border-radius: 0.8rem;
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.admin-calendar-range-row label:nth-child(3),
.admin-range-remove {
    grid-column: 1 / -1;
}

.admin-range-add {
    width: fit-content;
}

.admin-range-remove {
    align-self: end;
}

.admin-calendar-range-empty {
    text-align: left;
    padding: 0.65rem;
    border-radius: 0.8rem;
    background: rgba(255, 255, 255, 0.5);
}

.admin-calendar-day-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.6rem;
}

.admin-calendar-day-header strong {
    font-size: 0.95rem;
}

.admin-calendar-day-header span {
    border-radius: 999px;
    padding: 0.25rem 0.55rem;
    background: rgba(255, 255, 255, 0.68);
    color: var(--gray-700);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: capitalize;
}

.admin-support-layout {
    display: grid;
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
    gap: 1rem;
    min-height: 72vh;
}

.admin-main.admin-main-support {
    overflow: hidden;
    padding: 1rem 1.25rem;
}

.admin-main.admin-main-support .admin-dashboard-header {
    flex-shrink: 0;
    margin-bottom: 0;
}

.admin-main.admin-main-support #admin-support-inbox-content {
    flex: 1 1 auto;
    min-height: 0;
}

.admin-main.admin-main-support .admin-support-layout {
    height: 100%;
    min-height: 0;
}

.admin-intake-email-layout {
    display: grid;
    grid-template-columns: minmax(300px, 0.85fr) minmax(420px, 1.15fr) minmax(320px, 0.9fr);
    gap: 1rem;
    align-items: start;
}

.admin-intake-email-test-panel,
.admin-intake-email-list-panel,
.admin-intake-email-detail-panel {
    min-width: 0;
}

.admin-intake-email-form-grid {
    grid-template-columns: 1fr;
    padding: 1rem;
}

.admin-intake-email-form-actions {
    display: flex;
    justify-content: flex-end;
    padding: 0 1rem 1rem;
}

.admin-intake-email-list-panel {
    display: grid;
    gap: 1rem;
    padding-bottom: 1rem;
}

.admin-intake-email-list-panel .search-bar-container {
    margin: 1rem 1rem 0;
}

.admin-intake-email-table-wrap {
    overflow-x: auto;
}

.admin-intake-email-row {
    cursor: pointer;
}

.admin-intake-email-row.active {
    background: rgba(236, 253, 245, 0.72);
}

.admin-intake-email-detail-panel {
    display: grid;
    gap: 1rem;
    padding-bottom: 1rem;
}

.admin-intake-detail-section {
    display: grid;
    gap: 0.55rem;
    padding: 0 1rem;
}

.admin-intake-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
}

.admin-intake-detail-grid div {
    display: grid;
    gap: 0.2rem;
    border-radius: 0.85rem;
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(148, 163, 184, 0.2);
    padding: 0.75rem;
}

.admin-intake-detail-grid span,
.admin-intake-detail-section span {
    color: var(--gray-600);
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
}

.admin-intake-detail-grid strong,
.admin-intake-detail-section strong {
    color: var(--gray-900);
    font-size: 0.95rem;
    word-break: break-word;
}

.admin-intake-raw,
.admin-intake-json {
    max-height: 18rem;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    border-radius: 0.85rem;
    background: rgba(15, 23, 42, 0.92);
    color: rgba(255, 255, 255, 0.9);
    padding: 1rem;
    font-size: 0.85rem;
    line-height: 1.55;
}

.admin-thread-panel,
.admin-conversation-panel {
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.admin-thread-panel-header {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.45);
    display: grid;
    gap: 0.8rem;
}

.admin-filter-toggle {
    display: inline-flex;
    gap: 0.5rem;
}

.admin-filter-pill {
    border: 1px solid rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.45);
    color: var(--gray-700);
    border-radius: 999px;
    padding: 0.55rem 0.9rem;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
}

.admin-filter-pill.active {
    color: white;
    background: var(--brand-gradient);
    border-color: transparent;
    box-shadow: 0 18px 32px rgba(66, 184, 255, 0.18);
}

.admin-support-search-bar {
    width: 100%;
}

.admin-thread-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    overflow-y: auto;
    padding: 1rem;
}

.admin-thread-item {
    border: 1px solid rgba(255, 255, 255, 0.46);
    background: rgba(255, 255, 255, 0.44);
    border-radius: 1rem;
    padding: 0.9rem;
    text-align: left;
    cursor: pointer;
    box-shadow: var(--glass-shadow-soft);
}

.admin-thread-item.active {
    background: linear-gradient(135deg, rgba(66, 184, 255, 0.18) 0%, rgba(122, 92, 255, 0.16) 52%, rgba(234, 22, 22, 0.08) 100%);
    border-color: rgba(122, 92, 255, 0.36);
}

.admin-thread-item-top {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
}

.admin-thread-time,
.admin-thread-org {
    color: var(--gray-600);
    font-size: 0.8rem;
}

.admin-thread-preview {
    margin-top: 0.45rem;
    color: var(--gray-700);
    font-size: 0.9rem;
}

.admin-chat-header-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    padding: 1rem 1rem 0.4rem;
}

.admin-chat-heading {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.admin-chat-header-row h3 {
    font-size: 1.2rem;
}

.admin-chat-realtime-status {
    width: fit-content;
    margin-top: 0;
}

.admin-chat-org {
    color: var(--gray-600);
    font-size: 0.9rem;
    margin-top: 0.2rem;
}

.admin-chat-actions {
    display: flex;
    gap: 0.6rem;
}

.chat-thread-action {
    border-radius: 999px;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.6rem 1rem;
    cursor: pointer;
}

.chat-thread-action-archive {
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(241, 245, 249, 0.92);
    color: var(--gray-700);
}

.chat-thread-action-delete {
    border: 1px solid rgba(220, 38, 38, 0.24);
    background: rgba(254, 226, 226, 0.92);
    color: #b91c1c;
}

.admin-chat-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    padding: 0 1rem 0.9rem;
    color: var(--gray-700);
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.44);
}

.admin-chat-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.admin-chat-message {
    max-width: 72%;
    padding: 0.95rem 1rem;
    border-radius: 1rem;
    box-shadow: var(--glass-shadow-soft);
}

.admin-chat-message-inbound {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.56);
}

.admin-chat-message-outbound {
    align-self: flex-end;
    color: white;
    background: var(--brand-gradient);
}

.admin-chat-message-meta {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.76rem;
    margin-bottom: 0.35rem;
}

.admin-chat-composer {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.42);
    display: grid;
    gap: 0.8rem;
}

.admin-chat-composer textarea {
    resize: vertical;
    min-height: 92px;
}

.nurse-dashboard .data-table td strong,
.nurse-dashboard .data-table td span {
    display: block;
}

.nurse-login-card {
    width: min(100%, 640px);
}

.nurse-login-card .admin-demo-grid {
    grid-template-columns: minmax(110px, 0.8fr) minmax(220px, 1.5fr) minmax(100px, 0.7fr);
}

.nurse-login-card .admin-demo-grid strong {
    overflow-wrap: anywhere;
}

.nurse-login-prompt {
    display: block;
    margin-top: 0.9rem;
    color: var(--brand-primary);
    font-size: 0.9rem;
    font-weight: 800;
    text-align: center;
    text-decoration: none;
}

.nurse-login-prompt:hover {
    color: var(--brand-secondary);
}

.nurse-dashboard .data-table td span {
    margin-top: 0.2rem;
    color: var(--gray-600);
    font-size: 0.82rem;
}

.nurse-visit-row {
    cursor: pointer;
}

.nurse-visit-row.active {
    background: rgba(236, 253, 245, 0.72);
}

.nurse-complete-btn {
    border-color: rgba(22, 163, 74, 0.26);
    background: rgba(220, 252, 231, 0.9);
    color: #15803d;
}

.nurse-visit-detail-row td {
    background: rgba(248, 250, 252, 0.72);
}

.nurse-visit-detail {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    padding: 1rem;
}

.nurse-visit-detail h3,
.nurse-notes-modal-body h3 {
    margin: 0 0 0.7rem;
    color: var(--gray-900);
    font-size: 1rem;
}

.nurse-clinical-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
}

.nurse-clinical-item {
    display: grid;
    gap: 0.25rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 0.75rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.62);
}

.nurse-clinical-item span {
    color: var(--gray-600);
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
}

.nurse-clinical-item strong {
    color: var(--gray-900);
    font-size: 0.92rem;
    overflow-wrap: anywhere;
}

.nurse-instruction-list ol {
    display: grid;
    gap: 0.5rem;
    margin: 0;
    padding-left: 1.2rem;
    color: var(--gray-700);
    line-height: 1.5;
}

.visit-checklist-summary {
    display: grid;
    gap: 0.55rem;
}

.visit-checklist-badge {
    display: inline-grid;
    gap: 0.12rem;
    align-items: center;
    width: max-content;
    max-width: 100%;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 0.65rem;
    padding: 0.42rem 0.6rem;
    background: rgba(248, 250, 252, 0.86);
    color: var(--gray-700);
    font-size: 0.78rem;
    line-height: 1.2;
}

.visit-checklist-badge strong,
.visit-checklist-badge em {
    font-style: normal;
}

.visit-checklist-badge-ready {
    border-color: rgba(22, 163, 74, 0.28);
    background: rgba(220, 252, 231, 0.9);
    color: #15803d;
}

.visit-checklist-badge-in-progress {
    border-color: rgba(234, 179, 8, 0.3);
    background: rgba(254, 249, 195, 0.86);
    color: #854d0e;
}

.visit-checklist-meter {
    height: 0.45rem;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(226, 232, 240, 0.9);
}

.visit-checklist-meter span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #16a34a, #42b8ff);
}

.visit-checklist-section,
.nurse-checklist-section {
    display: grid;
    gap: 0.65rem;
}

.visit-checklist-section + .visit-checklist-section,
.nurse-checklist-section + .nurse-checklist-section {
    margin-top: 0.95rem;
}

.visit-checklist-section h4,
.nurse-checklist-section h4 {
    margin: 0;
    color: var(--gray-900);
    font-size: 0.9rem;
}

.visit-checklist-items,
.nurse-checklist-items {
    display: grid;
    gap: 0.5rem;
}

.visit-checklist-item,
.nurse-checklist-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.7rem;
    align-items: start;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 0.75rem;
    padding: 0.7rem;
    background: rgba(255, 255, 255, 0.68);
}

.visit-checklist-status-dot {
    width: 0.62rem;
    height: 0.62rem;
    margin-top: 0.28rem;
    border-radius: 999px;
    background: #94a3b8;
}

.visit-checklist-item-completed .visit-checklist-status-dot {
    background: #16a34a;
}

.visit-checklist-item-not-applicable .visit-checklist-status-dot {
    background: #64748b;
}

.visit-checklist-item strong,
.nurse-checklist-item strong {
    display: block;
    color: var(--gray-900);
    font-size: 0.88rem;
    line-height: 1.4;
}

.visit-checklist-item span,
.nurse-checklist-item em,
.nurse-checklist-item small {
    display: block;
    margin-top: 0.2rem;
    color: var(--gray-600);
    font-size: 0.76rem;
    font-style: normal;
    font-weight: 800;
}

.visit-checklist-item p {
    margin: 0.35rem 0 0;
    color: var(--gray-700);
    font-size: 0.82rem;
    line-height: 1.45;
}

.nurse-checklist-item {
    grid-template-columns: 1fr auto;
    align-items: center;
}

.nurse-checklist-item label {
    grid-template-columns: auto 1fr;
    align-items: start;
    gap: 0.65rem;
    margin: 0;
}

.nurse-checklist-item input[type="checkbox"] {
    width: 1.1rem;
    height: 1.1rem;
    margin-top: 0.15rem;
    padding: 0;
}

.nurse-schedule-panel {
    padding-bottom: 1rem;
}

.nurse-schedule-header {
    align-items: center;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.5rem 0;
}

.nurse-notes-modal-content {
    max-width: 980px;
}

.nurse-notes-modal-body {
    display: grid;
    gap: 1.2rem;
    padding: 1.4rem 2rem;
    max-height: min(76vh, 820px);
    overflow: auto;
}

.nurse-note-form,
.nurse-note-section {
    display: grid;
    gap: 1rem;
}

.nurse-note-section {
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 0.9rem;
    padding: 1rem;
    background: rgba(248, 250, 252, 0.7);
}

.nurse-note-ai-section {
    background: #ffffff;
}

.nurse-note-ai-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.nurse-note-ai-actions span {
    color: var(--gray-600);
    font-size: 0.86rem;
    font-weight: 800;
}

.nurse-note-ai-actions span[data-tone="error"] {
    color: #b91c1c;
}

.nurse-note-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
}

.nurse-vitals-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(74px, 1fr));
    gap: 0.65rem;
}

.nurse-note-span-2 {
    grid-column: 1 / -1;
}

.nurse-notes-modal-body label,
.nurse-note-topic {
    display: grid;
    gap: 0.45rem;
    color: var(--gray-700);
    font-weight: 800;
}

.nurse-notes-modal-body input,
.nurse-notes-modal-body textarea {
    width: 100%;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 0.85rem;
    padding: 0.85rem;
    font: inherit;
    color: var(--gray-900);
    background: rgba(255, 255, 255, 0.86);
}

.nurse-notes-modal-body textarea {
    resize: vertical;
}

.nurse-note-topics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
}

.nurse-note-topic {
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 0.75rem;
    padding: 0.6rem 0.7rem;
    background: rgba(255, 255, 255, 0.72);
    font-size: 0.86rem;
}

.nurse-note-topic input {
    width: 1rem;
    height: 1rem;
    padding: 0;
}

.visit-note-detail {
    display: grid;
    gap: 0.85rem;
}

.visit-note-section {
    display: grid;
    gap: 0.55rem;
}

.visit-note-section h4 {
    margin: 0;
    color: var(--gray-900);
    font-size: 0.86rem;
}

.visit-note-section p {
    margin: 0;
    color: var(--gray-700);
    line-height: 1.5;
}

.visit-note-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
}

.visit-note-item {
    display: grid;
    gap: 0.2rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 0.65rem;
    padding: 0.6rem;
    background: rgba(255, 255, 255, 0.66);
}

.visit-note-item span {
    color: var(--gray-500);
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
}

.visit-note-item strong {
    color: var(--gray-900);
    font-size: 0.86rem;
    overflow-wrap: anywhere;
}

.visit-note-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.visit-note-chip-list span {
    border: 1px solid rgba(66, 184, 255, 0.22);
    border-radius: 999px;
    padding: 0.35rem 0.55rem;
    background: rgba(239, 246, 255, 0.9);
    color: var(--gray-700);
    font-size: 0.78rem;
    font-weight: 800;
}

@media (max-width: 1180px) {
    .admin-metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-support-layout,
    .admin-intake-email-layout {
        grid-template-columns: 1fr;
    }

    .admin-intake-check-panel {
        grid-template-columns: 1fr;
    }

    .admin-calendar-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .nurse-visit-detail {
        grid-template-columns: 1fr;
    }

    .admin-availability-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-availability-form .btn-primary {
        grid-column: 1 / -1;
    }
}

@media (max-width: 720px) {
    .admin-demo-grid,
    .admin-metric-grid {
        grid-template-columns: 1fr;
    }

    .admin-login-card {
        padding: 1.3rem;
    }

    .admin-chat-header-row,
    .admin-chat-meta {
        flex-direction: column;
    }

    .admin-chat-message {
        max-width: 100%;
    }

    .admin-form-grid,
    .admin-calendar-grid,
    .admin-intake-detail-grid,
    .nurse-clinical-grid,
    .nurse-note-grid,
    .nurse-vitals-grid,
    .nurse-note-topics,
    .visit-note-grid {
        grid-template-columns: 1fr;
    }

    .nurse-schedule-header {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-calendar-range-row,
    .admin-availability-form {
        grid-template-columns: 1fr;
    }

    .admin-scheduling-main > .search-bar-container {
        flex-direction: column;
    }
}
