:root {
  --bg-void: #07090e;
  --bg-panel: #0e121b;
  --bg-card: #131824;
  --bg-card-hover: #171d2c;
  --bg-input: #0a0d14;
  --border-iron: #252d3f;
  --border-gold: rgba(218, 168, 72, 0.38);
  --gold-bright: #f0c45c;
  --gold-mid: #c89634;
  --gold-dim: rgba(240, 196, 92, 0.12);
  --crimson: #e04646;
  --crimson-dim: rgba(224, 70, 70, 0.14);
  --emerald: #22c55e;
  --emerald-dim: rgba(34, 197, 94, 0.14);
  --cyan: #38bdf8;
  --cyan-dim: rgba(56, 189, 248, 0.12);
  --violet: #a78bfa;
  --violet-dim: rgba(167, 139, 250, 0.12);
  --amber: #f59e0b;
  --text-main: #edf2f7;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.45);
  --radius: 12px;
  --radius-sm: 8px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at 15% 0%, rgba(200, 150, 52, 0.08), transparent 38%),
    radial-gradient(circle at 85% 10%, rgba(224, 70, 70, 0.07), transparent 34%),
    var(--bg-void);
  color: var(--text-main);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

.tabular {
  font-variant-numeric: tabular-nums;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-void);
}
::-webkit-scrollbar-thumb {
  background: var(--border-iron);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #364158;
}

/* Login Page */
.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: linear-gradient(180deg, #151a27 0%, #0e121b 100%);
  border: 1px solid var(--border-gold);
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65), 0 0 40px rgba(218, 168, 72, 0.08);
}

.gm-crest {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.gm-crest-badge {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(240, 196, 92, 0.22), rgba(224, 70, 70, 0.2));
  border: 1px solid var(--border-gold);
  color: var(--gold-bright);
  font-weight: 800;
  letter-spacing: 0.5px;
  font-size: 14px;
}

.login-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--gold-bright);
  letter-spacing: 0.4px;
}

.login-sub {
  margin: 6px 0 24px;
  color: var(--text-muted);
  font-size: 13px;
}

/* Form Elements */
.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  letter-spacing: 0.3px;
}

.input, .textarea, .select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-iron);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 10px 12px;
  font-size: 13.5px;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--gold-mid);
  box-shadow: 0 0 0 3px rgba(240, 196, 92, 0.12);
}

