/* Clinic Management System - Global Styles (Matching Original Node.js System) */

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

:root {
  /* New Clinic Color Scheme */
  --primary-color: #1C4643;
  --primary-dark: #1F3F3D;
  --primary-light: #F4F1E8;
  --accent-gold: #E0C387;
  --secondary-color: #2d7a5f;
  --danger-color: #8b3a3a;
  --warning-color: #E0C387;
  --text-primary: #1C4643;
  --text-secondary: #6B7280;
  --border-color: #E0C387;
  --bg-main: #F4F1E8;
  --bg-white: #FFFFFF;
  --sidebar-bg: #1C4643;
  --shadow-sm: 0 1px 2px 0 rgba(28, 70, 67, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(28, 70, 67, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(28, 70, 67, 0.1);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.6;
}

/* App Layout */
.app-layout {
  display: flex;
  min-height: 100vh;
  background-color: var(--bg-main);
}

.app-sidebar {
  width: 290px;
  background: linear-gradient(180deg, #1C4643 0%, #1F3F3D 100%);
  border-right: 3px solid var(--accent-gold);
  position: fixed;
  height: 100vh;
  left: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  padding: 20px 0;
  overflow-y: auto;
}

.app-main {
  margin-left: 290px;
  flex: 1;
  padding: 24px;
  width: calc(100% - 290px);
}

/* Sidebar Brand */
.sidebar-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 22px 16px 18px;
  border-bottom: 1px solid rgba(224, 195, 135, 0.35);
  margin-bottom: 20px;
}

.sidebar-brand-icon {
  width: 130px;
  height: 130px;
  background: transparent;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  overflow: hidden;
  padding: 0;
}

.sidebar-brand-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  padding: 0;
}

.sidebar-brand-text {
  font-size: 17px;
  font-weight: 800;
  color: var(--accent-gold);
  letter-spacing: 3.5px;
  text-transform: uppercase;
  line-height: 1.1;
}

/* Doctor-role sidebar header (uses .logo/.logo-icon/.logo-text) */
.sidebar-header {
  padding: 22px 16px 18px;
  border-bottom: 1px solid rgba(224, 195, 135, 0.35);
  margin-bottom: 20px;
  text-align: center;
}

.logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.logo-icon {
  width: 130px;
  height: 130px;
  background: transparent;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  overflow: hidden;
  padding: 0;
}

.logo-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  padding: 0;
}

.logo-text {
  font-size: 17px;
  font-weight: 800;
  color: var(--accent-gold, #E0C387);
  letter-spacing: 3.5px;
  text-transform: uppercase;
  line-height: 1.1;
}

.sidebar-nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(224,195,135,0.3) transparent;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 4px;
  color: var(--primary-light);
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.2s;
  cursor: pointer;
  opacity: 0.8;
}

.sidebar-nav-item:hover {
  background-color: rgba(224, 195, 135, 0.2);
  color: var(--accent-gold);
  opacity: 1;
}

.sidebar-nav-item.active {
  background-color: var(--accent-gold);
  color: var(--primary-dark);
  opacity: 1;
  font-weight: 600;
}

.sidebar-nav-icon {
  font-size: 20px;
}

/* Profile Section */
.profile-section {
  padding: 16px 20px;
  border-top: 2px solid var(--accent-gold);
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-gold);
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
}

.avatar-sm {
  width: 32px;
  height: 32px;
  font-size: 12px;
}

.profile-info {
  flex: 1;
}

.profile-name {
  font-size: 14px;
  font-weight: 600;
  color: #F4F1E8;
}

.profile-role {
  font-size: 12px;
  color: #E0C387;
  text-transform: capitalize;
}

/* Cards */
.card {
  background: var(--bg-white);
  border-radius: 12px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

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

.card-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.card-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
}

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

.stat-card {
  background: var(--bg-white);
  border-radius: 12px;
  padding: 20px;
  border: 1px solid var(--border-color);
  transition: all 0.3s;
}

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

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

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

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

.stat-icon.success {
  background-color: #DCFCE7;
  color: var(--secondary-color);
}

.stat-icon.danger {
  background-color: #FEE2E2;
  color: var(--danger-color);
}

