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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

/* Responsive Images */
img {
    max-width: 100%;
    height: auto;
}

.container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 40px);
}

.login-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 100%;
    text-align: center;
}

.header h1 {
    color: #333;
    margin-bottom: 10px;
    font-size: 2em;
}

.header p {
    color: #666;
    margin-bottom: 30px;
}

.status-message {
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: none;
}

.status-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.qr-container {
    margin: 30px 0;
}

.qr-container h3 {
    color: #333;
    margin-bottom: 20px;
}

.qr-code {
    background: white;
    padding: 20px;
    border-radius: 10px;
    display: inline-block;
    margin: 20px 0;
}

.qr-code img {
    max-width: 300px;
    width: 100%;
    height: auto;
}

.qr-instructions {
    color: #666;
    font-size: 0.9em;
    line-height: 1.6;
    margin-top: 20px;
}

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

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 0;
    border: none;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #e0e0e0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px 12px 0 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5em;
    color: white;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    font-weight: bold;
    color: white;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.modal-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 25px;
}

.modal-body label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.modal-body input[type="text"],
.modal-body input[type="email"],
.modal-body input[type="password"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

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

.modal-body small {
    color: #666;
    font-size: 0.85em;
}

/* Session Card Styles */
.session-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    background: white;
    transition: box-shadow 0.2s;
}

.session-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.status-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

.status-badge.success {
    background: #d4edda;
    color: #155724;
}

.status-badge.info {
    background: #d1ecf1;
    color: #0c5460;
}

.status-badge.error {
    background: #f8d7da;
    color: #721c24;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

/* QR Code Loading Animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.qr-loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

/* QR Code Container */
#qr-code-container {
    transition: opacity 0.3s ease-in;
}

#qr-code-container.show {
    opacity: 1;
}

.connected-message {
    padding: 30px;
}

.success-icon {
    font-size: 4em;
    margin-bottom: 20px;
}

.connected-message h2 {
    color: #28a745;
    margin-bottom: 10px;
}

.connected-message p {
    color: #666;
}

.dashboard-links {
    margin-top: 30px;
    display: flex;
    gap: 15px;
    justify-content: center;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-2px);
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
    transform: translateY(-2px);
}

.appointment-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.appointment-actions .btn {
    flex: 0 0 auto;
    min-width: 120px;
    text-align: center;
    white-space: nowrap;
}

.plan-info {
    padding: 0;
}

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

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

.settings-info {
    padding: 10px 0;
}

.setting-item {
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-item strong {
    color: #333;
    display: inline-block;
    min-width: 150px;
    margin-right: 10px;
}

.btn-danger:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9em;
}

/* Admin Dashboard */
.admin-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.dashboard-link {
    transition: all 0.2s ease;
}

.dashboard-link.active {
    color: #333 !important;
    background: #f0f0f0 !important;
    font-weight: 600 !important;
}

.dashboard-link:not(.active) {
    color: #666 !important;
    background: transparent !important;
}

.dashboard-link:not(.active):hover {
    color: #333 !important;
    background: #f5f5f5 !important;
}

.admin-header {
    background: white;
    padding: 20px 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: relative;
}

.header-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 15px;
}

.admin-header h1 {
    color: #333;
    margin: 0;
    flex: 1;
}

/* Hamburger Menu Button */
.admin-nav-toggle {
    display: none;
    flex-direction: column;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    gap: 5px;
    z-index: 1001;
    position: relative;
}

.hamburger-line {
    width: 25px;
    height: 3px;
    background: #333;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.admin-nav-toggle[aria-expanded="true"] .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.admin-nav-toggle[aria-expanded="true"] .hamburger-line:nth-child(2) {
    opacity: 0;
}

.admin-nav-toggle[aria-expanded="true"] .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Admin Nav Menu */
.admin-nav-menu {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: nowrap;
}

.nav-menu-section {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: nowrap;
}

