/* Acuity AI Custom Admin Styles */

/* Brand Colors */
:root {
  --acuity-blue: #0030B3;
  --acuity-teal: #00D98F;
  --acuity-gradient: linear-gradient(135deg, #0030B3 0%, #00D98F 100%);
}

/* Logo styling */
.navbar-brand img {
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* Primary button styling with Acuity gradient */
.btn-primary {
  background: var(--acuity-gradient) !important;
  border: none !important;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 48, 179, 0.3);
}

/* Sidebar active items */
.nav-sidebar .nav-link.active {
  background: var(--acuity-gradient) !important;
  color: white !important;
}

/* Card headers */
.card-header {
  background: linear-gradient(90deg, var(--acuity-blue), var(--acuity-teal)) !important;
  color: white !important;
}

/* Loading states */
.loading-overlay {
  background: var(--acuity-gradient);
  opacity: 0.9;
}

/* Custom icons enhancement */
.nav-link i {
  margin-right: 8px;
  width: 16px;
  text-align: center;
}

/* Top menu gradient */
.navbar-dark {
  background: linear-gradient(90deg, rgba(0, 48, 179, 0.9), rgba(0, 217, 143, 0.9)) !important;
}

/* Form focus states */
.form-control:focus {
  border-color: var(--acuity-teal) !important;
  box-shadow: 0 0 0 0.2rem rgba(0, 217, 143, 0.25) !important;
}

/* Data table enhancements */
.table-striped tbody tr:nth-of-type(odd) {
  background-color: rgba(0, 217, 143, 0.05);
}

/* Status badges */
.badge-success {
  background: var(--acuity-teal) !important;
}

.badge-info {
  background: var(--acuity-blue) !important;
}

/* KPI Dashboard Enhancements */
.small-box {
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.small-box:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.small-box .inner h3 {
  font-size: 2.2rem;
  font-weight: bold;
  margin-bottom: 5px;
}

.small-box .icon {
  font-size: 3rem;
  opacity: 0.8;
}

/* Dashboard Cards */
.dashboard-card {
  border: none;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
  overflow: hidden;
}

.dashboard-card .card-header {
  background: var(--acuity-gradient) !important;
  border-bottom: none;
  color: white !important;
  padding: 15px 20px;
}

.dashboard-card .card-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0;
}

/* Progress bars with Acuity theme */
.progress {
  border-radius: 10px;
  overflow: hidden;
  height: 8px;
}

.progress-bar {
  border-radius: 10px;
  transition: width 0.6s ease;
}

.bg-primary {
  background: var(--acuity-gradient) !important;
}

.bg-success {
  background: linear-gradient(135deg, #28a745, var(--acuity-teal)) !important;
}

.bg-warning {
  background: linear-gradient(135deg, #ffc107, #ff8c00) !important;
}

.bg-danger {
  background: linear-gradient(135deg, #dc3545, #c82333) !important;
}

.bg-info {
  background: linear-gradient(135deg, var(--acuity-blue), #007bff) !important;
}

/* Description blocks styling */
.description-block {
  padding: 15px;
  text-align: center;
}

.description-header {
  font-size: 2rem;
  font-weight: bold;
  color: #333;
  margin-bottom: 5px;
}

.description-text {
  font-size: 0.9rem;
  font-weight: 600;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.description-percentage {
  font-size: 1.5rem;
  margin-bottom: 10px;
  display: block;
}

/* Callout styling */
.callout {
  border-radius: 8px;
  border-left: 4px solid;
  padding: 15px;
  margin: 15px 0;
}

.callout-info {
  border-left-color: var(--acuity-blue);
  background-color: rgba(0, 48, 179, 0.05);
}

/* Quick actions buttons */
.btn-lg {
  border-radius: 8px;
  padding: 12px 30px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
}

.btn-lg:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Animation for number counters */
@keyframes countUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.small-box .inner h3 {
  animation: countUp 0.6s ease-out;
}

/* Info boxes styling */
.info-box {
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  margin-bottom: 15px;
  overflow: hidden;
}

.info-box:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.info-box-icon {
  border-radius: 8px 0 0 8px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 1.8rem !important;
  width: 70px !important;
  background: var(--acuity-gradient) !important;
}

.info-box-content {
  padding: 15px !important;
}

.info-box-text {
  font-size: 0.9rem !important;
  font-weight: 600 !important;
  color: #666 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
}

.info-box-number {
  font-size: 1.8rem !important;
  font-weight: bold !important;
  color: #333 !important;
  display: block !important;
  margin: 5px 0 !important;
}

.progress-description {
  font-size: 0.8rem !important;
  color: #888 !important;
  margin-top: 5px !important;
}

/* Enhanced progress groups */
.progress-group {
  margin-bottom: 15px;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
}

.progress-group:last-child {
  border-bottom: none;
}

.progress-group .float-right {
  font-weight: 600;
  color: #333;
}

/* Alert enhancements */
.alert {
  border-radius: 8px;
  border: none;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.alert-info {
  background: linear-gradient(135deg, rgba(0, 48, 179, 0.1), rgba(0, 217, 143, 0.1));
  border-left: 4px solid var(--acuity-blue);
}

.alert h5 {
  color: var(--acuity-blue);
  font-weight: 600;
}

/* Card tools styling */
.card-tools .badge {
  background: rgba(255, 255, 255, 0.2) !important;
  color: white !important;
  border-radius: 12px;
  padding: 5px 10px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Enhanced borders and spacing */
.border-right {
  border-right: 2px solid #f0f0f0 !important;
}

/* Status-specific styling */
.bg-info.info-box-icon {
  background: linear-gradient(135deg, var(--acuity-blue), #007bff) !important;
}

.bg-success.info-box-icon {
  background: linear-gradient(135deg, #28a745, var(--acuity-teal)) !important;
}

.bg-warning.info-box-icon {
  background: linear-gradient(135deg, #ffc107, #ff8c00) !important;
}

.bg-danger.info-box-icon {
  background: linear-gradient(135deg, #dc3545, #c82333) !important;
}

/* Icon animations */
.info-box-icon i {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* Compact inline tabular in Django admin */
.inline-group table {
  table-layout: auto;
  width: 100%;
}

/* Hide the checkbox column (original) in inlines */
.inline-group th.original,
.inline-group td.original {
  display: none;
}

.inline-group th,
.inline-group td {
  font-size: 13px;
  padding: 6px 8px;
}

/* Allow contract ID column to be wider for full UUID display */
.inline-group th.column-contract_id_display,
.inline-group td.column-contract_id_display {
  min-width: 300px;
  white-space: normal;
  word-break: break-all;
}

/* Other columns can be more compact */
.inline-group th:not(.original):not(.column-contract_id_display),
.inline-group td:not(.original):not(.column-contract_id_display) {
  white-space: nowrap;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Global compact styles across admin */
/* Slightly reduce base font sizing in main content without affecting nav/sidebar */
.content-wrapper,
.content,
.card,
.card-body {
  font-size: 15px;
}

/* Tables (lists, inlines, detail tables) */
table,
.table,
.results {
  font-size: 14px;
}

.table th,
.table td,
.results th,
.results td {
  padding: 6px 8px !important;
}

/* Form controls */
input.form-control,
select.form-control,
textarea.form-control,
.vTextField,
.vDateField,
.vTimeField,
.vURLField,
.vIntegerField,
.vDecimalField,
.select2-container .select2-selection--single .select2-selection__rendered {
  font-size: 13px !important;
}

/* Field labels */
label,
.control-label,
.col-form-label {
  font-size: 12px;
}

/* Headings inside cards/forms */
.card-title,
h1.page-title,
h2,
h3 {
  font-size: 1rem;
}

/* Reduce breadcrumb size slightly */
.breadcrumb-item,
.breadcrumb-item a {
  font-size: 12px;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .small-box .inner h3 {
    font-size: 1.8rem;
  }
  
  .description-header {
    font-size: 1.5rem;
  }
  
  .btn-lg {
    margin-bottom: 10px;
    width: 100%;
  }
  
  .info-box-number {
    font-size: 1.5rem !important;
  }
  
  .info-box-icon {
    width: 60px !important;
    font-size: 1.5rem !important;
  }
}

/* Hide the User Tasks fieldset header */
.field-user_tasks h2,
.field-user_tasks .fieldset-title,
.field-user_tasks legend {
    display: none !important;
}

/* Hide the User Tasks label next to the filter widget */
.field-user_tasks label,
.field-user_tasks .field-label,
.field-user_tasks .form-group label {
    display: none !important;
}

/* Make the User Tasks selector use full width of the form row */
.field-user_tasks .form-group,
.field-user_tasks .row {
  width: 100% !important;
}

/* Collapse the (now empty) label column and expand the widget column */
.field-user_tasks .col-sm-3 {
  display: none !important;
}
.field-user_tasks .col-sm-7,
.field-user_tasks .col-sm-9,
.field-user_tasks .col-md-9,
.field-user_tasks .col-lg-9,
.field-user_tasks .card-body > .form-group > div[class^="col-"] {
  flex: 0 0 100% !important;
  max-width: 100% !important;
}

/* Django filter_horizontal widget layout */
.field-user_tasks .selector {
  display: flex !important;
  gap: 16px !important;
  width: 100% !important;
}
.field-user_tasks .selector .selector-available,
.field-user_tasks .selector .selector-chosen {
  flex: 1 1 0 !important;
  width: 50% !important;
  max-width: 50% !important;
}
.field-user_tasks .selector .selector-chooser {
  align-self: center;
}
.field-user_tasks .selector select {
  width: 100% !important;
  max-width: 100% !important;
  font-size: 12px !important;
  line-height: 1.2 !important;
}

/* Options inside the dual-list selects */
.field-user_tasks .selector select option {
  font-size: 12px !important;
  padding: 2px 6px !important;
}

/* Ensure any help/description spans full width beneath */
.field-user_tasks .help,
.field-user_tasks .description {
  flex: 0 0 100% !important;
  max-width: 100% !important;
}

/* Mobile stacking */
@media (max-width: 992px) {
  .field-user_tasks .selector {
    flex-direction: column;
  }
  .field-user_tasks .selector .selector-available,
  .field-user_tasks .selector .selector-chosen {
    max-width: 100% !important;
    width: 100% !important;
  }
}

    .model-usertask #change-list-filters {
        position: sticky !important;
        top: 0 !important;
        z-index: 1000 !important;
        background-color: #fff !important;
        padding: 10px !important;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
        max-height: calc(100vh - 100px) !important;
        border-radius: 8px !important;
    }

    .model-usertask #changelist-search > .form-group {
      margin-bottom: 0 !important;
    }

    .model-usertask #changelist-search {
    justify-content: space-between !important;
    }
