/* Fortune Reading Orders — UI palette + components.
 *
 * Layered on top of Bootstrap 5: we don't replace the layout, just
 * recolor + restyle to match the screenshots (purple primary, soft
 * cards, hour chips, bottom-action sticky modal).
 */

:root {
  --fr-primary: #a100ff;
  --fr-primary-strong: #8a00d4;
  --fr-primary-soft: #f3e7ff;
  --fr-text: #1f2937;
  --fr-muted: #6b7280;
  --fr-border: #e5e7eb;
  --fr-card-radius: 18px;
  --fr-input-radius: 12px;
  --fr-sidebar-width: 248px;
}

body {
  background: #f7f7fb;
  color: var(--fr-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui,
    "Helvetica Neue", Arial, sans-serif;
}

/* ----------------------- Buttons ----------------------- */

.btn-primary,
.btn-primary:focus {
  background: var(--fr-primary);
  border-color: var(--fr-primary);
  color: #fff;
}
.btn-primary:hover,
.btn-primary:active {
  background: var(--fr-primary-strong);
  border-color: var(--fr-primary-strong);
}
.btn-outline-primary {
  color: var(--fr-primary);
  border-color: var(--fr-primary);
}
.btn-outline-primary:hover {
  background: var(--fr-primary);
  border-color: var(--fr-primary);
  color: #fff;
}
.btn-purple,
.btn-purple:focus {
  background: var(--fr-primary);
  border-color: var(--fr-primary);
  color: #fff;
}
.btn-purple:hover,
.btn-purple:active {
  background: var(--fr-primary-strong);
  border-color: var(--fr-primary-strong);
  color: #fff;
}
.btn {
  border-radius: 10px;
  font-weight: 500;
}

/* ----------------------- Cards ----------------------- */

.fr-card {
  background: #fff;
  border: 1px solid var(--fr-border);
  border-radius: var(--fr-card-radius);
  padding: 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.fr-card + .fr-card {
  margin-top: 12px;
}

.fr-stat {
  background: #fff;
  border: 1px solid var(--fr-border);
  border-radius: var(--fr-card-radius);
  padding: 16px;
  text-align: center;
}
.fr-stat .fr-stat-value {
  font-size: 1.75rem;
  font-weight: 700;
}
.fr-stat .fr-stat-label {
  color: var(--fr-muted);
  font-size: 0.85rem;
}
.fr-stat.fr-stat--accent .fr-stat-value {
  color: var(--fr-primary);
}
.fr-stat.fr-stat--success .fr-stat-value {
  color: #16a34a;
}
.fr-stat.fr-stat--warn .fr-stat-value {
  color: #ca8a04;
}
.fr-stat.fr-stat--info .fr-stat-value {
  color: #2563eb;
}

/* ----------------------- Inputs ----------------------- */

/* Apply consistent rounded styling to ALL form inputs even when the
 * server-rendered widget didn't tag them with .form-control. Forms
 * defined without explicit widget classes (Django ModelForm defaults)
 * still pick up this style. */
.form-control,
.form-select,
.fr-content input[type="text"],
.fr-content input[type="email"],
.fr-content input[type="password"],
.fr-content input[type="number"],
.fr-content input[type="date"],
.fr-content input[type="datetime-local"],
.fr-content input[type="url"],
.fr-content input[type="search"],
.fr-content input[type="tel"],
.fr-content textarea,
.fr-content select,
main input[type="text"],
main input[type="email"],
main input[type="password"],
main input[type="number"],
main input[type="date"],
main input[type="datetime-local"],
main input[type="url"],
main input[type="search"],
main input[type="tel"],
main textarea,
main select {
  display: block;
  width: 100%;
  border-radius: var(--fr-input-radius);
  border: 1px solid var(--fr-border);
  background: #fff;
  padding: 0.55rem 0.85rem;
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--fr-text);
}
.form-control:focus,
.form-select:focus,
.fr-content input:focus,
.fr-content textarea:focus,
.fr-content select:focus,
main input:focus,
main textarea:focus,
main select:focus {
  outline: none;
  border-color: var(--fr-primary);
  box-shadow: 0 0 0 3px rgba(161, 0, 255, 0.15);
}
/* Inline checkboxes shouldn't be stretched to 100% width */
.fr-content input[type="checkbox"],
.fr-content input[type="radio"],
main input[type="checkbox"],
main input[type="radio"] {
  width: auto;
  display: inline-block;
}

.form-section-title {
  text-transform: uppercase;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--fr-primary);
  letter-spacing: 0.04em;
  margin-bottom: 8px;
  margin-top: 12px;
}

/* ----------------------- Hour chips ----------------------- */

