/* ============================================================
   DOCTORMED WEB — Dark Futuristic Theme
   Orbitron + Exo 2 | Cyan #00d4ff | Gold #ffd700
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Exo+2:wght@300;400;500;600;700&display=swap');

:root {
  --bg-primary:    #0a0e1a;
  --bg-secondary:  #0d1224;
  --bg-card:       #111827;
  --bg-card-hover: #1a2235;
  --bg-input:      #0d1629;
  --border:        #1e3a5f;
  --border-glow:   #00d4ff44;
  --cyan:          #00d4ff;
  --cyan-dim:      #00d4ff88;
  --cyan-dark:     #0099bb;
  --gold:          #ffd700;
  --gold-dim:      #ffd70088;
  --red:           #ff4757;
  --green:         #2ed573;
  --orange:        #ffa502;
  --text-primary:  #e8f4f8;
  --text-secondary:#8da9be;
  --text-muted:    #4a6a7a;
  --shadow-cyan:   0 0 20px #00d4ff33;
  --shadow-card:   0 4px 24px #00000088;
  --radius:        10px;
  --radius-lg:     16px;
  --transition:    0.25s ease;
}

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

html, body {
  min-height: 100vh;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Exo 2', sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--cyan-dim); }

/* ── Typography ────────────────────────────────────────────── */
h1, h2, h3, .orbitron { font-family: 'Orbitron', monospace; }
h1 { font-size: 1.8rem; font-weight: 900; color: var(--cyan); }
h2 { font-size: 1.4rem; font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 700; }
a  { color: var(--cyan); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--gold); }

/* ── Inputs ────────────────────────────────────────────────── */
input, select, textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  color: var(--text-primary);
  font-family: 'Exo 2', sans-serif;
  font-size: 14px;
  transition: var(--transition);
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px var(--border-glow);
}
input::placeholder { color: var(--text-muted); }
label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.form-group { margin-bottom: 16px; }
.input-icon { position: relative; }
.input-icon i {
  position: absolute; left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted); font-size: 16px;
}
.input-icon input { padding-left: 40px; }

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 11px 24px;
  border-radius: var(--radius); border: none; cursor: pointer;
  font-family: 'Exo 2', sans-serif; font-weight: 600; font-size: 14px;
  transition: var(--transition); text-decoration: none; white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--cyan), var(--cyan-dark));
  color: #000; box-shadow: var(--shadow-cyan);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 0 30px #00d4ff55; }
