/* ============================================
   RADINFO TECH - Admin Portal Styles (Unslopped)
   ============================================ */

:root {
  --bg-canvas: #09090D;
  --bg-surface: #111117;
  --bg-surface-raised: #181822;
  --bg-surface-hover: #20202D;
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.14);
  
  --text-main: #F4F4F6;
  --text-muted: #8E8E9C;
  --text-dim: #5C5C6E;

  --accent-crimson: #E4294B;
  --accent-crimson-hover: #F04E6A;
  --accent-crimson-tint: rgba(228, 41, 75, 0.12);

  --status-new-bg: rgba(228, 41, 75, 0.12);
  --status-new-text: #FF6482;
  --status-prog-bg: rgba(245, 158, 11, 0.12);
  --status-prog-text: #FBBF24;
  --status-rep-bg: rgba(16, 185, 129, 0.12);
  --status-rep-text: #34D399;
  --status-arc-bg: rgba(107, 114, 128, 0.15);
  --status-arc-text: #9CA3AF;

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

body {
  font-family: var(--font-sans);
  background: var(--bg-canvas);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ==================== LOGIN SCREEN ==================== */
.login-view {
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 10%, rgba(228, 41, 75, 0.05) 0%, transparent 60%), var(--bg-canvas);
}

.login-wrapper {
  width: 100%;
  max-width: 420px;
  padding: 24px;
  margin: auto;
}

.login-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 36px 32px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
}

.login-brand {
  text-align: center;
  margin-bottom: 28px;
}

.admin-logo {
  max-height: 38px;
  margin-bottom: 16px;
  display: inline-block;
}

.admin-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.admin-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 20px;
}

.alert-error {
  background: rgba(228, 41, 75, 0.1);
  border: 1px solid rgba(228, 41, 75, 0.25);
  color: #FF859C;
}

.form-field {
  margin-bottom: 18px;
}

.form-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.field-icon {
  position: absolute;
  left: 12px;
  color: var(--text-dim);
  pointer-events: none;
}

.input-wrap input {
  width: 100%;
  padding: 11px 14px 11px 36px;
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 14px;
  transition: all 0.2s ease;
}

.input-wrap input:focus {
  outline: none;
  border-color: var(--accent-crimson);
  background: var(--bg-surface-hover);
  box-shadow: 0 0 0 3px rgba(228, 41, 75, 0.15);
}

.pw-toggle {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 4px;
}

.pw-toggle:hover {
  color: var(--text-main);
}

.login-footer {
  margin-top: 24px;
  text-align: center;
}

