/* ========================================
   DentLeon Pro - Fresh Modern Design
   Açık tema, minimalist, premium
======================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
    /* Fresh Teal/Emerald Colors */
    --primary: #0d9488;
    --primary-dark: #0f766e;
    --primary-light: #14b8a6;
    --primary-soft: #ccfbf1;

    /* Neutral Colors */
    --white: #ffffff;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;

    /* Accent Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;

    /* Background */
    --bg-body: #f0f9f9;
    /* Soft Dental Teal */
    --bg-card: #ffffff;
    --bg-hover: #f1f5f9;

    /* Text */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode Variables */
/* Dark Mode Variables */
[data-theme="dark"] {
    --bg-body: #020617;
    --bg-card: #0f172a;
    --bg-navbar: #020617;
    --bg-hover: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --gray-50: #0f172a;
    --gray-100: #1e293b;
    --gray-200: #334155;
    --gray-300: #475569;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #cbd5e1;
    --gray-700: #e2e8f0;
    --gray-800: #f1f5f9;
    --gray-900: #f8fafc;
    --primary-soft: rgba(13, 148, 136, 0.2);
}

body {
    background-color: var(--bg-body);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

[data-theme="dark"] .glass,
[data-theme="dark"] .card {
    background: #0f172a !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5) !important;
}

[data-theme="dark"] .navbar {
    background: rgba(2, 6, 23, 0.8) !important;
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
}

[data-theme="dark"] .list-header {
    background: rgba(255, 255, 255, 0.03) !important;
    border-bottom: 2px solid rgba(255, 255, 255, 0.05) !important;
    color: var(--primary-light) !important;
}

[data-theme="dark"] .list-item {
    background: transparent !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03) !important;
}

[data-theme="dark"] .list-item:hover {
    background: rgba(255, 255, 255, 0.02) !important;
}

[data-theme="dark"] .desktop-row div {
    color: #e2e8f0 !important;
}

[data-theme="dark"] .form-input,
[data-theme="dark"] .form-select,
[data-theme="dark"] .form-textarea {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: white !important;
}

[data-theme="dark"] .stat-card {
    background: #1e293b !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .report-stat-card {
    background: #1e293b !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .report-stat-card h3 {
    color: #f8fafc !important;
}

[data-theme="dark"] .report-stat-card p {
    color: #94a3b8 !important;
}