.textarea {
  min-height: 82px;
  resize: vertical;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-iron);
  background: #1a2030;
  color: var(--text-main);
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.btn:hover {
  background: #222a3e;
  border-color: #364158;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-gold {
  background: linear-gradient(135deg, #d7a33d, #b57f22);
  border-color: #f0c45c;
  color: #110d05;
  font-weight: 700;
}

.btn-gold:hover {
  background: linear-gradient(135deg, #e5b34b, #c58d2b);
  border-color: #f7d47c;
}

.btn-danger {
  background: rgba(224, 70, 70, 0.14);
  border-color: rgba(224, 70, 70, 0.4);
  color: #fca5a5;
}

.btn-danger:hover {
  background: rgba(224, 70, 70, 0.25);
  border-color: var(--crimson);
}

.btn-sm {
  padding: 6px 10px;
  font-size: 12px;
}

.btn-block {
  width: 100%;
}

.alert-error {
  background: var(--crimson-dim);
  border: 1px solid rgba(224, 70, 70, 0.45);
  color: #fecaca;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
}

.hidden {
  display: none !important;
}

/* Dashboard Layout */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(9, 11, 16, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-iron);
}

.topbar-inner {
  max-width: 1460px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.6px;
  color: var(--gold-bright);
  margin: 0;
}

.brand-sub {
  font-size: 11.5px;
  color: var(--text-muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--emerald-dim);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: #86efac;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.65); }
  70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.user-badge {
  padding: 6px 11px;
  border-radius: var(--radius-sm);
  background: var(--gold-dim);
  border: 1px solid var(--border-gold);
  color: var(--gold-bright);
  font-size: 12px;
  font-weight: 700;
}

.container {
  max-width: 1460px;
  margin: 0 auto;
  padding: 22px 24px 60px;
}

/* Global Summary Grid */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

@media (max-width: 1220px) {
  .summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.stat-card {
  background: linear-gradient(180deg, #141926 0%, #0f131d 100%);
  border: 1px solid var(--border-iron);
  border-radius: var(--radius);
  padding: 15px 16px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.stat-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: var(--accent, var(--gold-mid));
  opacity: 0.85;
}

.stat-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.45px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-value {
  margin-top: 8px;
  font-size: 26px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.4px;
}

.stat-sub {
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--text-dim);
}

/* Toolbar */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding: 12px 14px;
  background: var(--bg-panel);
  border: 1px solid var(--border-iron);
  border-radius: var(--radius);
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1;
}

.search-box {
  min-width: 240px;
  max-width: 340px;
  flex: 1;
}

.filter-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.pill-btn {
  border: 1px solid var(--border-iron);
  background: var(--bg-input);
  color: var(--text-muted);
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.pill-btn:hover {
  color: var(--text-main);
  border-color: #3a465f;
}

.pill-btn.active {
  background: var(--gold-dim);
  border-color: var(--border-gold);
  color: var(--gold-bright);
}

/* App Cards Grid */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
}

@media (max-width: 460px) {
  .apps-grid {
    grid-template-columns: 1fr;
  }
}

.app-card {
  background: linear-gradient(180deg, #151b29 0%, #10141f 100%);
  border: 1px solid var(--border-iron);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color 0.18s, transform 0.18s;
}

.app-card:hover {
  border-color: rgba(240, 196, 92, 0.45);
  transform: translateY(-1px);
}

.app-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.app-title {
  margin: 0;
  font-size: 16.5px;
  font-weight: 700;
  color: var(--text-main);
}

.app-id-tag {
  display: inline-block;
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--gold-bright);
  background: rgba(240, 196, 92, 0.08);
  border: 1px solid rgba(240, 196, 92, 0.22);
  padding: 2px 7px;
  border-radius: 6px;
}

.badges-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid transparent;
}

.badge-online {
  background: var(--emerald-dim);
  border-color: rgba(34, 197, 94, 0.35);
  color: #86efac;
}

.badge-offline {
  background: rgba(100, 116, 139, 0.14);
  border-color: rgba(100, 116, 139, 0.25);
  color: var(--text-muted);
}

.badge-ads-on {
  background: var(--cyan-dim);
  border-color: rgba(56, 189, 248, 0.3);
  color: #7dd3fc;
}

.badge-ads-off {
  background: var(--crimson-dim);
  border-color: rgba(224, 70, 70, 0.38);
  color: #fca5a5;
}

.badge-announce {
  background: var(--violet-dim);
  border-color: rgba(167, 139, 250, 0.35);
  color: #ddd6fe;
}

.metrics-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.mini-box {
  background: var(--bg-input);
  border: 1px solid rgba(37, 45, 63, 0.85);
  border-radius: var(--radius-sm);
  padding: 9px 10px;
}

.mini-box-label {
  font-size: 10.5px;
  color: var(--text-dim);
  font-weight: 600;
  text-transform: uppercase;
}

.mini-box-val {
  margin-top: 3px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
}

.app-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid rgba(37, 45, 63, 0.7);
  padding-top: 10px;
}

.app-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* Toggle Switch */
.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  font-size: 12.5px;
  font-weight: 600;
}

.switch input {
  appearance: none;
  width: 40px;
  height: 22px;
  background: #232a3b;
  border: 1px solid var(--border-iron);
  border-radius: 999px;
  position: relative;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s;
}

.switch input::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #cbd5e1;
  transition: transform 0.18s, background 0.18s;
}

.switch input:checked {
  background: rgba(34, 197, 94, 0.28);
  border-color: var(--emerald);
}

.switch input:checked::after {
  transform: translateX(18px);
  background: var(--emerald);
}

/* Empty State */
.empty-state {
  background: var(--bg-panel);
  border: 1px dashed var(--border-gold);
  border-radius: var(--radius);
  padding: 42px 24px;
  text-align: center;
}

.empty-state h3 {
  margin: 0 0 8px;
  color: var(--gold-bright);
}

