/* ============================================================
   ToothCare.pk - Master Stylesheet v1.0
   Performance: Single file, minimal CSS, Bootstrap-first
   ============================================================ */

/* ---- CSS Variables ---- */
:root {
  --tc-primary:    #04316f;
  --tc-primary-d:  #0052a3;
  --tc-sidebar:    #0a1628;
  --tc-sidebar-2:  #0f1f3d;
  --tc-surface:    #ffffff;
  --tc-bg:         #f0f4f8;
  --tc-border:     #e2e8f0;
  --tc-text:       #1a202c;
  --tc-text-2:     #4a5568;
  --tc-text-3:     #718096;
  --tc-success:    #16a34a;
  --tc-danger:     #dc2626;
  --tc-warning:    #d97706;
  --tc-info:       #0891b2;
  --tc-radius:     10px;
  --tc-shadow:     0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --tc-shadow-md:  0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --tc-glass:      rgba(255,255,255,.08);
  --tc-glass-b:    rgba(255,255,255,.12);
  --transition:    .18s ease;
}

[data-theme="dark"] {
  --tc-surface:  #1e2a3a;
  --tc-bg:       #111827;
  --tc-border:   #2d3748;
  --tc-text:     #f7fafc;
  --tc-text-2:   #cbd5e0;
  --tc-text-3:   #a0aec0;
  --tc-shadow:   0 1px 3px rgba(0,0,0,.3);
  --tc-shadow-md:0 4px 6px rgba(0,0,0,.3);
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--tc-bg);
  color: var(--tc-text);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}

/* ---- Layout ---- */
.tc-wrapper   { display: flex; min-height: 100vh; }
.tc-content   { flex: 1; min-width: 0; display: flex; flex-direction: column; margin-left: 240px; transition: margin var(--transition); }
.tc-main      { flex: 1; padding: 24px; }
.sidebar-collapsed .tc-content { margin-left: 64px; }

@media (max-width: 768px) {
  .tc-content { margin-left: 0; }
  .tc-main    { padding: 16px; }
}

/* ---- Sidebar ---- */
.tc-sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: 240px;
  background: linear-gradient(135deg, #04316f 0%, #19aeab 100%);
  display: flex; flex-direction: column;
  z-index: 1000; transition: width var(--transition);
  overflow: hidden;
}
.sidebar-collapsed .tc-sidebar { width: 64px; }

.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 16px; border-bottom: 1px solid var(--tc-glass-b);
  text-decoration: none; color: #fff; flex-shrink: 0;
}

.sidebar-brand-icon img {
    width: 200px;
    height: 62px;
}
/*.sidebar-brand-icon {
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--tc-primary); display: flex; align-items: center;
  justify-content: center; flex-shrink: 0;
}*/
.sidebar-brand-text { white-space: nowrap; overflow: hidden; }
.sidebar-brand-name { font-size: 15px; font-weight: 700; color: #fff; line-height: 1.2; }
.sidebar-brand-tag  { font-size: 10px; color: rgba(255,255,255,.5); }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 8px 0; }
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--tc-glass-b); border-radius: 3px; }

.nav-section { padding: 12px 16px 4px; font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .08em; color: rgba(255,255,255,.3);
  white-space: nowrap; overflow: hidden; }
.sidebar-collapsed .nav-section { opacity: 0; }

.nav-item { display: flex; align-items: center; gap: 10px;
  padding: 9px 16px; color: rgba(255,255,255,.65); text-decoration: none;
  border-radius: 0; transition: all var(--transition); position: relative;
  white-space: nowrap; }
.nav-item:hover { background: var(--tc-glass); color: #fff; }
.nav-item.active { background: var(--tc-primary); color: #fff; }
.nav-item.active::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: #fff; border-radius: 0 2px 2px 0; }
.nav-icon { width: 18px; height: 18px; flex-shrink: 0; }
.nav-label { font-size: 13px; font-weight: 500; }
.nav-badge { margin-left: auto; background: var(--tc-danger); color: #fff; font-size: 10px;
  font-weight: 700; padding: 1px 6px; border-radius: 10px; }
.sidebar-collapsed .nav-label, .sidebar-collapsed .nav-badge { display: none; }

.sidebar-footer { padding: 12px 16px; border-top: 1px solid var(--tc-glass-b); }
.user-pill { display: flex; align-items: center; gap: 8px; color: rgba(255,255,255,.7); }

/* ---- Topbar ---- */
.tc-topbar {
  background: var(--tc-surface); border-bottom: 1px solid var(--tc-border);
  padding: 0 24px; height: 60px; display: flex; align-items: center;
  justify-content: space-between; gap: 16px; position: sticky; top: 0; z-index: 100;
  box-shadow: var(--tc-shadow);
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.page-title { font-size: 16px; font-weight: 600; color: var(--tc-text); }

.btn-icon { width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--tc-border);
  background: transparent; display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--tc-text-2); transition: all var(--transition); }
.btn-icon:hover { background: var(--tc-bg); color: var(--tc-text); }
.btn-toggle { width: 36px; height: 36px; border: none; background: transparent;
  cursor: pointer; color: var(--tc-text-2); border-radius: 6px; }
.btn-toggle:hover { background: var(--tc-bg); }

.notif-btn { position: relative; }
.notif-dot { position: absolute; top: 5px; right: 5px; width: 8px; height: 8px;
  background: var(--tc-danger); border-radius: 50%; border: 2px solid var(--tc-surface); }

/* ---- Cards ---- */
.card { background: var(--tc-surface); border: 1px solid var(--tc-border);
  border-radius: var(--tc-radius); box-shadow: var(--tc-shadow); }
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--tc-border);
  display: flex; align-items: center; justify-content: space-between; }
