/* ============================================
   RT2-GO, KP3 - RT/RW Management App
   Design System: #1D4ED8 (Blue 700), Inter Font
   ============================================ */

/* CSS Variables */
:root {
  --primary: #1D4ED8;
  --primary-dark: #1e40af;
  --primary-light: #3b82f6;
  --primary-lighter: #60a5fa;
  --primary-bg: rgba(29, 78, 216, 0.08);
  --primary-border: rgba(29, 78, 216, 0.2);

  --green: #16a34a;
  --green-bg: rgba(22, 163, 74, 0.1);
  --red: #dc2626;
  --red-bg: rgba(220, 38, 38, 0.1);
  --yellow: #ca8a04;
  --yellow-bg: rgba(202, 138, 4, 0.1);
  --orange: #ea580c;
  --orange-bg: rgba(234, 88, 12, 0.1);

  --text-dark: #1a1a1a;
  --text-gray: #4a5568;
  --text-light: #718096;
  --bg-gray: #f7fafc;
  --bg-light: #edf2f7;
  --bg-white: #ffffff;
  --border: #e2e8f0;
  --border-dark: #cbd5e0;

  --sidebar-w: 260px;
  --sidebar-w-collapsed: 72px;
  --topbar-h: 64px;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 25px rgba(0,0,0,0.12);
  --transition: all 0.2s ease;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-gray);
  color: var(--text-dark);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ============================================
   LOGIN SCREEN
   ============================================ */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1D4ED8 0%, #1e40af 50%, #172554 100%);
  padding: 20px;
}
.login-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.login-logo { margin-bottom: 16px; display: flex; justify-content: center; }
.login-card h1 { font-size: 28px; font-weight: 800; color: var(--primary); margin-bottom: 4px; }
.login-subtitle { color: var(--text-light); font-size: 14px; margin-bottom: 32px; }
.login-form { text-align: left; }
.login-hint { margin-top: 20px; font-size: 12px; color: var(--text-light); }

/* ============================================
   FORM ELEMENTS
   ============================================ */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--text-gray); margin-bottom: 6px;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%; padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px; font-family: inherit;
  color: var(--text-dark); background: white;
  transition: var(--transition); outline: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.1);
}
.form-group textarea { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.form-error { color: var(--red); font-size: 12px; margin-top: 4px; }

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border: none; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: var(--transition); text-decoration: none;
  white-space: nowrap;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: white; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover { background: var(--primary-bg); }
.btn-danger { background: var(--red); color: white; }
.btn-danger:hover { background: #b91c1c; }
.btn-ghost { background: transparent; color: var(--text-gray); padding: 8px; }
.btn-ghost:hover { background: var(--bg-light); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-block { width: 100%; }
.btn-icon {
  width: 32px; height: 32px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); border: none; cursor: pointer;
  background: transparent; color: var(--text-light);
  transition: var(--transition);
}
.btn-icon:hover { background: var(--bg-light); color: var(--primary); }

/* ============================================
   APP LAYOUT
   ============================================ */
.app { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: var(--sidebar-w); background: white;
  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: 16px 20px; display: flex; align-items: center;
  justify-content: space-between; border-bottom: 1px solid var(--border);
  height: var(--topbar-h);
}
.sidebar-logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; color: var(--primary); }
.sidebar-toggle { display: none; }

.sidebar-nav { flex: 1; padding: 12px; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: var(--radius-sm);
  color: var(--text-gray); text-decoration: none;
  font-weight: 500; font-size: 14px; margin-bottom: 4px;
  transition: var(--transition);
}
.nav-item:hover { background: var(--primary-bg); color: var(--primary); }
.nav-item.active { background: var(--primary); color: white; }
.nav-item.active svg { stroke: white; }

.sidebar-footer {
  padding: 14px 16px; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.user-info { display: flex; align-items: center; gap: 10px; min-width: 0; }
.user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--primary); color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.user-details { display: flex; flex-direction: column; min-width: 0; }
.user-name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: var(--text-light); }
.btn-logout {
  width: 32px; height: 32px; border: none; border-radius: var(--radius-sm);
  background: transparent; color: var(--text-light); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition); flex-shrink: 0;
}
.btn-logout:hover { background: var(--red-bg); color: var(--red); }