.fr-chip {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--fr-border);
  background: #fff;
  font-size: 0.85rem;
  margin: 2px 4px 2px 0;
  user-select: none;
}
.fr-chip.is-active,
.fr-chip-input:checked + .fr-chip-label {
  background: var(--fr-primary);
  border-color: var(--fr-primary);
  color: #fff;
}
.fr-chip-input {
  display: none;
}
.fr-chip-label {
  cursor: pointer;
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--fr-border);
  background: #fff;
  font-size: 0.85rem;
  margin: 2px;
}

/* Status badges (fr-status-*) — used by Lịch bói cards */
.fr-status {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
}
.fr-status-warning {
  background: #fef3c7;
  color: #92400e;
}
.fr-status-info {
  background: #dbeafe;
  color: #1d4ed8;
}
.fr-status-success {
  background: #dcfce7;
  color: #166534;
}
.fr-status-secondary {
  background: #f1f5f9;
  color: #475569;
}
.fr-status-danger {
  background: #fee2e2;
  color: #991b1b;
}

/* ----------------------- Sidebar ----------------------- */

.fr-shell {
  display: flex;
  min-height: 100vh;
}

.fr-sidebar {
  width: var(--fr-sidebar-width);
  background: #fff;
  border-right: 1px solid var(--fr-border);
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  flex-shrink: 0;
}
.fr-sidebar .fr-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.fr-sidebar .fr-brand-name {
  font-weight: 700;
  font-size: 1.05rem;
}
.fr-sidebar .fr-brand-sub {
  color: var(--fr-muted);
  font-size: 0.8rem;
}
.fr-sidebar .fr-nav-group-title {
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.72rem;
  color: var(--fr-muted);
  padding: 12px 10px 4px;
}
.fr-sidebar .fr-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--fr-text);
  text-decoration: none;
  font-size: 0.92rem;
}
.fr-sidebar .fr-nav-link:hover {
  background: #f4f4f8;
}
.fr-sidebar .fr-nav-link.is-active {
  background: var(--fr-primary-soft);
  color: var(--fr-primary);
  font-weight: 500;
}
.fr-sidebar .fr-user-card {
  margin-top: auto;
  padding: 10px;
  border-top: 1px solid var(--fr-border);
  font-size: 0.85rem;
}

.fr-content {
  flex: 1;
  padding: 16px;
  max-width: 100%;
}

.fr-topbar {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: #fff;
  border-bottom: 1px solid var(--fr-border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.fr-topbar .fr-burger {
  background: transparent;
  border: 0;
  padding: 6px;
  font-size: 1.25rem;
}

/* Mobile drawer */
@media (max-width: 880px) {
  .fr-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.2s ease-out;
    box-shadow: 0 0 24px rgba(0, 0, 0, 0.1);
  }
  .fr-sidebar.is-open {
    transform: translateX(0);
  }
  .fr-topbar {
    display: flex;
  }
  .fr-content {
    padding: 12px;
  }
  .fr-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 40;
    display: none;
  }
  .fr-backdrop.is-open {
    display: block;
  }
}

/* ----------------------- Tabs ----------------------- */

.fr-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-bottom: 1px solid var(--fr-border);
  padding-bottom: 0;
  margin-bottom: 14px;
}
.fr-tabs .fr-tab {
  background: transparent;
  border: 0;
  padding: 8px 12px;
  border-radius: 8px 8px 0 0;
  color: var(--fr-muted);
  font-weight: 500;
}
.fr-tabs .fr-tab.is-active {
  color: #fff;
  background: var(--fr-primary);
}
.fr-tab-pane {
  display: none;
}
.fr-tab-pane.is-active {
  display: block;
}

/* ----------------------- Misc ----------------------- */

.text-purple {
  color: var(--fr-primary) !important;
}
.bg-purple {
  background: var(--fr-primary) !important;
  color: #fff;
}

.fr-warning-list {
  background: #fff5f5;
  border: 1px solid #fecaca;
  border-radius: 12px;
  padding: 10px 12px;
  margin: 10px 0;
}
.fr-warning-list .fr-warning-row {
  color: #b91c1c;
  font-size: 0.85rem;
  padding: 4px 0;
  border-top: 1px dashed #fecaca;
}
.fr-warning-list .fr-warning-row:first-of-type {
  border-top: 0;
}
.fr-warning-list .fr-warning-title {
  color: #b91c1c;
  font-weight: 600;
  font-size: 0.85rem;
}

.fr-order-card {
  border: 1px solid var(--fr-border);
  border-radius: var(--fr-card-radius);
  padding: 14px;
  background: #fff;
  margin-bottom: 12px;
}
.fr-order-card .fr-order-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  margin-bottom: 6px;
}
.fr-order-card .fr-order-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.92rem;
}
.fr-order-card .fr-order-amount {
  color: #2563eb;
  font-weight: 600;
}