.back-link {
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.back-link:hover {
  color: var(--text-main);
}

/* ==================== BUTTONS ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  padding: 10px 16px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.18s ease;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--accent-crimson);
  color: #FFFFFF;
}

.btn-primary:hover {
  background: var(--accent-crimson-hover);
  box-shadow: 0 4px 14px rgba(228, 41, 75, 0.25);
}

.btn-secondary {
  background: var(--bg-surface-raised);
  border-color: var(--border-subtle);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-strong);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn-ghost:hover {
  background: var(--bg-surface-raised);
  color: var(--text-main);
}

.btn-danger-ghost {
  background: transparent;
  color: #FF859C;
}

.btn-danger-ghost:hover {
  background: rgba(228, 41, 75, 0.12);
  color: #FFA3B5;
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 7px 12px;
  font-size: 12px;
}

/* ==================== DASHBOARD LAYOUT ==================== */
.dashboard-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.dash-header {
  height: 64px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.dash-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.dash-logo {
  max-height: 28px;
}

.dash-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-crimson);
  background: var(--accent-crimson-tint);
  border: 1px solid rgba(228, 41, 75, 0.25);
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.dash-search-bar {
  flex: 1;
  max-width: 440px;
  margin: 0 32px;
  position: relative;
  display: flex;
  align-items: center;
}

.dash-search-bar svg {
  position: absolute;
  left: 12px;
  color: var(--text-dim);
  pointer-events: none;
}

.dash-search-bar input {
  width: 100%;
  padding: 8px 14px 8px 36px;
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 13px;
  transition: all 0.18s;
}

.dash-search-bar input:focus {
  outline: none;
  border-color: var(--border-strong);
  background: var(--bg-surface-hover);
}

.dash-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.online-indicator {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

/* ==================== CONTENT & METRICS ==================== */
.dash-content {
  flex: 1;
  padding: 32px 28px;
}

.dash-container {
  max-width: 1380px;
  margin: 0 auto;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.metric-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 20px 22px;
  transition: transform 0.18s, border-color 0.18s;
}

.metric-card:hover {
  border-color: var(--border-strong);
}

.metric-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.metric-value {
  font-size: 32px;
  font-weight: 700;
  margin: 8px 0 4px;
  font-family: var(--font-sans);
  letter-spacing: -0.02em;
}

.metric-hint {
  font-size: 12px;
  color: var(--text-dim);
}

.highlight-red { color: #FF6482; }
.highlight-amber { color: #FBBF24; }
.highlight-green { color: #34D399; }

/* ==================== TOOLBAR & TABLE ==================== */
.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.filter-tabs {
  display: flex;
  gap: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 4px;
  border-radius: 8px;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.tab-btn:hover {
  color: var(--text-main);
}

.tab-btn.active {
  background: var(--bg-surface-raised);
  color: var(--text-main);
  font-weight: 600;
}

.toolbar-stats {
  font-size: 13px;
  color: var(--text-muted);
}

.table-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  overflow: hidden;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

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

.data-table th {
  padding: 12px 18px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}

.data-table td {
  padding: 14px 18px;
  font-size: 13px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background 0.15s;
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.col-id {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
}

.date-main {
  font-weight: 500;
  color: var(--text-main);
}

.date-sub {
  font-size: 11px;
  color: var(--text-dim);
}

.client-name {
  font-weight: 600;
  color: var(--text-main);
}

.client-meta {
  font-size: 11px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.link-email {
  color: #FF859C;
  text-decoration: none;
  font-weight: 500;
}

.link-email:hover {
  text-decoration: underline;
}

.contact-phone {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
}

.link-phone {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 12px;
  font-family: var(--font-mono);
}

.link-phone:hover {
  color: var(--text-main);
}

.link-wa {
  font-size: 11px;
  color: #34D399;
  text-decoration: none;
  font-weight: 600;
  background: rgba(16, 185, 129, 0.1);
  padding: 1px 6px;
  border-radius: 4px;
}

.link-wa:hover {
  background: rgba(16, 185, 129, 0.2);
}

.service-pill {
  display: inline-block;
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-subtle);
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  color: var(--text-main);
}

/* Status Dropdown */
.status-select {
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  background: transparent;
  font-family: inherit;
  transition: all 0.15s;
}

.status-select.status-new {
  background: var(--status-new-bg);
  color: var(--status-new-text);
  border-color: rgba(228, 41, 75, 0.3);
}

.status-select.status-in_progress {
  background: var(--status-prog-bg);
  color: var(--status-prog-text);
  border-color: rgba(245, 158, 11, 0.3);
}

.status-select.status-replied {
  background: var(--status-rep-bg);
  color: var(--status-rep-text);
  border-color: rgba(16, 185, 129, 0.3);
}

.status-select.status-archived {
  background: var(--status-arc-bg);
  color: var(--status-arc-text);
  border-color: rgba(107, 114, 128, 0.3);
}

.status-select option {
  background: var(--bg-surface-raised);
  color: var(--text-main);
}

/* Action Buttons */
.col-actions {
  text-align: right;
  white-space: nowrap;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-raised);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s;
}

.action-btn:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-strong);
}

.action-danger {
  color: #FF859C;
}

.action-danger:hover {
  background: rgba(228, 41, 75, 0.15);
  border-color: rgba(228, 41, 75, 0.3);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state svg {
  color: var(--text-dim);
  margin-bottom: 14px;
}

.empty-state p {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
}

.empty-state span {
  font-size: 13px;
  color: var(--text-dim);
}

/* ==================== MODAL ==================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

.modal-backdrop.open {
  display: flex;
}

.modal-dialog {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  width: 100%;
  max-width: 580px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
  animation: modalIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-main);
}

.modal-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover {
  color: var(--text-main);
}

.modal-body {
  padding: 24px;
}

.modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.modal-field label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.modal-val {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-main);
}

.modal-link {
  color: #FF859C;
  text-decoration: none;
}

.modal-link:hover {
  text-decoration: underline;
}

.modal-message-box {
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 16px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-main);
  max-height: 220px;
  overflow-y: auto;
  white-space: pre-wrap;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.15);
}

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

@media (max-width: 768px) {
  .dash-header {
    padding: 0 16px;
    flex-wrap: wrap;
    height: auto;
    padding-top: 12px;
    padding-bottom: 12px;
    gap: 12px;
  }
  .dash-search-bar {
    order: 3;
    max-width: 100%;
    margin: 0;
    width: 100%;
  }
  .metrics-grid {
    grid-template-columns: 1fr;
  }
  .table-toolbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}
