@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600&family=IBM+Plex+Mono:wght@500;600&display=swap');

/* Zyntl Admin — matches storefront design system */
body.admin-body {
  --ink: #0F172A;
  --paper: #FFFFFF;
  --mist: #F5F7FA;
  --line: #E2E8F0;
  --signal: #EA580C;
  --signal-ink: #C2410C;
  --go: #0E9F6E;
  --alert: #E02424;
  --muted: #64748B;
  --ink-soft: #334155;
  --shadow: 0 1px 2px rgba(16, 24, 38, .06), 0 8px 24px rgba(16, 24, 38, .06);
  --radius: 12px;

  --primary: var(--ink);
  --primary-dark: #0b1220;
  --accent: var(--signal);
  --accent-hover: var(--signal-ink);
  --bg: var(--mist);
  --bg-sidebar: var(--mist);
  --white: var(--paper);
  --text: var(--ink);
  --text-muted: var(--muted);
  --border: var(--line);
  --success: var(--go);
  --warning: #B45309;
  --danger: var(--alert);
  --font: 'Inter', system-ui, sans-serif;
  --font-heading: 'Space Grotesk', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
  --radius-lg: 16px;
  --radius-full: 50px;
  --shadow-lg: var(--shadow);
  --transition: all 0.15s ease;
  --header-height: 64px;

  margin: 0;
  font-family: var(--font);
  background: var(--mist);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

body.admin-body .logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -.02em;
  text-decoration: none;
  color: inherit;
}

body.admin-body .logo .logo-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--ink);
  position: relative;
  flex: none;
}

body.admin-body .logo .logo-mark::before,
body.admin-body .logo .logo-mark::after {
  content: "";
  position: absolute;
  background: var(--signal);
}

body.admin-body .logo .logo-mark::before { left: 6px; top: 6px; width: 6px; height: 6px; }
body.admin-body .logo .logo-mark::after { right: 6px; bottom: 6px; width: 6px; height: 6px; background: #fff; }

/* Admin login */
.admin-login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(160deg, #0b1220 0%, var(--ink) 45%, #1e293b 100%);
}

.admin-login-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 440px;
  padding: 40px 36px;
}

.admin-logo-wrap {
  text-align: center;
  margin-bottom: 28px;
}

.admin-logo-wrap .logo {
  justify-content: center;
  font-size: 26px;
  color: var(--ink);
  margin-bottom: 6px;
}

.admin-logo-wrap > p {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 600;
  margin: 0;
}

body.admin-body .form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

body.admin-body .form-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 15px;
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  transition: border-color .15s ease, box-shadow .15s ease;
}

body.admin-body .form-input:focus {
  outline: none;
  border-color: var(--signal);
  box-shadow: 0 0 0 3px rgba(234, 88, 12, .12);
}

body.admin-body .btn-primary {
  background: var(--signal);
  color: #fff;
  border: 0;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease;
}

body.admin-body .btn-primary:hover {
  background: var(--signal-ink);
}

body.admin-body .btn-outline {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink-soft);
  border-radius: 10px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease;
}

body.admin-body .btn-outline:hover {
  border-color: var(--signal);
  color: var(--signal);
}

/* Layout */
.admin-wrapper {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar */
.admin-sidebar {
  width: 252px;
  background: var(--ink);
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.admin-sidebar-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 20px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.admin-sidebar-header .logo {
  color: #fff;
}

.admin-nav {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 14px;
  margin-bottom: 2px;
  color: #94a3b8;
  font-weight: 500;
  font-size: 14px;
  border-radius: 10px;
  text-decoration: none;
  transition: background .15s ease, color .15s ease;
}

.admin-nav-item i {
  width: 18px;
  font-size: 15px;
  text-align: center;
}

.admin-nav-item:hover {
  background: rgba(255, 255, 255, .06);
  color: #fff;
}

.admin-nav-item.active {
  background: rgba(234, 88, 12, .15);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--signal);
  border-radius: 0 10px 10px 0;
}

.admin-nav-item .badge {
  background: var(--signal);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 20px;
  padding: 2px 8px;
  margin-left: auto;
}

.admin-sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, .08);
}

.admin-user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--signal);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex: none;
}

.admin-user-name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-user-role {
  font-size: 11px;
  color: #64748b;
}

/* Main */
.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--mist);
}

.admin-header {
  height: var(--header-height);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  flex-shrink: 0;
}

.admin-page-title {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
}

.admin-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-header-actions .icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink-soft);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background .15s ease;
}

