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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

/* Login */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.login-card h1 {
    text-align: center;
    font-size: 28px;
    margin-bottom: 8px;
    color: #333;
}

.login-card h2 {
    text-align: center;
    font-size: 16px;
    color: #666;
    margin-bottom: 30px;
    font-weight: 400;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #555;
}

.form-group input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e1e5ea;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: #5a6fd6;
}

.error-msg {
    color: #e74c3c;
    font-size: 14px;
    margin-bottom: 15px;
    padding: 10px;
    background: #fdf0ef;
    border-radius: 6px;
}

/* Layout */
.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: #2c3e50;
    color: white;
    padding: 0;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    top: 0;
    left: 0;
    z-index: 100;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h2 {
    font-size: 20px;
    margin-bottom: 6px;
}

.unread-badge {
    font-size: 12px;
    color: #ffd700;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: underline dashed 1px;
}

.unread-badge:hover {
    color: #ffffff;
    opacity: 0.9;
}

.sidebar-nav {
    list-style: none;
    padding: 10px 0;
    flex: 1;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.12);
}

.logout-link {
    display: block;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.logout-link:hover {
    color: #f87171 !important;
    transform: translateX(3px);
}

.sidebar-nav li a {
    display: block;
    padding: 10px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
}

.sidebar-nav li a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.sidebar-nav li a.active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border-left: 3px solid #667eea;
}

.nav-section {
    padding: 16px 20px 6px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.4);
}

.main-content {
    flex: 1;
    padding: 30px 40px;
    overflow-y: auto;
    margin-left: 260px;
}

/* Page header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
}

@media (max-width: 600px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

.page-header h1 {
    font-size: 24px;
    font-weight: 600;
}

.total-count {
    font-size: 14px;
    color: #888;
}

/* Table */
.notif-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.notif-table th {
    background: #f8f9fa;
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    font-weight: 600;
    border-bottom: 2px solid #eee;
}

.notif-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.notif-table tr:hover {
    background: #f8f9ff;
}

.notif-table tr.unread {
    background: #f0f4ff;
}

.notif-table tr.unread td:first-child {
    border-left: 3px solid #667eea;
}

.msg-cell {
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.doctor-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.doctor-link:hover {
    text-decoration: underline;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.badge-read {
    background: #e8f5e9;
    color: #2e7d32;
    display: none !important;
}

.badge-unread {
    background: #fff3e0;
    color: #e65100;
    display: none !important;
}

.btn-small {
    padding: 6px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    color: #555;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
}

.btn-small:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: scale(1.03) translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
}

.btn-small:active {
    transform: scale(0.97) translateY(0);
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 24px;
    padding: 16px;
}

.page-link {
    padding: 8px 20px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    color: #555;
    text-decoration: none;
    font-size: 14px;
}

.page-link:hover {
    background: #f0f0f0;
}

.page-info {
    color: #888;
    font-size: 14px;
}

/* Calendar */
.calendar-nav {
    display: flex;
    align-items: center;
    gap: 16px;
}

.calendar-nav h2 {
    min-width: 200px;
    text-align: center;
}

.calendar-grid {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    margin-bottom: 24px;
}

.calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #f8f9fa;
    border-bottom: 2px solid #eee;
}

.calendar-header span {
    padding: 12px;
    text-align: center;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    font-weight: 600;
}

.calendar-week {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border-bottom: 1px solid #f0f0f0;
}

.calendar-day {
    min-height: 80px;
    padding: 8px;
    border-right: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
}

.calendar-day:hover {
    background: #f0f4ff;
}

.calendar-day.empty {
    cursor: default;
}

.calendar-day.today {
    background: #e8f5e9;
    font-weight: 600;
}

.calendar-day .day-num {
    font-size: 14px;
    display: block;
    margin-bottom: 4px;
}

.calendar-day .day-count {
    display: inline-block;
    background: #667eea;
    color: white;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

/* Day notifications panel */
.day-notifications {
    background: white;
    border-radius: 10px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* Toast notifications */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 400px;
}

.toast {
    background: #2c3e50;
    color: white;
    padding: 14px 18px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideIn 0.3s ease;
    font-size: 14px;
}

.toast small {
    display: block;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 4px;
}

.toast button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
    float: right;
}

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

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

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 200px;
    }

    .main-content {
        padding: 20px;
    }

    .notif-table {
        font-size: 13px;
    }

    .msg-cell {
        max-width: 150px;
    }
}