[data-theme="dark"] .clinic-group-card {
    background: #0f172a !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .clinic-group-header {
    background: #1e293b !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .clinic-group-header h4 {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .report-table th,
[data-theme="dark"] .patients-list-table th {
    background: #0f172a !important;
    color: #94a3b8 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .report-table td,
[data-theme="dark"] .patients-list-table td {
    color: #cbd5e1 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
}

[data-theme="dark"] .doctor-row:hover {
    background: rgba(255, 255, 255, 0.05) !important;
}

[data-theme="dark"] .doctor-row.active {
    background: rgba(13, 148, 136, 0.2) !important;
}

[data-theme="dark"] .patients-panel {
    background: #020617 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .filters-bar {
    background: #1e293b !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .filters-bar label {
    color: #94a3b8 !important;
}

[data-theme="dark"] .filters-bar .form-input {
    background: #0f172a !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: white !important;
}

[data-theme="dark"] .month-selector {
    background: #1e293b !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: white !important;
}

[data-theme="dark"] .month-nav {
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: white !important;
}

[data-theme="dark"] .month-nav:hover {
    background: rgba(255, 255, 255, 0.05) !important;
}

[data-theme="dark"] .page-header .btn-white {
    background: #1e293b !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: white !important;
}

[data-theme="dark"] .page-header .btn-white:hover {
    background: #334155 !important;
}

/* Takvim (Calendar) Karanlık Mod */
[data-theme="dark"] .calendar-container {
    background: #1e293b !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .calendar-header {
    background: #0f172a !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .calendar-grid {
    background: #0f172a !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .calendar-day {
    background: #1e293b !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #e2e8f0 !important;
}

[data-theme="dark"] .calendar-day:hover {
    background: #334155 !important;
}

[data-theme="dark"] .day-name {
    background: #0f172a !important;
    color: #94a3b8 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* E-postalar (Emails) Karanlık Mod */
[data-theme="dark"] .email-item {
    background: #1e293b !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .email-header {
    background: #1e293b !important;
    /* Varsayılan olarak koyu kalmalı */
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
}

[data-theme="dark"] .email-header:hover {
    background: #334155 !important;
    /* Hover da bir tık açığı */
}

[data-theme="dark"] .email-body {
    background: #0f172a !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .email-subject {
    color: #f1f5f9 !important;
}

/* İş Takibi (Zirkon Jobs) Karanlık Mod */
[data-theme="dark"] .category-tabs {
    background: #1e293b !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .category-tab {
    color: #94a3b8 !important;
}

[data-theme="dark"] .category-tab:hover {
    background: rgba(255, 255, 255, 0.05) !important;
}

[data-theme="dark"] .zw-stat-card {
    background: #1e293b !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .zw-stat-label {
    color: #94a3b8 !important;
}

[data-theme="dark"] .zw-empty-state {
    background: #1e293b !important;
    border: 1px dashed rgba(255, 255, 255, 0.1) !important;
    color: #94a3b8 !important;
}

[data-theme="dark"] .zw-search-box input {
    background: #1e293b !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: white !important;
}

[data-theme="dark"] .zw-filter-btn {
    background: #1e293b !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #94a3b8 !important;
}

[data-theme="dark"] .parsed-info-box {
    background: #1e293b !important;
    border: 1px dashed rgba(255, 255, 255, 0.2) !important;
}

[data-theme="dark"] .edit-input {
    background: #0f172a !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: white !important;
}

[data-theme="dark"] .parsed-label {
    color: #10b981 !important;
    /* Mevcut yeşil tonunu koru veya aç */
}

[data-theme="dark"] .email-content {
    background: #1e293b !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #cbd5e1 !important;
}

[data-theme="dark"] .attachment-tag {
    background: rgba(255, 255, 255, 0.05) !important;
    color: #cbd5e1 !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* Patient Detail Page Dark Mode */
body[data-theme="dark"] .detail-container .stat-item {
    background: #1e293b !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .stat-label {
    color: #94a3b8 !important;
}

[data-theme="dark"] .stat-label[style] {
    color: #a78bfa !important;
    /* Mor rengi aç (Lila) */
}

[data-theme="dark"] .stat-value {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .stat-value[style] {
    color: #c4b5fd !important;
    /* Mor rengi daha da aç */
}

[data-theme="dark"] .accordion-item {
    background: #1e293b !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .accordion-header {
    background: #0f172a !important;
    /* Daha koyu başlık */
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
}

[data-theme="dark"] .process-title {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .process-step {
    background: #0f172a !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .process-step strong {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .form-textarea {
    background: #0f172a !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: white !important;
}

[data-theme="dark"] .note-bubble {
    background: #0f172a !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #cbd5e1 !important;
}

/* Bottom Bar Fixes */
[data-theme="dark"] .bottom-bar {
    background: #0f172a !important;
    /* Çok koyu lacivert */
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] #btnStartWork {
    background: transparent !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #f8fafc !important;
}

[data-theme="dark"] #btnStartWork:hover {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
}

/* Mobil için Tema Butonu Görünürlüğü */
@media (max-width: 768px) {
    .navbar-user {
        display: flex !important;
        gap: 10px;
        align-items: center;
        margin-right: -10px;
    }

    .navbar-user span,
    .navbar-user .user-avatar,
    .navbar-user .btn-secondary:not(#themeToggle) {
        display: none !important;
    }

    #themeToggle {
        display: flex !important;
        width: 38px !important;
        height: 38px !important;
        border-radius: 12px !important;
        background: var(--bg-card) !important;
        border: 1px solid var(--gray-200) !important;
    }
}

[data-theme="dark"] .page-header p {
    color: #94a3b8 !important;
}

[data-theme="dark"] .stage-num {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #e2e8f0 !important;
}

[data-theme="dark"] .patient-card-header .header-main h3 {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .info-row span:first-child {
    color: #94a3b8 !important;
}

[data-theme="dark"] .info-row span:last-child {
    color: #e2e8f0 !important;
}

[data-theme="dark"] .modal {
    background: #0f172a !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* Theme Toggle Button Fix */
#themeToggle {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 38px !important;
    height: 38px !important;
    padding: 0 !important;
    border-radius: 10px !important;
    border: 1px solid var(--gray-200) !important;
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
    cursor: pointer;
    transition: all 0.2s ease;
}

#themeToggle:hover {
    transform: scale(1.05);
    background: var(--gray-100) !important;
}

[data-theme="dark"] #themeToggle {
    border-color: rgba(255, 255, 255, 0.1) !important;
    background: #1e293b !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

@keyframes pulse-soft {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(13, 148, 136, 0.4);
    }

    70% {
        transform: scale(1.02);
        box-shadow: 0 0 0 10px rgba(13, 148, 136, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(13, 148, 136, 0);
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(20px);
        opacity: 0;
    }

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

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

html,
body {
    overflow-x: hidden;
    max-width: 100%;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    color: var(--primary-dark);
}

h1,
h2,
h3,
h4 {
    font-weight: 700;
    color: var(--gray-900);
}

h1 {
    font-size: 2rem;
}

h2 {
    font-size: 1.5rem;
}

h3 {
    font-size: 1.25rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: white;
    color: var(--gray-700);
    border: 1px solid var(--gray-200);
}

.btn-secondary:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
}

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

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

.btn-animate {
    transition: var(--transition-base);
}

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

.btn-premium {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(13, 148, 136, 0.3);
}

.btn-premium::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

.btn-premium:hover::after {
    left: 100%;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-700);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    color: var(--text-primary);
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    transition: all 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

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

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

/* LOGIN PAGE - Split Screen */
.login-page {
    min-height: 100vh;
    display: flex;
}

.login-left {
    flex: 1;
    background: linear-gradient(135deg, var(--primary) 0%, #047857 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 60px;
    color: white;
    position: relative;
    overflow: hidden;
}

.login-left::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    top: -200px;
    right: -200px;
}

.login-brand {
    position: relative;
    z-index: 1;
    text-align: center;
}

.login-brand h1 {
    font-size: 3rem;
    color: white;
    margin-bottom: 16px;
}

.login-brand p {
    font-size: 1.25rem;
    opacity: 0.9;
    max-width: 400px;
}

.login-features {
    margin-top: 60px;
    position: relative;
    z-index: 1;
}

.login-feature {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    font-size: 1rem;
}

.login-feature i {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
    background: white;
}

.login-form-container {
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-form-container h2 {
    font-size: 1.75rem;
    margin-bottom: 8px;
}

.login-btns {
    margin-top: 32px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* TOP NAVBAR */
.navbar {
    background: white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    padding: 0 48px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.navbar-nav {
    display: flex;
    gap: 4px;
}

.nav-link {
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-600);
    border-radius: 12px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.nav-link:hover {
    background: var(--gray-100);
    color: var(--primary);
}

.nav-link.active {
    background: #e6f4f2;
    color: var(--primary);
    box-shadow: none;
}

.nav-link i {
    font-size: 14px;
    opacity: 0.8;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-avatar {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

/* Main Content */
.main-content {
    padding: 40px 48px;
    max-width: 1600px;
    margin: 0 auto;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
}

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

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

.stat-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.2s;
}

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

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.teal {
    background: var(--primary-soft);
    color: var(--primary);
}

.stat-icon.blue {
    background: #dbeafe;
    color: #3b82f6;
}

.stat-icon.orange {
    background: #fef3c7;
    color: #f59e0b;
}

.stat-icon.green {
    background: #d1fae5;
    color: #10b981;
}

.stat-info h3 {
    font-size: 2rem;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-info p {
    color: var(--gray-500);
    font-size: 14px;
}

/* Cards */
.card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.02);
    overflow: hidden;
}

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

.card-body {
    padding: 24px;
}

/* Tables */
.table-container {
    overflow-x: auto;
}

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

.table th,
.table td {
    padding: 14px 20px;
    text-align: left;
}

.table th {
    background: var(--gray-50);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-500);
}

.table td {
    border-bottom: 1px solid var(--gray-100);
    font-size: 14px;
}

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

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: var(--radius-full);
}

.badge-success {
    background: #d1fae5;
    color: #059669;
}

.badge-warning {
    background: #fef3c7;
    color: #d97706;
}

.badge-info {
    background: var(--primary-soft);
    color: var(--primary);
}

.badge-danger {
    background: #fee2e2;
    color: #dc2626;
}

/* Improved Patient Cards (Two-Tone Design) */
.patients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 20px;
}

.patient-card {
    background: white;
    border-radius: 20px;
    border: none;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
}

.patient-card:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transform: translateY(-5px);
}

.card-top {
    background: #1a2236;
    /* Dark Navy */
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    position: relative;
    min-height: 110px;
}

.card-avatar {
    width: 64px;
    height: 64px;
    background: #fff8e7;
    /* Light Beige */
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.card-avatar i {
    font-size: 24px;
    color: #d97706;
    /* Amber/Orange */
}

.card-info {
    flex: 1;
}

.card-info h3 {
    margin: 0 0 4px 0;
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
}

.card-clinic {
    color: #10b981;
    /* Teal/Emerald */
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.card-doctor {
    color: #94a3b8;
    /* Slate gray */
    font-size: 0.8rem;
    font-weight: 500;
}

/* Custom Status Badge for Card */
.status-pill {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #fff8e7;
    color: #d97706;
    padding: 6px 16px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: capitalize;
}

.stage-label {
    position: absolute;
    top: 60px;
    right: 20px;
    width: 93px;
    /* Match status-pill approx width */
    text-align: center;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 0;
    border-radius: 8px;
}

.card-bottom {
    background: #e2e8f0;
    /* Much darker gray for clear distinction */
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid #cbd5e1;
}

.card-date {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #475569;
    /* Darker slate for better contrast on gray */
    font-size: 0.85rem;
    font-weight: 700;
}

.card-date i {
    color: #10b981;
}

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

.action-btn {
    width: 40px;
    height: 40px;
    background: #1a2236;
    border: none;
    border-radius: 10px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn:hover {
    color: white;
    background: #2d3748;
}

.action-btn.delete:hover {
    color: #ef4444;
}

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

.modal-overlay.active {
    display: flex;
}

.modal {
    background: white;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

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

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--gray-100);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray-400);
    cursor: pointer;
}

/* Toasts */
.toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 9999;
}

.toast {
    background: white;
    border-radius: var(--radius-md);
    padding: 16px 20px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease;
    border-left: 4px solid var(--primary);
    min-width: 300px;
}

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

.toast.error {
    border-left-color: var(--error);
}


/* Pulse Red Notification */
.pulse-red {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    animation: pulse-red-animation 2s infinite;
    border: 2px solid #ef4444 !important;
}

@keyframes pulse-red-animation {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(239, 68, 68, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

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

/* Utilities */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

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

.d-flex {
    display: flex;
}

.align-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-sm {
    gap: 8px;
}

.gap-md {
    gap: 16px;
}

.mt-sm {
    margin-top: 8px;
}

.mt-md {
    margin-top: 16px;
}

.mb-sm {
    margin-bottom: 8px;
}

.mb-md {
    margin-bottom: 16px;
}

.mb-lg {
    margin-bottom: 24px;
}

/* Glassmorphism Classes */
.glass {
    background: rgba(255, 255, 255, 0.7) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

.glass-dark {
    background: rgba(26, 34, 54, 0.8) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* Specific Refinements */
.patient-card {
    animation: fadeIn 0.5s ease-out backwards;
}

.patient-card:nth-child(2n) {
    animation-delay: 0.1s;
}

.patient-card:nth-child(3n) {
    animation-delay: 0.2s;
}

.status-pill {
    transition: var(--transition-fast);
}

.patient-card:hover .status-pill {
    transform: scale(1.1);
}

/* Micro-interactions for process steps */
.process-step {
    transition: var(--transition-base);
}

.process-step:hover:not(.active) {
    border-color: var(--gray-300);
    background: var(--gray-50);
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.process-step.active {
    animation: pulse-soft 2s infinite;
}

/* Floating Bar Premium */
.bottom-bar {
    background: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

/* Toast Animation */
.toast {
    animation: slideInRight 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* ---------------------------------------------------- */
/* MOBILE RESPONSIVE FIXES                              */
/* ---------------------------------------------------- */
/* ---------------------------------------------------- */
/* ---------------------------------------------------- */
/* MOBILE RESPONSIVE FIXES                              */
/* ---------------------------------------------------- */
/* ---------------------------------------------------- */
@media (max-width: 1200px) {

    /* 1. Navbar Adjustment */
    .navbar {
        height: 60px;
        padding: 0 15px;
        justify-content: center;
        /* Center logo */
    }

    .navbar-brand {
        margin: 0;
        font-size: 1.25rem;
    }

    /* Hide Desktop Nav & User Info */
    .navbar-nav,
    .navbar-user {
        display: none !important;
    }

    /* Mobile Floating Action Button (FAB) Menu */
    .mobile-menu-fab {
        position: fixed;
        bottom: 20px;
        left: 20px;
        width: 56px;
        height: 56px;
        background: var(--primary);
        border-radius: 50%;
        display: flex !important;
        /* Force show on mobile */
        align-items: center;
        justify-content: center;
        box-shadow: 0 4px 15px rgba(13, 148, 136, 0.4);
        z-index: 10000;
        border: none;
        color: white;
        font-size: 24px;
        transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        cursor: pointer;
    }

    .mobile-menu-fab:active {
        transform: scale(0.9);
    }

    .mobile-menu-fab.active {
        transform: rotate(45deg);
        background: var(--error);
    }

    /* Mobile Menu Container */
    .mobile-menu-container {
        position: fixed;
        bottom: 90px;
        left: 20px;
        width: 200px;
        background: white;
        border-radius: 16px;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
        padding: 10px;
        display: none;
        flex-direction: column;
        gap: 5px;
        z-index: 9999;
        transform-origin: bottom left;
        animation: menuPopup 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }

    .mobile-menu-container.show {
        display: flex;
    }

    .mobile-nav-item {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px 16px;
        text-decoration: none;
        color: var(--gray-700);
        font-weight: 500;
        border-radius: 12px;
        transition: 0.2s;
    }

    .mobile-nav-item:hover {
        background: var(--gray-50);
        color: var(--primary);
    }

    .mobile-nav-item.active {
        background: var(--primary-soft);
        color: var(--primary);
    }

    .mobile-nav-item.logout {
        color: var(--error);
        border-top: 1px solid var(--gray-100);
        margin-top: 5px;
        padding-top: 12px;
    }

    .mobile-nav-item.theme-toggle-mobile {
        border-top: 1px solid var(--gray-100);
        margin-top: 5px;
        padding-top: 12px;
        color: var(--primary);
    }

    @keyframes menuPopup {
        from {
            opacity: 0;
            transform: scale(0.8) translateY(20px);
        }

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

    /* Login Page Mobile Fixes */
    .login-page {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }

    .login-left {
        width: 100%;
        padding: 40px 20px;
        flex: none;
    }

    .login-left::before {
        display: none;
    }

    .login-brand h1 {
        font-size: 2rem;
    }

    .login-features {
        display: none;
    }

    .login-right {
        width: 100%;
        padding: 30px 20px;
        flex: 1;
    }

    /* 2. Main Layout */
    .main-content {
        padding: 15px;
        margin-bottom: 80px;
        /* Space for bottom bar if exists */
        overflow-x: hidden;
        /* Prevent horizontal scroll on main body */
        max-width: 100vw;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .page-title {
        font-size: 1.5rem;
    }

    /* 3. Patient Cards Grid */
    .patients-grid {
        grid-template-columns: 1fr;
        /* Single column on mobile */
        gap: 15px;
    }

    .compact-grid {
        grid-template-columns: 1fr;
    }

    /* 4. Patient Detail Page */
    .detail-container {
        padding: 0;
    }

    .detail-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .detail-header .d-flex {
        width: 100%;
        justify-content: space-between;
    }

    .left-col {
        width: 100%;
    }

    .right-col {
        display: none;
        /* Or stack it below if needed */
    }

    /* Stats Row in Detail */
    .stats-row {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    /* Process Steps */
    .process-grid {
        grid-template-columns: 1fr;
        /* Stack steps vertically */
        gap: 10px;
    }

    .process-step {
        flex-direction: row;
        justify-content: flex-start;
        padding: 15px;
        min-height: auto;
        text-align: left;
    }

    .process-step .step-number {
        margin-bottom: 0;
        margin-right: 10px;
    }

    /* 5. Modals */
    .modal {
        width: 95%;
        max-height: 90vh;
        overflow-y: auto;
    }

    /* 6. Calendar/List Views */
    .calendar-grid {
        display: flex;
        flex-direction: column;
    }

    .calendar-day-header {
        display: none;
        /* Hide day names on mobile vertical view */
    }

    .calendar-day {
        min-height: auto;
        border-right: none;
        border-bottom: 1px solid var(--gray-200);
    }

    /* 7. Bottom Bar (Patient Detail) */
    .bottom-bar {
        padding: 10px 15px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .bottom-bar .btn {
        flex: 1;
        font-size: 0.9rem;
        padding: 10px;
    }

    /* Emails List */
    .email-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .actions-cell {
        width: 100%;
        justify-content: flex-end;
        margin-top: 10px;
    }

    /* 8. Table Responsiveness Fixes - New Div List Layout */
    .table-container.header-row.desktop-only {
        display: none !important;
    }

    .list-item .desktop-row {
        display: none !important;
    }

    .list-item .mobile-card {
        display: flex !important;
    }

    .list-item {
        padding: 15px !important;
        background: #fff;
    }

    .card-body {
        padding: 0 !important;
    }

    /* Dashboard Filters */
    .dashboard-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .dashboard-filters select {
        width: 100%;
    }

    /* 8. Table Responsiveness Fixes */
    .table-container {
        overflow-x: hidden;
        /* No scroll, map to cards */
        width: 100%;
        margin: 0;
        padding: 0;
    }

    .table {
        width: 100%;
        /* Fluid */
    }

    /* Fix header actions on mobile */
    .header-actions {
        width: 100%;
        display: flex;
        flex-direction: column-reverse;
        /* Put filters above button or vice-versa */
        gap: 10px;
    }

    .header-actions .btn {
        width: 100%;
    }

    .header-actions .input-icon-group {
        width: 100%;
        max-width: none !important;
    }
}