/* ==========================================================================
   โยโย่แลนด์ (Yoyo Land) - Modern Dashboard Design System
   ========================================================================== */

:root {
  color-scheme: light;
  --font-body: "Prompt", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: "Plus Jakarta Sans", "Prompt", sans-serif;

  /* Surfaces & Backgrounds - Premium Light */
  --bg-page: #fafbfc;
  --bg-surface: #ffffff;
  --bg-surface-alt: #f3f4f6;
  --bg-sidebar: #ffffff;
  --border-color: rgba(0, 0, 0, 0.06);
  --border-subtle: rgba(0, 0, 0, 0.03);

  /* Typography */
  --text-main: #111827;
  --text-secondary: #4b5563;
  --text-muted: #9ca3af;

  /* Brand & Accents (Vibrant Electric) */
  --brand-primary: #4f46e5;
  --brand-primary-hover: #4338ca;
  --brand-gradient: var(--brand-primary);
  --brand-glow: rgba(79, 70, 229, 0.25);
  --brand-soft: #eef2ff;

  /* Semantic Colors - Softened for elegance */
  --color-success: #059669;
  --color-success-soft: #d1fae5;
  --color-warning: #d97706;
  --color-warning-soft: #fef3c7;
  --color-danger: #dc2626;
  --color-danger-soft: #fee2e2;
  --color-info: #0284c7;
  --color-info-soft: #e0f2fe;
  --color-purple: #7e22ce;
  --color-purple-soft: #f3e8ff;

  /* Shadows - Extremely smooth and diffuse */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-card: 0 4px 24px -4px rgba(0, 0, 0, 0.04), 0 2px 8px -2px rgba(0, 0, 0, 0.02);
  --shadow-hover: 0 20px 40px -8px rgba(0, 0, 0, 0.08), 0 8px 16px -4px rgba(0, 0, 0, 0.04);
  --shadow-modal: 0 32px 64px -16px rgba(0, 0, 0, 0.15);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  --sidebar-w: 260px;
}

[data-theme="dark"] {
  color-scheme: dark;
  /* Surfaces & Backgrounds - Deep Dark (OLED style) */
  --bg-page: #0a0a0a;
  --bg-surface: #121212;
  --bg-surface-alt: #1a1a1a;
  --bg-sidebar: #0a0a0a;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-subtle: rgba(255, 255, 255, 0.03);

  --text-main: #f9fafb;
  --text-secondary: #a1a1aa;
  --text-muted: #52525b;

  --brand-primary: #818cf8;
  --brand-primary-hover: #6366f1;
  --brand-soft: rgba(99, 102, 241, 0.12);
  
  --color-success: #34d399;
  --color-success-soft: rgba(52, 211, 153, 0.12);
  --color-warning: #fbbf24;
  --color-warning-soft: rgba(251, 191, 36, 0.12);
  --color-danger: #f87171;
  --color-danger-soft: rgba(248, 113, 113, 0.12);
  --color-info: #38bdf8;
  --color-info-soft: rgba(56, 189, 248, 0.12);
  --color-purple: #c084fc;
  --color-purple-soft: rgba(192, 132, 252, 0.12);

  --shadow-card: 0 4px 24px -4px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  --shadow-hover: 0 20px 40px -8px rgba(0, 0, 0, 1), 0 0 0 1px rgba(129, 140, 248, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --shadow-modal: 0 32px 64px -16px rgba(0, 0, 0, 1), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Base Styles */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-family: var(--font-body);
  background-color: var(--bg-page);
  color: var(--text-main);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  display: flex;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Sidebar Layout */
.app-sidebar {
  width: var(--sidebar-w);
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 40;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.brand-section {
  padding: 24px 20px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.brand-logo-wrap {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 4px 12px var(--brand-glow);
  flex-shrink: 0;
  background: var(--brand-gradient);
  display: grid;
  place-items: center;
}

.brand-logo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-info {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}

.brand-badge {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
}

/* Navigation */
.nav-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-category-title {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 10px 12px 6px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.88rem;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: all 0.18s ease;
}

.nav-link svg {
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  transition: color 0.18s ease, transform 0.18s ease;
  flex-shrink: 0;
}

.nav-link:hover {
  color: var(--text-main);
  background: var(--bg-surface-alt);
}

.nav-link:hover svg {
  color: var(--brand-primary);
  transform: scale(1.08);
}

.nav-link.active {
  color: #ffffff;
  background: var(--brand-gradient);
  box-shadow: 0 6px 18px var(--brand-glow);
  font-weight: 600;
}

.nav-link.active svg {
  color: #ffffff;
}

.nav-badge {
  margin-left: auto;
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: var(--bg-surface-alt);
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-weight: 600;
}

.nav-link.active .nav-badge {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.nav-badge.danger {
  background: var(--color-danger);
  color: #ffffff;
}

/* User & Sidebar Footer */
.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--bg-surface-alt);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--brand-gradient);
  color: #ffffff;
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 700;
  flex-shrink: 0;
}

.user-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.user-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 0.68rem;
  color: var(--color-success);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}

.user-role::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-success);
  display: inline-block;
}