.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.4); z-index: 99;
}
.sidebar-overlay.show { display: block; }

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

/* Topbar */
.topbar {
  height: var(--topbar-h); background: white;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px;
  padding: 0 24px; position: sticky; top: 0; z-index: 50;
}
.menu-btn { display: none; background: none; border: none; cursor: pointer; color: var(--text-gray); }
.page-title { font-size: 18px; font-weight: 700; flex: 1; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.rt-badge {
  background: var(--primary-bg); color: var(--primary);
  padding: 5px 14px; border-radius: 20px;
  font-size: 12px; font-weight: 600;
}

/* Page Content */
.page-content { padding: 24px; flex: 1; }

/* ============================================
   CARDS
   ============================================ */
.card {
  background: white; border-radius: var(--radius);
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
  overflow: hidden;
}
.card-header {
  padding: 18px 22px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.card-header h3 { font-size: 15px; font-weight: 700; }
.card-body { padding: 22px; }
.card-body-flush { padding: 0; }

/* ============================================
   STATS GRID
   ============================================ */
.stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 20px; margin-bottom: 24px;
}
.stat-card {
  background: white; border-radius: var(--radius);
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
  padding: 22px; display: flex; flex-direction: column; gap: 8px;
  transition: var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.stat-card .stat-icon {
  width: 44px; height: 44px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 4px;
}
.stat-card .stat-label { font-size: 13px; color: var(--text-light); font-weight: 500; }
.stat-card .stat-value { font-size: 28px; font-weight: 800; color: var(--text-dark); }
.stat-card .stat-sub { font-size: 12px; color: var(--text-light); }
.stat-card.blue .stat-icon { background: var(--primary-bg); color: var(--primary); }
.stat-card.green .stat-icon { background: var(--green-bg); color: var(--green); }
.stat-card.yellow .stat-icon { background: var(--yellow-bg); color: var(--yellow); }
.stat-card.red .stat-icon { background: var(--red-bg); color: var(--red); }
.stat-card.orange .stat-icon { background: var(--orange-bg); color: var(--orange); }

/* ============================================
   TABLES
   ============================================ */
.table-wrap { overflow-x: auto; }
table.data-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.data-table th {
  text-align: left; padding: 12px 16px;
  background: var(--bg-gray); font-weight: 600;
  color: var(--text-gray); font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  color: var(--text-dark); vertical-align: middle;
}
.data-table tbody tr:hover { background: var(--bg-gray); }
.data-table tbody tr:last-child td { border-bottom: none; }

/* ============================================
   BADGES & PILLS
   ============================================ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-red { background: var(--red-bg); color: var(--red); }
.badge-yellow { background: var(--yellow-bg); color: var(--yellow); }
.badge-blue { background: var(--primary-bg); color: var(--primary); }
.badge-gray { background: var(--bg-light); color: var(--text-light); }
.badge-orange { background: var(--orange-bg); color: var(--orange); }

/* ============================================
   SEARCH & FILTERS
   ============================================ */
.toolbar {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 20px; flex-wrap: wrap;
}
.search-box {
  position: relative; flex: 1; max-width: 400px;
}
.search-box input {
  width: 100%; padding: 9px 14px 9px 38px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 13px; outline: none; transition: var(--transition);
}
.search-box input:focus { border-color: var(--primary); }
.search-box svg {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-light);
}
.filter-select {
  padding: 9px 14px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-size: 13px;
  background: white; cursor: pointer; outline: none;
  font-family: inherit;
}

/* ============================================
   MODAL
   ============================================ */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; padding: 20px; animation: fadeIn 0.2s ease;
}
.modal {
  background: white; border-radius: var(--radius-lg);
  width: 100%; max-width: 560px; max-height: 90vh;
  overflow-y: auto; box-shadow: var(--shadow-lg);
  animation: slideUp 0.25s ease;
}
.modal.modal-lg { max-width: 720px; }
.modal-header {
  padding: 18px 24px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; background: white; z-index: 1;
}
.modal-header h3 { font-size: 17px; font-weight: 700; }
.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px;
  position: sticky; bottom: 0; background: white;
}
.modal-close {
  width: 32px; height: 32px; border: none; border-radius: var(--radius-sm);
  background: transparent; cursor: pointer; color: var(--text-light);
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: var(--bg-light); color: var(--text-dark); }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* ============================================
   TOAST
   ============================================ */