.card-title { font-size: 14px; font-weight: 600; color: var(--tc-text); margin: 0; }
.card-body  { padding: 20px; }

/* ---- KPI Cards ---- */
.kpi-card { background: var(--tc-surface); border: 1px solid var(--tc-border);
  border-radius: var(--tc-radius); padding: 20px; box-shadow: var(--tc-shadow);
  display: flex; align-items: center; gap: 16px; transition: box-shadow var(--transition); }
.kpi-card:hover { box-shadow: var(--tc-shadow-md); }
.kpi-icon { width: 48px; height: 48px; border-radius: 12px; display: flex;
  align-items: center; justify-content: center; flex-shrink: 0; }
.kpi-icon svg { width: 24px; height: 24px; }
.kpi-value { font-size: 26px; font-weight: 700; color: var(--tc-text); line-height: 1.1; }
.kpi-label { font-size: 12px; color: var(--tc-text-3); margin-top: 2px; }
.kpi-trend { font-size: 11px; font-weight: 600; margin-top: 4px; }
.kpi-trend.up   { color: var(--tc-success); }
.kpi-trend.down { color: var(--tc-danger); }

/* ---- Avatar ---- */
.avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; color: #fff; flex-shrink: 0; }
.avatar-sm { width: 28px; height: 28px; font-size: 11px; }
.avatar-lg { width: 56px; height: 56px; font-size: 18px; }
.avatar-primary { background: var(--tc-primary); }
.avatar-success { background: var(--tc-success); }
.avatar-danger  { background: var(--tc-danger); }
.avatar-warning { background: var(--tc-warning); }
.avatar-info    { background: var(--tc-info); }

/* ---- Table ---- */
.tc-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.tc-table th { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
  color: var(--tc-text-3); background: var(--tc-bg); padding: 10px 16px;
  border-bottom: 1px solid var(--tc-border); }
.tc-table td { padding: 12px 16px; border-bottom: 1px solid var(--tc-border);
  color: var(--tc-text); vertical-align: middle; }
.tc-table tbody tr:last-child td { border-bottom: none; }
.tc-table tbody tr:hover td { background: rgba(0,102,204,.03); }
.table-wrap { overflow-x: auto; border-radius: var(--tc-radius); border: 1px solid var(--tc-border); background: var(--tc-surface); }

/* ---- Forms ---- */
.tc-label { font-size: 12px; font-weight: 600; color: var(--tc-text-2); margin-bottom: 4px; display: block; }
.tc-input {
  width: 100%; padding: 8px 12px; border: 1px solid var(--tc-border);
  border-radius: 7px; background: var(--tc-surface); color: var(--tc-text);
  font-size: 13px; transition: border-color var(--transition);
  appearance: none; outline: none;
}
.tc-input:focus { border-color: var(--tc-primary); box-shadow: 0 0 0 3px rgba(0,102,204,.1); }
.tc-select { background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e"); background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; padding-right: 32px; }

/* ---- Buttons ---- */
.tc-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px;
  border-radius: 7px; font-size: 13px; font-weight: 600; cursor: pointer;
  border: none; transition: all var(--transition); text-decoration: none; }
