/* SuperClinic Admin Theme - Modern Light Theme */

:root {
  --primary-color: #4f46e5;    /* Modern indigo */
  --primary-hover: #6366f1;    /* Lighter indigo on hover */
  --primary-light: #e0e7ff;    /* Very light indigo */
  --secondary-color: #64748b;  /* Slate gray */
  --success-color: #10b981;    /* Emerald green */
  --danger-color: #ef4444;     /* Red */
  --warning-color: #f59e0b;    /* Amber */
  --info-color: #3b82f6;       /* Blue */
  --dark-color: #1e293b;       /* Slate gray (dark) */
  --light-color: #f1f5f9;      /* Slate gray (very light) */
  --body-bg: #ffffff;          /* White background */
  --card-bg: #ffffff;          /* White card background */
  --header-bg: #f8fafc;        /* Very light gray header */
  --text-color: #334155;       /* Slate gray (medium) */
  --text-light: #64748b;       /* Slate gray (lighter) */
  --text-muted: #94a3b8;       /* Slate gray (muted) */
  --border-color: #e2e8f0;     /* Very light border color */
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --radius: 0.5rem;
  --transition: all 0.2s ease-in-out;

  /* Contrast text colors */
  --text-on-light: #334155;    /* Dark text for light backgrounds */
  --text-on-dark: #ffffff;     /* White text for dark backgrounds */
}

/* Global styles */
body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--body-bg);
  color: var(--text-color);
  font-size: 15px;
  line-height: 1.6;
  margin: 0;
  padding: 0;
  letter-spacing: 0.01em;
  font-weight: 400;
}

a:link, a:visited {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition);
  font-weight: 500;
}

a:hover {
  color: var(--primary-hover);
  text-decoration: none;
}

/* Header */
#header {
  background: var(--primary-color);
  color: var(--text-on-dark);
  box-shadow: var(--shadow);
  height: auto;
  padding: 15px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: none;
}

#header a:link, #header a:visited {
  color: var(--text-on-dark);
}

#header a:hover {
  color: var(--primary-light);
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-wrapper {
  position: relative;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: white;
  border-radius: 50%;
}

.header-logo i {
  font-size: 24px;
  color: var(--primary-color);
  position: relative;
  z-index: 2;
}

.logo-pulse {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: white;
  opacity: 1;
  z-index: 1;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

@keyframes pulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.3);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 10px rgba(255, 255, 255, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
  }
}

.header-logo h1 {
  font-size: 20px;
  font-weight: 600;
  margin: 0;
  color: white;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

#user-tools {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 14px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  color: white;
}

.user-info i {
  font-size: 18px;
  color: white;
}

.user-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.password-change {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  transition: var(--transition);
  color: var(--primary-color);
  background-color: white;
  font-weight: 500;
  text-decoration: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.password-change:hover {
  background-color: var(--primary-light);
  color: var(--primary-color);
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#logout-form button {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.4);
  cursor: pointer;
  color: white;
  font-weight: 500;
  font-size: 14px;
  transition: var(--transition);
}

#logout-form button:hover {
  background-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

/* Container and main content */
#container {
  padding: 2rem;
  background: var(--light-color);
  position: relative;
  min-height: calc(100vh - 70px);
}

.main {
  margin-right: 320px;
}

#content {
  padding: 24px;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
}

#content h1 {
  font-weight: 600;
  font-size: 24px;
  margin-top: 0;
  margin-bottom: 1.5rem;
  color: var(--text-color);
  border-bottom: 2px solid var(--primary-light);
  padding-bottom: 10px;
}

.module {
  margin-bottom: 1.5rem;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  border: 1px solid var(--border-color);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.module:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.05);
}

.module h2, .module caption {
  background: var(--primary-color);
  color: var(--text-on-dark);
  font-weight: 600;
  font-size: 15px;
  padding: 14px 16px;
}

.module caption a {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-on-dark);
  text-decoration: none;
  font-weight: 600;
}

.module caption a i {
  font-size: 14px;
  opacity: 1;
}

.model-name i {
  margin-right: 6px;
  opacity: 0.8;
}