.empty-state p {
  margin: 0 auto 18px;
  max-width: 560px;
  color: var(--text-muted);
  font-size: 13.5px;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(4, 6, 10, 0.78);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal {
  width: 100%;
  max-width: 980px;
  max-height: 92vh;
  overflow-y: auto;
  background: linear-gradient(180deg, #151a27 0%, #0d111a 100%);
  border: 1px solid var(--border-gold);
  border-radius: 14px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.75);
}

.modal-sm {
  max-width: 480px;
}

.modal-head {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(17, 22, 34, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-iron);
  padding: 16px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-head h2 {
  margin: 0;
  font-size: 17px;
  color: var(--gold-bright);
}

.modal-body {
  padding: 20px 22px;
}

.modal-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 20px;
}

@media (max-width: 860px) {
  .modal-grid {
    grid-template-columns: 1fr;
  }
}

.section-box {
  background: rgba(10, 13, 20, 0.65);
  border: 1px solid var(--border-iron);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 14px;
}

.section-title {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--gold-bright);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 540px) {
  .row-2 {
    grid-template-columns: 1fr;
  }
}

.code-snippet {
  background: #06080c;
  border: 1px solid var(--border-iron);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px;
  color: #cbd5e1;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.history-table th,
.history-table td {
  padding: 7px 6px;
  border-bottom: 1px solid rgba(37, 45, 63, 0.7);
  text-align: right;
}

.history-table th:first-child,
.history-table td:first-child {
  text-align: left;
  color: var(--text-muted);
}

.history-table th {
  color: var(--text-dim);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
}

/* Toast */
.toast-stack {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: #141a26;
  border: 1px solid var(--border-gold);
  color: var(--text-main);
  padding: 11px 15px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
}

.toast.error {
  border-color: var(--crimson);
  color: #fecaca;
}

/* Economy Grid & Broadcast Modal */
.row-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 680px) {
  .row-3 {
    grid-template-columns: 1fr;
  }
}

.btn-announce {
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.25), rgba(56, 189, 248, 0.22));
  border-color: rgba(167, 139, 250, 0.55);
  color: #ede9fe;
  font-weight: 700;
}

.btn-announce:hover {
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.38), rgba(56, 189, 248, 0.32));
  border-color: #c4b5fd;
}

.modal-md {
  max-width: 660px;
}

.active-ann-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.active-ann-card {
  background: var(--bg-input);
  border: 1px solid rgba(167, 139, 250, 0.32);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.active-ann-meta {
  font-size: 11.5px;
  color: var(--gold-bright);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.active-ann-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 3px;
}

.active-ann-text {
  font-size: 12.5px;
  color: var(--text-muted);
  white-space: pre-line;
}

.badge-econ {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.38);
  color: #fde68a;
}

/* Top Navigation Tabs & Hukuk Stüdyosu */
.nav-tabs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-input);
  border: 1px solid var(--border-iron);
  padding: 4px;
  border-radius: 10px;
}

.nav-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 700;
  padding: 7px 13px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.nav-tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.03);
}

.nav-tab-btn.active {
  background: linear-gradient(135deg, rgba(240, 196, 92, 0.2), rgba(200, 150, 52, 0.12));
  border-color: var(--border-gold);
  color: var(--gold-bright);
}

.tab-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  background: var(--crimson);
  color: #fff;
}

.studio-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  background: linear-gradient(180deg, #151b29 0%, #0f131e 100%);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 18px;
}

.studio-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}

@media (max-width: 980px) {
  .studio-grid-2 {
    grid-template-columns: 1fr;
  }
}

.studio-panel {
  background: linear-gradient(180deg, #141926 0%, #0f131d 100%);
  border: 1px solid var(--border-iron);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-card);
}

.studio-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 460px;
  overflow-y: auto;
  padding-right: 4px;
}

.studio-item {
  background: var(--bg-input);
  border: 1px solid var(--border-iron);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.studio-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.studio-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-emerald {
  background: rgba(34, 197, 94, 0.18);
  border-color: rgba(34, 197, 94, 0.45);
  color: #86efac;
}

.btn-emerald:hover {
  background: rgba(34, 197, 94, 0.3);
  border-color: var(--emerald);
}

.petition-preview {
  background: #070a10;
  border: 1px solid rgba(37, 45, 63, 0.8);
  border-radius: 6px;
  padding: 9px 11px;
  font-size: 12px;
  color: var(--text-muted);
  white-space: pre-wrap;
  max-height: 140px;
  overflow-y: auto;
}


