/* ============================================
   ⚡ ARIZA TAKİP SİSTEMİ - Design System
   Elektrik Dağıtım Sektörü Teması
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── SLD (Canlı Tek Hat) Styles ─────────────────────── */
.sld-page { display:flex; flex-direction:column; height:100vh; background:#0a0f1a; padding:0; }
.sld-toolbar { display:flex; align-items:center; gap:10px; padding:10px 16px; background:rgba(10,15,30,.98); border-bottom:1px solid #1e3a5f; flex-shrink:0; flex-wrap:wrap; }
.sld-title { font-size:.8rem; font-weight:700; color:#00d4ff; letter-spacing:.05em; display:flex; align-items:center; gap:8px; }
.sld-badges { display:flex; gap:8px; flex-wrap:wrap; }
.sld-badge { font-size:.7rem; padding:3px 10px; border-radius:20px; font-weight:600; }
.sld-badge.on  { background:rgba(0,255,100,.12); color:#00ff64; border:1px solid #00ff6433; }
.sld-badge.off { background:rgba(255,80,80,.12); color:#ff5050; border:1px solid #ff505033; }
.sld-badge.ham { background:rgba(255,200,0,.12); color:#ffc800; border:1px solid #ffc80033; }
.sld-body { display:flex; flex:1; overflow:hidden; }
.sld-canvas-wrap { flex:1; overflow:auto; padding:16px; }
.sld-info-panel { width:240px; flex-shrink:0; background:rgba(10,15,30,.98); border-left:1px solid #1e3a5f; overflow-y:auto; padding:14px; }
.sld-info-section { margin-bottom:18px; }
.sld-info-title { font-size:.72rem; color:#00d4ff; text-transform:uppercase; letter-spacing:.06em; margin-bottom:8px; font-weight:600; }
.sld-info-item { font-size:.7rem; padding:4px 8px; margin:2px 0; border-radius:5px; display:flex; justify-content:space-between; align-items:center; }
.sld-info-item.on  { background:rgba(0,255,100,.06); color:#00ff64; }
.sld-info-item.off { background:rgba(255,80,80,.06); color:#ff6060; }
.sld-info-item.ham { background:rgba(255,200,0,.06); color:#ffc800; }

/* ── Trafo Bilgileri Styles ─────────────────────── */
.ti-header-card { display:flex; justify-content:space-between; align-items:flex-start; background:rgba(10,132,255,.06); border:1px solid rgba(10,132,255,.2); border-radius:14px; padding:16px 20px; margin-bottom:18px; gap:12px; flex-wrap:wrap; }
.ti-header-name { font-size:1.05rem; font-weight:700; }
.ti-header-sub  { font-size:.78rem; color:var(--text-secondary); margin-top:4px; }
.ti-status-badge { padding:5px 14px; border-radius:20px; font-size:.78rem; font-weight:700; background:rgba(48,209,88,.12); color:#30D158; border:1px solid rgba(48,209,88,.25); white-space:nowrap; }
.ti-equip-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:14px; margin-bottom:20px; }
@media(max-width:900px){ .ti-equip-grid { grid-template-columns:1fr; } }
.ti-equip-card { background:rgba(255,255,255,.03); border:1px solid rgba(255,255,255,.08); border-radius:14px; padding:18px; }
.ti-equip-title { font-size:.78rem; font-weight:700; color:var(--text-secondary); text-transform:uppercase; letter-spacing:.05em; margin-bottom:6px; }
.ti-equip-label { font-family:monospace; font-size:.85rem; font-weight:700; color:#0A84FF; background:rgba(10,132,255,.08); display:inline-block; padding:3px 10px; border-radius:6px; margin-bottom:12px; }
.ti-info-table { width:100%; border-collapse:collapse; font-size:.78rem; }
.ti-info-table td { padding:5px 0; vertical-align:top; }
.ti-info-table td:first-child { color:var(--text-tertiary); width:42%; padding-right:8px; }
.ti-info-table td:last-child { font-weight:500; }
.ti-info-table tr { border-bottom:1px solid rgba(255,255,255,.04); }
.ti-maint-ok      { color:#30D158; }
.ti-maint-soon    { color:#FF9F0A; font-weight:600; }
.ti-maint-overdue { color:#FF453A; font-weight:700; }
.ti-maint-neutral { color:var(--text-secondary); }
.ti-hamule-item { display:flex; justify-content:space-between; align-items:center; padding:8px 0; border-bottom:1px solid rgba(255,255,255,.05); font-size:.78rem; }
.ti-ham-state { font-size:.7rem; padding:2px 8px; border-radius:12px; background:rgba(255,200,0,.1); color:#ffc800; border:1px solid rgba(255,200,0,.2); }
.ti-maint-item { padding:8px 0; border-bottom:1px solid rgba(255,255,255,.05); }
.ti-section-title { font-size:.85rem; font-weight:700; color:var(--text-secondary); text-transform:uppercase; letter-spacing:.05em; margin-bottom:14px; }
.ti-analysis-kpi { display:grid; grid-template-columns:repeat(4,1fr); gap:12px; margin-bottom:16px; }
@media(max-width:700px){ .ti-analysis-kpi { grid-template-columns:repeat(2,1fr); } }
.ti-kpi-box { background:rgba(255,255,255,.03); border:1px solid rgba(255,255,255,.07); border-radius:12px; padding:14px; text-align:center; }
.ti-kpi-val { font-size:1.6rem; font-weight:800; line-height:1; margin-bottom:4px; }
.ti-kpi-lbl { font-size:.72rem; color:var(--text-tertiary); }
.ti-depar-table { width:100%; border-collapse:collapse; font-size:.78rem; }
.ti-depar-table thead th { padding:7px 10px; text-align:left; color:var(--text-tertiary); font-size:.7rem; text-transform:uppercase; letter-spacing:.04em; border-bottom:1px solid rgba(255,255,255,.08); white-space:nowrap; }
.ti-depar-row { border-bottom:1px solid rgba(255,255,255,.04); transition:background .15s; }
.ti-depar-row:hover { background:rgba(255,255,255,.04); }
.ti-depar-row td { padding:8px 10px; vertical-align:middle; }
.ti-dep-tip { display:inline-block; padding:2px 8px; border-radius:10px; font-size:.68rem; font-weight:700; letter-spacing:.04em; }
.ti-dep-main { background:rgba(10,132,255,.15); color:#0A84FF; border:1px solid rgba(10,132,255,.25); }
.ti-dep-sub  { background:rgba(255,159,10,.12); color:#FF9F0A; border:1px solid rgba(255,159,10,.2); }






/* ── Executive Dashboard Styles ─────────────────────── */
.exec-dashboard { display:flex; flex-direction:column; gap:20px; }
.exec-critical-bar { display:flex; align-items:center; gap:12px; padding:12px 16px; background:rgba(255,69,58,.1); border:1px solid rgba(255,69,58,.3); border-radius:10px; font-size:.85rem; color:#FF453A; flex-wrap:wrap; }
.exec-critical-bar strong { color:#FF453A; }
.exec-critical-list { display:flex; gap:8px; flex-wrap:wrap; }
.crit-badge { padding:3px 10px; background:rgba(255,69,58,.15); border:1px solid rgba(255,69,58,.3); border-radius:20px; font-size:.75rem; cursor:pointer; transition:background .2s; }
.crit-badge:hover { background:rgba(255,69,58,.3); }

.exec-kpi-row { display:grid; grid-template-columns:repeat(5,1fr); gap:14px; }
@media(max-width:900px){ .exec-kpi-row { grid-template-columns:repeat(2,1fr); } }
.exec-kpi-card { border-radius:14px; padding:18px 16px; border:1px solid rgba(255,255,255,.06); transition:transform .2s; cursor:default; }
.exec-kpi-card:hover { transform:translateY(-2px); }
.exec-kpi-card.danger  { background:rgba(255,69,58,.08); border-color:rgba(255,69,58,.2); }
.exec-kpi-card.success { background:rgba(48,209,88,.08); border-color:rgba(48,209,88,.2); }
.exec-kpi-card.warning { background:rgba(255,159,10,.08); border-color:rgba(255,159,10,.2); }
.exec-kpi-card.info    { background:rgba(10,132,255,.08); border-color:rgba(10,132,255,.2); }
.exec-kpi-card.neutral { background:rgba(255,255,255,.04); border-color:rgba(255,255,255,.08); }
.exec-kpi-icon { font-size:1.4rem; margin-bottom:8px; }
.exec-kpi-val  { font-size:1.9rem; font-weight:800; line-height:1; margin-bottom:4px; }
.exec-kpi-card.danger  .exec-kpi-val { color:#FF453A; }
.exec-kpi-card.success .exec-kpi-val { color:#30D158; }
.exec-kpi-card.warning .exec-kpi-val { color:#FF9F0A; }
.exec-kpi-card.info    .exec-kpi-val { color:#0A84FF; }
.exec-kpi-label { font-size:.8rem; font-weight:600; color:var(--text-primary); }
.exec-kpi-sub   { font-size:.7rem; color:var(--text-tertiary); margin-top:3px; }

.exec-charts-row { display:grid; grid-template-columns:2fr 1fr; gap:14px; }
@media(max-width:900px){ .exec-charts-row { grid-template-columns:1fr; } }
.exec-chart-card { background:rgba(255,255,255,.03); border:1px solid rgba(255,255,255,.07); border-radius:14px; padding:18px; overflow:hidden; min-height:0; }
.exec-chart-card canvas { max-height:200px !important; }
.exec-chart-title { font-size:.8rem; font-weight:600; color:var(--text-secondary); margin-bottom:14px; }


.exec-bottom-row { display:grid; grid-template-columns:2fr 1fr; gap:14px; }
@media(max-width:900px){ .exec-bottom-row { grid-template-columns:1fr; } }

.exec-table-card { background:rgba(255,255,255,.03); border:1px solid rgba(255,255,255,.07); border-radius:14px; padding:18px; }
.exec-table { width:100%; border-collapse:collapse; font-size:.8rem; }
.exec-table thead th { padding:8px 10px; text-align:left; color:var(--text-tertiary); font-size:.72rem; text-transform:uppercase; letter-spacing:.04em; border-bottom:1px solid rgba(255,255,255,.06); }
.exec-table-row { border-bottom:1px solid rgba(255,255,255,.04); cursor:pointer; transition:background .15s; }
.exec-table-row:hover { background:rgba(255,255,255,.04); }
.exec-table-row td { padding:10px 10px; vertical-align:middle; }
.exec-count { display:inline-block; min-width:28px; text-align:center; padding:3px 8px; border-radius:20px; font-weight:700; font-size:.82rem; }
.exec-count.danger  { background:rgba(255,69,58,.15); color:#FF453A; }
.exec-count.warning { background:rgba(255,159,10,.15); color:#FF9F0A; }
.exec-count.ok      { background:rgba(48,209,88,.12); color:#30D158; }
.exec-mini-bar { height:6px; background:rgba(255,255,255,.06); border-radius:4px; width:100px; overflow:hidden; }
.exec-mini-fill { height:100%; border-radius:4px; transition:width .4s; }

.exec-team-card { background:rgba(255,255,255,.03); border:1px solid rgba(255,255,255,.07); border-radius:14px; padding:18px; overflow:hidden; }
.exec-team-card canvas { max-height:160px !important; }

.exec-team-legend { margin-top:14px; display:flex; flex-direction:column; gap:6px; }
.exec-team-item { display:flex; justify-content:space-between; align-items:center; font-size:.78rem; color:var(--text-secondary); padding:6px 8px; border-radius:6px; cursor:pointer; transition:background .15s; }
.exec-team-item:hover { background:rgba(255,255,255,.05); color:var(--text-primary); }
.exec-team-cnt { font-weight:700; font-size:.82rem; padding:2px 8px; border-radius:12px; background:rgba(255,255,255,.06); }
.exec-team-cnt.danger { background:rgba(255,69,58,.15); color:#FF453A; }
.exec-map-widget { background:rgba(255,255,255,.03); border:1px solid rgba(255,255,255,.07); border-radius:14px; padding:18px; }
.exec-command-row { display:grid; grid-template-columns:3fr 2fr; gap:14px; }
@media(max-width:900px){ .exec-command-row { grid-template-columns:1fr; } }
.exec-map-card { background:rgba(255,255,255,.03); border:1px solid rgba(255,255,255,.07); border-radius:14px; padding:18px; }
.exec-live-faults { background:rgba(255,255,255,.03); border:1px solid rgba(255,255,255,.07); border-radius:14px; padding:18px; display:flex; flex-direction:column; }
.exec-live-fault-item { background:rgba(255,255,255,.02); border:1px solid rgba(255,255,255,.06); border-left:3px solid #FF453A; border-radius:10px; padding:10px 12px; cursor:pointer; transition:background .15s; flex-shrink:0; }
.exec-live-fault-item:hover { background:rgba(255,255,255,.05); }
.exec-ent-cards-row { display:grid; grid-template-columns:repeat(auto-fill,minmax(175px,1fr)); gap:10px; }
.exec-ent-card { background:rgba(255,255,255,.03); border:1px solid rgba(255,255,255,.07); border-radius:12px; padding:14px; cursor:pointer; transition:background .15s, transform .15s; }
.exec-ent-card:hover { background:rgba(255,255,255,.06); transform:translateY(-2px); }




/* --- CSS Custom Properties --- */

:root {
  /* Primary Colors */
  --primary: #0A84FF;
  --primary-light: #409CFF;
  --primary-dark: #0066CC;
  --primary-glow: rgba(10, 132, 255, 0.3);

  /* Accent */
  --accent: #FFD60A;
  --accent-light: #FFE040;
  --accent-dark: #CCB000;

  /* Semantic */
  --success: #30D158;
  --success-bg: rgba(48, 209, 88, 0.12);
  --danger: #FF453A;
  --danger-bg: rgba(255, 69, 58, 0.12);
  --warning: #FF9F0A;
  --warning-bg: rgba(255, 159, 10, 0.12);
  --info: #64D2FF;
  --info-bg: rgba(100, 210, 255, 0.12);

  /* Backgrounds */
  --bg-primary: #0D1117;
  --bg-secondary: #161B22;
  --bg-tertiary: #1C2128;
  --bg-card: #21262D;
  --bg-card-hover: #282E36;
  --bg-input: #1C2128;
  --bg-overlay: rgba(0, 0, 0, 0.6);

  /* Text */
  --text-primary: #F0F6FC;
  --text-secondary: #8B949E;
  --text-tertiary: #6E7681;
  --text-inverse: #0D1117;

  /* Borders */
  --border: #30363D;
  --border-light: #21262D;
  --border-focus: #0A84FF;

  /* Team Colors */
  --team-montorluk: #0A84FF;
  --team-olcu: #BF5AF2;
  --team-yeralti: #FF9F0A;
  --team-havai: #30D158;
  --team-trafo: #FF453A;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 24px;
  --space-2xl: 32px;
  --space-3xl: 48px;

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 50%;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 20px var(--primary-glow);

  /* Font */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Sidebar */
  --sidebar-width: 260px;
  --header-height: 64px;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 14px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  /* overflow-x:hidden yerine clip — Android'de child scroll'u engellemez */
  overflow-x: clip;
}


#app {
  min-height: 100vh;
}

a {
  color: var(--primary);
  text-decoration: none;
}

/* Utility */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.mt-sm  { margin-top: var(--space-sm); }
.mt-md  { margin-top: var(--space-md); }
.mt-lg  { margin-top: var(--space-lg); }
.mt-xl  { margin-top: var(--space-xl); }
.mt-2xl { margin-top: var(--space-2xl); }

/* --- Scrollbar --- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-tertiary);
}

/* ============================================
   LOGIN PAGE
   ============================================ */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0D1117 0%, #161B22 50%, #0D1117 100%);
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: 
    radial-gradient(circle at 20% 50%, rgba(10, 132, 255, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255, 214, 10, 0.06) 0%, transparent 40%),
    radial-gradient(circle at 50% 80%, rgba(191, 90, 242, 0.05) 0%, transparent 40%);
  animation: loginBgPulse 8s ease-in-out infinite alternate;
}

@keyframes loginBgPulse {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-2%, -1%) scale(1.05); }
}

.login-container {
  position: relative;
  z-index: 1;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-3xl);
  width: 420px;
  max-width: 95vw;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.login-logo {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.login-logo .logo-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: var(--space-md);
  animation: logoPulse 2s ease-in-out infinite;
}

@keyframes logoPulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 8px rgba(10, 132, 255, 0.5)); }
  50% { transform: scale(1.1); filter: drop-shadow(0 0 20px rgba(10, 132, 255, 0.8)); }
}

.login-logo h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.login-logo p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-top: var(--space-xs);
}

/* --- Form Elements --- */
.form-group {
  margin-bottom: var(--space-lg);
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-input, .form-select {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 0.95rem;
  transition: all 0.2s ease;
  outline: none;
}

.form-input:focus, .form-select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-input::placeholder {
  color: var(--text-tertiary);
}

.form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238B949E' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

.form-select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-family);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: 0 2px 8px rgba(10, 132, 255, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(10, 132, 255, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--text-tertiary);
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger), #CC362E);
  color: white;
}

.btn-success {
  background: linear-gradient(135deg, var(--success), #28A847);
  color: white;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.btn-block {
  width: 100%;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-icon:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

/* ============================================
   LAYOUT
   ============================================ */

.app-layout {
  display: flex;
  min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-header {
  padding: var(--space-xl);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.sidebar-header .logo-spark {
  font-size: 1.8rem;
  animation: logoPulse 2s ease-in-out infinite;
}

.sidebar-header h2 {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.sidebar-header h2 span {
  color: var(--accent);
}

.sidebar-nav {
  flex: 1;
  padding: var(--space-lg) var(--space-md);
  overflow-y: auto;
}

.nav-section-title {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: var(--space-lg) var(--space-md) var(--space-sm);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 10px var(--space-md);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  margin-bottom: 2px;
  font-size: 0.9rem;
  font-weight: 500;
  position: relative;
}

.nav-item:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.nav-item.active {
  background: rgba(10, 132, 255, 0.12);
  color: var(--primary);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
}

.nav-item .nav-icon-svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.65;
  transition: opacity 0.15s;
}

.nav-item:hover .nav-icon-svg,
.nav-item.active .nav-icon-svg {
  opacity: 1;
}

/* keep legacy emoji support */
.nav-item .nav-emoji {
  font-size: 1.15rem;
  width: 24px;
  text-align: center;
}

.nav-item .nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

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

.sidebar-user {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm);
}

.sidebar-user .user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: white;
}

.sidebar-user .user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user .user-name {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user .user-role {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

/* --- Main Content --- */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

/* --- Header --- */
.page-header {
  padding: var(--space-xl) var(--space-2xl);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-secondary);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
}

.page-header h1 {
  font-size: 1.4rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.page-header .header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.page-content {
  padding: var(--space-2xl);
}

/* ============================================
   DASHBOARD
   ============================================ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-2xl);
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--stat-color, var(--primary));
}

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

.stat-card .stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.stat-card .stat-emoji {
  font-size: 1.5rem;
}

.stat-card .stat-change {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 8px;
}

.stat-card .stat-change.up {
  color: var(--success);
  background: var(--success-bg);
}

.stat-card .stat-change.down {
  color: var(--danger);
  background: var(--danger-bg);
}

.stat-card .stat-value {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-xs);
}

.stat-card .stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Team Distribution */
.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-2xl);
}

.team-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  transition: all 0.2s ease;
  cursor: pointer;
}

.team-card:hover {
  border-color: var(--team-color, var(--primary));
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.team-card .team-emoji {
  font-size: 1.8rem;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.05);
}

.team-card .team-info {
  flex: 1;
}

.team-card .team-name {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.team-card .team-count {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--team-color, var(--primary));
}

.team-card .team-label {
  font-size: 0.7rem;
  color: var(--text-tertiary);
}

/* Recent Activity */
.activity-list {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border-light);
  transition: background 0.15s;
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-item:hover {
  background: var(--bg-card-hover);
}

.activity-item .activity-emoji {
  font-size: 1.2rem;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.activity-item .activity-content {
  flex: 1;
  min-width: 0;
}

.activity-item .activity-text {
  font-size: 0.85rem;
  line-height: 1.4;
}

.activity-item .activity-text strong {
  color: var(--primary-light);
}

.activity-item .activity-time {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* ============================================
   FAULTS LIST
   ============================================ */

.filters-bar {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
  flex-wrap: wrap;
}

.filter-chip {
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  font-family: var(--font-family);
}

.filter-chip:hover {
  border-color: var(--primary);
  color: var(--text-primary);
}

.filter-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.filter-chip.category-yg.active {
  background: var(--danger);
  border-color: var(--danger);
}

.filter-chip.category-ag.active {
  background: var(--primary);
  border-color: var(--primary);
}

.filter-chip.category-tespit.active {
  background: var(--warning);
  border-color: var(--warning);
  color: var(--text-inverse);
}

.faults-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.fault-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.fault-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--fault-status-color, var(--warning));
}

.fault-card:hover {
  border-color: var(--text-tertiary);
  transform: translateX(4px);
  box-shadow: var(--shadow-md);
}

.fault-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.fault-card-header .fault-id {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  font-weight: 600;
  font-family: 'Courier New', monospace;
}

.fault-card-header .fault-badges {
  display: flex;
  gap: var(--space-sm);
}

.badge {
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-yg {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(255, 69, 58, 0.2);
}

.badge-ag {
  background: rgba(10, 132, 255, 0.12);
  color: var(--primary-light);
  border: 1px solid rgba(10, 132, 255, 0.2);
}

.badge-ha {
  background: rgba(100, 210, 80, 0.12);
  color: #64D250;
  border: 1px solid rgba(100, 210, 80, 0.2);
}

.badge-tespit {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid rgba(255, 159, 10, 0.2);
}

.badge-status {
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
}

.badge-status.open {
  background: var(--danger-bg);
  color: var(--danger);
}

.badge-status.in-progress {
  background: var(--warning-bg);
  color: var(--warning);
}

.badge-status.resolved {
  background: var(--success-bg);
  color: var(--success);
}

/* Outage Duration Timer */
.outage-timer {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  letter-spacing: 0.02em;
}

.outage-timer.ok {
  background: var(--success-bg);
  color: var(--success);
}

.outage-timer.warning {
  background: var(--warning-bg);
  color: var(--warning);
}

.outage-timer.critical {
  background: var(--danger-bg);
  color: var(--danger);
  animation: timerPulse 2s ease-in-out infinite;
}

@keyframes timerPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Large outage timer for detail page */
.outage-timer-large {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-lg);
}

.outage-timer-large.ok { background: rgba(48, 209, 88, 0.08); border: 1px solid rgba(48, 209, 88, 0.2); }
.outage-timer-large.warning { background: rgba(255, 159, 10, 0.08); border: 1px solid rgba(255, 159, 10, 0.2); }
.outage-timer-large.critical { background: rgba(255, 69, 58, 0.08); border: 1px solid rgba(255, 69, 58, 0.2); }

.outage-timer-large .timer-value {
  font-size: 1.6rem;
  font-weight: 800;
  font-family: 'Courier New', monospace;
}

.outage-timer-large.ok .timer-value { color: var(--success); }
.outage-timer-large.warning .timer-value { color: var(--warning); }
.outage-timer-large.critical .timer-value { color: var(--danger); }

.outage-timer-large .timer-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Outage Cause Badge */
.badge-cause {
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-cause.ariza { background: var(--danger-bg); color: var(--danger); }
.badge-cause.sebeke { background: var(--warning-bg); color: var(--warning); }
.badge-cause.bildirimli { background: rgba(10, 132, 255, 0.12); color: var(--primary-light); }

/* TM/Depar Badge */
.badge-tm {
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 0.65rem;
  font-weight: 600;
  background: rgba(139, 148, 158, 0.12);
  color: var(--text-secondary);
  border: 1px solid rgba(139, 148, 158, 0.15);
  font-family: 'Courier New', monospace;
}

/* Repairs section */
.repairs-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.repair-item {
  padding: var(--space-md);
  background: rgba(255, 159, 10, 0.05);
  border: 1px solid rgba(255, 159, 10, 0.15);
  border-radius: var(--radius-md);
  font-size: 0.8rem;
}

.repair-item .repair-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-xs);
  font-weight: 600;
}

.repair-item .repair-detail {
  color: var(--text-secondary);
  font-size: 0.75rem;
}

.fault-card .fault-address {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: var(--space-sm);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.fault-card .fault-meta {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  color: var(--text-secondary);
  font-size: 0.8rem;
  flex-wrap: wrap;
}

.fault-card .fault-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ============================================
   FAULT DETAIL
   ============================================ */

.fault-detail-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 0;
  height: calc(100vh - var(--header-height));
}

.fault-info-panel {
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: var(--space-xl);
}

.fault-info-section {
  margin-bottom: var(--space-xl);
}

.fault-info-section .section-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-md);
}

.info-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-sm) 0;
}

.info-row .info-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  min-width: 100px;
  flex-shrink: 0;
}

.info-row .info-value {
  font-size: 0.85rem;
  font-weight: 500;
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: var(--space-2xl);
}

.timeline::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-sm);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: calc(-1 * var(--space-2xl) + 6px);
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background: var(--timeline-color, var(--primary));
  border: 2px solid var(--bg-secondary);
  box-shadow: 0 0 0 2px var(--timeline-color, var(--primary));
}

.timeline-item .timeline-team {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--timeline-color, var(--primary));
  margin-bottom: 2px;
}

.timeline-item .timeline-action {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.timeline-item .timeline-time {
  font-size: 0.7rem;
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* ============================================
   CHAT
   ============================================ */

.chat-panel {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--header-height));
  background: var(--bg-primary);
}

.chat-header {
  padding: var(--space-lg) var(--space-xl);
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.chat-header-info h3 {
  font-size: 0.95rem;
  font-weight: 600;
}

.chat-header-info .chat-participants {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

/* Chat Bubbles */
.chat-bubble {
  max-width: 70%;
  animation: bubbleIn 0.3s ease;
}

@keyframes bubbleIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat-bubble.sent {
  align-self: flex-end;
}

.chat-bubble.received {
  align-self: flex-start;
}

.chat-bubble.system {
  align-self: center;
  max-width: 85%;
}

.bubble-sender {
  font-size: 0.7rem;
  font-weight: 600;
  margin-bottom: 3px;
  padding-left: var(--space-sm);
}

.bubble-content {
  padding: 10px 16px;
  border-radius: var(--radius-lg);
  font-size: 0.9rem;
  line-height: 1.45;
  position: relative;
}

.chat-bubble.sent .bubble-content {
  background: var(--primary);
  color: white;
  border-bottom-right-radius: 4px;
}

.chat-bubble.received .bubble-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.chat-bubble.system .bubble-content {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-secondary);
  padding: 8px 20px;
  border-radius: 20px;
}

.chat-bubble.system .bubble-content .system-emoji {
  margin-right: var(--space-xs);
}

.bubble-time {
  font-size: 0.65rem;
  color: var(--text-tertiary);
  margin-top: 3px;
  padding: 0 var(--space-sm);
}

.chat-bubble.sent .bubble-time {
  text-align: right;
}

.bubble-image {
  max-width: 250px;
  border-radius: var(--radius-md);
  margin-top: var(--space-sm);
  border: 1px solid var(--border);
}

.bubble-location {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: rgba(255,255,255,0.08);
  border-radius: var(--radius-sm);
  margin-top: var(--space-sm);
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.15s;
}

.bubble-location:hover {
  background: rgba(255,255,255,0.12);
}

.bubble-material {
  margin-top: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: rgba(255,255,255,0.06);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent);
}

.bubble-material .material-title {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 4px;
}

.bubble-material .material-list {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Chat Input */
.chat-input-area {
  padding: var(--space-lg) var(--space-xl);
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
}

.chat-input-actions {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.chat-input-row {
  display: flex;
  align-items: flex-end;
  gap: var(--space-md);
}

.chat-input-row textarea {
  flex: 1;
  padding: 10px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 0.9rem;
  resize: none;
  outline: none;
  min-height: 42px;
  max-height: 120px;
  line-height: 1.4;
}

.chat-input-row textarea:focus {
  border-color: var(--border-focus);
}

.chat-input-row textarea::placeholder {
  color: var(--text-tertiary);
}

.send-btn {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  background: var(--primary);
  border: none;
  color: white;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.send-btn:hover {
  background: var(--primary-light);
  transform: scale(1.05);
}

/* Team assign dropdown */
.assign-dropdown {
  position: relative;
  display: inline-block;
}

.assign-menu {
  position: absolute;
  bottom: 100%;
  left: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-sm);
  min-width: 200px;
  box-shadow: var(--shadow-lg);
  display: none;
  z-index: 200;
}

.assign-menu.show {
  display: block;
  animation: fadeInUp 0.2s ease;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.assign-menu-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
  font-size: 0.85rem;
}

.assign-menu-item:hover {
  background: var(--bg-tertiary);
}

/* ============================================
   MODAL
   ============================================ */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
  backdrop-filter: blur(4px);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 520px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.3s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

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

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.modal-body {
  padding: var(--space-xl);
}

.modal-footer {
  padding: var(--space-lg) var(--space-xl);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-md);
}

/* ============================================
   UTILITIES
   ============================================ */

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-secondary { color: var(--text-secondary); }
.text-sm { font-size: 0.8rem; }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.gap-sm { gap: var(--space-sm); }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.hidden { display: none !important; }

/* Electric sparkle animation for loading */
@keyframes sparkle {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

.sparkle {
  animation: sparkle 1.5s ease-in-out infinite;
}

/* Pulse animation for live indicators */
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(48, 209, 88, 0.4); }
  70% { box-shadow: 0 0 0 8px rgba(48, 209, 88, 0); }
  100% { box-shadow: 0 0 0 0 rgba(48, 209, 88, 0); }
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--success);
  animation: pulse 2s infinite;
  display: inline-block;
}

/* ============================================
   RESPONSIVE & PWA MOBILE
   ============================================ */

/* --- Tablet --- */
@media (max-width: 1024px) {
  .fault-detail-layout {
    grid-template-columns: 1fr;
  }
  
  .fault-info-panel {
    border-right: none;
    border-bottom: 1px solid var(--border);
    max-height: 280px;
  }

  .chat-panel {
    height: calc(100vh - var(--header-height) - 280px);
  }
}

/* --- Mobile --- */
@media (max-width: 768px) {
  html {
    font-size: 15px;
  }

  /* Sidebar as overlay */
  .sidebar {
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
    z-index: 999;
  }
  
  .sidebar.open {
    transform: translateX(0);
  }

  /* Sidebar backdrop */
  .sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 998;
    display: none;
  }

  .sidebar-backdrop.show {
    display: block;
  }
  
  .main-content {
    margin-left: 0;
  }
  
  .page-content {
    padding: var(--space-lg);
    padding-bottom: 80px; /* space for bottom nav */
  }

  /* Header compact */
  .page-header {
    padding: var(--space-md) var(--space-lg);
  }

  .page-header h1 {
    font-size: 1.1rem;
  }
  
  /* Stats grid 2 columns on mobile */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
  }

  .stat-card {
    padding: var(--space-lg);
  }

  .stat-card .stat-value {
    font-size: 1.6rem;
  }

  /* Team grid 2 columns */
  .team-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
  }

  .team-card {
    padding: var(--space-md);
  }

  .team-card .team-emoji {
    font-size: 1.4rem;
    width: 40px;
    height: 40px;
  }
  
  /* Chat */
  .chat-bubble {
    max-width: 88%;
  }

  .chat-messages {
    padding: var(--space-md);
  }

  .chat-input-area {
    padding: var(--space-md);
    padding-bottom: calc(var(--space-md) + env(safe-area-inset-bottom, 0px));
  }

  .chat-input-row textarea {
    font-size: 16px; /* prevent iOS zoom */
    min-height: 40px;
  }

  .send-btn {
    width: 44px;
    height: 44px;
  }
  
  /* Filters horizontal scroll */
  .filters-bar {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: var(--space-sm);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .filters-bar::-webkit-scrollbar {
    display: none;
  }

  .filter-chip {
    flex-shrink: 0;
    padding: 8px 16px;
  }

  .filters-bar > .text-secondary {
    display: none;
  }

  /* Fault cards */
  .fault-card {
    padding: var(--space-lg);
  }

  .fault-card .fault-meta {
    gap: var(--space-md);
    font-size: 0.75rem;
  }

  /* Fault detail mobile layout  */
  .fault-detail-layout {
    grid-template-columns: 1fr;
    height: auto;
  }

  .fault-info-panel {
    max-height: none;
    border-bottom: 1px solid var(--border);
  }

  .chat-panel {
    height: 60vh;
    min-height: 400px;
  }

  /* Modal */
  .modal {
    width: 95vw;
    max-height: 85vh;
    border-radius: var(--radius-lg);
  }

  /* Section titles */
  .section-title {
    font-size: 1rem;
  }

  /* Activity items touch-friendly */
  .activity-item {
    padding: var(--space-md);
  }

  /* Login page mobile */
  .login-container {
    padding: var(--space-2xl);
    border-radius: var(--radius-lg);
  }

  /* Assign menu mobile  */
  .assign-menu {
    min-width: 180px;
  }

  .assign-menu-item {
    padding: var(--space-md);
  }
}

/* --- Small phones --- */
@media (max-width: 380px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .team-grid {
    grid-template-columns: 1fr;
  }

  .page-header h1 {
    font-size: 0.95rem;
  }
}

/* --- Bottom Navigation Bar (Mobile) --- */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.bottom-nav-items {
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: 56px;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  -webkit-user-select: none;
  user-select: none;
}

.bottom-nav-item .nav-icon {
  font-size: 1.3rem;
  line-height: 1;
}

.bottom-nav-item .nav-label {
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--text-tertiary);
  letter-spacing: 0.02em;
}

.bottom-nav-item.active .nav-label {
  color: var(--primary);
}

.bottom-nav-item.active .nav-icon {
  transform: scale(1.15);
}

.bottom-nav-item .nav-dot {
  position: absolute;
  top: 4px;
  right: 8px;
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: var(--radius-full);
  border: 2px solid var(--bg-secondary);
}

@media (max-width: 768px) {
  .bottom-nav {
    display: block;
  }
}

/* Mobile menu button */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.3rem;
  cursor: pointer;
  padding: var(--space-sm);
  -webkit-tap-highlight-color: transparent;
}

@media (max-width: 768px) {
  .mobile-menu-btn {
    display: block;
  }
}

/* Touch-friendly interactive elements */
@media (pointer: coarse) {
  .btn {
    min-height: 44px;
    min-width: 44px;
  }

  .btn-sm {
    min-height: 36px;
  }

  .btn-icon {
    width: 44px;
    height: 44px;
  }

  .nav-item {
    padding: 12px var(--space-md);
  }

  .filter-chip {
    min-height: 36px;
  }
}

/* PWA standalone mode adjustments */
@media (display-mode: standalone) {
  .login-page {
    padding-top: env(safe-area-inset-top);
  }
}

/* ============================================
   PHASE 3 — New Component Styles
   ============================================ */

/* Smart Hints Card */
.smart-hints-card {
  background: rgba(255, 159, 10, 0.06);
  border: 1px solid rgba(255, 159, 10, 0.3);
  border-radius: 12px;
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
}
.smart-hints-title { font-weight:700;font-size:.9rem;color:var(--warning);margin-bottom:var(--space-sm); }
.hint-item { display:flex;align-items:center;gap:var(--space-sm);padding:var(--space-sm) 0;border-bottom:1px solid var(--border); }
.hint-item:last-child { border-bottom:none; }
.hint-item.risk { background:rgba(255,69,58,.04);border-radius:8px;padding:var(--space-sm); }
.hint-icon { font-size:1.2rem;width:28px;text-align:center; }
.hint-content { flex:1; }
.hint-loc { font-weight:600;font-size:.85rem; }
.hint-meta { font-size:.75rem;color:var(--text-secondary);margin-top:2px; }

/* Enterprise Cards */
.enterprise-grid { display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:var(--space-lg);margin-bottom:var(--space-2xl); }
.enterprise-card { background:var(--bg-card);border:1px solid var(--border);border-radius:16px;padding:var(--space-lg);cursor:pointer;transition:all .2s; }
.enterprise-card:hover { border-color:var(--primary);transform:translateY(-2px); }
.enterprise-card.alert { border-color:rgba(255,69,58,.4); }
.ent-header { margin-bottom:var(--space-md); }
.ent-name { font-weight:700;font-size:1rem; }
.ent-region { font-size:.75rem;margin-top:2px; }
.ent-stats { display:grid;grid-template-columns:repeat(4,1fr);gap:var(--space-sm); }
.ent-stat { text-align:center; }
.ent-stat-val { font-size:1.3rem;font-weight:800; }
.ent-stat-label { font-size:.65rem;color:var(--text-tertiary); }

/* Performance Table */
.perf-table-wrap,.stock-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch; /* Android/iOS parmak kaydırma */
  margin-bottom: var(--space-xl);
  /* Android'de yatay scroll için gerekli */
  touch-action: pan-x pan-y;
}

.perf-table { width:100%;border-collapse:collapse;font-size:.8rem; }
.perf-table th { background:var(--bg-tertiary);padding:var(--space-sm) var(--space-md);text-align:left;font-weight:600;color:var(--text-secondary);font-size:.7rem;text-transform:uppercase;letter-spacing:.04em;white-space:nowrap; }
.perf-table td { padding:var(--space-sm) var(--space-md);border-bottom:1px solid var(--border);white-space:nowrap; }
.perf-row:hover td { background:var(--bg-card-hover); }
.perf-row.selected td { background:rgba(10,132,255,.08); }
.perf-warning-row td { background:rgba(255,159,10,.06);color:var(--warning);font-size:.75rem;padding:4px var(--space-md); }

/* Score Bar */
.score-bar { background:var(--bg-tertiary);border-radius:4px;height:6px;width:80px;overflow:hidden;display:inline-block;margin-right:6px;vertical-align:middle; }
.score-fill { height:100%;border-radius:4px;transition:width .5s; }

/* Staff Detail */
.staff-detail-card { background:var(--bg-card);border:1px solid var(--primary);border-radius:16px;padding:var(--space-xl);margin-bottom:var(--space-2xl); }
.staff-detail-header { display:flex;align-items:center;gap:var(--space-lg); }
.staff-avatar { width:54px;height:54px;background:var(--primary);border-radius:50%;display:flex;align-items:center;justify-content:center;font-weight:800;font-size:1.2rem;color:#fff;flex-shrink:0; }
.staff-name { font-weight:700;font-size:1.1rem; }
.staff-score { margin-left:auto;text-align:center; }

/* Material Rows */
.material-row { display:flex;gap:var(--space-sm);align-items:center;margin-bottom:var(--space-sm); }

/* Stock */
.stock-qty { font-weight:700; }
.stock-qty.warning { color:var(--warning); }
.stock-qty.danger  { color:var(--danger); }
.stock-input { background:var(--bg-input);border:1px solid var(--border);border-radius:6px;padding:4px 8px;color:var(--text-primary);font-size:.85rem; }

/* Stock Alert Bar */
.stock-alert-bar { background:rgba(255,159,10,.1);border:1px solid rgba(255,159,10,.3);border-radius:10px;padding:var(--space-md) var(--space-lg);margin-bottom:var(--space-xl);font-size:.85rem;color:var(--warning); }
.stock-alert-section { margin-bottom:var(--space-xl); }
.alert-item { padding:var(--space-sm) var(--space-lg);border-radius:8px;margin-bottom:var(--space-sm);font-size:.85rem; }
.alert-item.danger  { background:var(--danger-bg);border-left:3px solid var(--danger); }
.alert-item.success { background:var(--success-bg);border-left:3px solid var(--success); }

/* Badges */
.badge-role { background:rgba(191,90,242,.15);border:1px solid rgba(191,90,242,.3);color:#BF5AF2;padding:4px 12px;border-radius:20px;font-size:.75rem;font-weight:600; }
.nav-badge.danger { background:var(--danger); }
.text-danger  { color:var(--danger) !important; }
.text-warning { color:var(--warning) !important; }

/* Field outage timer */
.outage-timer-small { font-size:.75rem;font-weight:700;padding:2px 8px;border-radius:12px;background:var(--success-bg);color:var(--success); }
.outage-timer-small.warning  { background:var(--warning-bg);color:var(--warning); }
.outage-timer-small.critical { background:var(--danger-bg);color:var(--danger);animation:pulse 1.5s infinite; }

/* ============================================
   KESİNTİ HARİTASI — Map Page
   ============================================ */

/* Leaflet harita alanı */
#outagemap .leaflet-container { background:#0D1117; }
#outagemap .leaflet-control-zoom a {
  background:var(--bg-card) !important;
  border-color:var(--border) !important;
  color:var(--text-primary) !important;
}
#outagemap .leaflet-control-attribution {
  background:rgba(13,17,23,.7) !important;
  color:var(--text-tertiary) !important;
  font-size:.6rem !important;
}

/* TM Marker */
.tm-marker-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.tm-marker-inner {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform .2s;
  border: 2px solid rgba(255,255,255,.2);
}

.tm-marker-wrap:hover .tm-marker-inner { transform: scale(1.15); }

.tm-badge {
  position: absolute;
  top: -6px; right: -6px;
  background: #FF453A;
  color: white;
  font-size: .65rem;
  font-weight: 800;
  width: 18px; height: 18px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #0D1117;
}

.tm-label {
  font-size: .65rem;
  font-weight: 700;
  color: #fff;
  text-align: center;
  line-height: 1.2;
  text-shadow: 0 1px 4px rgba(0,0,0,.8);
  white-space: nowrap;
}

.tm-label small { font-size: .55rem; opacity: .7; }

/* Pulse animasyonları */
@keyframes tmPulseRed {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,69,58,.6), 0 0 16px rgba(255,69,58,.4); }
  50%       { box-shadow: 0 0 0 14px rgba(255,69,58,0), 0 0 24px rgba(255,69,58,.6); }
}
@keyframes tmPulseOrange {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,159,10,.5), 0 0 12px rgba(255,159,10,.3); }
  50%       { box-shadow: 0 0 0 12px rgba(255,159,10,0), 0 0 20px rgba(255,159,10,.5); }
}
@keyframes livePulse {
  0%, 100% { opacity:1; }
  50%       { opacity:.3; }
}

.tm-pulse-red    .tm-marker-inner { animation: tmPulseRed    2s ease-in-out infinite; }
.tm-pulse-orange .tm-marker-inner { animation: tmPulseOrange 2.5s ease-in-out infinite; }

/* Filtre butonu */
.map-filter-btn {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: rgba(13,17,23,.8);
  color: var(--text-secondary);
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  backdrop-filter: blur(8px);
}
.map-filter-btn:hover { background: var(--bg-card); color: var(--text-primary); }
.map-filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* Hafsf istatistik kutuları */
.map-stat-card {
  background: rgba(13,17,23,.85);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 18px;
  text-align: center;
  backdrop-filter: blur(12px);
  min-width: 80px;
}
.map-stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 2px;
}
.map-stat-label {
  font-size: .65rem;
  color: var(--text-secondary);
  font-weight: 600;
  white-space: nowrap;
}

/* Legend */
.map-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .72rem;
  color: var(--text-secondary);
  background: rgba(13,17,23,.7);
  padding: 4px 10px;
  border-radius: 20px;
  backdrop-filter: blur(8px);
}
.legend-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Grid hat çizgisi animasyonu */
.grid-line {
  stroke-dasharray: 8 6;
  animation: dashFlow 2s linear infinite;
}
@keyframes dashFlow {
  from { stroke-dashoffset: 28; }
  to   { stroke-dashoffset: 0; }
}

/* ============================================
   ZİMMET TAKİP - Material Tracking
   ============================================ */

.zimmet-table-wrapper {
  overflow-x: auto;
  margin-bottom: var(--space-xl);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
}

.zimmet-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.8rem;
  min-width: 1200px;
}

