/* Musteri Cloud - uygulama stilleri */
:root {
  --mc-brand: #0f766e;
  --mc-brand-dark: #0d5c56;
  --mc-brand-soft: #ccfbf1;
  --mc-ink: #0f172a;
  --mc-muted: #64748b;
  --mc-line: #e2e8f0;
  --mc-bg: #eef2ff;
  --mc-surface: #ffffff;
  --mc-sidebar: linear-gradient(180deg, #0f766e 0%, #0e7490 45%, #1d4ed8 100%);
  --mc-danger: #dc2626;
}

html, body { overflow-x: hidden; max-width: 100%; }

body {
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: var(--mc-ink);
  background:
    radial-gradient(ellipse 70% 50% at 10% -10%, rgba(13, 148, 136, 0.22), transparent),
    radial-gradient(ellipse 50% 40% at 100% 0%, rgba(37, 99, 235, 0.16), transparent),
    radial-gradient(ellipse 40% 30% at 80% 100%, rgba(234, 88, 12, 0.08), transparent),
    #f0f4ff;
}

.mc-brand { color: var(--mc-brand); }

/* ===== SIDEBAR (vivid, no plain white) ===== */
#mc-sidebar {
  background: var(--mc-sidebar) !important;
  border-right: none !important;
  color: #fff;
  box-shadow: 4px 0 24px rgba(15, 23, 42, 0.18);
}
#mc-sidebar .border-b, #mc-sidebar .border-t { border-color: rgba(255,255,255,0.15) !important; }
#mc-sidebar .sidebar-brand { color: #fff; font-weight: 800; letter-spacing: -0.02em; }
#mc-sidebar #sidebar-business { color: rgba(255,255,255,0.75) !important; }
#mc-sidebar .sidebar-foot { color: rgba(255,255,255,0.55) !important; }