.footer-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-secondary);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.18s ease;
}

.icon-btn:hover {
  color: var(--text-main);
  border-color: var(--brand-primary);
  background: var(--brand-soft);
}

.icon-btn svg {
  width: 17px;
  height: 17px;
}

/* Main Content Wrapper */
.app-main {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Header Topbar */
.app-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

[data-theme="dark"] .app-topbar {
  background: rgba(15, 21, 35, 0.85);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  max-width: 460px;
}

.mobile-menu-btn {
  display: none;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-main);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.search-box {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}

.search-box svg {
  position: absolute;
  left: 14px;
  width: 17px;
  height: 17px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 40px;
  padding: 0 16px 0 40px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-main);
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Common Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s ease;
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn svg {
  width: 16px;
  height: 16px;
}

.btn-primary {
  background: var(--brand-primary);
  color: #ffffff;
  box-shadow: 0 4px 12px var(--brand-glow);
}

.btn-primary:hover {
  opacity: 0.95;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px var(--brand-glow);
}

.btn-secondary {
  background: var(--bg-surface);
  border-color: var(--border-color);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: var(--bg-surface-alt);
  border-color: var(--text-muted);
}

.btn-soft {
  background: var(--brand-soft);
  color: var(--brand-primary);
  border-color: transparent;
}

.btn-soft:hover {
  background: rgba(99, 102, 241, 0.2);
}

.btn-sm {
  height: 32px;
  padding: 0 12px;
  font-size: 0.78rem;
  border-radius: var(--radius-sm);
}

.btn-danger {
  background: var(--color-danger-soft);
  color: var(--color-danger);
}

.btn-danger:hover {
  background: var(--color-danger);
  color: #ffffff;
}

/* Page Container */
.page-container {
  padding: 30px 32px 60px;
  max-width: 1560px;
  width: 100%;
  margin: 0 auto;
}

/* Page Header */
.page-header {
  margin-bottom: 24px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.header-titles h1 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-titles p {
  margin: 4px 0 0;
  color: var(--text-secondary);
  font-size: 0.88rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Banner / Source Note */
.info-banner {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(236, 72, 153, 0.08) 100%);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 24px;
}

.info-banner-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.info-banner-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  background: var(--brand-gradient);
  color: #ffffff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.info-banner-text {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.info-banner-text strong {
  color: var(--text-main);
  font-weight: 600;
}

/* Metric / KPI Cards */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.metric-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
  transition: all 0.22s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(99, 102, 241, 0.3);
}


.metric-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.metric-label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.metric-icon-wrap {

  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--card-soft, var(--brand-soft));
  color: var(--card-accent, var(--brand-primary));
  display: grid;
  place-items: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.03);
}

.metric-icon-wrap svg {
  width: 20px;
  height: 20px;
}

.metric-number {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.metric-footer {
  margin-top: 10px;
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Filter Toolbar */
.toolbar-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.filter-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  flex-wrap: wrap;
}

.filter-pill {
  flex: 1;
  justify-content: center;
  height: 40px;
  padding: 0 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.18s ease;
}

.filter-pill:hover {
  background: var(--bg-surface-alt);
  color: var(--text-main);
}

.filter-pill.active {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #ffffff;
  box-shadow: 0 4px 12px var(--brand-glow);
}

.pill-count {
  font-size: 0.7rem;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  background: var(--bg-surface-alt);
  color: var(--text-secondary);
}

.filter-pill.active .pill-count {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.view-modes {
  display: flex;
  align-items: center;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  padding: 3px;
}

.view-btn {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.15s ease;
}

.view-btn.active {
  background: var(--bg-surface-alt);
  color: var(--text-main);
}

/* Card Grids */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 18px;
}

.asset-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
  transition: all 0.22s ease;
  display: flex;
  flex-direction: column;
}

.asset-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(99, 102, 241, 0.35);
}

.asset-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.asset-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.asset-icon-box {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #ffffff;
  flex-shrink: 0;
}

.asset-icon-box svg {
  width: 22px;
  height: 22px;
}

.asset-texts {
  min-width: 0;
}