.zimmet-table th,
.zimmet-table td {
  padding: 10px 14px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  text-align: center;
  vertical-align: middle;
}

.zimmet-table th {
  background: var(--bg-secondary);
  font-weight: 700;
  color: var(--text-primary);
  position: sticky;
  top: 0;
  z-index: 10;
  white-space: nowrap;
}

.zimmet-table .col-name {
  font-size: 0.75rem;
  margin-bottom: 4px;
  white-space: normal;
  max-width: 120px;
  line-height: 1.2;
}

.zimmet-table .col-period {
  font-size: 0.65rem;
  color: var(--text-tertiary);
}

.zimmet-table .team-row {
  background: var(--bg-tertiary);
}

.zimmet-table .team-name {
  text-align: left;
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--primary);
  padding: 8px 16px;
}

.zimmet-table .sticky-col {
  position: sticky;
  left: 0;
  background: var(--bg-card);
  z-index: 11;
  text-align: left;
  min-width: 180px;
  box-shadow: 2px 0 5px rgba(0,0,0,0.2);
}

.zimmet-table th.sticky-col {
  z-index: 12;
  background: var(--bg-secondary);
}

.person-name {
  font-weight: 700;
  font-size: 0.85rem;
}

.person-title {
  font-size: 0.65rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.cell-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius-sm);
}

