/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  /* --- Brand Palette --- */
  /* Primary: Deep Navy/Slate */
  --pf-primary: #0F172A;
  /* Slate 900 */
  --pf-primary-light: #1E293B;
  /* Slate 800 */
  --pf-primary-rgb: 15, 23, 42;

  /* Accent: Sky Blue */
  --pf-accent: #0EA5E9;
  /* Sky 500 */
  --pf-accent-hover: #0284C7;
  /* Sky 600 */

  /* Neutrals */
  --pf-bg: #F8FAFC;
  /* Slate 50 */
  --pf-surface: #FFFFFF;
  /* White */
  --pf-text-main: #1E293B;
  /* Slate 800 */
  --pf-text-muted: #64748B;
  /* Slate 500 */
  --pf-border: #E2E8F0;
  /* Slate 200 */

  /* Functional */
  --pf-success: #10B981;
  /* Emerald 500 */
  --pf-warning: #F59E0B;
  /* Amber 500 */
  --pf-danger: #EF4444;
  /* Red 500 */
  --pf-info: #3B82F6;
  /* Blue 500 */

  /* --- Tokens --- */
  --pf-radius-sm: 0.375rem;
  /* 6px */
  --pf-radius-md: 0.75rem;
  /* 12px */
  --pf-radius-lg: 1rem;
  /* 16px */

  --pf-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --pf-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --pf-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

  /* Bootstrap Override Vars (where supported) */
  --bs-body-bg: var(--pf-bg);
  --bs-body-color: var(--pf-text-main);
  --bs-primary: var(--pf-primary);
  --bs-primary-rgb: var(--pf-primary-rgb);
  --bs-link-color: var(--pf-accent);
  --bs-link-hover-color: var(--pf-accent-hover);
  --bs-border-radius: var(--pf-radius-sm);
}

/* --- Global --- */
body {
  font-family: 'Inter', sans-serif;
  background-color: var(--pf-bg);
  color: var(--pf-text-main);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--pf-primary);
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 0.75em;
}

.page-title {
  font-size: 2rem;
  letter-spacing: -0.03em;
  color: var(--pf-primary);
  margin-bottom: 2rem;
}

/* --- Layout --- */
.container {
  max-width: 1200px;
}

/* --- Components: Navbar --- */
.navbar {
  background-color: var(--pf-surface) !important;
  border-bottom: 1px solid var(--pf-border);
  box-shadow: var(--pf-shadow-sm);
  padding: 1rem 0;
}

.navbar-brand {
  font-weight: 800;
  color: var(--pf-primary) !important;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.nav-link {
  color: var(--pf-text-muted) !important;
  font-weight: 500;
  transition: color 0.15s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--pf-accent) !important;
}

