/* =========================================================
   AAROGYA CLINIC OPD - CHATGPT INSPIRED MINIMALIST UI THEME
   Clean, Sleek, Professional, 100% English & Compact Controls
   ========================================================= */

:root {
  --bg-app: #ffffff;
  --bg-sidebar: #f9f9fb;
  --sidebar-hover: #ececf1;
  --sidebar-active: #e3e3e8;
  --sidebar-border: #e5e7eb;
  --bg-main: #ffffff;
  --bg-card: #ffffff;
  --text-main: #0d0d0d;
  --text-secondary: #4b5563;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --border-light: #f3f4f6;
  --primary: #10a37e;        /* OpenAI Teal/Emerald */
  --primary-hover: #0e8c6d;
  --primary-light: #ecfdf5;
  --dark-btn: #18181b;
  --dark-btn-hover: #27272a;
  --success: #10a37e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-pill: 9999px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-card: 0 1px 3px 0 rgba(0, 0, 0, 0.04), 0 1px 2px -1px rgba(0, 0, 0, 0.04);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
}

/* App Container Layout */
.app-container {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* Sidebar (ChatGPT Desktop Style) */
aside.sidebar {
  width: 250px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-shrink: 0;
  height: 100vh;
  position: sticky;
  top: 0;
  padding: 12px 10px;
  z-index: 40;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px 12px 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text-main);
}

.brand-logo {
  width: 28px;
  height: 28px;
  background: var(--dark-btn);
  color: #fff;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.brand-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

.new-action-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 7px 10px;
  margin-bottom: 12px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-main);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-sm);
}

.new-action-btn:hover {
  background: var(--sidebar-hover);
  border-color: #d1d5db;
}

.nav-section {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-section-title {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 8px 10px 4px 10px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 10px;
  font-size: 0.825rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius);
  transition: all 0.15s ease;
}

.nav-item:hover {
  background-color: var(--sidebar-hover);
  color: var(--text-main);
}

.nav-item.active {
  background-color: var(--sidebar-active);
  color: var(--text-main);
  font-weight: 600;
}

.sidebar-footer {
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

.user-profile-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--radius);
  color: var(--text-main);
  font-size: 0.8rem;
  background: transparent;
  cursor: pointer;
}

.user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
}

/* Main Content Wrapper */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #ffffff;
}

/* Top Bar (Minimal Breadcrumb / Actions) */
header.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px;
  border-bottom: 1px solid var(--border);
  background: #ffffff;
  position: sticky;
  top: 0;
  z-index: 30;
}

.top-bar-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
}

.top-bar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Main Body Content */
main.main-body {
  padding: 20px 24px;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

/* Compact Cards (ChatGPT style minimal borders) */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-card);
}

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

.card-header h2, .card-header h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Compact Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

@media (min-width: 768px) {
  .metrics-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
  }
}

.metric-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-sm);
}

.metric-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.metric-val {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.15;
}

.metric-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Compact Buttons (User requested: buttons compact kara) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 5px 11px;
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
  line-height: 1.2;
  white-space: nowrap;
}

.btn-sm {
  padding: 3px 8px;
  font-size: 0.75rem;
  border-radius: var(--radius-sm);
}

.btn-primary {
  background: var(--dark-btn);
  color: #ffffff;
  border-color: var(--dark-btn);
}

.btn-primary:hover {
  background: var(--dark-btn-hover);
  border-color: var(--dark-btn-hover);
}

.btn-secondary {
  background: #ffffff;
  color: var(--text-main);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: #f9fafb;
  border-color: #d1d5db;
}

