/* =========================================
   17. NEW PATIENT PROFILE (MODERN GRID)
   ========================================= */
.profile-grid-container {
    display: grid;
    grid-template-columns: 1fr 340px;
    /* Left (Content), Right (Profile Card) */
    gap: 25px;
    align-items: start;
}

@media (max-width: 991px) {
    .profile-grid-container {
        grid-template-columns: 1fr;
        /* Stack on mobile */
    }

    .profile-card-modern {
        order: -1;
        /* Show profile on top on mobile */
        position: relative !important;
        top: 0 !important;
    }
}

/* Right Side: Profile Card */
.profile-card-modern {
    background: #fff;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 20px;
    /* Sticky scroll */
    border: 1px solid #f0f0f0;
}

.p-card-avatar {
    width: 120px;
    height: 120px;
    background: #f1f5f9;
    /* Light gray background for placeholder */
    border-radius: 24px;
    /* Premium Rounded Corner */
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    border: 4px solid #fff;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    /* Modern soft shadow */
}

.p-card-avatar i {
    font-size: 60px;
    color: #94a3b8;
    /* Subtle icon color */
}

.p-card-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
    /* Hidden by default if use icon */
}

.p-card-avatar.has-image i {
    display: none;
}

.p-card-avatar.has-image img {
    display: block;
}


.p-card-name {
    font-size: 22px;
    font-weight: 800;
    color: #333;
    margin-bottom: 5px;
    font-family: 'Cairo', sans-serif;
}

.p-card-id {
    display: inline-block;
    background: #f8f9fa;
    color: #666;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 25px;
    border: 1px solid #eee;
}

/* Info Grid in Card */
.p-info-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f5f5f5;
    font-size: 14px;
}

.p-info-row:last-child {
    border-bottom: none;
}

.p-info-label {
    color: #888;
    font-weight: 600;
}

.p-info-val {
    font-weight: 700;
    color: #444;
}

.p-info-icon-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.p-info-icon-wrapper i {
    width: 24px;
    text-align: center;
    color: #3b82f6;
}

/* Red Flags Box */
.p-red-flags {
    background: #fef2f2;
    border-radius: 12px;
    padding: 18px;
    margin-top: 25px;
    text-align: right;
    border: 1px dashed #f87171;
    position: relative;
    overflow: hidden;
}

.p-red-flags::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: #ef4444;
}

/* Stats Infographic Box (Turquoise Green) */
.p-stats-box {
    background: #f0fdfa;
    border-radius: 12px;
    padding: 18px;
    margin-top: 25px;
    text-align: right;
    border: 1px dashed #2dd4bf;
    position: relative;
    overflow: hidden;
}

.p-stats-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: #0d9488;
}

.stats-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 10px;
}

.stat-item {
    background: rgba(255, 255, 255, 0.7);
    border-radius: 10px;
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid rgba(13, 148, 136, 0.1);
    transition: transform 0.2s ease;
}

.stat-item:hover {
    transform: translateY(-2px);
    background: #fff;
    border-color: #2dd4bf;
}

.stat-val {
    font-size: 15px;
    font-weight: 800;
    color: #0f766e;
    margin-bottom: 2px;
}

.stat-label {
    font-size: 10px;
    color: #557c7c;
    font-weight: 600;
}

body.dark-mode .p-stats-box {
    background: rgba(13, 58, 54, 0.3);
    border-color: #0d9488;
}

body.dark-mode .stat-item {
    background: rgba(15, 23, 42, 0.4);
    border-color: rgba(13, 148, 136, 0.2);
}

body.dark-mode .stat-val {
    color: #2dd4bf;
}

body.dark-mode .stat-label {
    color: #94a3b8;
}

/* Left Side: Tabs & Content */
.profile-action-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.profile-pills {
    display: flex;
    gap: 0;
    background: #f1f3f5;
    padding: 5px;
    border-radius: 12px;
    position: relative;
    z-index: 1;
}

