/* ============================================================
   Jetfire Theme for Superion
   Derived from Jetfire/Cabookle Site.css
   ============================================================ */

/* ── Color Variables ── */
:root {
  --primary-teal: #8A5FB5;
  --dark-teal: #704795;
  --accent-orange: #FF5722;
  --light-gray: #F7F7F7;
  --text-gray: #777;
  --border-gray: #DDD;
}

/* ── Base ── */
html {
  overflow-x: hidden;
}

body {
  font-family: 'Source Sans 3', 'Source Sans Pro', Helvetica, 'Open Sans', sans-serif;
  font-size: 16px;
  line-height: 1.75;
  color: #777;
  background-color: #F7F7F7;
  -webkit-font-smoothing: antialiased;
  margin: 0;
  padding: 0;
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
  color: var(--primary-teal);
  font-weight: 300;
  margin: 0 0 12px 0;
}

h1 {
  color: var(--primary-teal);
  font-size: 2.1em;
  line-height: 1.1em;
  font-weight: 900;
  font-style: normal;
  text-align: center;
  position: relative;
  margin-bottom: 17px;
  text-shadow: 0 2px #fff;
  letter-spacing: -0.03em;
}

h2 {
  color: #888;
  font-size: 24px;
  line-height: 24px;
  font-weight: 300;
  font-style: normal;
  padding: 0;
  margin-bottom: 17px;
}

h2.subtitle {
  font-weight: 400;
  text-align: center;
  font-size: 1.25em;
  padding: 0 0 10px 0;
  border-bottom: 1px solid #ddd;
}

h2.feature-heading {
  font-weight: 600;
  color: var(--primary-teal);
  font-size: 1.3em;
}

h3 { font-size: 1.5em; }

h4 {
  font-size: 14px;
  line-height: 22px;
  font-weight: 300;
}

h5 {
  font-size: 1.116em;
  font-weight: 300;
}

h6 {
  font-size: 1em;
  font-weight: 300;
  font-style: italic;
}

p { margin-bottom: 12px; }

strong { font-weight: bold; }

a {
  color: var(--primary-teal);
  transition: all 0.2s ease-out;
}

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

a:visited { text-decoration: none; }

/* ── Page title (h1 used on list pages) ── */
.page-title {
  font-size: 1.6em;
  font-weight: 900;
  color: var(--primary-teal);
  margin-bottom: 8px;
}

/* ── Buttons ── */
button,
.btn {
  background: #fff;
  border: 1px solid var(--primary-teal);
  color: var(--primary-teal);
  padding: 10px 16px;
  font-size: 1em;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.1s ease-out;
  display: inline-block;
  box-sizing: border-box;
  min-height: 40px;
  line-height: 1.5;
}