/* Admin breadcrumbs */
.breadcrumbs {
  background: white;
  padding: 12px 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  margin-bottom: 1.5rem;
  font-size: 14px;
  position: relative;
  overflow: hidden;
  color: var(--text-color);
  border: 1px solid var(--border-color);
}

.breadcrumbs::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(to right, var(--primary-color), var(--primary-hover), var(--primary-color));
  opacity: 0.3;
}

.breadcrumbs a {
  color: var(--primary-color);
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.breadcrumbs a i {
  font-size: 12px;
  color: var(--primary-color);
}

.breadcrumbs a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

.breadcrumbs .divider {
  color: var(--text-muted);
  margin: 0 8px;
}

/* Target the breadcrumb separator */
.breadcrumbs > * {
  display: inline-block;
  vertical-align: middle;
}

/* Style the current breadcrumb */
.breadcrumbs .current {
  color: var(--text-color);
  font-weight: 600;
}

/* Tables */
table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

thead th {
  background-color: var(--primary-light);
  color: var(--primary-color);
  font-weight: 600;
  font-size: 14px;
  padding: 14px 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-color);
}

td, th {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  font-size: 15px;
  color: var(--text-color);
  font-weight: 400;
  transition: var(--transition);
}

tr:hover td {
  background-color: rgba(79, 70, 229, 0.05);
  color: var(--text-color);
}

tr:last-child td, tr:last-child th {
  border-bottom: none;
}

/* Status badges */
.field-status span, .status-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-success, .status-active, .status-completed, .status-approved {
  background-color: rgba(87, 204, 153, 0.2);
  color: var(--success-color);
  border: 1px solid var(--success-color);
}

.status-warning, .status-pending, .status-waiting {
  background-color: rgba(255, 183, 77, 0.2);
  color: var(--warning-color);
  border: 1px solid var(--warning-color);
}

.status-error, .status-failed, .status-rejected, .status-cancelled {
  background-color: rgba(239, 83, 80, 0.2);
  color: var(--danger-color);
  border: 1px solid var(--danger-color);
}

.status-info, .status-in-progress, .status-processing {
  background-color: rgba(100, 181, 246, 0.2);
  color: var(--info-color);
  border: 1px solid var(--info-color);
}

/* Alternating row colors */
tr:nth-child(even) {
  background-color: #f9fafc;
}

tr:nth-child(odd) {
  background-color: #ffffff;
}

/* Form styles */
.form-row {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.form-row:last-child {
  border-bottom: none;
}

/* Make all form labels dark and clearly visible */
label, .vCheckboxLabel, .required label, .aligned label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #1e293b !important; /* Force dark color for all labels */
  font-size: 15px;
  text-shadow: none;
}

/* Ensure labels in fieldsets are also dark */
fieldset label {
  color: #1e293b !important;
  font-weight: 600;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="url"],
input[type="tel"],
textarea,
select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 15px;
  color: var(--text-color);
  transition: var(--transition);
  background-color: white;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) inset;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="url"]:focus,
input[type="tel"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(41, 121, 255, 0.2);
  animation: form-field-focus 0.3s ease-in-out;
}

@keyframes form-field-focus {
  0% { transform: translateY(0); }
  50% { transform: translateY(-1px); }
  100% { transform: translateY(0); }
}

.help {
  color: #475569 !important; /* Darker text for help text */
  font-size: 14px;
  margin-top: 0.5rem;
  font-weight: 400;
}

/* Buttons */
.button,
input[type="submit"],
input[type="button"],
.submit-row input {
  background: var(--primary-color);
  color: var(--text-on-dark);
  border: none;
  padding: 12px 18px;
  border-radius: var(--radius);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 15px;
  box-shadow: 0 2px 4px rgba(79, 70, 229, 0.2);
  position: relative;
}

.button:hover,
input[type="submit"]:hover,
input[type="button"]:hover,
.submit-row input:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(79, 70, 229, 0.25);
}

.button:active,
input[type="submit"]:active,
input[type="button"]:active,
.submit-row input:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(79, 70, 229, 0.2);
}

