/* ============================================================
   SOCIAL TRADING ADMIN — CORE STYLES
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green: #4CAF50;
  --green-dark: #388E3C;
  --green-light: #E8F5E9;
  --green-mid: #C8E6C9;
  --blue: #1976D2;
  --blue-light: #E3F2FD;
  --red: #E53935;
  --red-light: #FFEBEE;
  --orange: #F57C00;
  --orange-light: #FFF3E0;
  --gray-50: #FAFAFA;
  --gray-100: #F5F5F5;
  --gray-200: #EEEEEE;
  --gray-300: #E0E0E0;
  --gray-400: #BDBDBD;
  --gray-500: #9E9E9E;
  --gray-600: #757575;
  --gray-700: #616161;
  --gray-800: #424242;
  --gray-900: #212121;
  --white: #FFFFFF;
  --border: 1px solid var(--gray-300);
  --radius: 4px;
  --radius-lg: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.12);
  --shadow-md: 0 2px 8px rgba(0,0,0,.12);
  --font: 'Roboto', 'Segoe UI', sans-serif;
}

body {
  font-family: var(--font);
  font-size: 14px;
  color: var(--gray-900);
  background: var(--gray-100);
  line-height: 1.5;
}

a { color: var(--green-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── TOP NAVBAR ─────────────────────────────────────────── */
.navbar {
  background: var(--white);
  border-bottom: var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}
.navbar-inner {
  display: flex;
  align-items: center;
  height: 52px;
  padding: 0 20px;
  gap: 0;
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 700;
  color: var(--green-dark);
  text-decoration: none;
  padding-right: 24px;
  border-right: var(--border);
  margin-right: 8px;
  white-space: nowrap;
}
.navbar-brand svg { width: 28px; height: 28px; }
.nav-links {
  display: flex;
  align-items: stretch;
  height: 52px;
  flex: 1;
  gap: 0;
  list-style: none;
}
.nav-links li { position: relative; }
.nav-links a {
  display: flex;
  align-items: center;
  padding: 0 16px;
  height: 52px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--gray-700);
  text-decoration: none;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  transition: all .15s;
}
.nav-links a:hover { color: var(--green-dark); background: var(--gray-50); }
.nav-links a.active {
  color: var(--green-dark);
  border-bottom-color: var(--green);
  font-weight: 600;
}
.navbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.nav-icon-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: var(--border);
  background: var(--white);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-600);
  font-size: 14px;
  transition: background .15s;
}
.nav-icon-btn:hover { background: var(--gray-100); }
.lang-btn {
  height: 30px; padding: 0 10px;
  border-radius: 15px;
  border: var(--border);
  background: var(--white);
  cursor: pointer;
  font-size: 12px; font-weight: 600;
  color: var(--gray-700);
  display: flex; align-items: center; gap: 4px;
}

/* ── BREADCRUMB ─────────────────────────────────────────── */
.breadcrumb {
  padding: 10px 24px;
  font-size: 13px;
  color: var(--gray-500);
  background: var(--white);
  border-bottom: var(--border);
}
.breadcrumb a { color: var(--gray-600); }
.breadcrumb span { margin: 0 6px; }

/* ── LAYOUT ─────────────────────────────────────────────── */
.layout {
  display: flex;
  min-height: calc(100vh - 53px);
}
.sidebar {
  width: 220px;
  min-width: 220px;
  background: var(--white);
  border-right: var(--border);
  padding: 16px 0;
  flex-shrink: 0;
}
.sidebar-section {
  margin-bottom: 8px;
}
.sidebar-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .10em;
  color: var(--gray-500);
  padding: 8px 16px 4px;
}
.sidebar a {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  font-size: 13.5px;
  color: var(--gray-700);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: all .12s;
  gap: 6px;
}
.sidebar a:hover { background: var(--gray-50); color: var(--green-dark); }
.sidebar a.active {
  background: var(--green-light);
  color: var(--green-dark);
  border-left-color: var(--green);
  font-weight: 600;
}
.main-content {
  flex: 1;
  padding: 24px;
  min-width: 0;
}