.nav-menu-links {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.dashboard-link {
    color: #666;
    text-decoration: none;
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.2s ease;
    line-height: 1.3;
    text-align: center;
    display: inline-block;
}

.dashboard-link.active {
    color: #333;
    background: #f0f0f0;
    font-weight: 600;
}

.dashboard-link:not(.active):hover {
    color: #333;
    background: #f5f5f5;
}

.nav-plan-link {
    padding: 8px 15px;
    background: #f0f0f0;
    border-radius: 6px;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.nav-user-name {
    margin-right: 15px;
    color: #666;
}

.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Nav Overlay */
.admin-nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    font-size: 3em;
}

.stat-info h3 {
    font-size: 2em;
    color: #667eea;
    margin-bottom: 5px;
}

.stat-info p {
    color: #666;
    font-size: 0.9em;
}

.content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.card-header {
    padding: 20px 30px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-controls select,
.filter-controls input[type="date"] {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 0.9em;
}

.card-header h2 {
    color: #333;
    font-size: 1.5em;
}

.card-body {
    padding: 30px;
    max-height: 600px;
    overflow-y: auto;
    overflow-x: auto;
}

.appointments-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.admin-appointments-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    padding: 5px;
}

.admin-appointments-list.list-view {
    display: flex;
    flex-direction: column;
    gap: 15px;
    grid-template-columns: 1fr;
    overflow: visible;
}

.admin-appointments-list.grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.view-tabs {
    display: flex;
    gap: 10px;
    border-bottom: 2px solid #eee;
    margin-bottom: 20px;
}

/* Hide view tabs on mobile - only show grid view */
@media (max-width: 768px) {
    .view-tabs {
        display: none !important;
    }
    
    /* Force grid view on mobile */
    .admin-appointments-list.list-view {
        display: grid !important;
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
        gap: 15px !important;
    }
}

.view-tab {
    padding: 10px 20px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 0.95em;
    color: #666;
    transition: all 0.3s;
    font-weight: 500;
}

.view-tab:hover {
    color: #667eea;
    background: #f5f5f5;
}

.view-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
    font-weight: 600;
}

.appointment-grid-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.appointment-grid-row {
    margin-bottom: 8px;
    font-size: 0.9em;
    line-height: 1.6;
}

/* Compact List View Styles */
.appointment-list-row {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: visible;
    transition: all 0.3s;
}

.appointment-list-row:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.appointment-row-main {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    padding: 12px 20px;
    background: white;
    cursor: pointer;
    gap: 15px;
    transition: background 0.2s;
    overflow: visible;
    min-width: 0;
}

.appointment-row-main:hover {
    background: #f8f9fa;
}

.appointment-row-content {
    display: grid;
    grid-template-columns: 100px 115px 85px minmax(100px, 1fr) 125px 105px;
    gap: 10px;
    align-items: center;
    min-width: 0; /* Prevent grid from overflowing */
    width: 100%;
    overflow: visible;
}

.appointment-id-compact {
    font-weight: 600;
    color: #667eea;
    font-size: 0.9em;
}

.appointment-date-compact {
    color: #333;
    font-size: 0.9em;
    white-space: nowrap;
}

.appointment-time-compact {
    color: #333;
    font-size: 0.9em;
    white-space: nowrap;
}

.appointment-name-compact {
    color: #333;
    font-size: 0.9em;
    font-weight: 500;
    overflow: visible;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 120px;
    display: inline-block;
}

.appointment-phone-compact {
    color: #666;
    font-size: 0.9em;
    white-space: nowrap;
}

.expand-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px 10px;
    color: #667eea;
    font-size: 0.9em;
    transition: transform 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.expand-btn:hover {
    background: #f0f0f0;
    border-radius: 4px;
}

.expand-icon {
    transition: transform 0.3s;
    display: inline-block;
}

.appointment-row-expanded {
    border-top: 1px solid #e0e0e0;
    background: #fafafa;
    padding: 15px 20px;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 500px;
    }
}

.appointment-details-expanded {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 12px;
    margin-bottom: 15px;
    padding: 15px;
    background: white;
    border-radius: 6px;
}

.detail-row {
    color: #666;
    font-size: 0.9em;
    line-height: 1.6;
}

.detail-row strong {
    color: #333;
    margin-right: 8px;
}

.doctors-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.appointment-item {
    padding: 20px;
    border: 1px solid #eee;
    border-radius: 10px;
    transition: all 0.3s;
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.appointment-item:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.doctor-item {
    padding: 20px;
    border: 1px solid #eee;
    border-radius: 10px;
    transition: all 0.3s;
}

.doctor-item:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transform: translateX(5px);
}

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

.appointment-id {
    font-weight: bold;
    color: #667eea;
}