.p-pill {
    padding: 10px 25px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: #666;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    text-align: center;
    position: relative;
    z-index: 2;
}

.p-pill:hover {
    color: #333;
    background: rgba(255, 255, 255, 0.5);
}

.p-pill.active {
    background: #fff;
    color: #1f3aa8;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    font-weight: 800;
}

.profile-tab-content {
    background: #fff;
    border-radius: 20px;
    padding: 30px;
    min-height: 500px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.03);
    border: 1px solid #f8f9fa;
    position: relative;
}

/* Dark Mode Adjustments */
body.dark-mode .profile-card-modern,
body.dark-mode .profile-tab-content,
body.dark-mode .profile-pills {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

body.dark-mode .p-card-avatar {
    background: linear-gradient(135deg, #1e3a8a, #1f2937);
    color: #60a5fa;
    border-color: #334155;
    box-shadow: 0 0 20px rgba(96, 165, 250, 0.2);
}

body.dark-mode .p-card-name {
    color: #f8fafc;
}

body.dark-mode .p-info-label {
    color: #94a3b8;
}

body.dark-mode .p-info-val {
    color: #e2e8f0;
}

body.dark-mode .p-info-row {
    border-color: #334155;
}

body.dark-mode .p-card-id {
    background: #0f172a;
    border-color: #334155;
    color: #94a3b8;
}

body.dark-mode .p-red-flags {
    background: rgba(69, 10, 10, 0.5);
    border-color: #ef4444;
}

body.dark-mode .profile-pills {
    background: #0f172a;
}

body.dark-mode .p-pill {
    color: #94a3b8;
}

body.dark-mode .p-pill:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

body.dark-mode .p-pill.active {
    background: #334155;
    color: #38bdf8;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

body.dark-mode .p-info-icon-wrapper i {
    color: #38bdf8;
}

/* =========================================
   18. ANIMATED DASHBOARD (PATIENTS)
   ========================================= */
.p-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
    max-width: 1200px;
    margin: 40px auto;
}

@media (max-width: 1100px) {
    .p-dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .p-dashboard-grid {
        grid-template-columns: 1fr;
    }
}

.m-dash-card {
    background: #fff;
    border-radius: 20px;
    padding: 40px 30px;
    text-align: center;
    border: 1px solid #f1f5f9;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.m-dash-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, #3b82f6, #0d6efd);
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.m-dash-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(13, 110, 253, 0.15);
}

.m-dash-card:hover::before {
    transform: scaleX(1);
}

.m-d-icon-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 25px;
    font-size: 32px;
    transition: all 0.4s ease;
}

.m-dash-card:hover .m-d-icon-circle {
    transform: scale(1.1) rotate(5deg);
    background: #eff6ff;
}

.m-d-title {
    font-weight: 800;
    font-size: 20px;
    margin-bottom: 10px;
    color: #1e293b;
    font-family: 'Cairo', sans-serif;
}

.m-d-desc {
    color: #64748b;
    font-size: 14px;
    line-height: 1.5;
}

/* Specific Colors */
.m-card-add .m-d-icon-circle {
    color: #10b981;
    background: #ecfdf5;
}

.m-card-add:hover .m-d-icon-circle {
    background: #d1fae5;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

.m-card-search .m-d-icon-circle {
    color: #3b82f6;
    background: #eff6ff;
}

.m-card-search:hover .m-d-icon-circle {
    background: #dbeafe;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

.m-card-edit .m-d-icon-circle {
    color: #f59e0b;
    background: #fffbeb;
}

.m-card-edit:hover .m-d-icon-circle {
    background: #fef3c7;
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.3);
}

.m-card-list .m-d-icon-circle {
    color: #6366f1;
    background: #eef2ff;
}

.m-card-list:hover .m-d-icon-circle {
    background: #e0e7ff;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
}

/* Dark Mode */
body.dark-mode .m-dash-card {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

body.dark-mode .m-d-title {
    color: #f8fafc;
}

body.dark-mode .m-d-desc {
    color: #94a3b8;
}

body.dark-mode .m-d-icon-circle {
    background: #0f172a;
}

/* Specific Dark Icons */
body.dark-mode .m-card-add .m-d-icon-circle {
    color: #34d399;
    background: #064e3b;
}

body.dark-mode .m-card-search .m-d-icon-circle {
    color: #60a5fa;
    background: #1e3a8a;
}

body.dark-mode .m-card-edit .m-d-icon-circle {
    color: #fbbf24;
    background: #78350f;
}

body.dark-mode .m-card-list .m-d-icon-circle {
    color: #818cf8;
    background: #312e81;
}

/* Entrance Animation */
@keyframes cardEntrance {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.m-dash-card:nth-child(1) {
    animation: cardEntrance 0.5s ease 0s backwards;
}

.m-dash-card:nth-child(2) {
    animation: cardEntrance 0.5s ease 0.1s backwards;
}

.m-dash-card:nth-child(3) {
    animation: cardEntrance 0.5s ease 0.2s backwards;
}

.m-dash-card:nth-child(4) {
    animation: cardEntrance 0.5s ease 0.3s backwards;
}

/* =========================================
   19. MODERN MODALS (GLASSMORPHISM)
   ========================================= */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(8px);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.modal-box {
    background: #fff;
    border-radius: 24px;
    padding: 40px;
    width: 100%;
    max-width: 550px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    position: relative;
    animation: slideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.close-modal {
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 28px;
    color: #94a3b8;
    cursor: pointer;
    transition: 0.3s;
    line-height: 1;
}

.close-modal:hover {
    color: #ef4444;
    transform: rotate(90deg);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Dark Mode Modal */
body.dark-mode .modal-box {
    background: #1e293b;
    border-color: #334155;
    color: #f8fafc;
}

body.dark-mode .modal-box .form-label {
    color: #94a3b8;
}

body.dark-mode .modal-box .form-control {
    background: #0f172a;
    border-color: #334155;
    color: #fff;
}

body.dark-mode .modal-box h3 {
    color: #38bdf8 !important;
}

/* Profile Inline Editing */
.prof-edit-input {
    transition: all 0.2s ease-in-out;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px 15px;
    font-size: 15px;
    height: auto !important;
}

.prof-edit-input:disabled {
    background: #f8f9fa !important;
    border-color: #ced4da !important;
    /* Visible Grey Border */
    color: #334155 !important;
    cursor: default;
    opacity: 1;
    -webkit-text-fill-color: #334155;
    /* For iOS */
}

.prof-edit-input:not(:disabled) {
    background: #ffffff !important;
    border: 2px solid #3b82f6 !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.08);
    color: #0f172a !important;
}

body.dark-mode .prof-edit-input:disabled {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}

body.dark-mode .prof-edit-input:not(:disabled) {
    background: #0f172a !important;
    border-color: #60a5fa !important;
    color: #f8fafc !important;
}

/* =========================================
   20. MODERN PATIENT FORM
   ========================================= */
.modern-patient-form {
    background: #fff;
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.05);
    width: 100%;
    margin: 0 auto;
    border: 1px solid #f1f5f9;
    position: relative;
    overflow: hidden;
}

.modern-patient-form::after {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 150px;
    height: 150px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(13, 110, 253, 0.05));
    border-radius: 50%;
    z-index: 0;
}

.form-header-modern {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 35px;
    position: relative;
    z-index: 1;
}

.form-header-modern .icon-box {
    width: 45px;
    height: 45px;
    background: rgba(59, 130, 246, 0.08);
    /* Simpler, lighter background */
    color: #3b82f6;
    border-radius: 8px;
    /* Square with small radius instead of circle */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.form-header-modern h4 {
    margin: 0;
    font-weight: 800;
    color: #1e293b;
    font-size: 22px;
}

.input-group-modern {
    margin-bottom: 25px;
    position: relative;
    z-index: 1;
}

.input-group-modern label {
    display: block;
    font-weight: 700;
    color: #64748b;
    margin-bottom: 8px;
    font-size: 14px;
}

.input-wrapper-inner {
    position: relative;
}

.input-wrapper-inner i {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    transition: 0.3s;
}

.input-modern {
    width: 100%;
    padding: 12px 45px 12px 15px;
    border: 2px solid #f1f5f9;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #f8fafc;
}

.input-modern:focus {
    border-color: #3b82f6;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
    outline: none;
}

.input-modern:focus+i {
    color: #3b82f6;
}

.btn-premium-save {
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
    color: #fff;
    border: none;
    padding: 14px 40px;
    border-radius: 14px;
    font-weight: 800;
    font-size: 17px;
    cursor: pointer;
    transition: all 0.4s ease;
    box-shadow: 0 10px 25px rgba(31, 58, 168, 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 auto;
}

.btn-premium-save:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(31, 58, 168, 0.3);
    color: #fff;
}

.btn-back-modern {
    background: #f1f5f9;
    color: #64748b;
    border: none;
    padding: 8px 18px;
    border-radius: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.3s;
    margin-bottom: 30px;
}

.btn-back-modern:hover {
    background: #e2e8f0;
    color: #1e293b;
}

/* Dark Mode Form */
body.dark-mode .modern-patient-form {
    background: #1e293b;
    border-color: #334155;
}

body.dark-mode .form-header-modern h4 {
    color: #f8fafc;
}

body.dark-mode .form-header-modern .icon-box {
    background: #0f172a;
    color: #60a5fa;
}

body.dark-mode .input-modern {
    background: #0f172a;
    border-color: #334155;
    color: #fff;
}

body.dark-mode .input-group-modern label {
    color: #94a3b8;
}

body.dark-mode .btn-back-modern {
    background: #334155;
    color: #cbd5e1;
}

body.dark-mode .btn-back-modern:hover {
    background: #475569;
}

/* Search View Enhancements */
.search-results-modern {
    margin-top: 30px;
    text-align: right;
    border-top: 1px solid #f1f5f9;
    padding-top: 20px;
}

.search-results-modern h5 {
    font-size: 15px;
    color: #64748b;
    margin-bottom: 15px;
    font-weight: 700;
}

.result-item-modern {
    background: #fff;
    border: 1px solid #f1f5f9;
    border-radius: 12px;
    padding: 12px 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: 0.3s;
    cursor: pointer;
}

.result-item-modern:hover {
    border-color: #3b82f6;
    background: #eff6ff;
    transform: translateX(-5px);
}

.result-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.result-icon {
    width: 35px;
    height: 35px;
    background: #f1f5f9;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
}

.result-text .name {
    display: block;
    font-weight: 700;
    color: #1e293b;
    font-size: 14px;
}

.result-text .phone {
    font-size: 12px;
    color: #94a3b8;
}

body.dark-mode .result-item-modern {
    background: #0f172a;
    border-color: #334155;
}

body.dark-mode .result-text .name {
    color: #f8fafc;
}

body.dark-mode .result-icon {
    background: #1e293b;
    color: #94a3b8;
}

body.dark-mode .search-results-modern {
    border-color: #334155;
}

/* =========================================
   22. CREATIVE PATIENT DIRECTORY
   ========================================= */
.patient-directory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.patient-dir-card {
    background: #fff;
    border: 1px solid #f1f5f9;
    border-radius: 16px;
    padding: 20px;
    position: relative;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
}

.patient-dir-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.08);
    border-color: #3b82f6;
}

.pd-avatar {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    color: #3b82f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    margin-bottom: 15px;
    border: 3px solid #fff;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.15);
}

.pd-info h3 {
    font-size: 17px;
    font-weight: 800;
    color: #1e293b;
    margin: 0 0 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.pd-info p {
    font-size: 13px;
    color: #64748b;
    margin: 0 0 15px;
}

/* Patient Directory Card Buttons - Premium Style from Screenshot */
.pd-actions {
    display: flex;
    gap: 10px;
    width: 100%;
    margin-top: auto;
}

.pd-btn {
    flex: 1;
    padding: 10px 0;
    border-radius: 8px;
    /* Slightly rounded corners */
    font-size: 14px;
    font-weight: 700;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    /* Subtle shadow */
}

/* Edit Button - Solid Orange/Gold */
.pd-btn-edit {
    background-color: #e0a800;
    /* Matching screenshot orange */
    color: #fff !important;
    border: 1px solid #c69500;
}

.pd-btn-edit:hover {
    background-color: #d39e00;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(224, 168, 0, 0.3);
}

.pd-btn-edit i {
    font-size: 16px;
}

/* View Button - Light Gray/Blue */
.pd-btn-view {
    background-color: #f1f5f9;
    color: #475569 !important;
    border: 1px solid #cbd5e1;
}

.pd-btn-view:hover {
    background-color: #e2e8f0;
    color: #1e293b !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

/* Dark Mode Overrides for Buttons */
body.dark-mode .pd-btn-edit {
    background-color: #ffc107;
    color: #000 !important;
    border-color: #ffc107;
}

body.dark-mode .pd-btn-edit:hover {
    background-color: #ffdb4d;
}

body.dark-mode .pd-btn-view {
    background-color: #334155;
    color: #e2e8f0 !important;
    border-color: #475569;
}

body.dark-mode .pd-btn-view:hover {
    background-color: #475569;
    color: #fff !important;
}

/* Ensure Text Buttons in Table match color scheme too */
.ct-btn-text.edit {
    color: #fff;
    background-color: #e0a800;
    padding: 6px 14px;
}

.ct-btn-text.edit:hover {
    background-color: #d39e00;
    color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

body.dark-mode .ct-btn-text.edit {
    background-color: #ffc107;
    color: #000;
}

/* =========================================
   23. CREATIVE TABLE DIRECTORY (SEARCH VIEW)
   ========================================= */
.creative-table-wrapper {
    background: #fff;
    border-radius: 16px;
    border: 1px solid #f1f5f9;
    overflow: hidden;
    margin-top: 20px;
}

.ct-header {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 100px;
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
    font-weight: 800;
    color: #475569;
    font-size: 13px;
    padding: 15px 20px;
}

.ct-row {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 100px;
    padding: 12px 20px;
    align-items: center;
    border-bottom: 1px solid #f1f5f9;
    transition: 0.2s;
    cursor: pointer;
}

.ct-row:last-child {
    border-bottom: none;
}

.ct-row:hover {
    background: #f0f9ff;
}

.ct-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.ct-avatar {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #e0f2fe, #bae6fd);
    color: #0284c7;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.ct-text {
    display: flex;
    flex-direction: column;
}

.ct-name {
    font-weight: 800;
    color: #1e293b;
    font-size: 15px;
}

.ct-id {
    font-size: 12px;
    color: #94a3b8;
}

.ct-phone {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    /* For better numbers */
    color: #334155;
    font-weight: 600;
    font-size: 14px;
}

.ct-meta {
    font-size: 13px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ct-divider {
    color: #cbd5e1;
}

.ct-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* Text Buttons for Creative Table */
.ct-btn-text {
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 8px;
    transition: all 0.2s;
}

.ct-btn-text:hover {
    background: #e2e8f0;
    color: #3b82f6;
}

.ct-btn-text.edit {
    color: #d97706;
    background: rgba(245, 158, 11, 0.1);
}

.ct-btn-text.edit:hover {
    background: #f59e0b;
    color: #fff;
}

/* Dark Mode Adjustments */
body.dark-mode .ct-btn-text {
    color: #94a3b8;
}

body.dark-mode .ct-btn-text:hover {
    background: #334155;
    color: #60a5fa;
}

body.dark-mode .ct-btn-text.edit {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

body.dark-mode .ct-btn-text.edit:hover {
    background: #f59e0b;
    color: #000;
}

/* Mobile Table Styles */
@media (max-width: 600px) {
    .ct-header {
        display: none;
    }

    .ct-row {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 15px;
        border-bottom: 4px solid #f8f9fa;
    }

    .ct-info {
        margin-bottom: 5px;
    }

    .ct-actions {
        justify-content: flex-start;
        margin-top: 5px;
    }
}

/* Dark Mode Table */
body.dark-mode .creative-table-wrapper {
    background: #1e293b;
    border-color: #334155;
}

body.dark-mode .ct-header {
    background: #0f172a;
    border-color: #334155;
    color: #94a3b8;
}

body.dark-mode .ct-row {
    border-color: #334155;
}

body.dark-mode .ct-row:hover {
    background: #334155;
}

body.dark-mode .ct-name {
    color: #f8fafc;
}

body.dark-mode .ct-phone {
    color: #cbd5e1;
}

body.dark-mode .ct-avatar {
    background: #0f172a;
    color: #38bdf8;
}

body.dark-mode .ct-btn {
    background: #334155;
    color: #94a3b8;
}

body.dark-mode .ct-btn:hover {
    color: #fff;
}

/* Personal Photo Edit Frame */
.personal-photo-frame {
    width: 140px;
    height: 140px;
    background: #f8fafc;
    border-radius: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border: 3px dashed #cbd5e1;
    margin: 0 auto;
    transition: 0.3s;
    overflow: visible;
}

.personal-photo-frame img {
    width: 125px;
    height: 125px;
    border-radius: 22px;
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.personal-photo-frame .edit-overlay {
    position: absolute;
    bottom: -5px;
    right: -5px;
    background: #3b82f6;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.4);
    transition: 0.2s;
    z-index: 5;
}

.personal-photo-frame .edit-overlay:hover {
    transform: scale(1.1);
    background: #2563eb;
}

body.dark-mode .personal-photo-frame {
    background: #1e293b;
    border-color: #475569;
}

/* =========================================
   MODERN FOOTER ACTION BAR & BUTTONS
   ========================================= */
.action-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 15px 20px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    z-index: 1000;
    flex-wrap: wrap;
    border-top: 1px solid #f1f5f9;
}

/* Base Modern Button */
.btn-modern {
    padding: 12px 30px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 15px;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    letter-spacing: 0.5px;
}

.btn-modern:hover {
    transform: translateY(-3px);
}

.btn-modern i {
    font-size: 18px;
}

/* Print Button (Vibrant Blue Gradient) */
.btn-modern-print {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.btn-modern-print:hover {
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.5);
    color: white;
}

/* Save Button */
.btn-modern-save {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.btn-modern-save:hover {
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.5);
    color: white;
}

/* Save & Print */
.btn-modern-save-print {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.btn-modern-save-print:hover {
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5);
    color: white;
}

/* Secondary Button (Settings/Theme) */
.btn-modern-secondary {
    background: #fff;
    color: #64748b;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    padding: 12px;
    border-radius: 15px;
    width: 45px;
    height: 45px;
    justify-content: center;
}

.btn-modern-secondary:hover {
    background: #f8fafc;
    color: #334155;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

/* Disabled State */
.btn-modern:disabled,
.btn-modern.disabled {
    background: #e2e8f0;
    background-image: none;
    color: #94a3b8;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
    border: 1px solid #cbd5e1;
}

/* Dark Mode Support */
body.dark-mode .action-bar {
    background: rgba(30, 41, 59, 0.9);
    border-top-color: #334155;
}

body.dark-mode .btn-modern-secondary {
    background: #1e293b;
    color: #94a3b8;
    border-color: #475569;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

body.dark-mode .btn-modern-secondary:hover {
    background: #334155;
    color: #fff;
}

body.dark-mode .btn-modern:disabled {
    background: #334155;
    color: #64748b;
    border-color: #475569;
}