.stat-icon.warning {
  background-color: #FEF3C7;
  color: var(--warning-color);
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.stat-label {
  font-size: 14px;
  color: var(--text-secondary);
}

.stat-change {
  font-size: 12px;
  margin-top: 8px;
}

.stat-change.positive {
  color: var(--secondary-color);
}

.stat-change.negative {
  color: var(--danger-color);
}

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

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

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

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

.btn-secondary {
  background-color: #F3F4F6;
  color: var(--text-primary);
}

.btn-secondary:hover:not(:disabled) {
  background-color: #E5E7EB;
}

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

.btn-success:hover:not(:disabled) {
  background-color: #059669;
}

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

.btn-danger:hover:not(:disabled) {
  background-color: #DC2626;
}

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

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

.btn-icon {
  padding: 8px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Forms */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-primary);
  background-color: var(--bg-white);
  transition: all 0.2s;
}

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

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

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}

/* Tables */
.table-container {
  background: var(--bg-white);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

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

.table thead {
  background-color: var(--bg-main);
}

.table th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 14px;
  border-bottom: 1px solid var(--border-color);
}

.table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 14px;
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.table tbody tr:hover {
  background-color: var(--bg-main);
}

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

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

.badge-success {
  background-color: #DCFCE7;
  color: var(--secondary-color);
}

.badge-danger {
  background-color: #FEE2E2;
  color: var(--danger-color);
}

.badge-warning {
  background-color: #FEF3C7;
  color: var(--warning-color);
}

.badge-secondary {
  background-color: #F3F4F6;
  color: var(--text-secondary);
}

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

.modal {
  background: var(--bg-white);
  border-radius: 12px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

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

.modal-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-secondary);
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s;
}

.modal-close:hover {
  background-color: var(--bg-main);
}

.modal-body {
  padding: 24px;
}

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

/* Utilities */
.text-primary {
  color: var(--primary-color);
}

.text-secondary {
  color: var(--text-secondary);
}

.text-success {
  color: var(--secondary-color);
}

.text-danger {
  color: var(--danger-color);
}

.text-warning {
  color: var(--warning-color);
}

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.flex {
  display: flex;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

/* Loading */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--text-secondary);
}

