:root {

    --ivory:   #FFFDF7;
    --ivory2:  #F5F0E8;
    --blush:   #E8C4B8;
    --blush2:  #F2D5CB;
    --gold:    #C9A96E;
    --gold2:   #E2C48A;
    --sage:    #8A9E8A;
    --dark:    #1C1C1C;
    --mid:     #3A3530;
    --light-text: #6B6058;

    --font-primary: ui-serif, "Iowan Old Style", "Apple Garamond", Baskerville, "Times New Roman", "Droid Serif", Times, serif;
    --font-secondary:  "Avenir Next", Avenir, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-primary-admin:  "Avenir Next", Avenir, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    --radius: 16px;
    --transition: 0.4s cubic-bezier(.4,0,.2,1);
    
    /* Primary colors */
    --color-primary: #C9A96E;
    --color-primary-hover: #b8985d;
    --color-primary-dim: rgba(201, 169, 110, 0.5);

    /* Background colors */
    --bg-darkest: #121212;
    --bg-panel: #1C1C1C;
    --bg-surface: #2C2C2C;
    --bg-sections: #434242;
    --bg-dark-hover: #252525;

    /* Border colors */
    --color-border: #3A3530;

    /* Text colors */
    --text-primary: #F5F0E8;
    --text-white: #FFFFFF;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.5);

    /* State colors */
    --color-success: #4CAF50;
    --color-danger: #E07070;
    --color-danger-hover: #e53935;
    --color-warning: #ff9800;

    --color-blue: #1e5bbd;

    --color-delete: #ef4444;
}

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

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
::-webkit-scrollbar { display: none; }

html { scroll-behavior: smooth; overflow-x: clip; }

body { 
    font-family: var(--font-primary);
    -ms-overflow-style: none; 
    scrollbar-width: none; 
}

/* ---- Tailwind compatibility classes (Tailwind not loaded in admin) ---- */
.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-normal { font-weight: 400; }
.leading-relaxed { line-height: 1.625; }
.border-collapse { border-collapse: collapse; }
.rounded { border-radius: 0.25rem; }
.rounded-lg { border-radius: 0.5rem; }
.uppercase { text-transform: uppercase; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-primary { color: var(--color-primary); }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.875rem; }
.text-xl { font-size: 1.25rem; }
/* border-b adds bottom border; border-border sets the border color (Tailwind compat) */
.border-b { border-bottom: 1px solid var(--color-border); }
.border-border { border-color: var(--color-border); }
.bg-panel { background: var(--bg-panel); }
.bg-surface { background: var(--bg-surface); }
.bg-primary-dim { background: rgba(201,169,110,0.08); }
/* Tailwind arbitrary values */
.min-w-\[1120px\] { min-width: 1120px; }
.min-w-\[600px\] { min-width: 600px; }
.min-w-\[950px\] { min-width: 950px; }
.w-\[120px\] { width: 120px; }
.text-left { text-align:left; }
.mb-0 { margin-bottom:0; }
.mb-1 { margin-bottom:1rem; }
.mb-2 { margin-bottom:2rem; }
.mb-4 { margin-bottom:4rem; }
.mb-6 { margin-bottom: 6rem; }
.mb-8 { margin-bottom: 8rem; }
.mt-1 { margin-top:1rem; }
.mt-2 { margin-top:2rem; }
.mt-3 { margin-top:3rem; }
.mt-4 { margin-top:4rem; }
.pb-1 { padding-bottom:1rem; }
.text-sm { font-size:0.9rem; }
.text-center { text-align:center; }
.text-white {color: var(--text-white);}
.mx-1{
    margin-left: 1rem;
    margin-right: 1rem;
}
.my-1{
    margin-top: 1rem;
    margin-bottom: 1rem;
}
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.pb-2 { padding-bottom: 0.5rem; }
.pt-2 { padding-top: 0.5rem; }
.py-1{
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}
.py-2{
    padding-top: 1rem;
    padding-bottom: 1rem;
}

/* modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  background: rgba(0,0,0,0.78);
}

.modal-backdrop.is-open {
  display: flex;
}

body.modal-open {
  overflow: hidden;
}

.modal {
  position: relative;
  width: min(100%, 500px);
  max-height: 85vh;  
  background: #1C1C1C;
  border: 1px solid var(--color-primary);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  padding: 0;
  text-align: left;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal.modal-wide {
  width: min(100%, 900px);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: center;
  position: sticky;
  top: 0;
  background: #1C1C1C;
  border-bottom: 1px solid var(--color-primary);
  z-index: 10;
  padding: 10px 10px;
  min-height: 50px;
}

.modal-title {
  margin: 0;
  padding: 5px 5px;
  color: var(--color-primary);
  font-size: 1.5rem;
  text-align: center;
  word-break: break-word;
  line-height: 1.2;
}

h1.modal-title,h2.modal-title,h3.modal-title{
    font-weight: unset;
}

.modal-close-icon {
  position: absolute;
  right: 0.2rem;
  background: transparent;
  border: none;
  font-size: 2.5rem;
  line-height: 1;
  color: var(--color-primary);
  cursor: pointer;
  padding: 2px 10px 0 0;
  transition: opacity var(--transition);
}

.modal-close-icon:hover {
  opacity: 0.7;
}

.modal-body {
  padding: 1rem 2rem;
  overflow-y: auto;
  flex-grow: 1;
}

.modal label {
  color: var(--color-primary);
}

.modal-footer{
    display: flex;
    align-items: center;
    justify-content: center;
    position: sticky;
    bottom: 0;
    background: #1C1C1C;
    z-index: 10;
    padding-left: 2rem;
    padding-right: 2rem;
    margin: 10px;
    gap: 1rem;
}

.modal-overlay { position:fixed; top:0; left:0; width:100%; height:100%; background:rgba(0,0,0,0.8); align-items:center; justify-content:center; z-index:9999; }
.modal-overlay:not(.hidden) { display: flex; }

.modal-switch {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--bg-surface);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--color-primary);
    /*color: var(--color-primary);*/
}
.modal-switch label {
    margin-bottom: 0;
}

@media (max-width: 600px) {
    .modal-body {
        padding: 1rem 1rem;
    }
}

#deleteModal .modal, .modal.delete{
    border: 1px solid var(--color-danger);
}

#deleteModal .modal-header, .modal.delete .modal-header{
    border-bottom: 1px solid var(--color-danger);
}

#deleteModal .modal-title, .modal.delete .modal-title{
    color: var(--color-danger);
}

#deleteModal .modal-body, .modal.delete .modal-body{
    text-align: center;
    color: white;
}

#deleteModal .modal-close-icon, .modal.delete .modal-close-icon{
    color: var(--color-danger);
}

#deleteModal .modal-footer button, .modal.delete .modal-footer button {
    border: 1px solid var(--color-danger);
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    margin-bottom: 0;
    flex-shrink: 0;
}
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #3a3530;
    border: 1px solid var(--color-primary);
    transition: 0.4s;
    border-radius: 24px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 2px;
    top: 50%;
    transform: translateY(-50%);
    background-color: #f5f0e8;
    transition: 0.4s;
    border-radius: 50%;
}
.switch input:checked + .slider {
    background-color: var(--color-primary);
}
.switch input:checked + .slider:before {
    transform: translate(20px, -50%);
    background: #ffffff;
}

.switch-small {
    width: 32px !important;
    height: 18px !important;
}
.switch-small .slider {
    border-radius: 18px !important;
}
.switch-small .slider:before {
    height: 12px !important;
    width: 12px !important;
    left: 2px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
}
.switch-small input:checked + .slider:before {
    transform: translate(14px, -50%) !important;
}

.last-element{
    margin-bottom: 0 !important;
}

.switch-div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--bg-surface);
    padding: 0.5rem;
    border-radius: 8px;
    border: 1px solid var(--color-primary);
    color: var(--color-primary);    
}