/* Make anchor tags with .btn match button styling */
a.btn {
  font-family: inherit;
  text-align: center;
  vertical-align: middle;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

button:hover,
.btn:hover {
  color: var(--accent-orange);
  border-color: var(--accent-orange);
  background: #fff;
  text-decoration: none;
}

/* Primary button */
.btn-primary,
button.btn-primary {
  background: var(--primary-teal);
  color: #fff;
  border-color: #fff;
}

.btn-primary:hover,
button.btn-primary:hover {
  background: var(--accent-orange);
  color: #fff;
  border-color: #fff;
}

/* Small button */
.btn-sm {
  padding: 6px 10px;
  font-size: 0.9em;
  border-radius: 4px;
}

/* XS button */
.btn-xs {
  padding: 3px 6px;
  font-size: 0.85em;
  border-radius: 4px;
}

/* Danger / delete */
.btn-danger {
  background: #fff;
  border-color: #DA4F49;
  color: #DA4F49;
}

.btn-danger:hover {
  background: #DA4F49;
  color: #fff;
  border-color: #fff;
}

/* Info */
.btn-info { background: #49AFCD; color: #fff; border-color: #49AFCD; }
.btn-success { background: #5BB75B; color: #fff; border-color: #5BB75B; }
.btn-warning { background: #FAA732; color: #fff; border-color: #FAA732; }

/* Override Tailwind indigo buttons with teal */
.bg-indigo-600,
.bg-indigo-700,
button.bg-indigo-600,
button.bg-indigo-700,
a.bg-indigo-600,
a.bg-indigo-700 {
  background-color: var(--primary-teal) !important;
  color: white !important;
  border-color: white !important;
}

.bg-indigo-600:hover,
.bg-indigo-700:hover,
button.bg-indigo-600:hover,
button.bg-indigo-700:hover,
a.bg-indigo-600:hover,
a.bg-indigo-700:hover {
  background-color: var(--accent-orange) !important;
  color: white !important;
  border-color: white !important;
}

/* ── Tables ── */
table {
  width: 100%;
  border-collapse: collapse;
}

table thead {
  background-color: #fff;
}

table th {
  color: var(--accent-orange);
  font-weight: 600;
  padding: 12px 16px;
  text-align: left;
  border-bottom: 2px solid #DDD;
  font-size: 1em;
}

table td {
  padding: 12px 16px;
  border-bottom: 1px solid #EEE;
  vertical-align: middle;
  color: #555;
  font-size: 1em;
}

table tbody tr:hover {
  background-color: #FAFAFA;
}

/* Grouped rows (reading groups) */
tr.group,
tr.group:hover,
tr.group td {
  background-color: var(--primary-teal) !important;
  color: #fff !important;
}

/* Overdue */
td.overdue,
.text-overdue {
  color: var(--accent-orange) !important;
  font-weight: bold;
}

/* Table action buttons */
table button,
table a.btn-action {
  -webkit-appearance: none;
  appearance: none;
  background: #fff;
  color: var(--accent-orange);
  border: 1px solid var(--accent-orange);
  padding: 6px 14px;
  font-size: 1em;
  line-height: 1.5;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.1s ease-out;
  margin-right: 4px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  box-sizing: border-box;
}

table button:hover,
table a.btn-action:hover {
  background: var(--accent-orange);
  color: #fff;
  border-color: #fff;
  text-decoration: none;
}

/* Edit action (teal) */
table a.btn-edit {
  background: #fff;
  color: var(--primary-teal);
  border: 1px solid var(--primary-teal);
  padding: 6px 14px;
  font-size: 1em;
  line-height: 1.5;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.1s ease-out;
  margin-right: 4px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
}

table a.btn-edit:hover {
  background: var(--primary-teal);
  color: #fff;
  border-color: #fff;
  text-decoration: none;
}

/* FA icons inside buttons inherit button color */
table button i,
table a.btn-edit i,
table a.btn-action i {
  font-size: 0.95em;
}

/* ── Forms ── */
input:not([type="radio"]):not([type="checkbox"]),
select,
textarea {
  color: #444;
  background-color: #FAFAFA;
  border: none;
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 1em;
  font-family: inherit;
  width: 100%;
  box-sizing: border-box;
  transition: background-color 0.2s;
}

input:focus,
select:focus,
textarea:focus {
  background-color: #F0F0F0;
  border: none;
  outline: none;
  box-shadow: 0 0 0 2px var(--primary-teal);
}

label {
  color: var(--primary-teal);
  font-weight: 600;
  font-size: 0.9em;
  margin-bottom: 4px;
  display: block;
}

/* ── Sidebar search inputs ── */
.sidebar-input-group {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  background-color: #fff;
  border: 1px solid #DDD;
  border-radius: 4px;
  overflow: hidden;
  box-sizing: border-box;
  width: 100%;
}

.sidebar-input-icon {
  padding: 8px 10px;
  color: var(--primary-teal);
  background-color: #fff;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  border-right: 1px solid #DDD;
}

.sidebar-input-icon svg {
  width: 14px;
  height: 14px;
  stroke: var(--primary-teal);
}

.sidebar-input-group input {
  background-color: #fff;
  border: none;
  border-radius: 0;
  padding: 8px 10px;
  font-size: 0.9em;
  width: 100%;
}

.sidebar-input-group input:focus {
  box-shadow: none;
  background-color: #fff;
}

.sidebar-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
}

.sidebar-actions a,
.sidebar-actions button {
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  padding: 7px 10px;
  font-size: 0.9em;
}

/* ── Cards / Panels ── */
.card {
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
  padding: 20px;
  margin-bottom: 20px;
}

/* List table panel — full-width, no shadow, sits flat on page */
.table-panel {
  background: #fff;
  width: 99%;
  margin-left: 20px;
  margin-bottom: 20px;
}

.card-title {
  font-size: 1.3em;
  font-weight: 900;
  color: var(--primary-teal);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid #EEE;
}

/* ── Stats cards (Dashboard) ── */
.stat-card {
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-card-icon {
  color: var(--primary-teal);
  flex-shrink: 0;
}

.stat-card-icon svg {
  width: 32px;
  height: 32px;
  stroke: var(--primary-teal);
}

.stat-card-icon.overdue svg {
  stroke: var(--accent-orange);
}

.stat-card-value {
  font-size: 2em;
  font-weight: 900;
  color: var(--primary-teal);
  line-height: 1;
}

.stat-card-value.overdue {
  color: var(--accent-orange);
}

.stat-card-label {
  font-size: 0.9em;
  color: #999;
  margin-top: 2px;
}

/* ── Jumbotron / Hero ── */
.jumbotron {
  background-color: #fff;
  border: 1px solid var(--dark-teal);
  color: var(--primary-teal);
  padding: 30px;
  border-radius: 0;
  margin-bottom: 20px;
}

/* ── Page header row ── */
.page-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

/* ── Alert / error messages ── */
.alert-error {
  background-color: #FFEBEE;
  color: #C62828;
  border-left: 4px solid #DA4F49;
  padding: 12px 16px;
  border-radius: 4px;
  margin-bottom: 16px;
  font-size: 0.95em;
}

.alert-success {
  background-color: #E8F5E9;
  color: #2E7D32;
  border-left: 4px solid #5BB75B;
  padding: 12px 16px;
  border-radius: 4px;
  margin-bottom: 16px;
  font-size: 0.95em;
}

/* ── Pagination ── */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  border-top: 1px solid #EEE;
  background: #fff;
  font-size: 0.9em;
  color: #777;
}

.pagination button {
  padding: 5px 12px;
  font-size: 0.9em;
}

/* ── Footer ── */
footer {
  color: #777;
  background: rgba(245, 245, 245, 0.9);
  box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.15);
  padding: 16px;
  margin-top: 40px;
  text-align: center;
  font-size: 0.9em;
}

/* ── Override Tailwind indigo colors ── */
.text-indigo-600,
.text-indigo-700,
.text-indigo-900 {
  color: var(--primary-teal) !important;
}

.text-indigo-600:hover,
.text-indigo-700:hover,
.text-indigo-900:hover {
  color: var(--accent-orange) !important;
}

.border-indigo-500 {
  border-color: var(--primary-teal) !important;
}

.focus\:border-indigo-500:focus {
  border-color: var(--primary-teal) !important;
}

.focus\:ring-indigo-500:focus {
  --tw-ring-color: var(--primary-teal) !important;
}

/* ── Success/info overrides ── */
.text-green-600  { color: #5BB75B !important; }
.text-blue-600   { color: #49AFCD !important; }
.text-red-600    { color: var(--accent-orange) !important; }

.bg-green-100    { background-color: #E8F5E9 !important; }
.bg-red-100      { background-color: #FFEBEE !important; }
.bg-yellow-50    { background-color: #FFF9C4 !important; }

/* ── Loading state ── */
.loading-text {
  text-align: center;
  padding: 40px;
  color: #999;
  font-size: 1em;
}

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #999;
}

/* ── Login / Auth pages ── */
.auth-container {
  max-width: 480px;
  margin: 80px auto;
  padding: 40px;
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.auth-logo {
  font-family: 'Luckiest Guy', serif;
  font-size: 40px;
  color: var(--accent-orange);
  text-align: center;
  margin-bottom: 8px;
}

.auth-subtitle {
  text-align: center;
  color: #999;
  margin-bottom: 28px;
  font-size: 0.95em;
}

.form-group {
  margin-bottom: 16px;
}

.form-row {
  display: flex;
  gap: 16px;
}

.form-row .form-group {
  flex: 1;
}

.auth-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 0.9em;
  color: #999;
}

.auth-footer a {
  color: var(--primary-teal);
}

.auth-footer a:hover {
  color: var(--accent-orange);
}

.relative.inline-flex:hover:not(:disabled) {
  background-color: #EEE;
}

/* Error Messages */
.bg-red-50 {
  background-color: #F2DEDE !important;
}

.text-red-800 {
  color: #A94442 !important;
}

/* Disabled States */
button:disabled, .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Mobile Responsive Cards ── */
/* Hide mobile cards on desktop, show table */
.mobile-cards {
  display: none;
}

.desktop-table {
  display: table;
}

/* Mobile Card Styles */
@media (max-width: 767px) {
  /* Global mobile fixes */
  * {
    box-sizing: border-box;
  }
  
  html, body {
    overflow-x: hidden;
    max-width: 100%;
  }
  
  /* Hide desktop table on mobile, show cards */
  .desktop-table {
    display: none !important;
  }
  
  .mobile-cards {
    display: block;
    padding: 10px;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
  }
  
  .mobile-card {
    background: #fff;
    border: 1px solid #DDD;
    border-radius: 8px;
    margin: 0 0 12px 0;
    padding: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    box-sizing: border-box;
    width: 100%;
    overflow: hidden;
    word-wrap: break-word;
  }
  
  .mobile-card-header {
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 2px solid var(--primary-teal);
  }
  
  .mobile-card-header strong {
    color: var(--primary-teal);
    font-size: 1.1em;
    font-weight: 600;
    display: block;
  }
  
  .mobile-card-subtitle {
    color: #888;
    font-size: 0.9em;
    margin-top: 4px;
  }
  
  .mobile-card-body {
    margin-bottom: 12px;
  }
  
  .mobile-card-row {
    display: flex;
    padding: 8px 0;
    border-bottom: 1px solid #F0F0F0;
    font-size: 0.95em;
  }
  
  .mobile-card-row:last-child {
    border-bottom: none;
  }
  
  .mobile-card-label {
    font-weight: 600;
    color: #666;
    min-width: 120px;
    flex-shrink: 0;
  }
  
  .mobile-card-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid #EEE;
  }
  
  .mobile-card-actions .btn,
  .mobile-card-actions button,
  .mobile-card-actions a {
    width: 100%;
    text-align: center;
    justify-content: center;
    padding: 10px 12px;
    font-size: 0.85em;
    box-sizing: border-box;
    display: block;
  }
  
  /* Adjust table panel padding on mobile */
  .table-panel {
    margin-left: 0;
    width: 100%;
    box-sizing: border-box;
    padding: 0;
  }
  
  /* Sidebar elements on mobile */
  .sidebar-input-group {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  
  .sidebar-actions {
    width: 100%;
  }
  
  .sidebar-actions a,
  .sidebar-actions button {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  
  /* Responsive adjustments */
  nav h1 {
    font-size: 24px;
  }
  
  button, .btn {
    font-size: 0.9em;
    padding: 12px 16px;
    box-sizing: border-box;
  }
  
  /* Pagination on mobile */
  .pagination {
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
  }
  
  .pagination > div {
    width: 100%;
    justify-content: center;
  }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: var(--primary-teal);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--dark-teal);
}

/* Loading States */
.loading {
  color: var(--primary-teal);
}

/* Modal Headers */
h4.modal-title {
  font-size: 1.1em;
  font-weight: 400;
  color: var(--primary-teal);
}

/* Feature Headings */
h2.featureHeading {
  font-weight: 600;
  color: var(--primary-teal);
  font-size: 1.3em;
}

/* Slice/Section Padding */
.slice {
  padding: 50px 0 30px 0;
}

@media (min-width: 768px) {
  .slice {
    padding: 5px 0 30px 0;
  }
}