.cell-status.valid { background: rgba(48, 209, 88, 0.1); }
.cell-status.warning { background: rgba(255, 159, 10, 0.1); }
.cell-status.expired { background: rgba(255, 69, 58, 0.1); }

.status-icon {
  font-size: 1rem;
}

.status-date {
  font-size: 0.65rem;
  font-weight: 600;
}

.cell-status.valid .status-date { color: var(--success); }
.cell-status.warning .status-date { color: var(--warning); }
.cell-status.expired .status-date { color: var(--danger); }

.cell-missing {
  color: var(--text-tertiary);
  font-weight: bold;
}

.status-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 12px;
  background: var(--bg-card);
  border-radius: 20px;
  border: 1px solid var(--border);
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.status-dot.valid { background: var(--success); }
.status-dot.warning { background: var(--warning); }
.status-dot.expired { background: var(--danger); }
.status-dot.missing { background: var(--text-tertiary); }

/* ============================================
   POSTY — Saha Paylaşım Panosu
   ============================================ */

.posty-page-wrap {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 20px;
  padding: 20px 24px 40px;
  align-items: start;
  max-width: 1100px;
}

/* ── Compose Card ─────────────────────────── */
.posty-compose-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
  transition: box-shadow .2s;
}
.posty-compose-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #0A84FF, #BF5AF2, #FF9F0A);
}
.posty-compose-card:focus-within {
  box-shadow: 0 0 0 2px rgba(10,132,255,.25), var(--shadow-md);
}
.posty-compose-header { display: flex; gap: 12px; align-items: flex-start; }
.posty-compose-input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 0.9rem;
  padding: 12px 14px;
  resize: none;
  outline: none;
  transition: border-color .2s;
  line-height: 1.5;
}
.posty-compose-input:focus { border-color: var(--border-focus); }
.posty-compose-input::placeholder { color: var(--text-tertiary); }

