/* ========================================
   MEDINOW - STANDARDIZED STYLES
   ========================================
   Design System:
   - Primary Color: #14967F (Teal)
   - Secondary Color: #0D6B5F (Dark Teal)
   - Success: #28a745
   - Warning: #ffc107
   - Danger: #dc3545
   - Background: Linear gradient #f0f8f0 to #e8f5f2
   - Font: Segoe UI
   ======================================== */

/* ========================================
   1. RESET & BASE STYLES
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f0f8f0 0%, #e8f5f2 100%);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

body:not(.dashboard-page) {
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    width: 90%;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ========================================
   2. LAYOUT CONTAINERS
   ======================================== */
.auth-container, 
.admin-container {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 160px);
    justify-content: center;
    padding: 2rem 0;
}

.admin-container .container {
    padding: 0 2rem;
}

.auth-container h1 {
    text-align: center;
    color: #14967F;
    margin-bottom: 1.5rem;
    font-size: 2rem;
}

.auth-container .container,
.admin-container .container {
    margin-bottom: 2rem;
    flex: 1;
}

html {
    height: 100%;
}

body.dashboard-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body.dashboard-page header {
    flex-shrink: 0;
}

.dashboard-container {
    flex: 1 0 auto;
    padding: 2rem 0 0 0;
}

.dashboard-container .container {
    padding-bottom: 0;
}

body.client-dashboard .dashboard-container,
body.admin-dashboard .dashboard-container {
    padding-bottom: 2rem;
}

body.dashboard-page footer {
    flex-shrink: 0;
    margin-top: auto;
    position: relative;
    bottom: 0;
    left: 0;
    right: 0;
}

/* ========================================
   3. HEADER & NAVIGATION
   ======================================== */