.admin-header-actions .icon-btn:hover {
  background: var(--mist);
}

.admin-content-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 28px;
}

/* Stats */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.admin-stat-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: border-color .15s ease, transform .15s ease;
}

.admin-stat-card:hover {
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

.admin-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 20px;
  flex: none;
}

.admin-stat-icon.primary { background: #FFF1E9; color: var(--signal); }
.admin-stat-icon.success { background: #e7f7f0; color: var(--go); }
.admin-stat-icon.warning { background: #fef6e7; color: var(--warning); }
.admin-stat-icon.accent { background: #eff6ff; color: #2563eb; }

.admin-stat-details h3 {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin: 0 0 4px;
}

.admin-stat-details .value {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
}

/* Panels & tables */
.admin-panel-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 24px;
}

.admin-panel-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(180deg, #fff, #fbfcfe);
}

.admin-panel-title {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 14px 22px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.admin-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 600;
  color: var(--muted);
  background: var(--mist);
}

.admin-table td {
  font-size: 14px;
  color: var(--ink-soft);
}

.admin-table tbody tr:hover td {
  background: #fafbfc;
}

.admin-table tr:last-child td {
  border-bottom: none;
}

/* Status badges */
.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
}

.status-badge.completed,
.status-badge.delivered { background: #e7f7f0; color: var(--go); }
.status-badge.pending { background: #fef6e7; color: var(--warning); }
.status-badge.processing { background: #eff6ff; color: #2563eb; }
.status-badge.shipped { background: #f0f9ff; color: #0284c7; }
.status-badge.cancelled { background: #fef2f2; color: var(--alert); }

/* Forms in admin content */
body.admin-body textarea.form-input,
body.admin-body select.form-input {
  resize: vertical;
}

body.admin-body .btn-block {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
}

body.admin-body .btn-large {
  font-size: 15px;
  padding: 13px 20px;
}

@media (max-width: 1100px) {
  .admin-stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .admin-wrapper { flex-direction: column; height: auto; min-height: 100vh; }
  .admin-sidebar { width: 100%; height: auto; }
  .admin-nav { display: flex; flex-wrap: wrap; gap: 4px; padding: 12px; }
  .admin-nav-item { flex: 1 1 auto; min-width: 140px; }
  .admin-sidebar-footer { display: none; }
  .admin-stats-grid { grid-template-columns: 1fr; }
  .admin-content-scroll { padding: 16px; }
  .admin-table { display: block; overflow-x: auto; }
  .admin-support-layout { flex-direction: column; height: auto; min-height: 480px; }
  .admin-support-layout .support-sidebar { width: 100%; max-height: 220px; }
}

/* Admin messages chat */
.admin-support-layout {
  display: flex;
  height: calc(100vh - 180px);
  background: var(--paper);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.admin-support-layout .support-sidebar {
  width: 320px;
  border-right: 1px solid var(--line);
  background: var(--mist);
  display: flex;
  flex-direction: column;
}

.admin-support-layout .chat-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--paper);
}

.admin-support-layout .conversation-list { flex: 1; overflow-y: auto; }

.admin-support-layout .chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--mist);
}

.admin-support-layout .message-row {
  display: flex;
  gap: 12px;
  max-width: 80%;
}

.admin-support-layout .message-row.user { align-self: flex-start; }
.admin-support-layout .message-row.admin { align-self: flex-end; flex-direction: row-reverse; }

.admin-support-layout .message-bubble {
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
}

.admin-support-layout .message-row.admin .message-bubble {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.admin-support-layout .message-time {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}

.admin-support-layout .message-row.admin .message-time { text-align: right; }

.admin-support-layout .chat-input-area {
  padding: 16px;
  border-top: 1px solid var(--line);
  background: var(--paper);
}

.admin-support-layout .chat-input-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--mist);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 12px;
}

.admin-support-layout .chat-input-bar input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 14px;
  color: var(--ink);
}

.admin-support-layout .conversation-item {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  display: flex;
  gap: 12px;
  transition: background .15s ease;
  text-decoration: none;
  color: inherit;
}

.admin-support-layout .conversation-item:hover,
.admin-support-layout .conversation-item.active {
  background: var(--paper);
}

.admin-support-layout .unread-dot {
  width: 8px;
  height: 8px;
  background: var(--signal);
  border-radius: 50%;
  flex: none;
}

/* Email compose */
.email-compose-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

.form-group-flex {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.form-group-flex label {
  width: 80px;
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
}

.form-group-flex input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 15px;
  color: var(--ink);
  background: transparent;
}

