/* ZZP Helper Custom Styles */

/* Layout */
html, body {
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
}

/* Navbar */
.navbar-brand {
  font-weight: 600;
}

/* Cards */
.card {
  border: none;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.card-header {
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* Forms */
.form-label {
  font-weight: 500;
  color: #495057;
}

.form-check.card {
  cursor: pointer;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-check.card:hover {
  border-color: #0d6efd;
}

.form-check.card:has(input:checked) {
  border-color: #0d6efd;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Tables */
.table th {
  font-weight: 600;
  color: #495057;
  white-space: nowrap;
}

.table-hover tbody tr:hover {
  background-color: rgba(13, 110, 253, 0.05);
}

/* Badges */
.badge {
  font-weight: 500;
}

/* Buttons */
.btn-group-sm > .btn {
  padding: 0.25rem 0.5rem;
}

/* Invoice Form */
#itemsTable input,
#itemsTable select {
  min-width: 80px;
}

#itemsTable .item-total {
  font-weight: 500;
  line-height: 38px;
}

/* Statistics Cards */
.card.bg-primary .card-body,
.card.bg-success .card-body,
.card.bg-warning .card-body,
.card.bg-info .card-body,
.card.bg-danger .card-body {
  padding: 1.5rem;
}

/* Dashboard quick links */
.card .d-grid .btn {
  text-align: left;
  padding-left: 1rem;
}

/* Footer */
.footer {
  margin-top: auto;
}

/* Print styles */
@media print {
  .navbar,
  .btn,
  .footer,
  .card-header h5 {
    display: none !important;
  }

  .card {
    box-shadow: none !important;
    border: 1px solid #dee2e6 !important;
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .card-body .table-responsive {
    margin: -1rem;
    width: calc(100% + 2rem);
  }

  .card-body .table-responsive .table {
    margin-bottom: 0;
  }

  .d-flex.gap-2 {
    flex-wrap: wrap;
  }

  .d-flex.gap-2 .btn {
    flex: 1 1 auto;
  }
}

/* Loading state */
.btn.loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.btn.loading::after {
  content: "";
  position: absolute;
  width: 1rem;
  height: 1rem;
  top: 50%;
  left: 50%;
  margin-left: -0.5rem;
  margin-top: -0.5rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

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

/* Alert improvements */
.alert {
  border: none;
  border-radius: 0.5rem;
}

.alert-success {
  background-color: #d1e7dd;
  color: #0f5132;
}

.alert-danger {
  background-color: #f8d7da;
  color: #842029;
}

.alert-warning {
  background-color: #fff3cd;
  color: #664d03;
}

/* Company type selection */
.form-check.card .form-check-input {
  float: none;
  margin: 0;
  position: absolute;
  top: 1rem;
  right: 1rem;
}

.form-check.card .form-check-label {
  padding-right: 2rem;
}

/* Invoice status colors */
.status-draft { color: #6c757d; }
.status-sent { color: #0d6efd; }
.status-paid { color: #198754; }
.status-overdue { color: #dc3545; }

/* Totals table styling */
.table-borderless td {
  padding: 0.5rem 0;
}

/* Empty state */
.text-center.py-5 .display-1 {
  opacity: 0.5;
}