.posty-compose-tags {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-left: 50px;
}
.posty-compose-tags-label {
  font-size: 0.72rem;
  color: var(--text-tertiary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.posty-tag-option { cursor: pointer; }
.posty-tag-option input[type="radio"] { display: none; }
.posty-tag-option span {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all .15s;
}
.posty-tag-option input:checked + span {
  border-color: currentColor;
  box-shadow: 0 0 0 2px rgba(255,255,255,.08);
}

.posty-compose-img-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding-left: 50px;
  color: var(--text-tertiary);
}
.posty-img-url-input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: 0.78rem;
  padding: 6px 10px;
  outline: none;
  transition: border-color .2s;
}
.posty-img-url-input:focus { border-color: var(--border-focus); }
.posty-img-url-input::placeholder { color: var(--text-tertiary); }

.posty-compose-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
  padding-left: 50px;
}
.posty-char-count { font-size: 0.72rem; color: var(--text-tertiary); }
.posty-submit-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border: none;
  border-radius: var(--radius-md);
  padding: 8px 18px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-family);
  transition: all .2s;
  box-shadow: 0 2px 8px rgba(10,132,255,.3);
}
.posty-submit-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(10,132,255,.4); }
.posty-submit-btn:active { transform: translateY(0); }
.posty-submit-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.posty-read-only-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,.03);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  font-size: 0.82rem;
  color: var(--text-tertiary);
  margin-bottom: 16px;
}