.button.default,
input[type="submit"].default,
.submit-row input.default {
  background: var(--success-color);
  font-weight: 500;
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}

.button.default:hover,
input[type="submit"].default:hover,
.submit-row input.default:hover {
  background: #0da271;
  box-shadow: 0 4px 6px rgba(16, 185, 129, 0.25);
}

.button[disabled],
input[type="submit"][disabled],
input[type="button"][disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

/* Delete button */
.submit-row a.deletelink {
  background: var(--danger-color);
  color: var(--text-on-dark);
  padding: 12px 18px;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 500;
  box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2);
  transition: all 0.2s ease;
}

.submit-row a.deletelink:hover {
  background: #e02424;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(239, 68, 68, 0.25);
}

/* Submit row */
.submit-row {
  background: var(--light-color);
  padding: 20px;
  text-align: right;
  border-radius: var(--radius);
  margin-top: 1.5rem;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  border: 1px solid var(--border-color);
}

/* Messages */
.messagelist {
  margin: 0 0 1.5rem 0;
  padding: 0;
  list-style-type: none;
}

.messagelist li {
  padding: 16px 20px;
  margin-bottom: 12px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 500;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  border-left: 4px solid transparent;
}

.messagelist li.success {
  background-color: #ecfdf5;
  color: #065f46;
  border-left-color: var(--success-color);
}

.messagelist li.error {
  background-color: #fef2f2;
  color: #b91c1c;
  border-left-color: var(--danger-color);
}

.messagelist li.warning {
  background-color: #fffbeb;
  color: #92400e;
  border-left-color: var(--warning-color);
}

.messagelist li.info {
  background-color: #eff6ff;
  color: #1e40af;
  border-left-color: var(--info-color);
}

/* Dashboard */
.dashboard .module {
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.dashboard .module table {
  width: 100%;
}

.dashboard .module td a {
  display: block;
  padding: 8px 0;
  color: var(--text-color);
}

.dashboard .module td a:hover {
  color: var(--primary-color);
}

/* Responsive */
@media (max-width: 1200px) {
  .main {
    margin-right: 0;
  }

  #content-related {
    position: static;
    width: 100%;
    margin-top: 2rem;
    float: none;
    right: auto;
    top: auto;
  }

  #header {
    padding: 15px 20px;
    flex-direction: column;
    align-items: flex-start;
  }

  #user-tools {
    margin-top: 10px;
    flex-direction: column;
    align-items: flex-start;
  }

  #container {
    padding: 1rem;
  }
}

/* Footer */
#footer {
  margin-top: 1.5rem;
  padding: 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

/* Sidebar */
#content-related {
  width: 280px;
  padding: 20px;
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: absolute;
  right: 2rem;
  top: 2rem;
  border: 1px solid var(--border-color);
}

#content-related h3 {
  font-size: 16px;
  color: var(--primary-color);
  font-weight: 600;
  margin-top: 0;
  margin-bottom: 15px;
  border-bottom: 2px solid var(--primary-light);
  padding-bottom: 10px;
  position: relative;
}

#content-related .module {
  box-shadow: none;
  margin-bottom: 0;
}

/* Action list */
.actionlist {
  padding: 0;
  margin: 0;
  list-style-type: none;
}

.actionlist li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
  line-height: 1.4;
}

.actionlist li:last-child {
  border-bottom: none;
}

.actionlist a {
  display: block;
  color: var(--text-color);
  font-weight: 500;
  font-size: 14px;
  transition: all 0.2s ease;
  padding: 4px 0;
}

.actionlist a:hover {
  color: var(--primary-color);
  transform: translateX(2px);
}

/* Add icons to recent actions */
.actionlist .addlink::before {
  content: "➕ ";
  font-size: 12px;
}

.actionlist .changelink::before {
  content: "✏️ ";
  font-size: 12px;
}

.actionlist .deletelink::before {
  content: "🗑️ ";
  font-size: 12px;
}

/* Admin login page */
.login {
  background: var(--body-bg);
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.login::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at center, rgba(41, 121, 255, 0.05) 0%, transparent 70%);
  z-index: 0;
}

