/* Global Styles */
:root {
  --primary-color: #333f48;
  --secondary-color: #6c757d;
  --accent-color: #4a4a4a;
  --light-color: #f8f9fa;
  --dark-color: #343a40;
  --success-color: #28a745;
  --info-color: #17a2b8;
  --warning-color: #ffc107;
  --danger-color: #dc3545;
  --border-radius: 0.25rem;
  --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  --transition: all 0.3s ease-in-out;
}

body {
  font-family: 'Open Sans', sans-serif;
  color: var(--dark-color);
  background-color: #f5f5f5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.content-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Navbar Styles */
.navbar-brand img {
  height: 40px;
  margin-right: 10px;
}

.navbar {
  background-color: white;
  box-shadow: var(--box-shadow);
}

.navbar-light .navbar-nav .nav-link {
  color: var(--primary-color);
  font-weight: 500;
  padding: 0.5rem 1rem;
  transition: var(--transition);
}

.navbar-light .navbar-nav .nav-link:hover,
.navbar-light .navbar-nav .nav-link:focus {
  color: var(--accent-color);
}

.navbar-light .navbar-nav .active > .nav-link {
  color: var(--accent-color);
  font-weight: 600;
}

/* Card Styles */
.card {
  border: none;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  transition: var(--transition);
  margin-bottom: 1.5rem;
}

.card:hover {
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
}

.card-header {
  background-color: white;
  border-bottom: 1px solid rgba(0, 0, 0, 0.125);
  font-weight: 600;
}

/* Button Styles */
.btn {
  border-radius: var(--border-radius);
  font-weight: 500;
  padding: 0.375rem 1rem;
  transition: var(--transition);
}

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

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

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

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

/* Dashboard Styles */
.dashboard-stat-card {
  border-left: 4px solid var(--primary-color);
  transition: var(--transition);
}

.dashboard-stat-card:hover {
  transform: translateY(-5px);
}

.dashboard-stat-card .card-body {
  padding: 1.25rem;
}

.dashboard-stat-card .stat-number {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.dashboard-stat-card .stat-title {
  font-size: 0.875rem;
  color: var(--secondary-color);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.clients-card {
  border-left-color: var(--info-color);
}

.quotations-card {
  border-left-color: var(--warning-color);
}

.invoices-card {
  border-left-color: var(--success-color);
}

/* Table Styles */
.table thead th {
  background-color: #f8f9fa;
  border-top: none;
  border-bottom: 2px solid #dee2e6;
  font-weight: 600;
  color: var(--primary-color);
}

.table tbody tr {
  transition: var(--transition);
}

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

/* Badge Styles */
.badge {
  font-weight: 500;
  padding: 0.35em 0.65em;
  border-radius: 50rem;
}

.badge-draft, .badge-unpaid {
  background-color: #6c757d;
  color: white;
}

.badge-sent {
  background-color: #17a2b8;
  color: white;
}

.badge-accepted, .badge-paid {
  background-color: #28a745;
  color: white;
}

.badge-declined, .badge-overdue {
  background-color: #dc3545;
  color: white;
}

/* Form Styles */
.form-control {
  border-radius: var(--border-radius);
  border: 1px solid #ced4da;
  padding: 0.375rem 0.75rem;
  transition: var(--transition);
}

.form-control:focus {
  border-color: #adb5bd;
  box-shadow: 0 0 0 0.2rem rgba(173, 181, 189, 0.25);
}

.form-group label {
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--dark-color);
}

/* Login Page */
.login-container {
  max-width: 450px;
  margin: 0 auto;
  padding: 2rem;
}

.login-card {
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  border-radius: var(--border-radius);
  overflow: hidden;
}

.login-card .card-header {
  background-color: var(--primary-color);
  color: white;
  font-weight: 600;
  text-align: center;
  padding: 1.5rem;
}

.login-logo {
  width: 120px;
  margin: 0 auto 1.5rem;
  display: block;
}

/* Detail Pages */
.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.detail-header h1 {
  margin-bottom: 0;
}

.detail-card {
  margin-bottom: 1.5rem;
}

.detail-label {
  font-weight: 600;
  color: var(--secondary-color);
  margin-bottom: 0.25rem;
}

.detail-value {
  margin-bottom: 1rem;
}

/* Activities Styles */
.activity-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-right: 1rem;
  background-color: #e9ecef;
  color: var(--dark-color);
}

.activity-item {
  display: flex;
  align-items: flex-start;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.125);
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-content {
  flex: 1;
}

.activity-time {
  color: var(--secondary-color);
  font-size: 0.875rem;
}

.activity-badge.meeting {
  background-color: #cff4fc;
  color: #055160;
}

.activity-badge.call {
  background-color: #d1e7dd;
  color: #0f5132;
}

.activity-badge.email {
  background-color: #fff3cd;
  color: #664d03;
}

.activity-badge.note {
  background-color: #e2e3e5;
  color: #41464b;
}

.activity-badge.proposal {
  background-color: #cfe2ff;
  color: #084298;
}

/* Responsive Styles */
@media (max-width: 768px) {
  .detail-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .detail-header .btn-group {
    margin-top: 1rem;
    width: 100%;
  }
  
  .detail-header .btn {
    flex: 1;
  }
}

/* PDF Styles */
.pdf-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
  background-color: white;
}

.pdf-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #dee2e6;
}

.pdf-logo {
  height: 150px;
  max-width: 250px;
}

.pdf-title {
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.pdf-meta-label {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.pdf-meta-value {
  margin-bottom: 0.5rem;
}

.pdf-table {
  width: 100%;
  margin-bottom: 2rem;
}

.pdf-table th {
  background-color: #f8f9fa;
  font-weight: 600;
  text-align: left;
  padding: 0.75rem;
}

.pdf-table td {
  padding: 0.75rem;
  border-bottom: 1px solid #dee2e6;
}

.pdf-summary {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 2rem;
}

.pdf-summary-table {
  width: 40%;
}

.pdf-summary-table td {
  padding: 0.5rem;
}

.pdf-summary-table .total-row {
  font-weight: 700;
  border-top: 2px solid #dee2e6;
}

.pdf-notes {
  margin-bottom: 2rem;
  padding: 1rem;
  background-color: #f8f9fa;
  border-radius: var(--border-radius);
}

.pdf-signature {
  margin-top: 4rem;
  display: flex;
  justify-content: space-between;
}

.pdf-signature-box {
  width: 45%;
  border-top: 1px solid #dee2e6;
  padding-top: 0.5rem;
}

/* Dashboard Chart */
.chart-container {
  height: 300px;
  margin-bottom: 1.5rem;
}

/* Loader */
.loader {
  display: inline-block;
  width: 80px;
  height: 80px;
  position: fixed;
  top: 50%;
  left: 50%;
  margin-top: -40px;
  margin-left: -40px;
  z-index: 9999;
}

.loader:after {
  content: " ";
  display: block;
  width: 64px;
  height: 64px;
  margin: 8px;
  border-radius: 50%;
  border: 6px solid var(--primary-color);
  border-color: var(--primary-color) transparent var(--primary-color) transparent;
  animation: loader 1.2s linear infinite;
}

@keyframes loader {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.7);
  z-index: 9998;
  display: none;
}