/* ── Tag filter chips ──────────────────────── */
.posty-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.posty-filter-chip {
  padding: 5px 13px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.posty-filter-chip:hover {
  border-color: var(--chip-color, var(--primary));
  color: var(--chip-color, var(--primary));
}
.posty-filter-chip.active {
  background: var(--chip-color, var(--primary));
  border-color: var(--chip-color, var(--primary));
  color: #fff;
}

/* ── Feed ─────────────────────────────────── */
.posty-feed { display: flex; flex-direction: column; gap: 12px; }

/* ── Post card ────────────────────────────── */
.posty-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  transition: border-color .2s, box-shadow .2s, transform .2s;
  animation: postyCardIn .3s ease both;
}
.posty-card:hover {
  border-color: rgba(10,132,255,.3);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
@keyframes postyCardIn {
  from { opacity:0; transform: translateY(12px); }
  to   { opacity:1; transform: translateY(0); }
}
.posty-card-header { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 10px; }
.posty-card-meta { flex: 1; min-width: 0; }
.posty-author-row { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.posty-author-name { font-size: 0.88rem; font-weight: 700; color: var(--text-primary); }
.posty-author-sub {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  color: var(--text-tertiary);
  margin-top: 2px;
}
.posty-avatar {
  width: 38px; height: 38px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.82rem;
  color: #fff;
  flex-shrink: 0;
}
.posty-tag {
  border-radius: 20px;
  font-weight: 700;
  letter-spacing: .02em;
}
.posty-team-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.posty-content {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 10px;
}
.posty-img-wrap { margin-bottom: 10px; }
.posty-img {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

/* ── Actions ──────────────────────────────── */
.posty-actions {
  display: flex;
  gap: 4px;
  border-top: 1px solid var(--border-light);
  padding-top: 10px;
}
.posty-like-btn,
.posty-comment-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-tertiary);
  font-family: var(--font-family);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.posty-like-btn:hover    { background: rgba(255,69,58,.1);  color: #FF453A; }
.posty-comment-btn:hover { background: rgba(10,132,255,.1); color: #0A84FF; }
.posty-like-btn.liked    { color: #FF453A; background: rgba(255,69,58,.08); }

/* ── Comments ─────────────────────────────── */
.posty-comments-section {
  margin-top: 10px;
  animation: postySlideDown .2s ease;
}
@keyframes postySlideDown {
  from { opacity:0; transform: translateY(-6px); }
  to   { opacity:1; transform: translateY(0); }
}
.posty-comments-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.posty-comment-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: baseline;
  gap: 6px;
  padding: 7px 10px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
}
@keyframes postyCommentIn {
  from { opacity:0; transform:translateX(-8px); }
  to   { opacity:1; transform:translateX(0); }
}
.posty-comment-item.posty-comment-new { animation: postyCommentIn .35s ease; }
.posty-comment-author { font-weight: 700; color: var(--text-primary); white-space: nowrap; }
.posty-comment-text   { color: var(--text-secondary); word-break: break-word; }
.posty-comment-time   { font-size: 0.68rem; color: var(--text-tertiary); white-space: nowrap; }
.posty-comment-form   { display: flex; gap: 8px; }
.posty-comment-input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 0.8rem;
  padding: 7px 10px;
  outline: none;
  transition: border-color .2s;
}
.posty-comment-input:focus { border-color: var(--border-focus); }
.posty-comment-input::placeholder { color: var(--text-tertiary); }
.posty-comment-send {
  padding: 7px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.posty-comment-send:hover { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ── Sidebar panels ───────────────────────── */
.posty-sidebar-col { display: flex; flex-direction: column; gap: 14px; }
.posty-sidebar-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
}
.posty-sidebar-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 12px;
}
.posty-team-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .15s;
  font-size: 0.82rem;
  color: var(--text-secondary);
}
.posty-team-row:hover  { background: var(--bg-tertiary); color: var(--text-primary); }
.posty-team-row.active { background: rgba(10,132,255,.1); color: var(--primary); }
.posty-team-name { flex: 1; }
.posty-team-cnt {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 10px;
  background: rgba(255,255,255,.06);
  color: var(--text-tertiary);
}
.posty-tag-legend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 4px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background .15s;
}
.posty-tag-legend-row:hover { background: var(--bg-tertiary); }
.posty-tag-cnt { font-size: 0.72rem; color: var(--text-tertiary); }

/* ── Empty state ──────────────────────────── */
.posty-empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-tertiary);
  font-size: 0.88rem;
}
.posty-empty-icon { font-size: 2.5rem; margin-bottom: 12px; }