.asset-title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.asset-subtitle {
  margin: 2px 0 0;
  font-size: 0.76rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.badge-teal { background: var(--color-success-soft); color: var(--color-success); }
.badge-teal .badge-dot { background: var(--color-success); }

.badge-yellow { background: var(--color-warning-soft); color: var(--color-warning); }
.badge-yellow .badge-dot { background: var(--color-warning); }

.badge-red { background: var(--color-danger-soft); color: var(--color-danger); }
.badge-red .badge-dot { background: var(--color-danger); }

.badge-blue { background: var(--color-info-soft); color: var(--color-info); }
.badge-blue .badge-dot { background: var(--color-info); }

.badge-purple { background: var(--color-purple-soft); color: var(--color-purple); }
.badge-purple .badge-dot { background: var(--color-purple); }

.badge-gray { background: var(--bg-surface-alt); color: var(--text-secondary); }
.badge-gray .badge-dot { background: var(--text-muted); }

/* Card Metrics & Details */
.asset-metrics-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 10px 0 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.big-stat {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.1;
}

.stat-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.asset-kv-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.kv-box {
  background: var(--bg-surface-alt);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.kv-label {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.kv-value {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-main);
  margin-top: 2px;
}

.asset-actions {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* Modern Data Table */
.table-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.modern-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.84rem;
}

.modern-table th {
  padding: 14px 18px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--bg-surface-alt);
  border-bottom: 1px solid var(--border-color);
}

.modern-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  vertical-align: middle;
}

.modern-table tbody tr:hover {
  background: var(--bg-surface-alt);
}

.modern-table tbody tr:last-child td {
  border-bottom: none;
}

/* Platform Tiles Grid */
.platform-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.platform-tile {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
  text-align: left;
  width: 100%;
}

.platform-tile:hover {
  border-color: var(--brand-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.platform-tile-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.platform-tile-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.platform-tile-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
}

.platform-tile-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.platform-tile-count {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-main);
}

/* Action Items Checklist */
.action-checklist {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.18s ease;
}

.action-row:hover {
  border-color: var(--brand-primary);
  background: var(--bg-surface-alt);
}

.action-row-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.action-num-badge {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
}

.action-row-text strong {
  display: block;
  font-size: 0.88rem;
  color: var(--text-main);
}

.action-row-text small {
  display: block;
  font-size: 0.74rem;
  color: var(--text-muted);
}

.action-go {
  color: var(--brand-primary);
  font-size: 0.82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Empty State */
.empty-state {
  padding: 50px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  background: var(--brand-soft);
  color: var(--brand-primary);
  display: grid;
  place-items: center;
  margin-bottom: 16px;
}

.empty-state-icon svg {
  width: 28px;
  height: 28px;
}

.empty-state h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-main);
}

.empty-state p {
  margin: 6px 0 20px;
  font-size: 0.82rem;
  color: var(--text-muted);
  max-width: 400px;
}

/* Dialog & Form Styles */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-modal);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(14px) scale(0.98);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.open .modal-content {
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: 22px 24px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-title-box h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
}

.modal-title-box p {
  margin: 2px 0 0;
  font-size: 0.78rem;
  color: var(--brand-primary);
  font-weight: 500;
}

.modal-body {
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-main);
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.form-textarea {
  height: 85px;
  padding: 10px 14px;
  resize: vertical;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.modal-footer {
  padding: 16px 24px 22px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--border-subtle);
}

/* Toast */
.toast-msg {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 120;
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-modal);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  font-weight: 500;
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-msg.show {
  opacity: 1;
  transform: translateY(0);
}

.toast-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--color-success);
  color: #ffffff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

/* Platform Colors */
.bg-telegram { background: #229ed9; }
.bg-x { background: #0f1419; }
.bg-facebook { background: #1877f2; }
.bg-youtube { background: #ff0000; }
.bg-bluesky { background: #0285ff; }
.bg-instagram { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }
.bg-redgif { background: #e34682; }
.bg-sim { background: #10b981; }

/* Responsive */
@media (max-width: 1024px) {
  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .platform-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .app-sidebar {
    transform: translateX(-100%);
  }
  .app-sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-modal);
  }
  .app-main {
    margin-left: 0;
  }
  .mobile-menu-btn {
    display: inline-flex;
  }
  .app-topbar {
    padding: 10px 16px;
  }
  .page-container {
    padding: 20px 16px 40px;
  }
  .metrics-grid {
    grid-template-columns: 1fr;
  }
  .cards-grid {
    grid-template-columns: 1fr;
  }
  .platform-grid {
    grid-template-columns: 1fr;
  }
}