.nav-stack { display: flex; flex-direction: column; gap: 0.12rem; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.38rem 0.7rem;
  border-radius: 0.55rem;
  color: rgba(255,255,255,0.88);
  font-weight: 600;
  text-decoration: none;
  transition: background-color .15s ease, color .15s ease, transform .12s ease;
}
.nav-link .nav-ico {
  width: 28px; height: 28px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  background: rgba(255,255,255,0.14);
}
.nav-link .nav-ico svg {
  width: 15px; height: 15px; stroke: #fff; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: 1;
}
.nav-link:hover {
  background: rgba(255,255,255,0.14);
  color: #fff;
  transform: translateX(2px);
}
.nav-link.nav-link-active {
  background: rgba(255,255,255,0.22);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.25);
}
.nav-link.nav-link-active .nav-ico { background: #fbbf24; }
.nav-link.nav-link-active .nav-ico svg { stroke: #78350f; }

.nav-ico-dash { background: #f59e0b !important; }
.nav-ico-cust { background: #38bdf8 !important; }
.nav-ico-appt { background: #a78bfa !important; }
.nav-ico-svc  { background: #34d399 !important; }
.nav-ico-prod { background: #fb7185 !important; }
.nav-ico-cash { background: #fbbf24 !important; }
.nav-ico-bank { background: #60a5fa !important; }
.nav-ico-cari { background: #c084fc !important; }
.nav-ico-hiz  { background: #2dd4bf !important; }
.nav-ico-set  { background: #94a3b8 !important; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 6px; color: #64748b;
}
.icon-btn:hover { background: #f1f5f9; color: #0f172a; }

.tab-btn {
  padding: 0.5rem 1rem; font-size: 0.875rem; color: #64748b;
  border-bottom: 2px solid transparent; white-space: nowrap;
}
.tab-btn.active-tab { color: var(--mc-brand); border-bottom-color: var(--mc-brand); font-weight: 600; }

.mc-card {
  background: var(--mc-surface);
  border: 1px solid rgba(148,163,184,0.25);
  border-radius: 1rem;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.mc-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  background: var(--mc-brand); color: #fff; font-weight: 600; font-size: 0.875rem;
  padding: 0.55rem 1rem; border-radius: 0.55rem; border: none; cursor: pointer;
}
.mc-btn:hover { background: var(--mc-brand-dark); }
.mc-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.mc-btn-ghost { background: #e2e8f0; color: #334155; }
.mc-btn-ghost:hover { background: #cbd5e1; }
.mc-btn-danger { background: var(--mc-danger); }

.mc-input, .mc-select, .mc-textarea {
  width: 100%; border: 1px solid #cbd5e1; border-radius: 0.55rem;
  padding: 0.5rem 0.75rem; font-size: 0.9rem; background: #fff;
}
.mc-input:focus, .mc-select:focus, .mc-textarea:focus {
  outline: none; border-color: var(--mc-brand);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

.mc-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.mc-table th {
  text-align: left; padding: 0.65rem 0.75rem; color: var(--mc-muted);
  font-weight: 600; border-bottom: 1px solid var(--mc-line); background: #f8fafc;
  cursor: pointer; user-select: none; white-space: nowrap;
}
.mc-table th.sortable:hover { color: var(--mc-brand); }
.mc-table th .sort-ind { opacity: 0.4; font-size: 0.7rem; margin-left: 4px; }
.mc-table th.sorted .sort-ind { opacity: 1; color: var(--mc-brand); }
.mc-table td { padding: 0.7rem 0.75rem; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.mc-table tr:hover td { background: #f8fafc; }

.badge {
  display: inline-block; padding: 0.15rem 0.5rem; border-radius: 999px;
  font-size: 0.7rem; font-weight: 600;
}
.badge-ok { background: #d1fae5; color: #065f46; }
.badge-warn { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #e0f2fe; color: #075985; }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15,23,42,.5);
  z-index: 40; display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.modal-panel {
  background: #fff; border-radius: 1rem; width: 100%; max-width: 560px;
  max-height: 90vh; overflow: auto; box-shadow: 0 24px 48px rgba(0,0,0,.22);
}
.modal-panel.modal-wide { max-width: 720px; }

.stat-card {
  border-radius: 1rem; padding: 1.1rem 1.15rem; color: #fff;
  box-shadow: 0 10px 28px rgba(15,23,42,.12);
  position: relative; overflow: hidden;
}
.stat-card::after {
  content: ''; position: absolute; right: -12px; top: -12px;
  width: 88px; height: 88px; border-radius: 50%; background: rgba(255,255,255,.15);
}
.stat-card .label { font-size: 0.75rem; opacity: 0.9; font-weight: 600; }
.stat-card .value { font-size: 1.7rem; font-weight: 800; margin-top: 0.25rem; letter-spacing: -0.02em; }
.stat-teal { background: linear-gradient(135deg, #0d9488, #14b8a6); }
.stat-blue { background: linear-gradient(135deg, #2563eb, #38bdf8); }
.stat-violet { background: linear-gradient(135deg, #7c3aed, #a78bfa); }
.stat-amber { background: linear-gradient(135deg, #d97706, #fbbf24); }
.stat-rose { background: linear-gradient(135deg, #e11d48, #fb7185); }

.money-pos { color: #047857; font-weight: 600; }
.money-neg { color: #b91c1c; font-weight: 600; }

.slot-btn {
  padding: 0.4rem 0.55rem; border-radius: 0.4rem; font-size: 0.8rem;
  border: 1px solid var(--mc-line); background: #fff;
}
.slot-btn.musait { cursor: pointer; }
.slot-btn.musait:hover, .slot-btn.selected {
  border-color: var(--mc-brand); background: var(--mc-brand-soft); color: var(--mc-brand-dark);
}
.slot-btn.dolu { opacity: 0.4; cursor: not-allowed; text-decoration: line-through; }

/* Randevu kart / takvim */
.appt-card {
  border-radius: 0.9rem; border: 1px solid #e2e8f0; padding: 0.85rem;
  background: #fff; box-shadow: 0 4px 12px rgba(15,23,42,.04);
}
.appt-card .time { font-weight: 800; color: #0f766e; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-head { text-align: center; font-size: 0.7rem; font-weight: 700; color: #64748b; padding: 0.35rem; }
.cal-cell {
  min-height: 88px; border-radius: 0.55rem; border: 1px solid #e2e8f0;
  background: #fff; padding: 0.3rem; font-size: 0.7rem;
}
.cal-cell.muted { background: #f8fafc; color: #94a3b8; }
.cal-cell.today { border-color: #0d9488; box-shadow: inset 0 0 0 1px #0d9488; }
.cal-chip {
  display: block; margin-top: 2px; padding: 2px 4px; border-radius: 4px;
  background: #ccfbf1; color: #115e59; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.account-tile {
  border-radius: 1rem; padding: 1rem 1.1rem; border: 1px solid #e2e8f0; background: #fff;
  transition: box-shadow .15s ease, transform .12s ease;
}
.account-tile:hover { box-shadow: 0 10px 24px rgba(15,23,42,.08); transform: translateY(-1px); }
.account-tile .bal { font-size: 1.45rem; font-weight: 800; letter-spacing: -0.02em; }

.wizard-steps { display: flex; gap: 0.4rem; margin-bottom: 1rem; flex-wrap: wrap; }
.wizard-steps span {
  font-size: 0.7rem; font-weight: 700; padding: 0.25rem 0.55rem; border-radius: 999px;
  background: #e2e8f0; color: #64748b;
}
.wizard-steps span.on { background: #0f766e; color: #fff; }

.mc-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}
.mc-table { min-width: 560px; width: 100%; }
.mc-table th.num,
.mc-table td.num,
.mc-table .num {
  text-align: right !important;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.mc-table td.money-pos,
.mc-table td.money-neg { text-align: right; font-variant-numeric: tabular-nums; }
.detay-fields {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 1rem;
}
.detay-fields.detay-fields-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.5rem;
  align-items: start;
}
.detay-fields .df-col {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-width: 0;
}
.detay-fields .df-row {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}
.detay-fields .df-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #64748b;
}
.detay-fields .df-value {
  font-size: 0.95rem;
  color: #0f172a;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}

@media (max-width: 768px) {
  .mc-table-wrap { overflow-x: auto; margin: 0 -0.25rem; padding: 0 0.25rem; }
  .hide-mobile { display: none !important; }
  .cal-cell { min-height: 64px; }
  .detay-fields.detay-fields-2col {
    grid-template-columns: 1fr;
  }
  .list-toolbar {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }
  .list-toolbar .tb-left,
  .list-toolbar .tb-right {
    width: auto;
    flex: 1 1 auto;
    min-width: 0;
  }
  .list-toolbar .tb-right {
    margin-left: auto !important;
    flex: 0 1 auto;
  }
  .list-toolbar .mc-input,
  .list-toolbar .mc-select {
    min-width: 7.5rem !important;
    max-width: 11rem !important;
    width: auto !important;
    flex: 0 1 auto;
  }
  .list-pager-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .list-pager .pager-total,
  .list-pager .pager-excel,
  .list-pager .page-btns { justify-self: center; }
  .list-pager .page-btns { justify-content: center; }
  .act-group {
    flex-direction: row !important;
    flex-wrap: nowrap !important;
  }
  .modal-panel { width: calc(100vw - 1.25rem) !important; max-width: 100%; margin: 0.5rem; }
  main { padding-left: 0.75rem !important; padding-right: 0.75rem !important; }
}

/* RTL (Arabic) */
html[dir="rtl"],
body.mc-rtl {
  direction: rtl;
}
html[dir="rtl"] #mc-sidebar,
body.mc-rtl #mc-sidebar {
  left: auto;
  right: 0;
  transform: translateX(100%);
}
@media (min-width: 768px) {
  html[dir="rtl"] #mc-sidebar,
  body.mc-rtl #mc-sidebar {
    transform: none;
  }
  html[dir="rtl"] .md\:ml-64,
  body.mc-rtl .md\:ml-64 {
    margin-left: 0 !important;
    margin-right: 16rem;
  }
}
html[dir="rtl"] #user-menu-dropdown,
body.mc-rtl #user-menu-dropdown {
  right: auto;
  left: 0;
}
html[dir="rtl"] .list-toolbar,
body.mc-rtl .list-toolbar {
  flex-direction: row-reverse;
}
html[dir="rtl"] .tb-left,
body.mc-rtl .tb-left {
  flex-direction: row-reverse;
}
html[dir="rtl"] .modal-head,
body.mc-rtl .modal-head {
  flex-direction: row-reverse;
}
