﻿/* ==============================================
  Validex Modern SaaS Dashboard
   Black & White Minimal Theme
   ============================================== */

:root {
  /* Black & White Color System */
  --bg-main: #ffffff;
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  --bg-hover: #f9fafb;
  --bg-accent: #f3f4f6;
  
  --border-light: #e5e7eb;
  --border-medium: #d1d5db;
  --border-dark: #9ca3af;
  
  /* Text Colors */
  --text-primary: #111827;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  
  /* Pure Black & White */
  --black: #000000;
  --white: #ffffff;
  
  /* Minimal Status Colors (subtle) */
  --success: #16a34a;
  --success-light: #f0fdf4;
  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --danger: #dc2626;
  --danger-light: #fef2f2;
  --info: #6b7280;
  --info-light: #f9fafb;
  
  /* Layout */
  --sidebar-width: 260px;
  --topbar-height: 64px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* ==============================================
   GLOBAL RESETS & BASE STYLES
   ============================================== */

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

body, html {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-main);
  color: var(--text-primary);
  height: 100%;
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  text-decoration: none;
  color: inherit;
}

/* ==============================================
   LAYOUT STRUCTURE
   ============================================== */

.dashboard-layout {
  display: flex;
  min-height: 100vh;
  background: var(--bg-main);
}

/* ==============================================
   SIDEBAR NAVIGATION
   ============================================== */

.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-light);
  position: fixed;
  height: 100vh;
  left: 0;
  top: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border-light);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  transition: all 0.2s;
}

.sidebar-logo i {
  color: var(--black);
  font-size: 1.75rem;
}

.sidebar-logo:hover {
  opacity: 0.8;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 0;
}

.nav-section {
  margin-bottom: 24px;
}

.nav-section-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: 8px 20px;
  margin-bottom: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  margin: 2px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-weight: 500;
  transition: all 0.2s;
  position: relative;
}

.nav-item i {
  font-size: 1.25rem;
  width: 24px;
  text-align: center;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--bg-accent);
  color: var(--text-primary);
  font-weight: 600;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 24px;
  background: var(--black);
  border-radius: 0 3px 3px 0;
}

/* ==============================================
   MAIN CONTENT AREA
   ============================================== */

.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ==============================================
   TOP BAR
   ============================================== */

.topbar {
  height: var(--topbar-height);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.topbar-subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-time {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  padding: 8px 16px;
  background: var(--bg-accent);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
}

/* ==============================================
   CONTENT AREA
   ============================================== */

.content-area {
  flex: 1;
  padding: 32px;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
}

/* ==============================================
   CARDS
   ============================================== */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
  overflow: hidden;
}

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

.card-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-title i {
  color: var(--text-secondary);
  font-size: 1.25rem;
}

.card-actions {
  display: flex;
  gap: 8px;
}

.card-body {
  padding: 24px;
}

.card-body:empty {
  padding: 0;
}

/* ==============================================
   METRICS GRID (Dashboard Cards)
   ============================================== */

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.metric-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--black);
}

.metric-card.success::before {
  background: var(--text-secondary);
}

.metric-card.warning::before {
  background: var(--text-secondary);
}

.metric-card.danger::before {
  background: var(--text-secondary);
}

.metric-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.metric-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.metric-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metric-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: var(--bg-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--text-primary);
}

.metric-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 8px;
}

.metric-change {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.metric-change i {
  font-size: 1rem;
}

/* Card-specific colors */
.metrics-grid > .metric-card:nth-child(1)::before {
  background: #2979ff;
}

.metrics-grid > .metric-card:nth-child(1) .metric-label {
  color: #2979ff;
}

.metrics-grid > .metric-card:nth-child(1) .metric-value {
  color: #2979ff;
}

.metrics-grid > .metric-card:nth-child(2)::before {
  background: #16a34a;
}

.metrics-grid > .metric-card:nth-child(2) .metric-label {
  color: #16a34a;
}

.metrics-grid > .metric-card:nth-child(2) .metric-value {
  color: #16a34a;
}

.metrics-grid > .metric-card:nth-child(3)::before {
  background: #f59e0b;
}

.metrics-grid > .metric-card:nth-child(3) .metric-label {
  color: #f59e0b;
}

.metrics-grid > .metric-card:nth-child(3) .metric-value {
  color: #f59e0b;
}

.metrics-grid > .metric-card:nth-child(4)::before {
  background: #000000;
}

.metrics-grid > .metric-card:nth-child(4) .metric-label {
  color: #000000;
}

.metrics-grid > .metric-card:nth-child(4) .metric-value {
  color: #000000;
}

/* ==============================================
   TABLES
   ============================================== */

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.875rem;
}

thead {
  background: var(--bg-accent);
}

thead th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border-light);
}

thead th:first-child {
  border-top-left-radius: var(--radius-sm);
}

thead th:last-child {
  border-top-right-radius: var(--radius-sm);
}

tbody tr {
  border-bottom: 1px solid var(--border-light);
  transition: background 0.2s;
}

tbody tr:hover {
  background: var(--bg-hover);
}

tbody tr:last-child {
  border-bottom: none;
}

tbody td {
  padding: 16px;
  color: var(--text-primary);
}

tbody td a {
  color: var(--text-primary);
  font-weight: 500;
  transition: color 0.2s;
  text-decoration: underline;
}

tbody td a:hover {
  color: var(--text-secondary);
}

tbody td code {
  background: var(--bg-accent);
  padding: 4px 8px;
  border-radius: 4px;
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 0.8rem;
  color: var(--text-primary);
  border: 1px solid var(--border-light);
}

