/* ==========================================================================
   MSME VYAPARI — Merchant Admin Dashboard Styles (admin.css)
   ========================================================================== */

:root {
  --primary: #10B981;
  --primary-dark: #059669;
  --primary-light: #ECFDF5;
  --primary-glow: rgba(16, 185, 129, 0.2);

  --gave-red: #EF4444;
  --gave-light: #FEF2F2;
  --got-green: #10B981;
  --got-light: #ECFDF5;

  --bg-sidebar: #0F172A;
  --bg-main: #F8FAFC;
  --bg-card: #FFFFFF;

  --text-main: #0F172A;
  --text-muted: #64748B;
  --text-light: #94A3B8;

  --border: #E2E8F0;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
}

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
}

/* Layout Grid */
.admin-sidebar {
  width: 260px;
  background-color: var(--bg-sidebar);
  color: #FFFFFF;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  padding: 1.5rem 1rem;
  flex-shrink: 0;
}

.admin-main {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
}

.brand-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 0.5rem 1.8rem 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 1.5rem;
}

.brand-badge {
  width: 38px;
  height: 38px;
  background: var(--primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.2rem;
  color: #FFFFFF;
}

.brand-name {
  font-size: 1.15rem;
  font-weight: 800;
}

.brand-tag {
  font-size: 0.72rem;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}

.sidebar-nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex-grow: 1;
}

.nav-item-btn {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.8rem 1rem;
  border-radius: var(--radius-md);
  color: var(--text-light);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: all 150ms ease;
}

.nav-item-btn:hover, .nav-item-btn.active {
  background: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
}

.nav-item-btn.active {
  background: var(--primary);
  color: #FFFFFF;
}

.sidebar-footer {
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.82rem;
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Header */
.admin-topbar {
  height: 70px;
  background: #FFFFFF;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.shop-selector {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.shop-name-title {
  font-size: 1.1rem;
  font-weight: 700;
}

.sync-status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary-dark);
  background: var(--primary-light);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
}

.sync-dot {
  width: 7px;
  height: 7px;
  background: var(--primary);
  border-radius: 50%;
}

/* Content View Body */
.admin-content {
  padding: 2rem;
  flex-grow: 1;
}

/* Metric Cards */
.metrics-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.metric-card {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.metric-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.metric-value {
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1.2;
}

.metric-got { color: var(--got-green); }
.metric-gave { color: var(--gave-red); }

/* Table & Actions Card */
.content-card {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.table-toolbar {
  padding: 1.2rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 1rem;
}

.search-input {
  padding: 0.6rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  outline: none;
  min-width: 260px;
}
.search-input:focus { border-color: var(--primary); }

.filter-group {
  display: flex;
  gap: 0.5rem;
}

.filter-chip {
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: #FFFFFF;
  cursor: pointer;
}
.filter-chip.active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary-dark);
}

.btn-add {
  padding: 0.65rem 1.2rem;
  background: var(--primary);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* Data Table */
.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  padding: 0.9rem 1.5rem;
  background: var(--bg-main);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

.data-table tr:hover {
  background: #F8FAFC;
}

.party-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #E2E8F0;
  color: #475569;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  margin-right: 0.75rem;
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal-overlay.show { display: flex; }

.modal-box {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  max-width: 500px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

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

.modal-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
}

.form-control {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  outline: none;
}
.form-control:focus { border-color: var(--primary); }

.modal-actions {
  padding: 1rem 1.5rem;
  background: var(--bg-main);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}