.btn-success {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.btn-success:hover {
  background: var(--primary-hover);
}

.btn-danger {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fca5a5;
}

.btn-danger:hover {
  background: #fecaca;
}

.btn-outline-primary {
  background: transparent;
  border-color: var(--border);
  color: var(--text-main);
}

.btn-outline-primary:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

/* Compact Form Controls */
.form-group {
  margin-bottom: 0.75rem;
}

.form-label {
  display: block;
  font-size: 0.775rem;
  font-weight: 600;
  margin-bottom: 3px;
  color: #374151;
}

.form-control, .form-select {
  width: 100%;
  padding: 6px 10px;
  font-size: 0.825rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background-color: #ffffff;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.15s ease;
}

.form-control:focus, .form-select:focus {
  border-color: var(--dark-btn);
  box-shadow: 0 0 0 2px rgba(24, 24, 27, 0.08);
}

.grid-2 { display: grid; grid-template-columns: 1fr; gap: 8px; }
.grid-3 { display: grid; grid-template-columns: 1fr; gap: 8px; }
.grid-4 { display: grid; grid-template-columns: 1fr; gap: 8px; }

@media (min-width: 640px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* Tables (Minimalist ChatGPT style) */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.8rem;
}

.data-table th {
  background: #f9fafb;
  color: #4b5563;
  font-weight: 600;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-light);
  color: #1f2937;
  vertical-align: middle;
}

.data-table tr:hover {
  background-color: #fbfbfc;
}

/* Subtle Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  font-size: 0.7rem;
  font-weight: 500;
}

.badge-waiting { background: #fef3c7; color: #92400e; }
.badge-consulting { background: #e0f2fe; color: #0369a1; }
.badge-completed { background: #dcfce7; color: #166534; }
.badge-cancelled { background: #fee2e2; color: #991b1b; }
.badge-paid { background: #dcfce7; color: #166534; }
.badge-partial { background: #fef3c7; color: #92400e; }
.badge-unpaid { background: #fee2e2; color: #991b1b; }

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal-content {
  background: #ffffff;
  border-radius: var(--radius-lg);
  max-width: 540px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
  padding: 1.25rem;
  border: 1px solid var(--border);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 8px;
  margin-bottom: 12px;
}

.close-btn {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--text-muted);
}

/* Quick Action Chips */
.chip {
  display: inline-block;
  background: #f3f4f6;
  color: #374151;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  font-size: 0.725rem;
  cursor: pointer;
  margin: 2px;
  border: 1px solid #e5e7eb;
  transition: all 0.15s;
}

.chip:hover {
  background: #e5e7eb;
  color: #111827;
}

/* Mobile Bottom Navigation (Visible on mobile only) */
.mobile-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #ffffff;
  border-top: 1px solid var(--border);
  display: none;
  justify-content: space-around;
  padding: 6px 0;
  z-index: 99;
}

@media (max-width: 767px) {
  aside.sidebar {
    display: none;
  }
  .mobile-nav {
    display: flex;
  }
  body {
    padding-bottom: 56px;
  }
  main.main-body {
    padding: 12px;
  }
  header.top-bar {
    padding: 8px 14px;
  }
}

.mob-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.7rem;
  padding: 2px 8px;
}

.mob-item .icon {
  font-size: 1.15rem;
  margin-bottom: 1px;
}

.mob-item.active {
  color: var(--dark-btn);
  font-weight: 600;
}

/* Table Pagination & Enhancement Styles */
.table-pagination-bar {
  background: #fdfdfd;
}

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

.sort-indicator {
  transition: color 0.15s ease;
}

.badge-active {
  background: #dcfce7;
  color: #166534;
}

.badge-inactive {
  background: #fee2e2;
  color: #991b1b;
}

.dept-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  font-size: 0.725rem;
  font-weight: 500;
  color: #334155;
}

/* Print Styles */
@media print {
  body { background: #ffffff !important; padding: 0 !important; }
  aside.sidebar, header.top-bar, .mobile-nav, .no-print, .btn, .new-action-btn { display: none !important; }
  .main-wrapper, main.main-body { padding: 0 !important; max-width: 100% !important; }
  .card { border: none !important; box-shadow: none !important; padding: 0 !important; }
}