/* ==============================================
   BADGES & STATUS PILLS
   ============================================== */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  background: var(--bg-accent);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
}

.badge-success {
  background: var(--bg-accent);
  color: var(--text-primary);
  border-color: var(--border-medium);
}

.badge-warning {
  background: var(--bg-accent);
  color: var(--text-primary);
  border-color: var(--border-medium);
}

.badge-danger {
  background: var(--bg-accent);
  color: var(--text-primary);
  border-color: var(--border-medium);
}

.badge-info {
  background: var(--bg-accent);
  color: var(--text-primary);
  border-color: var(--border-medium);
}

/* ==============================================
   BUTTONS
   ============================================== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--black);
  color: var(--white);
}

.btn-primary:hover:not(:disabled) {
  background: #1f2937;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--white);
  color: var(--text-primary);
  border: 1px solid var(--border-medium);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--text-primary);
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-success:hover:not(:disabled) {
  background: #15803d;
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover:not(:disabled) {
  background: #b91c1c;
}

.btn-info {
  background: var(--text-secondary);
  color: white;
}

.btn-info:hover:not(:disabled) {
  background: var(--text-primary);
}

.btn-outline-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
}

.btn-outline-danger:hover:not(:disabled) {
  background: var(--danger);
  color: white;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1rem;
}

.btn i {
  font-size: 1rem;
}

/* ==============================================
   FORMS
   ============================================== */

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--text-primary);
  background: var(--bg-card);
  transition: all 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--black);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.form-control::placeholder {
  color: var(--text-muted);
}

/* File Input Styling - Minimal & Clean */
input[type="file"].form-control {
  padding: 10px 14px;
  cursor: pointer;
  background: var(--bg-hover);
  border: 1px solid var(--border-medium);
  transition: all 0.2s ease;
}

input[type="file"].form-control:hover {
  border-color: var(--black);
  background: var(--bg-accent);
}

input[type="file"].form-control:focus {
  border-color: var(--black);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

input[type="file"].form-control::file-selector-button {
  padding: 6px 12px;
  margin: 0 8px 0 0;
  border: 1px solid var(--black);
  background: var(--black);
  color: var(--white);
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}

input[type="file"].form-control::file-selector-button:hover {
  background: var(--white);
  color: var(--black);
  border-color: var(--black);
}
textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

select.form-control {
  cursor: pointer;
}

.form-text {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ==============================================
   UPLOAD CARDS GRID
   ============================================== */

.upload-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.upload-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 32px 24px;
  text-align: center;
  transition: all 0.3s;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.upload-card:hover {
  border-color: var(--black);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.upload-icon {
  font-size: 3rem;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.upload-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.upload-description {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.5;
}

/* ==============================================
   ALERTS
   ============================================== */

.alert {
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.875rem;
}

.alert i {
  font-size: 1.25rem;
  margin-top: 2px;
}

.alert-success {
  background: var(--bg-accent);
  color: var(--text-primary);
  border-left: 4px solid var(--black);
}

.alert-warning {
  background: var(--bg-accent);
  color: var(--text-primary);
  border-left: 4px solid var(--text-secondary);
}

.alert-danger {
  background: var(--bg-accent);
  color: var(--text-primary);
  border-left: 4px solid var(--text-secondary);
}

.alert-info {
  background: var(--bg-accent);
  color: var(--text-primary);
  border-left: 4px solid var(--text-secondary);
}

/* ==============================================
   EMPTY STATE
   ============================================== */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 40px;
  min-height: 300px;
}

.empty-icon {
  font-size: 5rem;
  color: #28a745;
  margin-bottom: 24px;
  opacity: 1;
}

.empty-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.empty-text {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 500px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ==============================================
   LOADING SPINNER
   ============================================== */

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border-light);
  border-top-color: var(--black);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==============================================
   UTILITIES
   ============================================== */

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.d-flex {
  display: flex;
}

.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 16px; }

.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }

.mt-3 { margin-top: 16px; }

/* ==============================================
   SWEETALERT2 CUSTOMIZATION
   ============================================== */

.delete-progress-track {
  width: 100%;
  height: 8px;
  background: var(--border-light);
  border-radius: 4px;
  overflow: hidden;
  margin: 16px 0;
}

.delete-progress-bar {
  height: 100%;
  background: var(--black);
  transition: width 0.3s ease;
}

.delete-progress-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 8px;
}

/* ==============================================
   ISSUE LIST (Provider Details)
   ============================================== */

.issues-summary {
  background: var(--bg-accent);
  border-left: 4px solid var(--black);
  padding: 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 24px;
  font-weight: 600;
  color: var(--text-primary);
}

.issue-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.issue-item {
  background: var(--bg-accent);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.issue-field {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.issue-message {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* ==============================================
   RESPONSIVE DESIGN
   ============================================== */

@media (max-width: 1024px) {
  .sidebar {
    width: 70px;
  }
  
  .sidebar-logo span,
  .nav-section-title,
  .nav-item span {
    display: none;
  }
  
  .main-content {
    margin-left: 70px;
  }
  
  .metrics-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s;
  }
  
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  
  .main-content {
    margin-left: 0;
  }
  
  .topbar {
    padding: 0 16px;
  }
  
  .topbar-title {
    font-size: 1.25rem;
  }
  
  .topbar-subtitle {
    display: none;
  }
  
  .content-area {
    padding: 16px;
  }
  
  .metrics-grid {
    grid-template-columns: 1fr;
  }
  
  .upload-grid {
    grid-template-columns: 1fr;
  }
  
  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}