header {
    background: linear-gradient(135deg, #14967F 0%, #0D6B5F 100%);
    color: white;
    padding: 0.75rem 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

header h1 {
    margin: 0;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

header h1 img {
    height: 40px;
    width: auto;
    border-radius: 4px;
}

header nav {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    flex-wrap: nowrap;
}

header nav a,
header nav button {
    color: white;
    text-decoration: none;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-weight: 500;
    font-size: 0.9rem;
    background: transparent;
    border: 0;
    cursor: pointer;
    font-family: inherit;
    display: inline-block;
    vertical-align: middle;
}

header nav a:hover, 
header nav a.active,
header nav button:hover,
header nav button.active {
    background-color: rgba(255, 255, 255, 0.2);
}

header nav a.btn-primary,
header nav .btn-primary,
nav a.btn-primary {
    background-color: white !important;
    background: white !important;
    color: #14967F !important;
    padding: 0.4rem 1rem !important;
    font-weight: 600 !important;
    border: none !important;
}

header nav a.btn-primary:hover,
header nav .btn-primary:hover,
nav a.btn-primary:hover {
    background-color: #f0f8f0 !important;
    background: #f0f8f0 !important;
    color: #0D6B5F !important;
    transform: none !important;
    box-shadow: none !important;
}

header nav .btn-logout {
    background: white !important;
    border: none !important;
    color: #14967F !important;
    padding: 0.4rem 0.8rem;
}

header nav .btn-logout:hover {
    background-color: #dc3545 !important;
    color: white !important;
    border: none !important;
}

/* Dropdown Categories no Menu */
header nav .nav-category {
    position: relative;
    display: inline-block;
}

header nav .nav-category-header {
    /* Herda TUDO do header nav button acima */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    outline: none;
}

header nav .nav-category.open .nav-category-header {
    background-color: rgba(255, 255, 255, 0.2);
}

header nav .nav-category-header .category-arrow {
    font-size: 0.65rem;
    margin-left: 0.3rem;
    transition: transform 0.3s ease;
    opacity: 0.8;
}

header nav .nav-category.open .category-arrow {
    transform: rotate(180deg);
}

header nav .nav-category-items {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    min-width: 200px !important;
    background: white !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    border-radius: 8px !important;
    margin-top: 0.5rem !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(-10px) !important;
    transition: all 0.3s ease !important;
    z-index: 1000 !important;
    overflow: hidden !important;
    display: block !important;
}

header nav .nav-category.open .nav-category-items {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
}

header nav .nav-category-items a {
    display: block;
    color: #333;
    padding: 0.75rem 1rem;
    border-radius: 0;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

header nav .nav-category-items a:hover {
    background-color: #f8f9fa;
    border-left-color: #14967F;
    padding-left: 1.2rem;
}

header nav .nav-category-items a.active {
    background-color: #e8f5f1;
    border-left-color: #14967F;
    color: #14967F;
}

header nav .nav-category-items a i {
    margin-right: 0.5rem;
    width: 1.2rem;
    text-align: center;
}

/* ========================================
   4. BUTTONS
   ======================================== */
.btn-primary, 
.btn-secondary, 
.btn-danger,
.btn-success,
.btn-warning {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    font-size: 1rem;
    line-height: 1.5;
}

.btn-primary {
    background: linear-gradient(135deg, #14967F 0%, #0D6B5F 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(20, 150, 127, 0.4);
}

.btn-secondary {
    background: white;
    color: #14967F;
    border: 2px solid #14967F;
}

.btn-secondary:hover {
    background-color: #14967F;
    color: white;
    border-color: #14967F;
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
    color: #212529 !important;
    border: none;
    font-weight: 600;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #e0a800 0%, #c69500 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.4);
}

button:disabled,
.btn-primary:disabled,
.btn-secondary:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.6;
}

/* ========================================
   5. FORMS
   ======================================== */
.auth-form,
.schedule-form,
.settings-form,
.service-form {
    max-width: 500px;
    margin: 2rem auto;
    padding: 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
    background-color: white;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #14967F;
    box-shadow: 0 0 0 3px rgba(20, 150, 127, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #999;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-group input[type="checkbox"],
.form-group input[type="radio"] {
    width: auto;
    margin-right: 0.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.availability-form form.no-card,
.availability-section form.no-card {
    background: transparent;
    box-shadow: none;
    padding: 0;
    margin: 0;
    max-width: none;
}

form button,
form .btn-primary {
    width: 100%;
    padding: 0.875rem;
    background: linear-gradient(135deg, #14967F 0%, #0D6B5F 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

form button:hover,
form .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(20, 150, 127, 0.4);
}

form button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* ========================================
   6. ALERTS & MESSAGES
   ======================================== */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-weight: 500;
    border-left: 4px solid;
}

.error,
.alert-error {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.success,
.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert-warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffc107;
}

.alert-info {
    color: #0D6B5F;
    background-color: #e8f5f2;
    border-color: #14967F;
}

.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.empty-state p {
    color: #666;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

/* Auth Container Specifics */
.auth-container h1 {
    text-align: center;
    color: #14967F;
    margin-bottom: 1.5rem;
    font-size: 2rem;
}

.auth-container p {
    text-align: center;
    margin-top: 1rem;
    color: #666;
}

.auth-container a {
    color: #14967F;
    text-decoration: none;
    font-weight: 600;
}

.auth-container a:hover {
    text-decoration: underline;
    color: #0D6B5F;
}

/* ========================================
   7. PAGE HEADERS
   ======================================== */
.admin-header,
.dashboard-header,
.plans-header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 1rem 0;
}

.admin-header h1,
.dashboard-header h1,
.plans-header h1 {
    color: #14967F;
    margin-bottom: 0.5rem;
    font-size: 2.5rem;
    font-weight: 700;
}

.admin-header p,
.dashboard-header p,
.plans-header p {
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.user-role {
    color: #6c757d;
    font-size: 1.1rem;
    margin: 0;
}

/* ========================================
   8. DASHBOARD & SECTIONS
   ======================================== */
.dashboard-grid {
    display: grid;
    gap: 2rem;
    margin-bottom: 0;
}

.dashboard-section {
    margin-bottom: 3rem;
}

.dashboard-section:last-child {
    margin-bottom: 0;
}

.dashboard-section h2 {
    color: #14967F;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    font-weight: 600;
}

.clinic-actions, 
.admin-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin: 1.5rem 0;
    padding-bottom: 0.5rem;
}

/* ========================================
   9. CARDS (Appointments, Stats, Doctors, etc.)
   ======================================== */

/* Appointments */
.appointments-list {
    display: grid;
    gap: 1.5rem;
}

.appointment-card {
    background: white;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-left: 4px solid #14967F;
    transition: all 0.3s ease;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.appointment-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.appointment-card.status-pending,
.appointment-card.status-scheduled {
    border-left-color: #ffc107;
}

.appointment-card.status-confirmed {
    border-left-color: #28a745;
}

.appointment-card.status-cancelled {
    border-left-color: #dc3545;
    opacity: 0.7;
}

.appointment-info {
    display: grid;
    gap: 0.75rem;
}

.appointment-info h3 {
    margin: 0;
    color: #14967F;
    font-size: 1.1rem;
    font-weight: 600;
}

.appointment-info p,
.appointment-info .info-item {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.appointment-info p strong,
.appointment-info .info-item strong {
    color: #333;
    min-width: 95px;
    font-weight: 600;
}

.appointment-info .info-item span {
    color: #666;
    flex: 1;
}

.appointment-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding-top: 0.75rem;
    border-top: 1px solid #e8e8e8;
    margin-top: 0.5rem;
}

.appointment-actions button,
.appointment-actions .btn-success,
.appointment-actions .btn-warning,
.appointment-actions .btn-danger {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    border: none;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
    font-weight: 600;
    text-align: center;
}

.appointment-actions button:active,
.appointment-actions .btn-success:active,
.appointment-actions .btn-warning:active,
.appointment-actions .btn-danger:active {
    transform: scale(0.98);
}

.appointment-actions .btn-success {
    background: #28a745;
    color: white;
}

.appointment-actions .btn-success:hover {
    background: #218838;
}

.appointment-actions .btn-warning {
    background: #ffc107;
    color: #212529;
}

.appointment-actions .btn-warning:hover {
    background: #e0a800;
}

.appointment-actions .btn-danger {
    background: #dc3545;
    color: white;
}

.appointment-actions .btn-danger:hover {
    background: #c82333;
}

.appointment-actions form {
    display: inline-flex;
    margin: 0;
}

.appointment-actions button {
    white-space: nowrap;
}

/* Status Badges */
.status {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-scheduled,
.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-confirmed {
    background: #d4edda;
    color: #155724;
}

.status-cancelled {
    background: #f8d7da;
    color: #721c24;
}

/* Appointments Table View */
.appointments-table-container {
    overflow-x: auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin: 2rem 0;
}

.appointments-table {
    width: 100%;
    border-collapse: collapse;
}

.appointments-table thead {
    background: linear-gradient(135deg, #14967F 0%, #0D6B5F 100%);
    color: white;
}

.appointments-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.appointments-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}

.appointments-table tbody tr:hover {
    background: #f8f9fa;
}

.appointments-table tbody tr:last-child {
    border-bottom: none;
}

.appointments-table td {
    padding: 1rem;
    font-size: 0.9rem;
    color: #333;
}

.table-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.table-actions form {
    display: inline;
    margin: 0;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    border-radius: 6px;
    font-weight: 600;
}

/* Appointments Cards Grid View */
.appointments-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.appointment-card-compact {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s ease;
    border-left: 4px solid #14967F;
}

.appointment-card-compact:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.appointment-card-compact.status-pending,
.appointment-card-compact.status-scheduled {
    border-left-color: #ffc107;
}

.appointment-card-compact.status-confirmed {
    border-left-color: #28a745;
}

.appointment-card-compact.status-cancelled {
    border-left-color: #dc3545;
    opacity: 0.7;
}

.appointment-card-compact .card-header {
    background: #f8f9fa;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e8e8e8;
}

.appointment-card-compact .card-header h3 {
    margin: 0;
    font-size: 1rem;
    color: #14967F;
    font-weight: 600;
}

.appointment-card-compact .card-body {
    padding: 1rem;
}

.appointment-card-compact .card-body p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
    color: #666;
}

.appointment-card-compact .card-body strong {
    color: #333;
    font-weight: 600;
}

.appointment-card-compact .card-actions {
    padding: 1rem;
    background: #f8f9fa;
    border-top: 1px solid #e8e8e8;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.appointment-card-compact .card-actions form {
    margin: 0;
}

/* Modal de Reagendamento */
.reschedule-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

.reschedule-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f0f0f0;
}

.modal-header h2 {
    margin: 0;
    color: #14967F;
    font-size: 1.5rem;
}

.close-modal {
    background: none;
    border: none;
    font-size: 2rem;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.close-modal:hover {
    background: #f0f0f0;
    color: #333;
}

.modal-appointment-info {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.modal-appointment-info h3 {
    margin: 0 0 0.5rem 0;
    color: #14967F;
    font-size: 1.1rem;
}

.modal-appointment-info p {
    margin: 0.25rem 0;
    color: #666;
    font-size: 0.9rem;
}

.modal-content .form-group {
    margin-bottom: 1rem;
}

.modal-content .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #333;
    font-weight: 600;
    font-size: 0.95rem;
}

.modal-content .form-group input[type="date"],
.modal-content .form-group input[type="time"] {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: all 0.2s;
}

.modal-content .form-group input[type="date"]:focus,
.modal-content .form-group input[type="time"]:focus {
    outline: none;
    border-color: #14967F;
    box-shadow: 0 0 0 3px rgba(20, 150, 127, 0.1);
}

.modal-content .btn-primary:hover {
    background: #0D6B5F !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(20, 150, 127, 0.3);
}

.modal-content .btn-primary:active {
    transform: translateY(0);
}

/* Slots dentro do modal */
.modal-content .slots-grid {
    max-width: 100%;
}

.modal-content .slot-button {
    cursor: pointer;
    pointer-events: auto;
}

.modal-content .slot-button:hover {
    background-color: #14967F;
    color: white;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(30px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   CALENDAR VIEW - Professional Calendar Layout
   ============================================ */

/* Calendar Container */
.calendar-wrapper {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-top: 2rem;
}

/* Calendar Header - Navigation */
.calendar-header {
    background: linear-gradient(135deg, #14967F 0%, #0D6B5F 100%);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}

.calendar-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    text-align: center;
    flex: 1;
}

.calendar-nav {
    padding: 0.5rem 1rem;
    background: white;
    color: #14967F;
    text-decoration: none !important;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid white;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    font-size: 0.9rem;
}

.calendar-nav:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(20, 150, 127, 0.4);
    text-decoration: none !important;
}

/* Calendar Grid */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: white;
}

/* Calendar Day Headers */
.calendar-day-header {
    background: linear-gradient(180deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 0.625rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.875rem;
    color: #495057;
    border-bottom: 2px solid #14967F;
    border-right: 1px solid #dee2e6;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.calendar-day-header:last-child {
    border-right: none;
}

/* Calendar Day Cells */
.calendar-day {
    min-height: 120px;
    padding: 0.75rem;
    border-right: 1px solid #dee2e6;
    border-bottom: 1px solid #dee2e6;
    background: white;
    transition: all 0.2s ease;
    position: relative;
    overflow: visible;
}

.calendar-day:nth-child(7n) {
    border-right: none;
}

.calendar-day:hover {
    background: #f8f9fa;
}

.calendar-day.empty-day {
    background: #f8f9fa;
    opacity: 0.5;
}

/* Day Number */
.calendar-day-number {
    font-weight: 600;
    font-size: 1rem;
    color: #495057;
    margin-bottom: 0.5rem;
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.calendar-day.today .calendar-day-number {
    background: #14967F;
    color: white;
    font-weight: 700;
}

/* Appointment Cards in Calendar */
.calendar-appointment {
    font-size: 0.75rem;
    margin-bottom: 0.375rem;
    padding: 0.375rem 0.5rem;
    background: white;
    border-radius: 6px;
    border-left: 3px solid #14967F;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    cursor: pointer;
    overflow: visible;
    position: relative;
}

.calendar-appointment:hover {
    transform: translateX(3px);
    box-shadow: 0 2px 6px rgba(20, 150, 127, 0.3);
}

/* Disable pointer events on other appointments when a menu is open */
.calendar-appointment.menu-disabled {
    pointer-events: none !important;
    opacity: 0.5;
    user-select: none;
}

.calendar-appointment.menu-disabled * {
    pointer-events: none !important;
}

/* Keep the appointment with open menu fully visible and interactive */
.calendar-appointment:has(.calendar-appointment-menu.active) {
    opacity: 1 !important;
    pointer-events: auto !important;
    z-index: 10000;
}

.calendar-appointment.status-confirmed {
    border-left-color: #28a745;
    background: linear-gradient(90deg, rgba(40, 167, 69, 0.1) 0%, white 20%);
}

.calendar-appointment.status-pending {
    border-left-color: #ffc107;
    background: linear-gradient(90deg, rgba(255, 193, 7, 0.1) 0%, white 20%);
}

.calendar-appointment.status-cancelled {
    border-left-color: #dc3545;
    background: linear-gradient(90deg, rgba(220, 53, 69, 0.1) 0%, white 20%);
    opacity: 0.7;
}

.calendar-appointment-title {
    font-weight: 600;
    color: #212529;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calendar-appointment-client {
    color: #6c757d;
    margin-bottom: 0.25rem;
    font-size: 0.7rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calendar-appointment-time {
    font-size: 0.7rem;
    color: #14967F;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.calendar-appointment-time::before {
    content: "🕐";
    font-size: 0.8rem;
}

/* More Appointments Indicator */
.calendar-more-appointments {
    font-size: 0.7rem;
    color: #14967F;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    text-align: center;
    cursor: pointer;
    margin-top: 0.25rem;
    border-radius: 4px;
    background: rgba(20, 150, 127, 0.1);
}

.calendar-more-appointments:hover {
    background: rgba(20, 150, 127, 0.2);
}

/* Empty State in Calendar */
.calendar-day.has-appointments {
    background: linear-gradient(135deg, rgba(20, 150, 127, 0.02) 0%, white 100%);
}

/* Calendar Appointment Menu Dropdown */
.calendar-appointment {
    position: relative;
}

.calendar-appointment-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 99999;
    margin-top: 0.25rem;
    overflow: hidden;
    display: none;
    animation: slideDownMenu 0.2s ease;
    pointer-events: auto !important;
}

.calendar-appointment-menu.active {
    display: block;
    pointer-events: auto !important;
}

.calendar-appointment-menu * {
    pointer-events: auto !important;
}

@keyframes slideDownMenu {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.calendar-menu-item {
    display: block;
    width: 100%;
    padding: 0.6rem 0.85rem;
    text-align: left;
    border: none;
    background: white;
    color: #212529;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    border-bottom: 1px solid #e9ecef;
    position: relative;
    z-index: 100000;
}

.calendar-menu-item:last-child {
    border-bottom: none;
}

.calendar-menu-item:hover {
    background: #f1f3f5;
    color: #14967F;
    transform: translateX(3px);
}

.calendar-menu-item.confirm:hover {
    background: #d4edda;
    color: #155724;
}

.calendar-menu-item.reschedule:hover {
    background: #fff3cd;
    color: #856404;
}

.calendar-menu-item.transfer:hover {
    background: #d1ecf1;
    color: #0c5460;
}

.calendar-menu-item.cancel:hover {
    background: #f8d7da;
    color: #721c24;
}

/* Stats Cards */
.clinic-stats, 
.admin-stats,
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 2rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.15);
}

.stat-card h3 {
    color: #666;
    margin-bottom: 0.75rem;
    font-size: 1rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: #14967F;
    margin: 0;
}

/* Doctor Cards */
.doctors-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.doctor-card,
.doctor-item {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #14967F;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.doctor-card:hover,
.doctor-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.15);
}

.doctor-card h4,
.doctor-item h3 {
    margin: 0 0 0.75rem 0;
    color: #14967F;
    font-size: 1.2rem;
    font-weight: 600;
}

.doctor-card p,
.doctor-info p {
    margin: 0.35rem 0;
    color: #666;
    font-size: 0.95rem;
}

.doctor-info {
    flex: 1;
}

.doctor-details {
    margin-top: 0.5rem;
}

.doctor-details p {
    margin: 0.25rem 0;
}

.doctor-details strong {
    color: #333;
    font-weight: 600;
}

.doctor-actions {
    display: flex;
    gap: 0.5rem;
}

.doctor-actions form {
    display: inline-block !important;
    margin: 0 !important;
}

/* User Cards */
.recent-users {
    display: grid;
    gap: 1rem;
}

.user-item {
    background: white;
    padding: 1.25rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-left: 3px solid #14967F;
}

.user-info h4 {
    margin: 0 0 0.25rem 0;
    color: #333;
    font-weight: 600;
}

.user-info p {
    margin: 0.25rem 0;
    color: #666;
    font-size: 0.9rem;
}

.user-info small {
    color: #999;
    font-size: 0.8rem;
}

/* Stats Cards */
.clinic-stats, .admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-card h3 {
    color: #666;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: #14967F;
    margin: 0;
}

/* Actions */
.clinic-actions, .admin-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.empty-state p {
    color: #666;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin: 0;
    font-weight: 500;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
}

.schedule-form input, .schedule-form select, .schedule-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.schedule-form input:focus, .schedule-form select:focus, .schedule-form textarea:focus {
    outline: none;
    border-color: #14967F;
}

.schedule-form textarea {
    resize: vertical;
    min-height: 100px;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

/* ========================================
   10. PLANS SECTION
   ======================================== */
.plans-container {
    padding: 3rem 0;
    background: linear-gradient(135deg, #f0f8f0 0%, #e8f5f2 100%);
    flex: 1;
}

.plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.plan-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    position: relative;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.plan-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.plan-card.featured {
    border-color: #14967F;
    background: linear-gradient(135deg, #f0f8f0 0%, #e8f5f2 100%);
}

.plan-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #14967F 0%, #0D6B5F 100%);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.plan-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.plan-header h3 {
    color: #14967F;
    font-size: 1.6rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.plan-price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    margin-bottom: 1rem;
}

.currency {
    font-size: 1.2rem;
    color: #666;
    margin-right: 0.25rem;
}

.amount {
    font-size: 2.8rem;
    font-weight: 700;
    color: #14967F;
}

.period {
    font-size: 1rem;
    color: #666;
    margin-left: 0.25rem;
}

.plan-description {
    text-align: center;
    margin-bottom: 1.5rem;
}

.plan-description p {
    color: #666;
    line-height: 1.6;
}

.plan-features {
    margin-bottom: 2rem;
    padding: 0 0.5rem;
}

.feature-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
    color: #555;
    font-size: 0.95rem;
}

.checkmark {
    color: #28a745;
    font-weight: bold;
    margin-right: 0.75rem;
    font-size: 1.2rem;
}

.plan-actions {
    text-align: center;
}

.plan-actions .btn-primary {
    width: 100%;
    padding: 0.875rem 2rem;
}

.plans-footer {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #e1e5e9;
    margin-top: 2rem;
}

.plans-footer p {
    color: #666;
    margin-bottom: 1.5rem;
}

/* Dashboard Enhancements */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.doctors-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.doctor-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    border-left: 4px solid #14967F;
}

.doctor-card h4 {
    margin: 0 0 0.5rem 0;
    color: #14967F;
}

.doctor-card p {
    margin: 0;
    color: #666;
}

.recent-users {
    display: grid;
    gap: 1rem;
}

.user-item {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-left: 3px solid #14967F;
}

.user-info h4 {
    margin: 0 0 0.25rem 0;
    color: #333;
}

.user-info p {
    margin: 0 0 0.25rem 0;
    color: #666;
    font-size: 0.9rem;
}

.user-info small {
    color: #999;
    font-size: 0.8rem;
}

/* ========================================
   11. HOME PAGE SECTIONS
   ======================================== */
.hero {
    background: linear-gradient(135deg, #14967F 0%, #0D6B5F 100%);
    padding: 5rem 0 4rem;
    text-align: center;
    color: white;
}

.hero h2 {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    color: white;
    font-weight: 700;
}

.hero p {
    font-size: 1.3rem;
    margin-bottom: 2.5rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.8;
}

.hero a.btn-primary,
.hero .btn-primary,
section.hero a.btn-primary {
    background-color: white !important;
    background: white !important;
    color: #14967F !important;
    margin: 0.5rem !important;
    border: none !important;
}

.hero a.btn-primary:hover,
.hero .btn-primary:hover,
section.hero a.btn-primary:hover {
    background-color: #f0f8f0 !important;
    background: #f0f8f0 !important;
    color: #0D6B5F !important;
}

.hero a.btn-secondary,
.hero .btn-secondary,
section.hero a.btn-secondary {
    background-color: white !important;
    background: white !important;
    color: #14967F !important;
    border: none !important;
    margin: 0.5rem !important;
}

.hero a.btn-secondary:hover,
.hero .btn-secondary:hover,
section.hero a.btn-secondary:hover {
    background-color: #f0f8f0 !important;
    background: #f0f8f0 !important;
    color: #0D6B5F !important;
    border: none !important;
}

.features, 
.pricing, 
.testimonials, 
.cta {
    padding: 4rem 0;
}

.features h2, 
.pricing h2, 
.testimonials h2, 
.cta h2 {
    text-align: center;
    margin-bottom: 3rem;
    color: #14967F;
    font-size: 2.5rem;
    font-weight: 700;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.feature {
    text-align: center;
    padding: 2.5rem 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.feature:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.feature h3 {
    color: #14967F;
    margin-bottom: 1rem;
    font-size: 1.4rem;
    font-weight: 600;
}

.feature p {
    color: #666;
    line-height: 1.6;
}

.testimonial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.testimonial {
    background: white;
    padding: 2.5rem 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: all 0.3s ease;
}

.testimonial:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.testimonial p {
    font-style: italic;
    margin-bottom: 1.5rem;
    color: #555;
    line-height: 1.6;
}

.testimonial cite {
    font-weight: 600;
    color: #14967F;
    font-style: normal;
}

.cta {
    background: linear-gradient(135deg, #14967F 0%, #0D6B5F 100%);
    color: white;
    text-align: center;
    padding: 5rem 0;
}

.cta h2 {
    color: white;
    font-size: 2.5rem;
}

.cta p {
    margin-bottom: 2.5rem;
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.95);
}

/* Home Page Plans (different from Plans page) */
.pricing .plans {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.pricing .plan {
    border: 2px solid #e1e5e9;
    padding: 2rem;
    border-radius: 12px;
    background: white;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
}

.pricing .plan:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: #14967F;
}

.pricing .plan.featured {
    border-color: #14967F;
    background: linear-gradient(135deg, #f0f8f0 0%, #e8f5f2 100%);
    position: relative;
}

.pricing .plan .badge {
    position: absolute;
    top: -12px;
    right: 20px;
    background: #14967F;
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(20, 150, 127, 0.3);
}

.pricing .plan h3 {
    color: #14967F;
    margin-bottom: 1rem;
    font-size: 1.8rem;
    font-weight: 700;
}

.pricing .plan .price {
    font-size: 2.5rem;
    font-weight: bold;
    color: #14967F;
    margin-bottom: 1.5rem;
}

.pricing .plan .price span {
    font-size: 1rem;
    color: #666;
}

.pricing .plan ul {
    list-style: none;
    padding: 0;
    margin-bottom: 2rem;
    text-align: left;
}

.pricing .plan li {
    margin-bottom: 0.75rem;
    padding-left: 1.5rem;
    position: relative;
}

.pricing .plan li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #28a745;
    font-weight: bold;
}

/* ========================================
   12. FOOTER
   ======================================== */
footer {
    background: linear-gradient(135deg, #14967F 0%, #0D6B5F 100%);
    color: white;
    padding: 1.5rem 0;
    width: 100%;
    margin-top: auto;
    clear: both;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

footer .container {
    text-align: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

footer p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.9;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 1.5rem;
    text-align: left;
}

.footer-section h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.footer-section h3 img {
    width: 24px;
    height: 24px;
    vertical-align: middle;
    margin-right: 0.5rem;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section ul li {
    margin-bottom: 0.75rem;
}

.footer-section ul li a {
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    opacity: 0.9;
}

.footer-section ul li a:hover {
    opacity: 1;
    padding-left: 5px;
}

.slot-button.available {
    border-color: #14967F;
    background: linear-gradient(135deg, #f0f8f0 0%, #e8f5f2 100%);
}

.slot-button small {
    font-size: 0.75rem;
    opacity: 0.8;
    margin-top: 0.25rem;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: white;
    border: none;
    color: #14967F;
    font-size: 1.5rem;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    border-radius: 4px;
    min-width: 45px;
    min-height: 40px;
    line-height: 1;
}

/* Responsive */
@media (max-width: 1100px) {
    .mobile-menu-toggle {
        display: block;
        order: 2;
    }
    
    header .container {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 1rem;
    }
    
    header h1 {
        font-size: 1.1rem;
        display: flex;
        align-items: center;
        gap: 8px;
        order: 1;
        flex: 0 0 auto;
    }
    
    header h1 img {
        height: 35px;
        width: 35px;
        object-fit: contain;
    }
    
    header nav {
        order: 3;
    }
    
    header nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: linear-gradient(135deg, #14967F 0%, #0D6B5F 100%);
        flex-direction: column;
        gap: 0;
        padding: 1rem;
        display: none;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    }
    
    header nav.active {
        display: flex;
    }
    
    header nav a {
        width: 100%;
        text-align: center;
        padding: 0.75rem 1rem;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    header nav a:last-child {
        border-bottom: none;
    }
    .hero h2 {
        font-size: 2rem;
    }
    .feature-grid, .plans, .testimonial-grid {
        grid-template-columns: 1fr;
    }
    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        text-align: center;
    }

    /* Form adjustments for mobile */
    form {
        max-width: 90%;
        margin: 1rem auto;
        padding: 1.5rem;
    }
}

/* Very small screens - allow wrap to fit */
@media (max-width: 600px) {
    header nav {
        flex-wrap: wrap;
        gap: 0.1rem;
    }
    header nav a {
        padding: 0.1rem 0.2rem;
        font-size: 0.6rem;
    }
}

/* Medium screens - adjust header nav for better fit */
@media (max-width: 900px) {
    header nav {
        gap: 0.2rem;
    }
    header nav a {
        padding: 0.3rem 0.5rem;
        font-size: 0.7rem;
    }
    header nav a[href*="index.php"]:first-child {
        display: none;
    }
}

/* ========================================
   15. APPOINTMENT SCHEDULING & SLOTS
   ======================================== */
.slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
    max-width: 900px;
}

.slot-button {
    padding: 1rem 0.75rem;
    border: 2px solid #14967F;
    background-color: #fff;
    color: #14967F;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    text-align: center;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.25rem;
}

.slot-button:hover {
    background-color: #14967F;
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(20, 150, 127, 0.3);
}

.slot-button.selected {
    background: linear-gradient(135deg, #14967F 0%, #0D6B5F 100%);
    color: white;
    border-color: #0D6B5F;
}

.slot-button.disabled {
    background-color: #f5f5f5;
    color: #999;
    border-color: #ddd;
    cursor: not-allowed;
    opacity: 0.5;
}

.slot-button.disabled:hover {
    background-color: #f5f5f5;
    color: #999;
    transform: none;
    box-shadow: none;
}

.slot-button.available {
    border-color: #28a745;
}

.slot-time {
    font-weight: 600;
    font-size: 1rem;
}

.slot-status {
    font-size: 0.75rem;
    opacity: 0.85;
}

.slot-button small {
    font-size: 0.75rem;
    opacity: 0.8;
    margin-top: 0.25rem;
}

/* Step Indicator */
.step-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    background-color: #f5f5f5;
    color: #666;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.step.active {
    background: linear-gradient(135deg, #14967F 0%, #0D6B5F 100%);
    color: white;
    box-shadow: 0 4px 10px rgba(20, 150, 127, 0.3);
}

.step.completed {
    background-color: #0D6B5F;
    color: white;
}

.step::before {
    content: "○";
    font-size: 1.3rem;
    font-weight: bold;
}

.step.active::before {
    content: "●";
}

.step.completed::before {
    content: "✓";
}

/* ========================================
   13. TABLES
   ======================================== */
.users-table {
    overflow-x: auto;
    margin-top: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.users-table table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
}

.users-table thead {
    background: linear-gradient(135deg, #14967F 0%, #0D6B5F 100%);
    color: white;
}

.users-table th {
    padding: 1.25rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
}

.users-table th:nth-child(1) { width: 20%; } /* Nome */
.users-table th:nth-child(2) { width: 25%; } /* Email */
.users-table th:nth-child(3) { width: 10%; } /* Tipo */
.users-table th:nth-child(4) { width: 20%; } /* Clínica */
.users-table th:nth-child(5) { width: 15%; } /* Data */
.users-table th:nth-child(6) { width: 10%; } /* Ações */

.users-table td {
    padding: 1rem;
    border-bottom: 1px solid #e1e5e9;
    vertical-align: middle;
    font-size: 0.95rem;
}

.users-table tbody tr {
    transition: background-color 0.2s ease;
}

.users-table tbody tr:hover {
    background-color: #f8f9fa;
}

.users-table tbody tr:last-child td {
    border-bottom: none;
}

/* Role Badges */
.role-badge {
    display: inline-block;
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.role-admin {
    background-color: #dc3545;
    color: white;
}

.role-doctor {
    background-color: #28a745;
    color: white;
}

.role-client {
    background-color: #007bff;
    color: white;
}

.role-clinic {
    background-color: #6f42c1;
    color: white;
}

/* Textarea Styles */
textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    min-height: 100px;
    transition: border-color 0.3s ease;
}

textarea:focus {
    outline: none;
    border-color: #14967F;
    box-shadow: 0 0 0 3px rgba(20, 150, 127, 0.1);
}

/* ========================================
   14. SERVICES
   ======================================== */
.services-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.service-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    background: white;
    transition: all 0.3s ease;
}

.service-item:hover {
    border-color: #14967F;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.service-info {
    flex: 1;
}

.service-info h3 {
    margin: 0 0 0.75rem 0;
    color: #14967F;
    font-size: 1.2rem;
    font-weight: 600;
}

.service-info p {
    margin: 0.5rem 0;
    color: #666;
    font-size: 0.95rem;
}

.service-details {
    display: flex;
    gap: 1.5rem;
    font-size: 0.9rem;
    color: #555;
    margin-top: 0.5rem;
}

.service-actions {
    display: flex;
    gap: 0.5rem;
}

.service-actions form {
    display: inline !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* ========================================
   15. CLINIC DOCTORS LIST
   ======================================== */
.doctors-items-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.doctor-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    background: white;
    transition: all 0.3s ease;
}

.doctor-item:hover {
    border-color: #14967F;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.doctor-item-info {
    flex: 1;
}

.doctor-item-info h3 {
    margin: 0 0 0.5rem 0;
    color: #14967F;
    font-size: 1.2rem;
    font-weight: 600;
}

.doctor-item-info p {
    margin: 0.25rem 0;
    color: #666;
    font-size: 0.95rem;
}

.doctor-item-info strong {
    color: #333;
    font-weight: 600;
}

.doctor-item-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.doctor-item-actions form {
    display: inline !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* ========================================
   16. AVAILABILITY SCHEDULE
   ======================================== */
.availability-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.availability-section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 2px solid #e1e5e9;
    transition: all 0.3s ease;
}

.availability-section:hover {
    border-color: #14967F;
}

.availability-section h2 {
    color: #14967F;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.availability-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Days Selector */
.days-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
    justify-content: flex-start;
}

.day-button {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    flex-shrink: 0;
}

.day-button:hover {
    border-color: #14967F;
    background: #f0f8f0;
}

.day-button input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.day-button input[type="checkbox"]:checked + span {
    color: white;
}

.day-button:has(input[type="checkbox"]:checked) {
    background: linear-gradient(135deg, #14967F 0%, #0D6B5F 100%);
    border-color: #14967F;
    box-shadow: 0 3px 8px rgba(20, 150, 127, 0.3);
}

.day-button span {
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    transition: color 0.3s ease;
}

/* Time Inputs */
.time-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 0.75rem;
}

.time-inputs .form-group {
    margin-bottom: 0;
}

.time-inputs .form-group input[type="time"] {
    padding: 0.75rem;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
}

/* Current Availability Display */
.availability-by-day {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.day-schedule {
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    padding: 1.25rem;
    background: #f9f9f9;
    transition: all 0.3s ease;
}

.day-schedule:hover {
    border-color: #14967F;
    background: #f0f8f0;
}

.day-schedule h3 {
    margin: 0 0 1rem 0;
    color: #14967F;
    font-size: 1.2rem;
    font-weight: 600;
}

.day-times {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.time-slot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: white;
    border-radius: 8px;
    border: 1px solid #e1e5e9;
    transition: all 0.2s ease;
}

.time-slot:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.time-slot span {
    font-weight: 500;
    color: #333;
    font-size: 0.95rem;
}

.time-slot form {
    display: inline !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* ========================================
   17. UTILITY CLASSES
   ======================================== */
.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.info-item strong {
    flex: 0 0 auto;
    margin-right: 1rem;
    color: #333;
    font-weight: 600;
}

.info-item span {
    flex: 1;
    text-align: left;
    color: #666;
}

/* Text Utilities */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* Spacing Utilities */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* ========================================
   18. RESPONSIVE DESIGN
   ======================================== */

/* Tablets and Small Desktops */
@media (max-width: 900px) {
    header h1 {
        font-size: 1.5rem;
    }
    
    header nav {
        gap: 0.3rem;
    }
    
    header nav a {
        padding: 0.4rem 0.7rem;
        font-size: 0.85rem;
    }
}

/* Tablets */
@media (max-width: 768px) {
    .container {
        width: 95%;
        padding: 0 1rem;
    }
    
    /* Hero Section */
    .hero h2 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1.1rem;
    }
    
    /* Grids */
    .feature-grid,
    .plans-grid,
    .testimonial-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid,
    .clinic-stats,
    .admin-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Availability */
    .availability-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .days-selector {
        justify-content: center;
        gap: 0.25rem;
    }
    
    .day-button {
        width: 42px;
        height: 42px;
    }
    
    .day-button span {
        font-size: 0.8rem;
    }
    
    .time-inputs {
        grid-template-columns: 1fr;
    }
    
    .time-slot {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    /* Tables */
    .users-table {
        font-size: 0.85rem;
    }
    
    .users-table th,
    .users-table td {
        padding: 0.75rem 0.5rem;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        text-align: center;
    }
    
    /* Forms */
    .auth-form,
    .schedule-form {
        padding: 1.5rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn-primary,
    .form-actions .btn-secondary {
        width: 100%;
    }
}

/* Mobile Phones */
@media (max-width: 600px) {
    html {
        font-size: 14px;
    }
    
    .container {
        width: 100%;
        padding: 0 0.75rem;
    }
    
    header nav a {
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
    }
    
    .hero {
        padding: 3rem 0 2rem;
    }
    
    .hero h2 {
        font-size: 1.75rem;
    }
    
    .dashboard-header h1,
    .admin-header h1,
    .plans-header h1 {
        font-size: 2rem;
    }
    
    .stats-grid,
    .clinic-stats,
    .admin-stats {
        grid-template-columns: 1fr;
    }
    
    /* Tables Responsivas */
    .appointments-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .appointments-table {
        min-width: 600px;
    }
    
    .appointments-table th,
    .appointments-table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
    }
    
    .table-actions {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .btn-sm {
        width: 100%;
        font-size: 0.75rem;
        padding: 0.5rem;
    }
    
    /* Cards Grid */
    .appointments-cards-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .slots-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .slot-button {
        min-height: 50px;
        padding: 0.5rem;
        font-size: 0.85rem;
    }
    
    .appointment-card {
        padding: 1rem;
        gap: 0.75rem;
    }
    
    .appointment-info h3 {
        font-size: 1rem;
    }
    
    .appointment-info p,
    .appointment-info .info-item {
        font-size: 0.85rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .appointment-info p strong {
        min-width: auto;
        font-size: 0.8rem;
    }
    
    .appointment-actions {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
        margin-top: 0.75rem;
    }
    
    .appointment-actions form {
        width: 100%;
    }
    
    .appointment-actions button,
    .appointment-actions .btn-success,
    .appointment-actions .btn-warning,
    .appointment-actions .btn-danger {
        width: 100%;
        padding: 0.75rem;
        font-size: 0.9rem;
        min-height: 44px;
        border-radius: 8px;
    }
    
    /* Modal Responsivo */
    .modal-content {
        padding: 1.5rem;
        max-height: 85vh;
        margin: 0.5rem;
    }
    
    .modal-header h2 {
        font-size: 1.25rem;
    }
    
    .close-modal {
        width: 36px;
        height: 36px;
        font-size: 1.75rem;
    }
}

/* Calendar Responsive */
@media (max-width: 768px) {
    .calendar-header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .calendar-header h3 {
        order: -1;
        font-size: 1.25rem;
    }
    
    .calendar-nav {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    .calendar-day {
        min-height: 80px;
        padding: 0.5rem 0.25rem;
    }
    
    .calendar-day-number {
        font-size: 0.875rem;
        padding: 0.2rem 0.4rem;
    }
    
    .calendar-appointment {
        font-size: 0.65rem;
        padding: 0.25rem 0.375rem;
        margin-bottom: 0.25rem;
    }
    
    .calendar-appointment-title {
        font-size: 0.7rem;
    }
    
    .calendar-appointment-client,
    .calendar-appointment-time {
        font-size: 0.65rem;
    }
    
    .calendar-more-appointments {
        font-size: 0.65rem;
        padding: 0.2rem 0.3rem;
    }
}

@media (max-width: 600px) {
    .calendar-wrapper {
        margin-top: 1rem;
        border-radius: 8px;
    }
    
    .calendar-day {
        min-height: 70px;
        padding: 0.375rem 0.2rem;
    }
    
    .calendar-day-header {
        padding: 0.5rem 0.25rem;
        font-size: 0.75rem;
    }
    
    .calendar-day-number {
        font-size: 0.8rem;
    }
    
    .calendar-appointment {
        padding: 0.2rem 0.3rem;
        margin-bottom: 0.2rem;
    }
    
    /* Show only time on small screens */
    .calendar-appointment-client {
        display: none;
    }
    
    .calendar-appointment-title {
        white-space: normal;
        line-height: 1.2;
        max-height: 2.4em;
        overflow: hidden;
    }
}

/* Extra Small Devices */
@media (max-width: 400px) {
    .slots-grid {
        grid-template-columns: 1fr;
    }
    
    .plans-grid {
        grid-template-columns: 1fr;
    }
    
    .calendar-day {
        min-height: 60px;
        padding: 0.25rem 0.15rem;
    }
    
    .calendar-day-number {
        font-size: 0.75rem;
        margin-bottom: 0.25rem;
    }
    
    .calendar-appointment {
        font-size: 0.6rem;
        padding: 0.15rem 0.25rem;
    }
    
    .calendar-appointment-time::before {
        display: none;
    }
}

/* ========================================
   LOADING SPINNER - v4.1
   ======================================== */
.appointments-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    border-radius: 8px;
    transition: opacity 0.3s ease;
}

.appointments-loading-overlay.hidden {
    display: none;
}

.spinner-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(20, 150, 127, 0.1);
    border-top-color: #14967F;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.spinner-text {
    color: #14967F;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
}

/* Smooth fade in/out for appointments container */
.appointments-container {
    position: relative;
    transition: opacity 0.2s ease;
}

.appointments-container.loading {
    opacity: 0.6;
    pointer-events: none;
}