.login #container {
  width: 540px;
  min-width: 480px;
  max-width: 600px;
  padding: 0;
  position: relative;
  z-index: 1;
  animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.login #content {
  padding: 30px;
  border: 1px solid var(--border-color);
  min-width: 420px;
  width: 480px;
  max-width: 100%;
}

.login #header {
  padding: 20px 30px;
  text-align: center;
  justify-content: center;
  border-bottom: 2px solid var(--primary-color);
  margin-bottom: 20px;
}

.login .header-logo {
  justify-content: center;
}

.login .header-logo i {
  font-size: 36px;
  margin-bottom: 10px;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: block;
}

.login .form-row {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
}

.login input[type="text"],
.login input[type="password"] {
  width: 100%;
  padding: 14px 16px;
  font-size: 16px;
}

.login .submit-row {
  margin-bottom: 0;
  padding: 20px 0 0 0;
  text-align: center;
  background: none;
  display: block;
}

.login label {
  font-size: 16px;
  margin-bottom: 10px;
  display: block;
  color: var(--text-light);
}

.login .submit-row input {
  width: 100%;
  padding: 16px;
  font-size: 16px;
  font-weight: 600;
  background: linear-gradient(to right, var(--primary-color), var(--primary-hover));
  transition: all 0.3s ease;
  border-radius: var(--radius);
}

.login .submit-row input:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Icons */
.icon {
  margin-right: 5px;
}

/* Pagination */
.paginator {
  margin: 1.5rem 0;
  padding: 12px 16px;
  background: var(--dark-color);
  border-radius: var(--radius);
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-color);
}

.paginator a, .paginator .current {
  display: inline-block;
  padding: 6px 12px;
  margin: 0 3px;
  border-radius: var(--radius);
  color: var(--text-color);
}

.paginator a {
  color: var(--primary-color);
  text-decoration: none;
}

.paginator a:hover {
  background: var(--primary-light);
}

.paginator .current {
  background: var(--primary-color);
  color: var(--text-on-dark);
  font-weight: 500;
}

/* Filter */
.filtered .results {
  margin-top: 1.5rem;
}

#changelist-filter {
  background: var(--light-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 1.5rem;
}

#changelist-filter h2 {
  font-size: 16px;
  font-weight: 600;
  margin-top: 0;
  margin-bottom: 15px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
  color: var(--text-on-dark);
  background: transparent;
}

#changelist-filter h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 15px 0 10px 0;
  color: var(--text-light);
}

#changelist-filter ul {
  margin: 0;
  padding: 0;
  list-style-type: none;
}

#changelist-filter li {
  padding: 6px 0;
}

#changelist-filter a {
  color: var(--text-color);
  text-decoration: none;
}

#changelist-filter a:hover {
  color: var(--primary-color);
}

#changelist-filter a.selected {
  color: var(--primary-color);
  font-weight: 500;
}

/* Search form */
#changelist-search {
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  background: var(--light-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

#changelist-search input[type="text"] {
  flex-grow: 1;
  margin-right: 10px;
}

#changelist-search input[type="submit"] {
  background: var(--primary-color);
  color: white;
  padding: 12px 16px;
}