/* ==========================================================================
   Premium Cards Layout & Form Styling
   ========================================================================== */

/* Form Container */
.form-card-container {
    margin-bottom: 40px;
    animation: fadeIn 0.5s ease-out;
}

.create-notif-card {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.card-title-bar {
    margin-bottom: 24px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 16px;
}

.card-title-bar h2 {
    font-size: 20px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 4px;
}

.card-title-bar p {
    font-size: 13px;
    color: #7f8c8d;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

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

/* Custom styled dropdown select */
.select-wrapper {
    position: relative;
    width: 100%;
}

.select-wrapper select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 15px;
    background: #fff;
    appearance: none;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.select-wrapper select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.select-wrapper::after {
    content: '▼';
    font-size: 10px;
    color: #7f8c8d;
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.form-group input[type="text"],
.form-group input[type="number"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

/* Success & Error alerts */
.success-alert {
    background-color: #f0fdf4;
    border-left: 4px solid #16a34a;
    color: #15803d;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 20px;
    animation: slideInUp 0.3s ease;
}

.error-alert {
    background-color: #fef2f2;
    border-left: 4px solid #dc2626;
    color: #b91c1c;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 20px;
    animation: slideInUp 0.3s ease;
}

/* Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 30px;
}

/* 3 columns on large desktop screens */
@media (min-width: 1200px) {
    .cards-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 1 column on mobile screens */
@media (max-width: 768px) {
    .cards-grid {
        grid-template-columns: 1fr;
    }
}

/* Elegant Notification Card */
.notif-card {
    background: white;
    border-radius: 14px;
    padding: 24px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    border: 1px solid #f1f3f5;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s ease;
    animation: cardEntrance 0.4s ease-out;
}

.notif-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.07);
}

/* Unread status styling */
.notif-card.unread {
    border-left: 4px solid #f97316;
    background: #fffdfb;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.doctor-badge {
    background: #f0f4ff;
    color: #4f46e5;
    font-weight: 600;
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(79, 70, 229, 0.1);
}

.card-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.card-time {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 500;
}

.card-header .header-time {
    display: none !important;
}

.card-body {
    flex-grow: 1;
    margin-bottom: 18px;
}

.card-text {
    font-size: 14px;
    line-height: 1.6;
    color: #334155;
    word-break: break-word;
}

/* Short version design */
.card-short-version {
    margin-top: 12px;
    padding: 10px 12px;
    background: #f8fafc;
    border-radius: 8px;
    font-size: 12px;
    color: #475569;
    border-left: 3px solid #cbd5e1;
}

.card-footer {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    border-top: 1px solid #f1f5f9;
    padding-top: 14px;
    margin-top: auto;
    width: 100%;
    flex-wrap: wrap;
}

.card-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    flex-shrink: 0;
    flex-grow: 1;
}

.card-time {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}

.card-footer .btn-small {
    padding: 4px 10px !important;
    font-size: 11px !important;
}

/* Custom Success Small Button */
.btn-success {
    background: #10b981 !important;
    color: white !important;
    border: none !important;
    font-weight: 600 !important;
}

.btn-success:hover {
    background: #059669 !important;
}

/* Custom Danger Small Button */
.btn-danger {
    background: #fef2f2 !important;
    color: #ef4444 !important;
    border: 1px solid rgba(239, 68, 68, 0.2) !important;
    font-weight: 600 !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.btn-danger:hover {
    background: #ef4444 !important;
    color: white !important;
    border-color: #ef4444 !important;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15) !important;
    transform: scale(1.03) translateY(-1px) !important;
}

.btn-danger:active {
    transform: scale(0.97) translateY(0) !important;
}

/* Empty State */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 40px;
    background: white;
    border-radius: 12px;
    color: #64748b;
    border: 2px dashed #e2e8f0;
}

/* Keyframes animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideInUp {
    from {
        transform: translateY(15px);
        opacity: 0;
    }

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

@keyframes cardEntrance {
    from {
        transform: scale(0.96) translateY(10px);
        opacity: 0;
    }

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

/* ==========================================================================
   Overlay Modal Dialog Styles
   ========================================================================== */
.modal-overlay {
    display: none;
    /* hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-overlay.open {
    display: flex;
    animation: modalOverlayFade 0.3s ease;
}

.modal-card {
    background: white;
    border-radius: 16px;
    padding: 30px;
    width: 100%;
    max-width: 650px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transform: scale(0.95);
    opacity: 0;
}

/* Scrollbar styling for modal card */
.modal-card::-webkit-scrollbar {
    width: 6px;
}

.modal-card::-webkit-scrollbar-track {
    background: transparent;
}

.modal-card::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.modal-overlay.open .modal-card {
    transform: scale(1);
    opacity: 1;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

.modal-close {
    position: absolute;
    top: 18px;
    right: 20px;
    background: none;
    border: none;
    font-size: 28px;
    color: #94a3b8;
    cursor: pointer;
    transition: color 0.15s ease;
    line-height: 1;
}

.modal-close:hover {
    color: #334155;
}

/* Modal specific trigger button */
.btn-new-notif {
    padding: 10px 20px !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    font-weight: 600 !important;
    border: none !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.25) !important;
    transition: transform 0.2s, box-shadow 0.2s !important;
}

.btn-new-notif:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(102, 126, 234, 0.35) !important;
}

/* Keyframe Animations for Modal */
@keyframes modalOverlayFade {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Custom Note Action Button */
.btn-note {
    background: #4f46e5 !important;
    color: white !important;
    border: none !important;
    font-weight: 600 !important;
}

.btn-note:hover {
    background: #4338ca !important;
}

/* Custom Secondary Small Button (Mark Unread) */
.btn-secondary {
    background: #64748b !important;
    color: white !important;
    border: none !important;
    font-weight: 600 !important;
}

.btn-secondary:hover {
    background: #475569 !important;
}

/* Doctor Badge Clickable */
.doctor-badge-clickable {
    cursor: pointer;
    transition: all 0.2s ease;
}

.doctor-badge-clickable:hover {
    background: #e0e7ff;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.2);
}

/* Doctor Info Grid in Modal */
.doctor-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 20px;
}

@media (max-width: 500px) {
    .doctor-info-grid {
        grid-template-columns: 1fr;
    }
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 3px solid #667eea;
}

.info-label {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

.info-value {
    font-size: 14px;
    color: #1e293b;
    font-weight: 600;
    word-break: break-word;
}

.info-value a.clickable-link {
    color: #4f46e5;
    text-decoration: none;
    font-weight: 500;
}

.info-value a.clickable-link:hover {
    text-decoration: underline;
}

/* ==========================================================================
   Responsive Sliding Sidebar Drawer on Mobile
   ========================================================================== */
.mobile-header {
    display: none;
}

.mobile-close-sidebar {
    display: none;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(2px);
    z-index: 1001;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
    pointer-events: auto;
}

@media (max-width: 768px) {
    .layout {
        flex-direction: column;
    }

    .mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        background: white;
        padding: 12px 20px;
        border-bottom: 1px solid #f1f5f9;
        position: sticky;
        top: 0;
        z-index: 999;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
    }

    .mobile-menu-btn {
        background: none;
        border: none;
        font-size: 24px;
        color: #1e293b;
        cursor: pointer;
        padding: 4px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-logo {
        font-weight: 700;
        font-size: 18px;
        color: #1e293b;
    }

    .mobile-badge {
        font-size: 11px;
        font-weight: 600;
        background: #f1f5f9;
        color: #475569;
        padding: 4px 10px;
        border-radius: 12px;
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .mobile-badge:hover {
        background: #e2e8f0;
        color: #1e293b;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: -280px;
        /* hidden off-screen */
        width: 260px;
        height: 100vh;
        z-index: 1002;
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        box-shadow: 20px 0 30px rgba(0, 0, 0, 0.05);
    }

    .sidebar.open {
        transform: translateX(280px);
    }

    .mobile-close-sidebar {
        display: block;
        background: none;
        border: none;
        font-size: 24px;
        color: #94a3b8;
        cursor: pointer;
        margin-left: auto;
    }

    .main-content {
        padding: 20px;
        margin-left: 0 !important;
    }
}

/* ==========================================================================
   Filter Toolbar Styles
   ========================================================================== */
.filter-toolbar {
    display: flex;
    gap: 16px;
    background: white;
    padding: 16px 20px;
    border-radius: 14px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
    margin-bottom: 24px;
    align-items: center;
    flex-wrap: wrap;
    border: 1px solid #e2e8f0;
    animation: modalOverlayFade 0.3s ease;
}

.filter-group-item {
    flex: 1;
    min-width: 200px;
}

.filter-group-item.search-box {
    flex: 2;
}

.filter-group-item input,
.filter-group-item select {
    width: 100%;
    height: 44px;
    padding: 11px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    color: #1e293b;
    background-color: #f8fafc;
    box-sizing: border-box;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.01);
}

.filter-group-item input:focus,
.filter-group-item select:focus {
    outline: none;
    border-color: #4f46e5;
    background-color: white;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.toolbar-actions {
    display: flex;
    gap: 8px;
    flex: 1;
    justify-content: flex-end;
    min-width: fit-content;
    align-items: center;
}

.day-header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    gap: 16px;
}

@media (max-width: 768px) {
    .filter-toolbar {
        flex-direction: column;
        gap: 12px;
        padding: 14px;
    }

    .filter-group-item {
        width: 100%;
    }

    .toolbar-actions {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .toolbar-actions .btn-small {
        flex: 1;
        min-width: 90px;
        justify-content: center;
        text-align: center;
    }
    
    .day-header-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .calendar-grid {
        overflow: hidden;
    }
    
    .calendar-header, .calendar-week {
        min-width: auto;
    }

    .calendar-header span {
        padding: 8px 2px;
        font-size: 11px;
    }
    
    .calendar-day {
        min-height: 60px;
        padding: 4px 2px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        gap: 2px;
    }

    .calendar-day .day-num {
        font-size: 13px;
        margin-bottom: 2px;
    }

    .calendar-day .day-count {
        font-size: 9px;
        padding: 1px 4px;
        border-radius: 6px;
    }

    .calendar-nav {
        width: 100%;
        justify-content: space-between;
        gap: 8px;
    }
    
    .calendar-nav h2 {
        min-width: auto;
        font-size: 16px;
        flex: 1;
        text-align: center;
        margin: 0;
    }
    
    .calendar-nav .btn-small {
        font-size: 11px !important;
        padding: 6px 10px !important;
        white-space: nowrap;
    }
}

/* ==========================================================================
   Sidebar Searchable Dropdown Styles
   ========================================================================== */
.custom-dropdown {
    position: relative;
    width: 100%;
    margin-top: 6px;
    margin-bottom: 12px;
}

.dropdown-trigger {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 10px;
    padding: 11px 14px;
    font-size: 13.5px;
    color: #1e293b !important;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    text-align: left;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.dropdown-trigger:hover {
    background: #f8fafc !important;
    border-color: #94a3b8 !important;
}

.dropdown-trigger span {
    color: #1e293b !important;
}

.dropdown-trigger .chevron {
    font-size: 9px;
    color: #64748b !important;
    transition: transform 0.25s ease;
    margin-left: 6px;
}

.custom-dropdown.open .dropdown-trigger .chevron {
    transform: rotate(180deg);
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 100%;
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    z-index: 1010;
    padding: 8px;
    animation: dropdownFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.custom-dropdown.open .dropdown-menu {
    display: block;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

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

.dropdown-menu .search-wrapper {
    padding: 2px;
    margin-bottom: 6px;
    border-bottom: 1px solid #e2e8f0;
}

.dropdown-menu .search-wrapper input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px;
    font-size: 13px;
    background: #f8fafc !important;
    color: #1e293b !important;
    transition: all 0.15s ease;
}

.dropdown-menu .search-wrapper input::placeholder {
    color: #94a3b8 !important;
}

.dropdown-menu .search-wrapper input:focus {
    outline: none;
    border-color: #4f46e5 !important;
    background: #ffffff !important;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.15) !important;
}

.dropdown-options {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 180px;
    overflow-y: auto;
}

/* Scrollbar styling for options */
.dropdown-options::-webkit-scrollbar {
    width: 5px;
}

.dropdown-options::-webkit-scrollbar-track {
    background: transparent;
}

.dropdown-options::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.dropdown-option {
    display: block !important;
    padding: 9px 12px !important;
    color: #334155 !important;
    text-decoration: none !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    border-radius: 8px !important;
    transition: all 0.15s ease !important;
    background: transparent !important;
    border-left: none !important;
}

.dropdown-option:hover {
    background: #f1f5f9 !important;
    color: #0f172a !important;
    padding-left: 15px !important;
}

.dropdown-option.active {
    background: rgba(79, 70, 229, 0.08) !important;
    color: #4f46e5 !important;
    font-weight: 600 !important;
    border-left: none !important;
}

/* ==========================================================================
   Clickable Phone & Email Links
   ========================================================================== */
.clickable-link {
    color: #4f46e5 !important;
    text-decoration: none !important;
    font-weight: 600 !important;
    border-bottom: 1px dashed #cbd5e1;
    padding: 2px 6px;
    margin: 0 2px;
    border-radius: 6px;
    background: rgba(79, 70, 229, 0.04);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.01);
}

.clickable-link:hover {
    color: #4338ca !important;
    background: rgba(79, 70, 229, 0.1) !important;
    border-bottom-style: solid;
    border-bottom-color: #4f46e5;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.08);
}

/* ==========================================================================
   Copy Button & Working Hours Grid
   ========================================================================== */
.info-value-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
}

.btn-copy {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #475569;
    line-height: 1;
}

.btn-copy:hover {
    background: #e2e8f0;
    color: #0f172a;
    transform: scale(1.05);
}

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

.working-hours-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.working-hour-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 4px solid #10b981;
    font-size: 13.5px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    gap: 12px;
}

.working-hour-row.closed {
    border-left-color: #cbd5e1;
    background: #f1f5f9;
    color: #64748b;
}

.working-hour-day {
    font-weight: 600;
    color: #334155;
    white-space: nowrap; /* Prevent day name from wrapping */
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.working-hour-row.closed .working-hour-day {
    color: #64748b;
}

.working-hour-time {
    font-weight: 500;
    color: #0f172a;
    text-align: right;
    flex: 1;
    min-width: 150px; /* Allow wrapping only on extremely small screens */
}

.working-hour-row.closed .working-hour-time {
    color: #64748b;
}

/* ==========================================================================
   Layout Switcher & List View Layout
   ========================================================================== */
.view-toggle-container {
    display: flex;
    background: #e2e8f0;
    padding: 3px;
    border-radius: 10px;
    gap: 2px;
    margin-left: auto;
    height: 44px;
    box-sizing: border-box;
    align-items: stretch;
}

@media (max-width: 768px) {
    .view-toggle-container {
        display: none !important;
    }
}

.view-toggle-btn {
    border: none;
    background: transparent;
    padding: 0 14px;
    font-size: 14px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.view-toggle-btn:hover {
    color: #0f172a;
}

.view-toggle-btn.active {
    background: white;
    color: #4f46e5;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* List Layout Rules */
.cards-grid.layout-list {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
}

.cards-grid.layout-list .notif-card {
    display: grid !important;
    grid-template-columns: 150px 1fr minmax(240px, max-content) !important;
    align-items: center !important;
    padding: 16px 24px !important;
    gap: 20px !important;
    border-radius: 12px !important;
    min-height: auto !important;
    background: #ffffff !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.025) !important;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.25s ease !important;
}

.cards-grid.layout-list .notif-card:hover {
    transform: translateX(4px) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06) !important;
}

@media (max-width: 1200px) {
    .cards-grid.layout-list .notif-card {
        grid-template-columns: 140px 1fr minmax(220px, max-content) !important;
        gap: 16px !important;
        padding: 14px 20px !important;
    }
}

.cards-grid.layout-list .notif-card .card-header {
    margin-bottom: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: center !important;
    gap: 8px !important;
    width: 100% !important;
    flex-shrink: 0 !important;
}

.cards-grid.layout-list .notif-card .card-body {
    margin-bottom: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    justify-content: center !important;
    width: 100% !important;
}

.cards-grid.layout-list .notif-card .card-text {
    margin-bottom: 0 !important;
    font-size: 14.5px !important;
    color: #1e293b !important;
    line-height: 1.5 !important;
}

.cards-grid.layout-list .notif-card .card-short-version {
    margin-top: 6px !important;
    padding: 6px 14px !important;
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-left: 3px solid #4f46e5 !important;
    border-radius: 12px !important;
    font-size: 13px !important;
    color: #475569 !important;
    display: inline-flex;
    align-items: center !important;
    gap: 6px !important;
    width: fit-content !important;
}

.cards-grid.layout-list .notif-card .card-footer {
    border-top: none !important;
    padding-top: 0 !important;
    margin-top: 0 !important;
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-end !important;
    justify-content: center !important;
    gap: 12px !important;
    flex-shrink: 0 !important;
}

.cards-grid.layout-list .notif-card .card-actions {
    display: flex !important;
    flex-direction: row !important;
    gap: 10px !important;
    margin-left: auto !important;
    flex-grow: 0 !important;
}

.cards-grid.layout-list .notif-card .card-actions .btn-small {
    padding: 8px 18px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
}

.cards-grid.layout-list .notif-card .card-footer .card-time {
    display: none !important;
}

.cards-grid.layout-list .notif-card .card-header .header-time {
    display: inline-flex !important;
    font-size: 11.5px !important;
    color: #64748b !important;
    margin-top: 4px !important;
    font-weight: 500 !important;
    align-items: center !important;
    gap: 4px !important;
}

@media (max-width: 992px) {
    .cards-grid.layout-list .notif-card {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        padding: 16px !important;
    }
    
    .cards-grid.layout-list .notif-card .card-header {
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        margin-bottom: 12px !important;
    }
    
    .cards-grid.layout-list .notif-card .card-body {
        margin-bottom: 12px !important;
    }
    
    .cards-grid.layout-list .notif-card .card-footer {
        border-top: 1px solid #f1f5f9 !important;
        padding-top: 12px !important;
        margin-top: 12px !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        gap: 8px !important;
        flex-wrap: wrap !important;
    }

    .cards-grid.layout-list .notif-card .card-actions {
        margin-left: 0 !important;
        flex-grow: 1 !important;
    }

    .cards-grid.layout-list .notif-card .card-time {
        margin-left: 0 !important;
    }
}

/* ==========================================================================
   Input Icons & Password Toggles
   ========================================================================== */
.input-icon-wrapper {
    position: relative;
    width: 100%;
}

.input-icon-wrapper i.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
    font-size: 15px;
}

.input-icon-wrapper input {
    padding-left: 42px !important;
}

.password-toggle-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    cursor: pointer;
    font-size: 15px;
    transition: color 0.2s;
    z-index: 10;
}

.password-toggle-icon:hover {
    color: #4f46e5;
}

.input-icon-wrapper input[type="password"],
.input-icon-wrapper input[type="text"] {
    padding-right: 42px !important;
}

/* Refresh Button */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    background: white !important;
    color: #4f46e5 !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 8px !important;
    cursor: pointer;
    transition: all 0.2s ease !important;
}

.btn-refresh:hover {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
    color: #4338ca !important;
}

.btn-refresh i {
    transition: transform 0.4s ease;
}

.btn-refresh.spinning i {
    animation: btnSpin 0.8s linear infinite;
}

@keyframes btnSpin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================================================
   Print Styles (Doctor Profile Export)
   ========================================================================== */
@media print {
    /* Hide everything else ONLY when printing the modal */
    body.printing-modal * {
        visibility: hidden;
    }
    
    body.printing-modal #doctorModal, 
    body.printing-modal #doctorModal * {
        visibility: visible;
    }
    
    body.printing-modal #doctorModal {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: auto;
        background: transparent !important;
        box-shadow: none !important;
        display: block !important;
        align-items: flex-start !important;
        padding: 0 !important;
    }
    
    body.printing-modal .modal-card {
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        transform: none !important;
        margin: 0 !important;
    }

    /* General Print Styles (Dashboard & Calendar) */
    .hide-on-print, .modal-close, .btn-copy, .sidebar, .mobile-header, .view-toggle-container, .pagination {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }
    
    .filter-toolbar {
        border: none !important;
        background: transparent !important;
        padding: 0 !important;
        margin-bottom: 20px !important;
    }
    
    .doctor-info-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }

    .working-hours-grid {
        display: block !important;
    }
    .working-hour-row {
        border: 1px solid #e2e8f0 !important;
        break-inside: avoid;
    }
}

/* Helper to hide cards cleanly without layout gaps */
.notif-card.hidden-card,
.cards-grid .notif-card.hidden-card,
.cards-grid.layout-list .notif-card.hidden-card {
    display: none !important;
}