/* ── Shake (validation) ───────────────────── */
@keyframes postyShake {
  0%,100% { transform: translateX(0); }
  20%,60% { transform: translateX(-6px); }
  40%,80% { transform: translateX(6px); }
}
.posty-shake { animation: postyShake .4s ease; border-color: var(--danger) !important; }

/* ── Responsive ───────────────────────────── */
@media (max-width: 960px) {
  .posty-page-wrap { grid-template-columns: 1fr; }
  .posty-sidebar-col { display: none; }
}
@media (max-width: 600px) {
  .posty-page-wrap { padding: 12px 12px 80px; }
  .posty-compose-tags,
  .posty-compose-img-row,
  .posty-compose-footer { padding-left: 0; }
}




/* ============================================
   💡 AYDINLATMA TARAMA (v2)
   ============================================ */

/* Tabs Header */
.ls-tabs-header {
  display: flex;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
  gap: 8px;
  overflow-x: auto;
}
.ls-tabs-header::-webkit-scrollbar { display: none; }
.ls-tab-btn {
  padding: 14px 20px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}
.ls-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.03);
}
.ls-tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Page Inner Layout */
.ls-page-inner {
  padding: 24px;
}

/* Toolbar */
.ls-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.ls-search-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 340px;
}
.ls-search {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: .85rem;
  outline: none;
  transition: border-color .2s;
}
.ls-search:focus { border-color: var(--primary); }