/* Date hierarchy */
.change-list .toplinks {
  margin-bottom: 1.5rem;
  background: var(--light-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

.change-list .toplinks li {
  display: inline-block;
  margin-right: 10px;
}

/* Custom SuperClinic branding */
.superclinic-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 0;
}

/* History module */
.module.history-module table {
  width: 100%;
}

.module.history-module th {
  width: 40%;
}

/* Django raw_id fields */
.related-lookup {
  margin-left: 5px;
  padding: 6px 8px;
}

/* Utility classes */
.text-primary {
  color: var(--primary-color);
}

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

.text-danger {
  color: var(--danger-color);
}

.text-warning {
  color: var(--warning-color);
}

.text-info {
  color: var(--info-color);
}

/* Make object-tools more modern */
.object-tools {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.object-tools li {
  list-style-type: none;
}

.object-tools a {
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--primary-color);
  color: var(--text-on-dark);
  text-decoration: none;
  display: inline-block;
  font-weight: 500;
}

.object-tools a:hover {
  background: var(--primary-hover);
}

/* Inlines */
.inline-group {
  margin-bottom: 1.5rem;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.inline-group h2 {
  background: var(--dark-color);
  color: var(--text-on-dark);
  font-weight: 500;
  font-size: 15px;
  padding: 14px 16px;
}

.inline-related {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
}

.inline-related:last-child {
  border-bottom: none;
}

/* Admin date/time picker */
.calendarbox, .clockbox {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: var(--light-color);
  padding: 0;
  border: 1px solid var(--border-color);
}

.calendar {
  width: 100%;
}

.calendar caption {
  background: var(--dark-color);
  color: var(--text-on-dark);
  padding: 10px;
  text-align: center;
  font-weight: 500;
}

.calendar th {
  padding: 8px;
  text-align: center;
  font-weight: 500;
  background: var(--dark-color);
  color: var(--text-on-dark);
}

.calendar td {
  padding: 8px;
  text-align: center;
  border: none;
}

.calendar td a {
  display: block;
  padding: 6px;
  border-radius: var(--radius);
  transition: var(--transition);
  color: var(--text-color);
}

.calendar td a:hover {
  background: var(--primary-light);
  color: var(--primary-hover);
}

.calendarbox .calendarnav-previous,
.calendarbox .calendarnav-next {
  color: var(--text-on-dark);
  text-decoration: none;
  padding: 4px 8px;
  font-weight: bold;
}

/* Admin selectors */
.selector {
  display: flex;
  gap: 20px;
}

.selector-available,
.selector-chosen {
  width: 100%;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
}

.selector h2 {
  background: var(--dark-color);
  color: var(--text-on-dark);
  padding: 10px;
  margin: 0;
  font-size: 15px;
  text-align: center;
}

.selector select {
  width: 100%;
  height: 200px;
  padding: 0;
  border: none;
  border-radius: 0;
  background-color: var(--card-bg);
  color: var(--text-color);
}

.selector .selector-filter {
  padding: 10px;
  background: var(--dark-color);
  border-bottom: 1px solid var(--border-color);
}

.selector-filter input[type="text"] {
  padding: 8px 10px;
}

.selector .selector-available input {
  width: calc(100% - 30px);
}

.selector ul.selector-chooser {
  display: flex;
  flex-direction: column;
  justify-content: center;
  list-style-type: none;
  padding: 0;
  margin: 0;
  gap: 10px;
}

.selector-add, .selector-remove {
  background: var(--dark-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 5px 10px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-color);
}

.selector-add:hover, .selector-remove:hover {
  background: var(--primary-light);
  color: var(--primary-color);
}

/* Admin list editor */
.list-editor {
  padding: 10px;
  background: var(--dark-color);
  border-radius: var(--radius);
  margin-top: 10px;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--dark-color);
}

::-webkit-scrollbar-thumb {
  background-color: #666;
  border-radius: 6px;
  border: 2px solid var(--dark-color);
}

::-webkit-scrollbar-thumb:hover {
  background-color: #888;
}

/* Selection */
::selection {
  background: rgba(79, 70, 229, 0.2);
  color: #1e293b;
}

/* Global text overrides to ensure visibility */
.form-row div div label,
div.inputs div label,
form div label,
.add-row,
td a,
th a,
.paginator a,
a.addlink,
a.changelink,
.aligned ul label,
.module h2,
.module caption,
.inline-group fieldset.module h2,
.inline-group h2,
.selector-available h2,
.selector-chosen h2,
.content-filter h2,
.content-filter h3,
.content-filter label,
a.section,
.selector label,
.selector-filter label,
.addlink,
.changelink {
  color: #1e293b !important;
}

/* Force white text where we want it on colored backgrounds */
.object-tools a,
.module h2,
.module caption,
.inline-group fieldset.module h2,
.submit-row input,
.button,
#header h1,
#user-tools,
#header,
#header a:link,
#header a:visited,
#logout-form button {
  color: white !important;
}