/* ── PAGE HEADER ────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  box-shadow: var(--shadow);
}
.page-header-icon {
  width: 48px; height: 48px; min-width: 48px;
  background: var(--gray-200);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.page-header-text h1 { font-size: 20px; font-weight: 600; }
.page-header-text p { font-size: 13px; color: var(--gray-500); margin-top: 2px; }
.page-header-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* ── STAT TILES (top of admin page) ────────────────────── */
.stat-tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}
.stat-tile {
  padding: 14px 18px;
  border-right: var(--border);
}
.stat-tile:last-child { border-right: none; }
.stat-tile-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--gray-500);
  margin-bottom: 10px;
}
.stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
  font-size: 13px;
}
.stat-row-label { color: var(--gray-700); }
.stat-row-value { font-weight: 600; display: flex; align-items: center; gap: 5px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-green { background: var(--green); }
.dot-gray { background: var(--gray-400); }
.dot-red { background: var(--red); }

/* ── CARDS ──────────────────────────────────────────────── */
.card {
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header {
  padding: 14px 20px;
  border-bottom: var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--white);
}
.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-800);
  border-left: 3px solid var(--green);
  padding-left: 10px;
}
.card-subtitle { font-size: 12px; color: var(--gray-500); margin-top: 2px; padding-left: 13px; }
.card-body { padding: 20px; }
.card-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ── BUTTONS ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 0 14px; height: 34px;
  font-size: 13px; font-weight: 500;
  border-radius: var(--radius);
  border: var(--border);
  cursor: pointer;
  background: var(--white);
  color: var(--gray-700);
  transition: all .15s;
  white-space: nowrap;
  font-family: var(--font);
}
.btn:hover { background: var(--gray-100); }
.btn-primary { background: var(--green); border-color: var(--green); color: #fff; font-weight: 600; }
.btn-primary:hover { background: var(--green-dark); border-color: var(--green-dark); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn-danger { background: var(--red-light); border-color: var(--red); color: var(--red); }
.btn-warning { background: var(--orange-light); border-color: var(--orange); color: var(--orange); }
.btn-success { background: var(--green-light); border-color: var(--green); color: var(--green-dark); }
.btn-outline-green { border-color: var(--green); color: var(--green-dark); }
.btn-outline-green:hover { background: var(--green-light); }

/* ── TABLES ─────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: .06em;
  border-bottom: 2px solid var(--gray-200);
  background: var(--gray-50);
  white-space: nowrap;
  text-align: left;
}
tbody td {
  padding: 11px 14px;
  font-size: 13px;
  border-bottom: 1px solid var(--gray-200);
  color: var(--gray-800);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--gray-50); }
.tbl-link { color: var(--green-dark); font-weight: 500; }
.tbl-link:hover { text-decoration: underline; }

/* ── BADGES ─────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 8px; border-radius: 12px;
  font-size: 11px; font-weight: 600;
  white-space: nowrap;
}
.badge-green { background: var(--green-light); color: var(--green-dark); border: 1px solid var(--green-mid); }
.badge-gray { background: var(--gray-200); color: var(--gray-700); border: 1px solid var(--gray-300); }
.badge-red { background: var(--red-light); color: var(--red); border: 1px solid #FFCDD2; }
.badge-orange { background: var(--orange-light); color: var(--orange); border: 1px solid #FFE0B2; }
.badge-blue { background: var(--blue-light); color: var(--blue); border: 1px solid #BBDEFB; }

/* ── FORMS ──────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block; margin-bottom: 5px;
  font-size: 13px; font-weight: 500; color: var(--gray-700);
}
.form-label .req { color: var(--red); margin-left: 2px; }
.form-control {
  width: 100%; height: 38px;
  padding: 0 12px;
  border: var(--border); border-radius: var(--radius);
  font-size: 13px; font-family: var(--font);
  color: var(--gray-900); background: var(--white);
  outline: none; transition: border-color .15s;
}
.form-control:focus { border-color: var(--green); box-shadow: 0 0 0 2px rgba(76,175,80,.12); }
.form-hint { font-size: 11px; color: var(--gray-500); margin-top: 4px; line-height: 1.4; }
textarea.form-control { height: auto; padding: 8px 12px; resize: vertical; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath fill='%23757575' d='M5 6L0 0h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ── DETAIL SECTIONS ─────────────────────────────────────── */
.detail-section {
  border: var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  overflow: hidden;
  background: var(--white);
}
.detail-section-header {
  padding: 12px 18px;
  background: var(--gray-50);
  border-bottom: var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.detail-section-title {
  font-size: 14px; font-weight: 600;
  color: var(--gray-800);
  border-left: 3px solid var(--green);
  padding-left: 10px;
}
.detail-section-sub { font-size: 12px; color: var(--gray-500); padding-left: 13px; }
.detail-rows {}
.detail-row {
  display: flex;
  padding: 10px 18px;
  border-bottom: 1px solid var(--gray-200);
  align-items: center;
}
.detail-row:last-child { border-bottom: none; }
.detail-row-key {
  width: 220px; min-width: 220px;
  font-size: 13px; color: var(--gray-600); font-weight: 500;
}
.detail-row-val { font-size: 13px; color: var(--gray-900); }

/* ── TABS ────────────────────────────────────────────────── */
.tabs {
  display: flex; border-bottom: 2px solid var(--gray-200);
  margin-bottom: 20px; gap: 0;
}
.tab {
  padding: 10px 18px;
  font-size: 13.5px; font-weight: 500;
  color: var(--gray-600);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  text-decoration: none;
  transition: all .15s;
}
.tab:hover { color: var(--green-dark); }
.tab.active { color: var(--green-dark); border-bottom-color: var(--green); font-weight: 600; }

/* ── INFO SIDEBAR PANEL ──────────────────────────────────── */
.info-panel {
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  font-size: 13px;
  overflow: hidden;
}
.info-panel-section {
  padding: 12px 14px;
  border-bottom: var(--border);
}
.info-panel-section:last-child { border-bottom: none; }
.info-panel-label {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .10em;
  color: var(--gray-500); margin-bottom: 8px;
  display: flex; align-items: center; justify-content: space-between;
}
.info-panel-row {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 6px; gap: 8px;
}
.info-panel-key { color: var(--gray-600); }
.info-panel-val { font-weight: 500; color: var(--gray-900); text-align: right; }

/* ── STAT CARDS (dashboard) ──────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}
.stat-card-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--gray-500); margin-bottom: 8px; }
.stat-card-value { font-size: 28px; font-weight: 700; color: var(--gray-900); line-height: 1; }
.stat-card-sub { font-size: 12px; color: var(--gray-500); margin-top: 6px; }
.stat-card-green { border-top: 3px solid var(--green); }
.stat-card-blue { border-top: 3px solid var(--blue); }
.stat-card-orange { border-top: 3px solid var(--orange); }
.stat-card-red { border-top: 3px solid var(--red); }

/* ── ALERTS ──────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  display: flex; align-items: flex-start; gap: 10px;
  margin-bottom: 16px;
  border-left: 4px solid;
}
.alert-info { background: var(--blue-light); border-color: var(--blue); color: #0D47A1; }
.alert-success { background: var(--green-light); border-color: var(--green); color: var(--green-dark); }
.alert-warning { background: var(--orange-light); border-color: var(--orange); color: var(--orange); }
.alert-danger { background: var(--red-light); border-color: var(--red); color: var(--red); }

/* ── MODAL ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 500;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 520px;
  box-shadow: 0 8px 32px rgba(0,0,0,.2);
  max-height: 90vh; overflow-y: auto;
}
.modal-header {
  padding: 18px 22px 14px;
  border-bottom: var(--border);
}
.modal-title { font-size: 16px; font-weight: 600; color: var(--gray-900); }
.modal-sub { font-size: 12px; color: var(--gray-500); margin-top: 3px; }
.modal-body { padding: 20px 22px; }
.modal-footer {
  padding: 14px 22px;
  border-top: var(--border);
  display: flex; justify-content: flex-end; gap: 10px;
  background: var(--gray-50);
}

/* ── TOGGLE ──────────────────────────────────────────────── */
.toggle {
  width: 38px; height: 20px;
  border-radius: 10px;
  background: var(--gray-300);
  position: relative; cursor: pointer;
  transition: background .18s;
  border: none; outline: none;
  flex-shrink: 0;
}
.toggle.on { background: var(--green); }
.toggle::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
  transition: left .18s;
}
.toggle.on::after { left: 20px; }

/* ── PAGINATION ──────────────────────────────────────────── */
.pagination {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px;
  border-top: var(--border);
  background: var(--gray-50);
  font-size: 12px; color: var(--gray-600);
}
.pag-btns { display: flex; gap: 4px; }
.pag-btn {
  width: 28px; height: 28px;
  border: var(--border); border-radius: var(--radius);
  background: var(--white); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--gray-600);
}
.pag-btn:hover { background: var(--gray-100); }
.pag-btn.active { background: var(--green); border-color: var(--green); color: #fff; }
.pag-select { height: 28px; padding: 0 8px; border: var(--border); border-radius: var(--radius); font-size: 12px; }

/* ── FILTERS BAR ─────────────────────────────────────────── */
.filters-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  background: var(--gray-50);
  border-bottom: var(--border);
  flex-wrap: wrap;
}
.filters-bar .form-control { height: 32px; font-size: 12px; width: auto; min-width: 100px; }

/* ── POSITIVE / NEGATIVE ─────────────────────────────────── */
.pos { color: var(--green-dark); font-weight: 600; }
.neg { color: var(--red); font-weight: 600; }
.neutral { color: var(--gray-600); }

/* ── TWO COLUMN LAYOUT ───────────────────────────────────── */
.two-col { display: grid; grid-template-columns: 1fr 280px; gap: 20px; align-items: start; }
.three-col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ── CHART PLACEHOLDER ───────────────────────────────────── */
.chart-bar {
  display: flex; align-items: flex-end; gap: 4px;
  height: 50px;
}
.chart-col {
  flex: 1; border-radius: 2px 2px 0 0;
  min-width: 14px; max-width: 24px;
}
.chart-col-green { background: var(--green); }
.chart-col-red { background: var(--red); opacity: .7; }
.chart-label {
  font-size: 10px; color: var(--gray-500);
  display: flex; gap: 4px; margin-top: 3px;
}

/* ── MISC ────────────────────────────────────────────────── */
.section-title { font-size: 16px; font-weight: 600; color: var(--gray-800); margin-bottom: 16px; }
.text-muted { color: var(--gray-500); font-size: 12px; }
.text-right { text-align: right; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.gap-8 { gap: 8px; }
.flex { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.actions-cell { display: flex; gap: 5px; }
.empty-state {
  text-align: center; padding: 40px 20px; color: var(--gray-500);
  font-size: 13px;
}
.empty-state svg { width: 36px; height: 36px; margin-bottom: 10px; opacity: .4; }

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media(max-width: 900px) {
  .sidebar { display: none; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat-tiles { grid-template-columns: 1fr 1fr; }
  .two-col { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}