/* Table */
.ls-table-wrap {
  background: rgba(255,255,255,.02);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 14px;
  overflow: hidden;
  overflow-x: auto;
}
.ls-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
}
.ls-table thead th {
  padding: 10px 14px;
  text-align: left;
  color: var(--text-tertiary);
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  border-bottom: 1px solid rgba(255,255,255,.07);
  white-space: nowrap;
  background: rgba(255,255,255,.02);
}
.ls-table tbody tr {
  border-bottom: 1px solid rgba(255,255,255,.04);
  transition: background .15s;
}
.ls-table tbody tr:hover { background: rgba(255,255,255,.04); }
.ls-table td { padding: 11px 14px; vertical-align: middle; }

/* Badges */
.ls-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 700;
  white-space: nowrap;
}
.ls-badge.ok     { background: rgba(48,209,88,.13);  color: #30D158; border: 1px solid rgba(48,209,88,.25); }
.ls-badge.danger { background: rgba(255,69,58,.13);  color: #FF453A; border: 1px solid rgba(255,69,58,.25); }

/* Pano Grid */
.ls-pano-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.ls-pano-card {
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 14px;
  padding: 16px;
}
.ls-pano-card h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.ls-tu-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ls-tu-item {
  background: rgba(255,255,255,.02);
  border: 1px solid rgba(255,255,255,.05);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.8rem;
}

/* Map Form Panel */
.ls-map-panel {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 320px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  z-index: 1000;
  overflow: hidden;
}
.ls-map-panel .panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(255,255,255,.02);
  border-bottom: 1px solid var(--border);
}
.ls-map-panel .panel-header h4 { margin: 0; font-size: 0.9rem; }
.ls-map-panel .panel-body { padding: 16px; }

/* Modal Elements */
.ls-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
  backdrop-filter: blur(4px);
}
.ls-modal-overlay.show {
  opacity: 1;
  pointer-events: all;
}
.ls-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(.96);
  z-index: 2001;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 580px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0,0,0,.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
}
.ls-modal.open {
  opacity: 1;
  pointer-events: all;
  transform: translate(-50%, -50%) scale(1);
}
.ls-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 0;
}
.ls-modal-header h3 { font-size: 1rem; font-weight: 700; }
.ls-modal-close {
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.ls-modal-close:hover { background: var(--bg-card-hover); color: var(--text-primary); }

.ls-modal-body { padding: 20px 24px 24px; }
.ls-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.ls-pano-marker {
  font-size: 24px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

@media (max-width: 600px) {
  .ls-form-grid { grid-template-columns: 1fr; }
  .ls-toolbar { flex-direction: column; align-items: stretch; }
  .ls-search-wrap { max-width: 100%; }
}
/* ── Aydınlatma Tarama Dashboard ── */
.ls-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 20px;
  padding: 20px 0;
}

.ls-dash-card {
  background: var(--surface-light);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.ls-dash-card.col-4 { grid-column: span 4; }
.ls-dash-card.col-8 { grid-column: span 8; }
.ls-dash-card.col-6 { grid-column: span 6; }
.ls-dash-card.col-12 { grid-column: span 12; }

@media (max-width: 1024px) {
  .ls-dash-card.col-4, .ls-dash-card.col-8, .ls-dash-card.col-6 {
    grid-column: span 12;
  }
}

.ls-dash-card h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ls-chart-container {
  position: relative;
  width: 100%;
  height: 250px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.ls-stat-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.ls-stat-row:last-child {
  border-bottom: none;
}

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

.ls-mini-map {
  width: 100%;
  height: 300px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.ls-filter-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.ls-filter-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.ls-filter-btn:hover {
  background: rgba(255, 255, 255, 0.05);
}

.ls-filter-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