.btn-secondary {
  background: transparent; color: var(--cyan);
  border: 1px solid var(--cyan);
}
.btn-secondary:hover { background: var(--border-glow); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #ff2f40; }
.btn-gold { background: linear-gradient(135deg, var(--gold), #cc9900); color: #000; }
.btn-sm { padding: 7px 14px; font-size: 12px; }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
}
.card:hover { border-color: var(--border-glow); }
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

/* ── Badges ────────────────────────────────────────────────── */
.badge {
  display: inline-block; padding: 3px 10px;
  border-radius: 20px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.badge-cyan   { background: #00d4ff22; color: var(--cyan); border: 1px solid var(--cyan-dim); }
.badge-gold   { background: #ffd70022; color: var(--gold); border: 1px solid var(--gold-dim); }
.badge-green  { background: #2ed57322; color: var(--green); border: 1px solid #2ed57388; }
.badge-red    { background: #ff475722; color: var(--red);   border: 1px solid #ff475788; }
.badge-orange { background: #ffa50222; color: var(--orange); border: 1px solid #ffa50288; }

/* ── Table ─────────────────────────────────────────────────── */
.dm-table { width: 100%; border-collapse: collapse; }
.dm-table th {
  text-align: left; padding: 10px 14px;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-muted); border-bottom: 1px solid var(--border);
}
.dm-table td {
  padding: 12px 14px; border-bottom: 1px solid var(--border);
  color: var(--text-primary); font-size: 14px;
}
.dm-table tr:hover td { background: var(--bg-card-hover); }
.dm-table tr:last-child td { border-bottom: none; }

/* ── Modal ─────────────────────────────────────────────────── */
.dm-modal-overlay {
  position: fixed; inset: 0; background: #000000cc;
  display: none; align-items: center; justify-content: center;
  z-index: 1000; backdrop-filter: blur(4px);
}
.dm-modal-overlay.open { display: flex; }
.dm-modal {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px;
  width: 90%; max-width: 520px; max-height: 90vh; overflow-y: auto;
  box-shadow: 0 20px 60px #000000bb;
  animation: modalIn 0.25s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(-20px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.dm-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
}
.dm-modal-close {
  background: none; border: none; color: var(--text-muted);
  font-size: 22px; cursor: pointer; padding: 4px;
  transition: var(--transition); line-height: 1;
}
.dm-modal-close:hover { color: var(--red); }

/* ── Toast ─────────────────────────────────────────────────── */
.dm-toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 20px;
  font-size: 14px; z-index: 9999;
  transform: translateX(120%); transition: transform 0.35s ease;
  box-shadow: var(--shadow-card);
}
.dm-toast.show { transform: translateX(0); }
.dm-toast-info    { border-left: 3px solid var(--cyan); }
.dm-toast-success { border-left: 3px solid var(--green); }
.dm-toast-error   { border-left: 3px solid var(--red); }
.dm-toast-warning { border-left: 3px solid var(--orange); }

/* ── Loader ────────────────────────────────────────────────── */
#dm-loader {
  position: fixed; inset: 0; background: #0a0e1add;
  display: none; align-items: center; justify-content: center;
  z-index: 9998; backdrop-filter: blur(3px);
}
.dm-loader-inner { text-align: center; }
.dm-spinner {
  width: 48px; height: 48px; border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--cyan);
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }
#dm-loader p { color: var(--cyan); font-family: 'Orbitron', monospace; font-size: 12px; }

/* ── Sidebar Layout ────────────────────────────────────────── */
.dm-layout {
  display: flex; min-height: 100vh;
}
.dm-sidebar {
  width: 240px; min-width: 240px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: fixed; height: 100vh; z-index: 100;
  transition: var(--transition);
}
.dm-sidebar-logo {
  padding: 20px 16px;
  border-bottom: 1px solid var(--border);
}
.dm-sidebar-logo .logo-title {
  font-family: 'Orbitron', monospace;
  font-size: 1.1rem; font-weight: 900;
  color: var(--cyan); letter-spacing: 1px;
}
.dm-sidebar-logo .logo-sub {
  font-size: 11px; color: var(--text-muted); margin-top: 2px;
}
.dm-sidebar-clinic {
  padding: 12px 16px; font-size: 12px;
  color: var(--gold); font-weight: 600;
  border-bottom: 1px solid var(--border);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dm-sidebar-nav { flex: 1; overflow-y: auto; padding: 8px 0; }
.dm-nav-section {
  padding: 10px 16px 4px;
  font-size: 10px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--text-muted); font-weight: 700;
}
.dm-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; cursor: pointer;
  color: var(--text-secondary); font-size: 14px; font-weight: 500;
  transition: var(--transition); border-left: 3px solid transparent;
  text-decoration: none;
}
.dm-nav-item:hover { color: var(--text-primary); background: var(--bg-card-hover); }
.dm-nav-item.active {
  color: var(--cyan); border-left-color: var(--cyan);
  background: var(--border-glow);
}
.dm-nav-item i { width: 18px; text-align: center; font-size: 16px; }
.dm-sidebar-user {
  padding: 14px 16px; border-top: 1px solid var(--border);
}
.dm-user-info { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.dm-user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan), var(--cyan-dark));
  display: flex; align-items: center; justify-content: center;
  font-family: 'Orbitron', monospace; font-weight: 700;
  color: #000; font-size: 14px; flex-shrink: 0;
}
.dm-user-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-user-role { font-size: 11px; color: var(--text-muted); }
.dm-main {
  flex: 1; margin-left: 240px;
  display: flex; flex-direction: column; min-height: 100vh;
}
.dm-topbar {
  background: var(--bg-secondary); border-bottom: 1px solid var(--border);
  padding: 14px 24px; display: flex;
  align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 90;
}
.dm-page-title { font-family: 'Orbitron', monospace; font-size: 1rem; color: var(--cyan); }
.dm-content { flex: 1; padding: 24px; }

/* ── Stats Grid ────────────────────────────────────────────── */
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px; margin-bottom: 24px;
}
.stat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px;
  display: flex; align-items: center; gap: 16px;
  transition: var(--transition);
}
.stat-card:hover { border-color: var(--cyan-dim); transform: translateY(-2px); }
.stat-icon {
  width: 48px; height: 48px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.stat-icon.cyan   { background: #00d4ff18; color: var(--cyan); }
.stat-icon.gold   { background: #ffd70018; color: var(--gold); }
.stat-icon.green  { background: #2ed57318; color: var(--green); }
.stat-icon.orange { background: #ffa50218; color: var(--orange); }
.stat-value { font-family: 'Orbitron', monospace; font-size: 1.6rem; font-weight: 700; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ── Content Grid ──────────────────────────────────────────── */
.content-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 900px) { .content-grid { grid-template-columns: 1fr; } }

/* ── Empty State ───────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 48px 24px;
  color: var(--text-muted);
}
.empty-state i { font-size: 48px; margin-bottom: 16px; display: block; }
.empty-state h3 { color: var(--text-secondary); margin-bottom: 8px; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
  .dm-sidebar { transform: translateX(-100%); }
  .dm-sidebar.open { transform: translateX(0); }
  .dm-main { margin-left: 0; }
  .dm-content { padding: 16px; }
}

/* ── Glow Divider ──────────────────────────────────────────── */
.glow-line {
  height: 1px; background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  margin: 24px 0; opacity: 0.4;
}

/* ── Search Bar ────────────────────────────────────────────── */
.search-bar {
  display: flex; gap: 12px; margin-bottom: 20px; align-items: center;
}
.search-bar .input-icon { flex: 1; }

/* ── Tabs ──────────────────────────────────────────────────── */
.dm-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.dm-tab {
  padding: 10px 20px; cursor: pointer; font-size: 13px; font-weight: 600;
  color: var(--text-muted); border-bottom: 2px solid transparent;
  transition: var(--transition);
}
.dm-tab:hover { color: var(--text-primary); }
.dm-tab.active { color: var(--cyan); border-bottom-color: var(--cyan); }

/* ── Prontuário ────────────────────────────────────────────── */
.prontuario-item {
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; margin-bottom: 12px;
  transition: var(--transition);
}
.prontuario-item:hover { border-color: var(--cyan-dim); }
.prontuario-meta {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px;
}
.prontuario-date { font-size: 12px; color: var(--text-muted); }
.prontuario-body { font-size: 14px; line-height: 1.7; color: var(--text-secondary); }

/* ── Agenda ────────────────────────────────────────────────── */
.agenda-item {
  display: flex; gap: 16px; align-items: flex-start;
  padding: 14px; border-radius: var(--radius);
  border: 1px solid var(--border); margin-bottom: 10px;
  background: var(--bg-secondary); transition: var(--transition);
}
.agenda-item:hover { border-color: var(--cyan-dim); }
.agenda-hora {
  font-family: 'Orbitron', monospace; font-size: 1rem;
  color: var(--cyan); min-width: 60px; font-weight: 700;
}
.agenda-info h4 { font-size: 14px; margin-bottom: 4px; }
.agenda-info p  { font-size: 12px; color: var(--text-muted); }