.status-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: bold;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: fit-content;
    display: inline-block;
    text-align: center;
    overflow: visible;
}

.status-scheduled {
    background: #fff3cd;
    color: #856404;
}

.status-rescheduled {
    background: #ffeaa7;
    color: #d63031;
    font-weight: bold;
}

.status-completed {
    background: #d4edda;
    color: #155724;
}

.status-cancelled {
    background: #f8d7da;
    color: #721c24;
}

.appointment-details {
    color: #666;
    font-size: 0.9em;
    line-height: 1.8;
}

.doctor-item {
    cursor: pointer;
}

.doctor-name {
    font-weight: bold;
    color: #333;
    font-size: 1.1em;
    margin-bottom: 5px;
}

.doctor-specialization {
    color: #667eea;
    margin-bottom: 10px;
}

.doctor-info {
    color: #666;
    font-size: 0.9em;
    line-height: 1.6;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #999;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 15px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    position: relative;
    /* Use overflow-y: auto for scrolling, but allow dropdowns to overflow */
    overflow-y: auto;
    overflow-x: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.modal-header h2 {
    color: #333;
}

.close-btn {
    background: none;
    border: none;
    font-size: 2em;
    cursor: pointer;
    color: #999;
    line-height: 1;
}

.close-btn:hover {
    color: #333;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    font-family: inherit;
}

.form-group select {
    position: relative;
    z-index: 1;
    background-color: white;
}

/* Ensure select dropdowns don't get clipped */
.modal-content form {
    position: relative;
    z-index: 1;
}

/* Ensure select dropdowns appear above modal content when focused */
select:focus {
    z-index: 1001;
    position: relative;
}

/* Fix for select dropdowns in modals - ensure they render above modal */
.modal {
    overflow: visible !important;
}

/* Ensure modal content allows dropdowns to overflow */
.modal-content {
    overflow: visible !important;
}

    /* But allow scrolling for the form content */
.modal-content form {
    max-height: calc(90vh - 120px);
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 5px;
    -webkit-overflow-scrolling: touch;
}

/* Mobile: Adjust form max-height */
@media (max-width: 768px) {
    .modal-content form {
        max-height: calc(85vh - 100px);
    }
}

/* When select is open, ensure dropdown is visible */
select option {
    position: relative;
}

.form-group textarea {
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.checkbox-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
    cursor: pointer;
}

.modal-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.doctor-selector {
    background: white;
    padding: 20px 30px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.doctor-selector label {
    margin-right: 15px;
    font-weight: 500;
    color: #333;
}

.doctor-selector select {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    min-width: 250px;
}

.availability-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.info-item {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.info-item strong {
    display: block;
    margin-bottom: 5px;
    color: #333;
}

.info-item span {
    color: #666;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .admin-container {
        padding: 10px;
    }
    
    /* Ensure touch-friendly button sizes */
    .btn {
        min-height: 44px; /* iOS recommended touch target */
        padding: 10px 16px;
    }
    
    .btn-small {
        min-height: 36px;
        padding: 8px 14px;
    }
    
    /* All Headers - Mobile Responsive */
    h1 {
        font-size: 1.5rem !important;
        word-wrap: break-word;
        line-height: 1.3;
    }
    
    h2 {
        font-size: 1.3rem !important;
        word-wrap: break-word;
        line-height: 1.3;
    }
    
    h3 {
        font-size: 1.1rem !important;
        word-wrap: break-word;
    }
    
    /* Admin Header Mobile */
    .admin-header {
        padding: 15px 20px;
        position: relative;
        flex-direction: row;
        align-items: center;
    }
    
    .header-main {
        width: 100%;
        justify-content: space-between;
    }
    
    .admin-header h1 {
        font-size: 1.2rem !important;
        margin: 0;
        flex: 1;
        word-break: break-word;
        line-height: 1.3;
    }
    
    /* Show hamburger button on mobile */
    .admin-nav-toggle {
        display: flex;
    }
    
    /* Hide nav menu on mobile by default */
    .admin-nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 320px;
        height: 100vh;
        background: white;
        flex-direction: column;
        align-items: flex-start;
        padding: 80px 25px 25px;
        gap: 0;
        box-shadow: -2px 0 10px rgba(0,0,0,0.1);
        transition: right 0.3s ease;
        z-index: 999;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .admin-nav-menu.active {
        right: 0;
    }
    
    .nav-menu-section {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding-bottom: 20px;
        border-bottom: 1px solid #eee;
        margin-bottom: 20px;
    }
    
    .nav-menu-section:last-child {
        border-bottom: none;
        margin-bottom: 0;
    }
    
    .nav-menu-links {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .dashboard-link {
        display: block;
        padding: 12px 15px;
        font-size: 1rem;
        border-radius: 8px;
        width: 100%;
        text-align: left;
    }
    
    .nav-plan-link {
        width: 100%;
        padding: 12px 15px;
        justify-content: flex-start;
        font-size: 0.95rem;
        margin-bottom: 8px;
    }
    
    .nav-user-name {
        width: 100%;
        margin-right: 0 !important;
        margin-bottom: 12px;
        padding: 12px 15px;
        background: #f8f9fa;
        border-radius: 8px;
        text-align: center;
        font-size: 0.95rem;
    }
    
    .nav-menu-btn {
        width: 100%;
        text-align: center;
        padding: 12px 15px;
        font-size: 0.95rem;
        min-height: 44px;
    }
    
    /* Show overlay on mobile when menu is open */
    .admin-nav-overlay {
        display: block;
    }
    
    /* Login/Register/Forgot/Reset Headers */
    .login-header,
    .register-header,
    .forgot-header,
    .reset-header {
        margin-bottom: 20px !important;
        padding: 0 10px;
    }
    
    .login-header h1,
    .register-header h1,
    .forgot-header h1,
    .reset-header h1 {
        font-size: 1.4rem !important;
        margin-bottom: 8px !important;
    }
    
    .login-header p,
    .register-header p,
    .forgot-header p,
    .reset-header p {
        font-size: 0.9rem !important;
        line-height: 1.5;
    }
    
    /* Verify Email Header */
    .verify-card h1 {
        font-size: 1.4rem !important;
        margin-bottom: 15px !important;
    }
    
    .verify-icon {
        font-size: 48px !important;
        margin-bottom: 15px !important;
    }
    
    /* Login/Register Cards */
    .login-card,
    .register-card,
    .forgot-card,
    .reset-card,
    .verify-card {
        padding: 25px 20px !important;
        margin: 10px;
        border-radius: 15px;
    }
    
    .login-container,
    .register-container,
    .forgot-container,
    .reset-container,
    .verify-container {
        padding: 10px !important;
    }
    
    
    /* Stats Grid */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        margin-bottom: 20px;
    }
    
    .stat-card {
        padding: 20px;
        flex-direction: row;
        gap: 15px;
    }
    
    .stat-icon {
        font-size: 2.5em;
    }
    
    .stat-info h3 {
        font-size: 1.8em;
    }
    
    /* Content Grid */
    .content-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    /* Cards */
    .card {
        border-radius: 12px;
    }
    
    .card-header {
        padding: 15px 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .card-header h2 {
        font-size: 1.2rem !important;
        width: 100%;
        margin: 0;
    }
    
    /* Modal Headers */
    .modal-header h2 {
        font-size: 1.2rem !important;
    }
    
    /* Section Headers */
    .section-title {
        font-size: 1.8rem !important;
    }
    
    .section-subtitle {
        font-size: 1rem !important;
    }
    
    .card-body {
        padding: 20px;
        max-height: none;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Appointments List */
    .admin-appointments-list {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .appointment-item {
        padding: 15px;
    }
    
    .appointment-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .appointment-header h3,
    .appointment-header h4 {
        font-size: 1rem !important;
        margin: 0;
    }
    
    /* Compact List View Mobile */
    .appointment-row-main {
        grid-template-columns: 1fr;
        padding: 12px 15px;
    }
    
    .appointment-row-content {
        grid-template-columns: 1fr;
        gap: 8px;
        width: 100%;
    }
    
    .appointment-id-compact,
    .appointment-date-compact,
    .appointment-time-compact,
    .appointment-name-compact,
    .appointment-phone-compact {
        width: 100%;
        padding: 4px 0;
    }
    
    .appointment-details-expanded {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 12px;
    }
    
    .expand-btn {
        margin-top: 10px;
        align-self: flex-start;
    }
    
    /* Doctor Item Headers */
    .doctor-name {
        font-size: 1rem !important;
    }
    
    .doctor-specialization {
        font-size: 0.9rem !important;
    }
    
    .appointment-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .appointment-actions .btn {
        width: 100%;
        min-width: auto;
    }
    
    /* Doctor Selector */
    .doctor-selector {
        padding: 15px 20px;
        margin-bottom: 15px;
    }
    
    .doctor-selector label {
        display: block;
        margin-bottom: 8px;
        margin-right: 0;
    }
    
    .doctor-selector select {
        width: 100%;
        min-width: auto;
    }
    
    /* Forms */
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .checkbox-group {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    /* Modal Mobile */
    .modal {
        padding: 10px;
        align-items: flex-start;
        padding-top: 20px;
    }
    
    .modal-content {
        width: 95%;
        max-width: 95%;
        padding: 20px;
        margin: 0 auto;
        max-height: 90vh;
        border-radius: 12px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .modal-header {
        padding-bottom: 12px;
        margin-bottom: 20px;
    }
    
    .modal-header h2 {
        font-size: 1.3rem;
    }
    
    .close-btn {
        font-size: 1.8em;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
    
    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 10px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .modal-actions {
        flex-direction: column;
        gap: 10px;
        margin-top: 20px;
        padding-top: 15px;
    }
    
    .modal-actions .btn {
        width: 100%;
    }
    
    /* Login Card */
    .login-card {
        padding: 25px 20px;
        margin: 10px;
        border-radius: 15px;
    }
    
    .header h1 {
        font-size: 1.5rem;
    }
    
    .qr-code {
        padding: 15px;
    }
    
    .qr-code img {
        max-width: 250px;
    }
    
    .qr-instructions {
        font-size: 0.85em;
        padding: 0 10px;
    }
    
    .dashboard-links {
        flex-direction: column;
        gap: 10px;
    }
    
    .dashboard-links .btn {
        width: 100%;
    }
    
    /* Availability Info */
    .availability-info {
        gap: 15px;
    }
    
    .info-item {
        padding: 12px;
    }
    
    /* Leaves List */
    .leaves-list {
        gap: 12px;
    }
    
    /* Filter Controls */
    .filter-controls {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-controls select,
    .filter-controls input[type="date"] {
        width: 100%;
        margin-bottom: 8px;
    }
    
    /* Setting Item */
    .setting-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .setting-item strong {
        min-width: auto;
        margin-right: 0;
    }
    
    /* Plan Page */
    .plan-info {
        padding: 15px;
    }
    
    .plan-card {
        margin-bottom: 15px;
    }
}

/* Extra Small Devices */
@media (max-width: 480px) {
    /* Headers - Extra Small */
    h1 {
        font-size: 1.3rem !important;
    }
    
    h2 {
        font-size: 1.1rem !important;
    }
    
    h3 {
        font-size: 1rem !important;
    }
    
    .admin-header h1 {
        font-size: 1rem !important;
    }
    
    .login-header h1,
    .register-header h1,
    .forgot-header h1,
    .reset-header h1,
    .verify-card h1 {
        font-size: 1.2rem !important;
    }
    
    .stat-icon {
        font-size: 2em;
    }
    
    .stat-info h3 {
        font-size: 1.5em;
    }
    
    .card-header h2 {
        font-size: 1.1rem !important;
    }
    
    .modal-header h2 {
        font-size: 1.1rem !important;
    }
    
    .modal-content {
        padding: 15px;
    }
    
    .login-card,
    .register-card,
    .forgot-card,
    .reset-card,
    .verify-card {
        padding: 20px 15px !important;
    }
    
    .header h1 {
        font-size: 1.2rem !important;
    }
    
    .qr-code img {
        max-width: 200px;
    }
    
    .verify-icon {
        font-size: 40px !important;
    }
    
    .section-title {
        font-size: 1.5rem !important;
    }
}
    
    /* Connected Message */
    .connected-message {
        padding: 20px;
    }
    
    .success-icon {
        font-size: 3em;
    }
    
    .connected-message h2 {
        font-size: 1.3rem;
    }
    
    #phone-number-display {
        font-size: 16px !important;
        padding: 12px !important;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    #connected-phone-number {
        margin-left: 0 !important;
        margin-top: 8px;
        display: block;
    }
    
    /* Button Groups */
    .dashboard-links {
        margin-top: 20px;
    }
    
    /* Status Messages */
    .status-message {
        padding: 12px;
        font-size: 0.9rem;
    }
}