.toast-container {
  position: fixed; top: 20px; right: 20px; z-index: 300;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: white; border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 14px 20px;
  display: flex; align-items: center; gap: 10px;
  min-width: 280px; max-width: 400px;
  animation: slideInRight 0.25s ease; border-left: 4px solid var(--primary);
}
.toast.success { border-left-color: var(--green); }
.toast.error { border-left-color: var(--red); }
.toast.warning { border-left-color: var(--yellow); }
.toast .toast-icon { flex-shrink: 0; }
.toast .toast-msg { font-size: 13px; font-weight: 500; }

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
  text-align: center; padding: 48px 20px;
  color: var(--text-light);
}
.empty-state svg { margin-bottom: 12px; opacity: 0.4; }
.empty-state p { font-size: 14px; }

/* ============================================
   PROGRESS BAR
   ============================================ */
.progress-bar {
  height: 8px; background: var(--bg-light);
  border-radius: 4px; overflow: hidden;
}
.progress-bar .fill {
  height: 100%; background: var(--primary);
  border-radius: 4px; transition: width 0.4s ease;
}
.progress-bar .fill.green { background: var(--green); }
.progress-bar .fill.yellow { background: var(--yellow); }
.progress-bar .fill.red { background: var(--red); }

/* ============================================
   POLLING BARS
   ============================================ */
.poll-bar-wrap { margin-bottom: 14px; }
.poll-bar-label {
  display: flex; justify-content: space-between;
  font-size: 13px; margin-bottom: 4px;
}
.poll-bar {
  height: 28px; background: var(--bg-light);
  border-radius: var(--radius-sm); overflow: hidden; position: relative;
}
.poll-bar .poll-fill {
  height: 100%; background: var(--primary);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; padding-left: 10px;
  color: white; font-size: 12px; font-weight: 600;
  transition: width 0.5s ease; min-width: 0;
}
.poll-bar .poll-fill.green { background: var(--green); }
.poll-bar .poll-fill.orange { background: var(--orange); }

/* ============================================
   MISC
   ============================================ */
.text-muted { color: var(--text-light); }
.text-sm { font-size: 12px; }
.text-right { text-align: right; }
.font-bold { font-weight: 700; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 16px; }
.flex-wrap { flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.w-full { width: 100%; }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-primary { color: var(--primary); }

.divider { height: 1px; background: var(--border); margin: 16px 0; }

.activity-item {
  display: flex; gap: 12px; padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: none; }
.activity-dot {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 14px;
}
.activity-text { font-size: 13px; line-height: 1.5; }
.activity-time { font-size: 11px; color: var(--text-light); }

/* ============================================
   CCTV MODULE
   ============================================ */
.cctv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}
.cctv-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: var(--transition);
}
.cctv-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.cctv-card.cctv-offline { opacity: 0.85; }

.cctv-feed {
  position: relative;
  height: 180px;
  background: #0a0a0a;
  cursor: pointer;
  overflow: hidden;
}
.cctv-live-feed {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  overflow: hidden;
}
.cctv-feed-offline {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #1a1a1a;
  color: #dc2626;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
}
.cctv-scanline {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: rgba(29, 78, 216, 0.5);
  animation: cctv-scan 4s linear infinite;
  z-index: 2;
}
@keyframes cctv-scan {
  0% { top: 0; }
  100% { top: 100%; }
}
.cctv-noise {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,0.03) 1px, transparent 1px),
    radial-gradient(circle at 70% 60%, rgba(255,255,255,0.02) 1px, transparent 1px),
    radial-gradient(circle at 40% 80%, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 3px 3px, 5px 5px, 7px 7px;
  opacity: 0.5;
  z-index: 1;
}
.cctv-feed-content {
  position: relative;
  z-index: 3;
  color: rgba(255,255,255,0.8);
  font-size: 11px;
  font-family: 'Courier New', monospace;
  padding: 10px;
}
.cctv-feed-content > div { margin-bottom: 2px; }
.cctv-feed-overlay {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 4;
}
.cctv-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #dc2626;
  color: white;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}