.tc-btn-primary { background: var(--tc-primary); color: #fff; }
.tc-btn-primary:hover { background: var(--tc-primary-d); color: #fff; }
.tc-btn-outline { background: transparent; border: 1px solid var(--tc-border); color: var(--tc-text-2); }
.tc-btn-outline:hover { border-color: var(--tc-primary); color: var(--tc-primary); }
.tc-btn-danger  { background: var(--tc-danger); color: #fff; }
.tc-btn-sm { padding: 5px 10px; font-size: 12px; }
.tc-btn svg { width: 15px; height: 15px; }

/* ---- Badge override ---- */
.badge { font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 6px; }

/* ---- Alert ---- */
.tc-alert { padding: 12px 16px; border-radius: var(--tc-radius); border-left: 4px solid;
  margin-bottom: 16px; font-size: 13px; }
.tc-alert-success { background: #f0fdf4; border-color: var(--tc-success); color: #166534; }
.tc-alert-danger  { background: #fef2f2; border-color: var(--tc-danger); color: #991b1b; }
.tc-alert-warning { background: #fffbeb; border-color: var(--tc-warning); color: #92400e; }
.tc-alert-info    { background: #ecfeff; border-color: var(--tc-info); color: #155e75; }

/* ---- Glassmorphism ---- */
.glass {
  background: var(--tc-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--tc-glass-b);
}

/* ---- Charts ---- */
.chart-wrap { position: relative; height: 240px; }

/* ---- Page header ---- */
.page-header { display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.page-header h1 { font-size: 20px; font-weight: 700; color: var(--tc-text); margin: 0; }

/* ---- Search bar ---- */
.search-wrap { position: relative; }
.search-wrap input { padding-left: 36px; }
.search-wrap svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: var(--tc-text-3); width: 16px; height: 16px; }

/* ---- Modal ---- */
.tc-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5);
  z-index: 1050; display: none; align-items: center; justify-content: center; }
.tc-modal-overlay.show { display: flex; }
.tc-modal { background: var(--tc-surface); border-radius: 12px; width: 90%; max-width: 560px;
  max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.2); }
.tc-modal-header { padding: 16px 20px; border-bottom: 1px solid var(--tc-border);
  display: flex; align-items: center; justify-content: space-between; }
.tc-modal-title { font-size: 16px; font-weight: 600; }
.tc-modal-body  { padding: 20px; }
.tc-modal-footer{ padding: 16px 20px; border-top: 1px solid var(--tc-border);
  display: flex; justify-content: flex-end; gap: 8px; }

/* ---- Stats row ---- */
.stat-item { text-align: center; }
.stat-item .val { font-size: 22px; font-weight: 700; color: var(--tc-text); }
.stat-item .lbl { font-size: 11px; color: var(--tc-text-3); text-transform: uppercase; letter-spacing: .05em; }

/* ---- Timeline ---- */
.timeline { position: relative; padding-left: 24px; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 0; bottom: 0; width: 2px; background: var(--tc-border); }
.timeline-item { position: relative; margin-bottom: 20px; }
.timeline-dot { position: absolute; left: -20px; top: 4px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--tc-primary); border: 2px solid var(--tc-surface); }
.timeline-content { font-size: 13px; }
.timeline-time { font-size: 11px; color: var(--tc-text-3); }

/* ---- Queue item ---- */
.queue-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  border-bottom: 1px solid var(--tc-border); }
.queue-item:last-child { border-bottom: none; }
.queue-num { width: 28px; height: 28px; border-radius: 50%; background: var(--tc-bg);
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--tc-text-3); flex-shrink: 0; }

/* ---- Login Page ---- */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #04316f 0%, #19aeab 100%); }
.login-card { background: #fff; backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,.1); border-radius: 16px;
  padding: 40px; width: 100%; max-width: 400px; }
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo img {width: 300px;height: 100px}
.login-logo-icon { width: 56px; height: 56px; background: var(--tc-primary); border-radius: 14px;
  display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; }
.login-logo-name { font-size: 22px; font-weight: 800; color: #fff; }
.login-logo-tag  { font-size: 12px; color: rgba(255,255,255,.5); }
.login-label { color: #19aeab; font-size: 12px; font-weight: 600; margin-bottom: 6px; display: block; }
.login-input { background: rgba(255,255,255,.08); border:1px solid #04316f;
  color: #04316f; border-radius: 8px; }
.login-input::placeholder { color:#04316f; }
.login-input:focus { border-color: var(--tc-primary); box-shadow: 0 0 0 3px rgba(0,102,204,.3); }

/* ---- Utilities ---- */
.text-muted { color: var(--tc-text-3) !important; }
.fs-xs { font-size: 11px; }
.fs-sm { font-size: 12px; }
.gap-xs { gap: 4px; }
.fw-600 { font-weight: 600; }
.divider { border-top: 1px solid var(--tc-border); margin: 16px 0; }
.tc-tooltip { position: relative; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .tc-sidebar { transform: translateX(-100%); }
  .tc-sidebar.open { transform: translateX(0); }
  .hide-mobile { display: none; }
  .kpi-card { padding: 14px; }
  .kpi-value { font-size: 22px; }
}

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

/* ---- Print ---- */
@media print {
  .tc-sidebar, .tc-topbar, .no-print { display: none !important; }
  .tc-content { margin-left: 0 !important; }
  .card { box-shadow: none !important; border: 1px solid #ddd !important; }
}