/* Page Loading Animation */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--primary-color);
  z-index: 9999;
  animation: pageLoad 1s ease-out forwards;
  opacity: 0.8;
}

@keyframes pageLoad {
  0% { width: 0; }
  20% { width: 20%; }
  50% { width: 60%; }
  80% { width: 85%; }
  100% { width: 100%; opacity: 0; }
}

/* Better Dropdowns */
select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a9b7c6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}

/* Card Hover Effects */
.module:hover {
  transform: translateY(-2px);
  transition: transform 0.3s ease;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

/* Additional fixes for dark text everywhere */
.aligned .form-row input, .aligned .form-row textarea {
  color: #1e293b;
}

/* Fix select2 and other enhanced widgets */
.select2-container--admin-autocomplete .select2-results__option {
  color: #1e293b !important;
}

/* Fix inline related */
.inline-related h3 {
  color: #1e293b !important;
  background: #f8fafc !important;
}

/* Fix stacked inline */
.js-inline-admin-formset .inline-related fieldset.module h2 {
  color: white !important;
}

/* Fix tabular inline */
.tabular .help {
  color: #475569 !important;
}

/* Fix calendar and time widgets */
.calendarbox, .clockbox {
  color: #1e293b !important;
  background: white !important;
}

.calendarbox .calendarnav, .clockbox h2 {
  color: #1e293b !important;
  background: #f1f5f9 !important;
}

/* Fix datetime widget */
.datetime span {
  color: #475569 !important;
}

/* Fix p tags in forms */
.form-row p {
  color: #1e293b !important;
}

/* Fix widget descriptions */
.field-box .help,
p.help,
.form-row .help,
.help,
form .helptext {
  color: #475569 !important;
}

/* Fix any remaining label issues */
.form-row label {
  color: #1e293b !important;
  font-weight: 600;
}

/* Fix gray buttons with white text issue */
button,
input[type="button"],
input[type="reset"],
input[type="submit"],
.button,
input[type="submit"].default,
.button.default,
.submit-row input,
a.button,
.related-lookup,
.selector-add,
.selector-remove,
.datetimeshortcuts a {
  background-color: var(--primary-color) !important;
  color: white !important;
  border: none !important;
  text-shadow: none !important;
  box-shadow: 0 2px 4px rgba(79, 70, 229, 0.2) !important;
}

/* For secondary/cancel buttons */
.closelink,
.button.cancel-link {
  background-color: #f3f4f6 !important;
  color: #1e293b !important;
  border: 1px solid #d1d5db !important;
}

/* Ensure all buttons have proper hover state */
button:hover,
input[type="button"]:hover,
input[type="reset"]:hover,
input[type="submit"]:hover,
.button:hover,
.submit-row input:hover,
a.button:hover,
.related-lookup:hover,
.selector-add:hover,
.selector-remove:hover {
  background-color: var(--primary-hover) !important;
  color: white !important;
}

/* And hover for secondary buttons */
.closelink:hover,
.button.cancel-link:hover {
  background-color: #e5e7eb !important;
  color: #111827 !important;
}

/* Fix specific problematic buttons */
.datetimeshortcuts a:link,
.datetimeshortcuts a:visited,
.related-lookup,
.add-related,
.change-related,
.delete-related {
  background-color: var(--primary-color) !important;
  padding: 5px 10px !important;
  border-radius: var(--radius) !important;
  color: white !important;
  border: none !important;
}

.datetimeshortcuts a:hover,
.related-lookup:hover,
.add-related:hover,
.change-related:hover,
.delete-related:hover {
  background-color: var(--primary-hover) !important;
}

/* Ensure all selector buttons have proper styling */
.selector .selector-available input[type="submit"],
.selector .selector-chosen input[type="submit"] {
  background-color: var(--primary-color) !important;
  color: white !important;
  text-shadow: none !important;
  box-shadow: 0 2px 4px rgba(79, 70, 229, 0.2) !important;
  margin: 5px 5px !important;
}

/* Fix any other button-like elements we missed */
.tool-button,
.addlink,
.object-tools a,
.inline-related .inline-deletelink,
a.add-handler,
a.add-row,
.inline-group .tabular tr td.original p,
.add-another,
.calendar-shortcuts a,
.calendar-cancel a,
.timelist a {
  background-color: var(--primary-color) !important;
  background-image: none !important;
  color: white !important;
  text-shadow: none !important;
  padding: 5px 10px !important;
  border-radius: var(--radius) !important;
  text-decoration: none !important;
  display: inline-block !important;
}

/* Force white text on ALL buttons and button-like elements */
button,
input[type="button"],
input[type="reset"],
input[type="submit"],
.button,
a.button,
input[type="submit"].default,
.button.default,
.submit-row input,
.related-lookup,
.add-related,
.change-related,
.delete-related,
.selector-add,
.selector-remove,
.datetimeshortcuts a,
.add-another,
a.add-row,
.calendar-shortcuts a,
.calendar-cancel a,
.timelist a,
.addlink,
.changelink,
.object-tools a,
a.historylink,
a[href^="javascript:"],
td.original a,
.tool-button span,
.colM .aligned .add-another,
.colM .aligned .related-lookup,
.inline-group .tabular tr.add-row td a,
.inline-group ul.tools a,
.inline-group ul.tools a.add,
.inline-group a.inline-deletelink,
.module ul.object-tools li a,
input[type=submit].default,
p.datetime input[type=submit],
p.file-upload input[type=submit] {
  color: white !important;
  text-shadow: none !important;
  font-weight: 500 !important;
}

/* Fix button spans and children that inherit text color */
button *,
input[type="button"] *,
input[type="reset"] *,
input[type="submit"] *,
.button *,
a.button *,
.add-another *,
a.add-row *,
.object-tools a *,
.datetimeshortcuts a *,
.related-lookup *,
.add-related *,
.change-related *,
.delete-related * {
  color: white !important;
}

/* Extra fix for any remaining problematic gray-on-white elements */
.inline-deletelink:link,
.inline-deletelink:visited {
  background-color: var(--danger-color) !important;
  color: white !important;
}

/* Force background color on more specific button types */
#content-related .addlink,
.addlink,
.changelink,
.inline-group .tabular tr.add-row td a,
.inline-group ul.tools a.add,
td.original p a,
.datetimeshortcuts a,
.add-another,
.related-lookup,
a.add-row,
a.add-handler,
a.related-lookup,
a.related-lookup img,
.selector-add,
.selector-remove,
.selector .selector-available h2 a,
.selector .selector-chosen h2 a,
p.datetime .datetimeshortcuts a {
  background-color: var(--primary-color) !important;
  color: white !important;
  padding: 5px 10px !important;
  border-radius: var(--radius) !important;
  text-decoration: none !important;
  display: inline-block !important;
}

/* Specific fix for button elements in select/filter fields */
p.datetime .datetimeshortcuts a,
.related-widget-wrapper a.related-lookup {
  display: inline-block !important;
  background-color: var(--primary-color) !important;
  color: white !important;
  border-radius: var(--radius) !important;
  margin-left: 5px !important;
  text-align: center !important;
}

/* Fix specifically for sidebar add links */
#content-related .addlink,
#content-related ul.object-tools a,
.module ul.object-tools a.addlink,
a.addlink,
a.add,
.actionlist .addlink {
  background-color: var(--primary-color) !important;
  color: white !important;
  text-decoration: none !important;
  border-radius: var(--radius) !important;
  display: inline-block !important;
  padding: 5px 10px !important;
  margin: 3px 0 !important;
  font-weight: 500 !important;
}

/* HIGHLY SPECIFIC override for actionlist addlink */
#content-related .module .actionlist li a.addlink,
.dashboard .module .actionlist li a.addlink {
  color: white !important;
  font-weight: 500 !important;
  background-color: var(--primary-color) !important;
}

/* Override even more aggressive for the action list links */
.actionlist li a.addlink::before,
.actionlist li a.changelink::before,
.actionlist li a.deletelink::before {
  color: white !important;
}

/* Avatar Placeholders */
.avatar-placeholder {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--primary-light);
  color: var(--text-on-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 16px;
  text-transform: uppercase;
}