/* --- Components: Cards --- */
.card {
  background-color: var(--pf-surface);
  border: 1px solid var(--pf-border);
  /* Subtle border */
  border-radius: var(--pf-radius-md);
  box-shadow: var(--pf-shadow-sm);
  margin-bottom: 1.5rem;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.card:hover {
  box-shadow: var(--pf-shadow);
}

.card-header {
  background-color: transparent;
  border-bottom: 1px solid var(--pf-border);
  padding: 1.25rem 1.5rem;
  font-weight: 600;
  color: var(--pf-primary);
}

.card-body {
  padding: 1.5rem;
}

/* --- Components: Buttons --- */
.btn {
  font-weight: 600;
  padding: 0.625rem 1.25rem;
  border-radius: var(--pf-radius-sm);
  transition: all 0.2s ease;
  letter-spacing: 0.01em;
}

.btn-primary {
  background-color: var(--pf-primary);
  border-color: var(--pf-primary);
  color: white;
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

.btn-primary:hover {
  background-color: var(--pf-primary-light);
  border-color: var(--pf-primary-light);
  transform: translateY(-1px);
  box-shadow: var(--pf-shadow);
}

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

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

.btn-outline-primary {
  color: var(--pf-accent);
  border-color: var(--pf-accent);
}

.btn-outline-primary:hover {
  background-color: var(--pf-accent);
  color: white;
  border-color: var(--pf-accent);
}

/* --- Components: Forms --- */
.form-label {
  font-weight: 500;
  color: var(--pf-text-main);
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.form-control,
.form-select {
  border: 1px solid var(--pf-border);
  border-radius: var(--pf-radius-sm);
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  color: var(--pf-text-main);
  box-shadow: var(--pf-shadow-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--pf-accent);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
  /* Accent ring */
  outline: none;
}

/* --- Components: Tables --- */
.table {
  width: 100%;
  margin-bottom: 0;
  color: var(--pf-text-main);
  border-collapse: separate;
  border-spacing: 0;
}

.table thead th {
  background-color: var(--pf-bg);
  color: var(--pf-text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--pf-border);
  padding: 1rem 1.5rem;
}

.table tbody td {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--pf-border);
  vertical-align: middle;
  font-size: 0.95rem;
}

.table-striped tbody tr:nth-of-type(odd) {
  background-color: transparent;
  /* Remove default Bootstrap stripe for cleaner look */
}

.table tbody tr:hover {
  background-color: var(--pf-bg);
}

/* --- Components: Badges --- */
.badge {
  font-weight: 600;
  padding: 0.35em 0.8em;
  border-radius: 9999px;
  /* Pill shape */
  font-size: 0.75rem;
  letter-spacing: 0.025em;
}

.bg-secondary {
  background-color: var(--pf-border) !important;
  color: var(--pf-text-muted);
}

.bg-success {
  background-color: #DCFCE7 !important;
  color: #166534;
}

/* Green-100 bg, Green-800 text */
.bg-info {
  background-color: #E0F2FE !important;
  color: #075985;
}

/* Sky-100 bg, Sky-800 text */
.bg-warning {
  background-color: #FEF3C7 !important;
  color: #92400E;
}

/* Amber-100 bg, Amber-800 text */
.bg-danger {
  background-color: #FEE2E2 !important;
  color: #991B1B;
}

/* Red-100 bg, Red-800 text */

/* --- Utilities --- */
.sidebar-logo-invert {
  filter: brightness(0) invert(1);
}

.text-muted {
  color: var(--pf-text-muted) !important;
}

.text-primary {
  color: var(--pf-accent) !important;
}

.text-success {
  color: var(--pf-success) !important;
}

/* Dashboard Specifics */
.currency-input {
  font-family: 'Inter', monospace;
  /* Monospaced numbers */
  font-weight: 500;
}

.avatar-sm {
  width: 32px;
  height: 32px;
  line-height: 32px;
  display: inline-block;
}

/* --- Global Hover Effects --- */
a {
  transition: all 0.2s ease;
}

/* Generic Link Hover */
a:not(.btn):hover {
  color: var(--pf-accent-hover);
  text-decoration: underline;
}

/* Text-Dark Links (like Dashboard Client Name) */
a.text-dark:hover {
  color: var(--pf-accent) !important;
  text-decoration: none;
  /* Clean look, just color change */
}

/* Icons inside links */
a i,
button i {
  transition: transform 0.2s ease;
}

a:hover i,
button:hover i {
  transform: scale(1.15);
  /* Subtle pop */
}

/* Action Buttons (Icon only) */
.btn-link:hover {
  color: var(--pf-accent) !important;
}

/* --- Sidebar Layout --- */
.d-flex.h-100 {
  min-height: 100vh;
}

.sidebar {
  width: 280px;
  background-color: var(--pf-primary);
  color: #fff;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--pf-primary-light);
  min-height: 100vh;
}

.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand {
  color: #fff !important;
  font-size: 1.5rem;
  font-weight: 800;
  text-decoration: none;
  letter-spacing: -0.02em;
}

.sidebar-nav {
  padding: 1.5rem 1rem;
  flex-grow: 1;
}

.nav-item {
  margin-bottom: 0.5rem;
  list-style: none;
  /* remove dots */
}

/* Sidebar Links */
.nav-link {
  color: #94a3b8 !important;
  /* Slate-400 */
  padding: 0.75rem 1rem;
  border-radius: var(--pf-radius-sm);
  display: flex;
  align-items: center;
  font-weight: 500;
  transition: all 0.2s ease;
  text-decoration: none !important;
}

.nav-link i {
  margin-right: 0.75rem;
  font-size: 1.1rem;
  width: 24px;
  text-align: center;
}

.nav-link:hover,
.nav-link.active {
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff !important;
}

.nav-link:hover i,
.nav-link.active i {
  transform: scale(1.1);
  color: var(--pf-accent) !important;
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.2);
}

.content-wrapper {
  flex-grow: 1;
  background-color: var(--pf-bg);
  overflow-y: auto;
  height: 100vh;
  /* Scroll inside wrapper */
}

/* --- Auth Helpers --- */
.min-vh-80 {
  min-height: 80vh;
}

.sq-48 {
  width: 48px;
  height: 48px;
}
