/* Apple HIG Inspired Theme - Global Overrides for Tabler UI */

:root {
  --apple-blue: #007aff;
  --apple-gray: #8e8e93;
  --apple-green: #34c759;
  --apple-indigo: #5856d6;
  --apple-orange: #ff9500;
  --apple-pink: #ff2d55;
  --apple-purple: #af52de;
  --apple-red: #ff3b30;
  --apple-teal: #5ac8fa;
  --apple-yellow: #ffcc00;

  --apple-bg-primary: #f5f5f7;
  /* Light gray background common in iPadOS/macOS settings */
  --apple-card-bg: #ffffff;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  background-color: var(--apple-bg-primary);
  color: #1d1d1f;
  -webkit-font-smoothing: antialiased;
}

/* --- Layout & Spacing --- */

/* Give the main content more breathing room from the sidebar */
.page-wrapper {
  padding-left: 1.5rem;
  /* Separates content from sidebar */
  padding-right: 1.5rem;
  padding-top: 1.5rem;
}

@media (max-width: 991px) {
  .page-wrapper {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* Sidebar Styling */
.navbar-vertical {
  border-right: 1px solid rgba(0, 0, 0, 0.08);
  background-color: #ffffff;
  /* Ensure sidebar is white for contrast */
}

/* Navbar Brand spacing */
.navbar-brand {
  padding-top: 1rem;
  padding-bottom: 1rem;
}

/* Sidebar navigation items spacing */
.navbar-vertical .nav-link {
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
  font-weight: 500;
  border-radius: 10px;
  /* Rounded highlight on hover */
  margin: 2px 12px;
  /* Pull in from edges of sidebar */
}

/* --- Buttons --- */

.btn {
  border-radius: 10px;
  /* Smooth rounded corners, not fully pill unless specified */
  font-weight: 600;
  transition: all 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
  padding: 0.6rem 1.2rem;
  box-shadow: none;
  border: 1px solid transparent;
}

.btn-primary {
  background-color: var(--apple-blue);
  border-color: transparent;
}

.btn-primary:hover {
  background-color: #0071eb;
  /* Slightly darker blue */
  transform: translateY(-1px);
}

.btn-outline-primary {
  color: var(--apple-blue);
  border-color: var(--apple-blue);
  background-color: transparent;
}

.btn-outline-primary:hover {
  background-color: var(--apple-blue);
  color: #fff;
}

.btn-danger,
.btn-outline-danger {
  /* similar logic if needed, but keeping defaults or mapping to apple-red */
}

/* --- Cards --- */

.card {
  border: none;
  border-radius: 16px;
  /* Larger radius for iOS-like cards */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
  /* Soft, diffuse shadow */
  background-color: var(--apple-card-bg);
  margin-bottom: 1.5rem;
}

.card-header {
  background: transparent;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  font-weight: 700;
  font-size: 1.1rem;
  padding: 1.25rem 1.5rem;
}

.card-body {
  padding: 1.5rem;
}

/* --- Inputs --- */

.form-control,
.form-select {
  border-radius: 10px;
  border: 1px solid #d2d2d7;
  padding: 0.6rem 0.8rem;
  font-size: 0.95rem;
  background-color: #ffffff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--apple-blue);
  box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.15);
  /* Soft focus ring */
}

/* --- Tables --- */

.table thead th {
  text-transform: uppercase;
  font-size: 0.75rem;
  font-weight: 600;
  color: #86868b;
  /* Apple gray */
  letter-spacing: 0.05em;
  background-color: transparent;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.table tbody td {
  font-size: 0.95rem;
  vertical-align: middle;
}

/* --- Badges (From previous step) --- */

.badge {
  font-weight: 600;
  letter-spacing: -0.01em;
  border-radius: 6px;
  /* Slightly tighter radius for badges inside tables */
  padding: 0.35em 0.6em;
  text-transform: none;
  font-size: 0.75rem;
  line-height: 1;
  border: 1px solid transparent;
}

/* Override solid badges to be subtle by default */

/* Primary / Blue */
.badge.bg-primary,
.badge.bg-blue,
.badge.bg-primary-lt,
.badge.bg-blue-lt {
  background-color: rgba(0, 122, 255, 0.15) !important;
  color: #007aff !important;
}

/* Secondary / Gray */
.badge.bg-secondary,
.badge.bg-gray,
.badge.bg-secondary-lt,
.badge.bg-gray-lt {
  background-color: rgba(142, 142, 147, 0.15) !important;
  color: #636366 !important;
}

/* Success / Green */
.badge.bg-success,
.badge.bg-green,
.badge.bg-success-lt,
.badge.bg-green-lt {
  background-color: rgba(52, 199, 89, 0.15) !important;
  color: #28cd41 !important;
}

/* Warning / Orange / Yellow */
.badge.bg-warning,
.badge.bg-orange,
.badge.bg-yellow,
.badge.bg-warning-lt,
.badge.bg-orange-lt,
.badge.bg-yellow-lt {
  background-color: rgba(255, 149, 0, 0.15) !important;
  color: #ff9500 !important;
}

/* Danger / Red */
.badge.bg-danger,
.badge.bg-red,
.badge.bg-danger-lt,
.badge.bg-red-lt {
  background-color: rgba(255, 59, 48, 0.15) !important;
  color: #ff3b30 !important;
}

/* Info / Cyan / Azure */
.badge.bg-info,
.badge.bg-cyan,
.badge.bg-azure,
.badge.bg-info-lt,
.badge.bg-cyan-lt,
.badge.bg-azure-lt {
  background-color: rgba(50, 173, 230, 0.15) !important;
  color: #007aff !important;
  /* Unified blue-ish tone or keep distinct */
}

/* Purple */
.badge.bg-purple,
.badge.bg-purple-lt {
  background-color: rgba(175, 82, 222, 0.15) !important;
  color: #af52de !important;
}

/* Pink */
.badge.bg-pink,
.badge.bg-pink-lt {
  background-color: rgba(255, 45, 85, 0.15) !important;
  color: #ff2d55 !important;
}

/* Light / White */
.badge.bg-light,
.badge.bg-white {
  background-color: #ffffff !important;
  color: #1d1d1f !important;
  border-color: #d1d1d6 !important;
}

/* Dark */
.badge.bg-dark {
  background-color: #1d1d1f !important;
  color: #ffffff !important;
}

/* --- Utilities --- */
.w-search {
  min-width: 300px;
}