.spinner {
  border: 3px solid var(--border-color);
  border-top: 3px solid var(--primary-color);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-state-icon {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.empty-state-text {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

/* Calendar Styles */
.calendar-container {
  background: white;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border-color);
  margin-bottom: 24px;
}

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

.calendar-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.calendar-view-toggle {
  display: flex;
  gap: 8px;
  background-color: #F3F4F6;
  padding: 4px;
  border-radius: 8px;
}

.calendar-view-toggle button {
  padding: 6px 16px;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.calendar-view-toggle button.active {
  background-color: white;
  color: var(--primary-color);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.calendar-grid,
.calendar-week {
  display: grid !important;
  grid-template-columns: repeat(7, 1fr) !important;
  gap: 12px !important;
}

.calendar-day {
  min-height: 180px !important;
  padding: 16px;
  background-color: #F9FAFB;
  border-radius: 12px;
  border: 2px solid var(--accent-gold);
}

.calendar-day-header {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.calendar-day-number {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.calendar-day.today {
  background-color: #EFF6FF;
  border-color: var(--primary-color);
}

.calendar-day.today .calendar-day-number {
  color: var(--primary-color);
}

.calendar-day-appointments {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.calendar-appointment {
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.calendar-appointment .appointment-time {
  font-weight: 600;
  margin-bottom: 2px;
}

.calendar-appointment .appointment-title {
  font-size: 10px;
  opacity: 0.9;
}

/* Colorful appointment gradients */
.calendar-appointment:nth-child(1) {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.calendar-appointment:nth-child(2) {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
}

.calendar-appointment:nth-child(3) {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  color: white;
}

.calendar-appointment:nth-child(4) {
  background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
  color: white;
}

.calendar-appointment:nth-child(5) {
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
  color: white;
}

.calendar-appointment-more {
  font-size: 10px;
  color: var(--text-secondary);
  padding: 2px 6px;
  text-align: center;
  font-weight: 600;
}

/* Appointment Cards for Today's Schedule */
.appointment-card {
  background-color: white;
  border-left: 4px solid;
  padding: 16px;
  margin-bottom: 12px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s;
}

.appointment-card:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.appointment-card.status-scheduled {
  border-left-color: #667eea;
}

.appointment-card.status-confirmed {
  border-left-color: var(--primary-color);
}

.appointment-card.status-completed {
  border-left-color: var(--secondary-color);
}

.appointment-card.status-cancelled {
  border-left-color: var(--danger-color);
}

.appointment-details {
  flex: 1;
  margin-left: 16px;
}

.appointment-patient {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.appointment-status {
  display: inline-block;
}

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

/* Badge status colors */
.badge-scheduled { background-color: #E0E7FF; color: #3730A3; }
.badge-confirmed { background-color: #DBEAFE; color: #1E40AF; }
.badge-completed { background-color: #D1FAE5; color: #065F46; }
.badge-cancelled { background-color: #FEE2E2; color: #991B1B; }

/* Schedule Section */
.schedule-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.schedule-day {
  background: white;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.schedule-day h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.schedule-slot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px;
  background-color: #F9FAFB;
  border-radius: 6px;
  margin-bottom: 8px;
}

.schedule-slot span {
  font-size: 13px;
  color: var(--text-primary);
}

/* Patients Grid */
.patients-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.patient-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  border: 1px solid var(--border-color);
  transition: all 0.2s;
  cursor: pointer;
}

.patient-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.patient-card-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.patient-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 20px;
}

.patient-card-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.patient-card-phone {
  font-size: 14px;
  color: var(--text-secondary);
}

.patient-card-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

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

.patient-stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary-color);
}

.patient-stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Profile Page Styles */
.profile-container {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

.profile-card {
  background: var(--bg-white);
  border-radius: 12px;
  padding: 32px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.profile-header-section {
  display: flex;
  gap: 24px;
  align-items: center;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 32px;
}

.profile-avatar-large {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 48px;
  font-weight: 700;
}

.profile-header-info h2 {
  font-size: 28px;
  margin-bottom: 8px;
}

.profile-specialization {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.profile-license {
  font-size: 14px;
  color: var(--text-secondary);
}

.profile-details h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 24px;
}

.profile-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.info-item label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 500;
}

.info-item .form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  background: var(--bg-main);
}

.info-item .form-input:not([readonly]) {
  background: var(--bg-white);
  border-color: var(--primary-color);
}

.profile-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.stats-card {
  background: var(--bg-white);
  border-radius: 12px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  height: fit-content;
}

.stats-card h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 20px;
}

.stats-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: var(--bg-main);
  border-radius: 8px;
}

.stat-label {
  font-size: 14px;
  color: var(--text-secondary);
}

.stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary-color);
}

/* Schedule Page Styles */
.schedule-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.schedule-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
}

.schedule-day {
  background: var(--bg-main);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
}

.day-header {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.time-slot {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.slot-status {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
}

.slot-status.active {
  background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
  color: white;
}

.slot-status.partial {
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
  color: white;
}

.slot-status.inactive {
  background: #E5E7EB;
  color: var(--text-secondary);
}

.appointment-item {
  display: flex;
  gap: 16px;
  padding: 16px;
  background: var(--bg-main);
  border-radius: 8px;
  margin-bottom: 12px;
}

.appointment-date {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: white;
  border-radius: 8px;
  padding: 12px;
  text-align: center;
  min-width: 60px;
}

.date-day {
  font-size: 24px;
  font-weight: 700;
}

.date-month {
  font-size: 12px;
  text-transform: uppercase;
}

.appointment-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.appointment-time {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
}

.appointment-patient {
  font-size: 14px;
  color: var(--text-secondary);
}

.appointment-status {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  width: fit-content;
}

.appointment-status.scheduled {
  background: #EFF6FF;
  color: var(--primary-color);
}

.appointment-status.confirmed {
  background: #D1FAE5;
  color: var(--secondary-color);
}

.appointment-status.completed {
  background: #F3F4F6;
  color: var(--text-secondary);
}

/* Table Styles */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table thead {
  background: var(--bg-main);
}

.data-table th {
  padding: 12px;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border-color);
}

.data-table td {
  padding: 16px 12px;
  font-size: 14px;
  border-bottom: 1px solid var(--border-color);
}

.data-table tbody tr:hover {
  background: var(--bg-main);
}

/* Badge Styles */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.badge-success {
  background: #D1FAE5;
  color: var(--secondary-color);
}

.badge-warning {
  background: #FEF3C7;
  color: var(--warning-color);
}

.badge-danger {
  background: #FEE2E2;
  color: var(--danger-color);
}

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

.page-header h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.subtitle {
  font-size: 14px;
  color: var(--text-secondary);
}

/* Search Input */
.search-input {
  padding: 10px 16px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  min-width: 300px;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px var(--primary-light);
}

/* Button Sizes */
.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

.btn-icon {
  padding: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 6px;
  font-size: 18px;
  transition: all 0.2s;
}

.btn-icon:hover {
  background: var(--bg-main);
}

/* Responsive */
@media (max-width: 1024px) {
  .profile-container {
    grid-template-columns: 1fr;
  }
  
  .profile-info-grid {
    grid-template-columns: 1fr;
  }
  
  .schedule-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
}

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

/* ================================================================
   RTL LAYOUT  (Arabic language mode)
   Activated when <html dir="rtl"> is set by accountant-lang.js
================================================================ */
html[dir="rtl"] .app-sidebar {
  left: auto;
  right: 0;
  border-right: none;
  border-left: 3px solid var(--accent-gold);
}

html[dir="rtl"] .app-main {
  margin-left: 0;
  margin-right: 290px;
  direction: rtl;
  text-align: right;
}

html[dir="rtl"] .data-table th,
html[dir="rtl"] .data-table td {
  text-align: right;
}

html[dir="rtl"] .page-header {
  direction: rtl;
  text-align: right;
}

html[dir="rtl"] .kpi-card,
html[dir="rtl"] .stat-card {
  direction: rtl;
  text-align: right;
}

html[dir="rtl"] .sidebar-nav-item {
  flex-direction: row-reverse;
  justify-content: flex-end;
}

html[dir="rtl"] .profile-section {
  flex-direction: row-reverse;
}

html[dir="rtl"] .profile-info {
  text-align: right;
}

/* RTL 768px sidebar rule removed – overlay sidebar handles all widths <= 1280px */

/* ================================================================
   ENHANCED MOBILE/TABLET LAYOUT (all roles)
================================================================ */
.mobile-nav-toggle {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1301;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-white);
  color: var(--primary-color);
  box-shadow: var(--shadow-md);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.mobile-nav-toggle:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

@media (max-width: 1280px) {
  .app-sidebar {
    width: min(82vw, 290px);
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 1300;
  }

  .app-main {
    margin-left: 0;
    width: 100%;
    padding: 72px 16px 16px;
  }

  body.sidebar-open .app-sidebar {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  body.sidebar-open {
    overflow: hidden;
  }

  body.sidebar-open::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 1200;
  }

  .mobile-nav-toggle {
    display: inline-flex;
  }

  .page-header,
  .card-header,
  .calendar-header,
  .profile-header-section {
    flex-wrap: wrap;
    gap: 12px;
  }

  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table,
  .data-table {
    min-width: 720px;
  }
}

@media (max-width: 640px) {
  .app-main {
    padding: 12px;
  }

  .card,
  .profile-card,
  .stats-card,
  .calendar-container,
  .calendar-card {
    padding: 14px;
  }

  .search-input {
    min-width: 0;
    width: 100%;
  }

  .btn,
  .action-btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 1280px) {
  html[dir="rtl"] .mobile-nav-toggle {
    left: auto;
    right: 12px;
  }

  html[dir="rtl"] .app-sidebar {
    left: auto;
    right: 0;
    transform: translateX(100%);
    border-left: 3px solid var(--accent-gold);
    border-right: none;
  }

  html[dir="rtl"] body.sidebar-open .app-sidebar {
    transform: translateX(0);
  }

  html[dir="rtl"] .app-main {
    margin-right: 0;
    margin-left: 0;
  }
}