.cctv-live-dot {
  width: 6px; height: 6px;
  background: white;
  border-radius: 50%;
  animation: cctv-blink 1s infinite;
}
@keyframes cctv-blink { 50% { opacity: 0.3; } }

.cctv-info { padding: 14px 16px; }
.cctv-info-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.cctv-info-header h3 { font-size: 14px; font-weight: 700; }
.cctv-loc { font-size: 12px; color: var(--text-light); margin-bottom: 4px; }
.cctv-desc { font-size: 12px; color: var(--text-gray); margin-bottom: 8px; line-height: 1.5; }
.cctv-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cctv-fullscreen-feed {
  position: relative;
  width: 100%;
  height: 400px;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  overflow: hidden;
}

/* ============================================
   MARKETPLACE MODULE
   ============================================ */
.mkt-categories {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.mkt-cat-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 18px;
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-gray);
  min-width: 80px;
}
.mkt-cat-btn:hover { border-color: var(--primary); color: var(--primary); }
.mkt-cat-btn.active { background: var(--primary); border-color: var(--primary); color: white; }

.mkt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}
.mkt-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}
.mkt-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.mkt-card.mkt-sold { opacity: 0.7; }

.mkt-thumb {
  height: 140px;
  background: linear-gradient(135deg, var(--bg-light) 0%, var(--bg-gray) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
}
.mkt-thumb-icon { font-size: 48px; }
.mkt-sold-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-15deg);
  background: var(--red);
  color: white;
  padding: 6px 20px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 1px;
  z-index: 2;
}

.mkt-body { padding: 14px 16px; flex: 1; }
.mkt-cat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.mkt-rating { font-size: 12px; color: var(--yellow); font-weight: 600; }
.mkt-title { font-size: 14px; font-weight: 700; margin-bottom: 4px; line-height: 1.4; }
.mkt-desc { font-size: 12px; color: var(--text-light); line-height: 1.5; margin-bottom: 10px; }
.mkt-price-row { display: flex; align-items: baseline; gap: 4px; }
.mkt-price { font-size: 18px; font-weight: 800; color: var(--primary); }
.mkt-satuan { font-size: 12px; color: var(--text-light); }

.mkt-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.mkt-seller { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mkt-seller-name { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Marketplace Detail */
.mkt-detail { display: flex; gap: 24px; }
.mkt-detail-thumb {
  flex-shrink: 0;
  width: 200px;
  height: 200px;
  background: linear-gradient(135deg, var(--bg-light) 0%, var(--bg-gray) 100%);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.mkt-detail-info { flex: 1; }
.mkt-detail-price { font-size: 28px; font-weight: 800; color: var(--primary); margin: 4px 0; }
.mkt-seller-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-gray);
  border-radius: var(--radius-sm);
}
.mkt-contact-phone {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--primary-bg);
  border: 2px dashed var(--primary-border);
  border-radius: var(--radius);
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  cursor: pointer;
  transition: var(--transition);
  margin: 8px 0;
}
.mkt-contact-phone:hover { background: var(--primary); color: white; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.show { transform: translateX(0); }
  .sidebar-toggle { display: flex; }
  .main-content { margin-left: 0; }
  .menu-btn { display: flex; }
  .page-content { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat-card { padding: 16px; }
  .stat-card .stat-value { font-size: 22px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .card-body { padding: 16px; }
  .topbar { padding: 0 16px; }
  .page-title { font-size: 16px; }
  .modal { max-width: 100%; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .rt-badge { display: none; }
  .cctv-grid { grid-template-columns: 1fr; }
  .mkt-grid { grid-template-columns: 1fr; }
  .mkt-detail { flex-direction: column; }
  .mkt-detail-thumb { width: 100%; height: 160px; }
  .mkt-cat-btn { min-width: 64px; padding: 8px 12px; }
}
