@import url('https://fonts.googleapis.com/css2?family=Literata:opsz,wght@7..72,200..900&family=Nunito:wght@300;400;600&display=swap');

:root {
  /* Brand Colors */
  --color-white: #ffffff;
  --color-sand: #f4f1ec;
  --color-blue: #7990c7;
  --color-olive: #989b68;
  --color-yellow: #ffc34a;

  /* Semantic Colors */
  --bg-main: var(--color-white);
  --bg-secondary: var(--color-sand);
  --text-primary: #333333;
  --text-secondary: var(--color-olive);
  --accent: var(--color-blue);
  --border: #e0e0e0;

  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  /* Softer, but not too round for cards */
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.04);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Nunito', sans-serif;
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  line-height: 1.7;
  /* Large line-height */
  font-weight: 400;
  /* Avoid heavy weights */
}

/* Layout */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  background-color: var(--color-white);
  /* border-right: 1px solid var(--border); */
  /* Cleaner look without border, or very subtle */
  padding: var(--spacing-lg) var(--spacing-md);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 10;
}

.main-content {
  flex: 1;
  margin-left: 260px;
  padding: var(--spacing-xl);
  background-color: var(--bg-secondary);
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: 'Literata', serif;
  color: var(--color-blue);
  font-weight: 600;
  margin-bottom: var(--spacing-sm);
  letter-spacing: 0.01em;
}

h1 {
  font-size: 2.5rem;
}

h2 {
  font-size: 1.75rem;
}

h3 {
  font-size: 1.35rem;
}

p {
  margin-bottom: var(--spacing-sm);
  color: #666;
  font-weight: 400;
}

/* Navigation */
.brand {
  margin-bottom: var(--spacing-xl);
  padding: 0 var(--spacing-xs);
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.brand h2 {
  font-family: 'Literata', serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-blue);
  margin: 0;
  line-height: 1;
}

.nav-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: 0.75rem var(--spacing-sm);
  text-decoration: none;
  color: var(--color-olive);
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  font-family: 'Nunito', sans-serif;
}

.nav-item i {
  display: inline-block;
  font-size: 1.25rem;
  line-height: 1;
}

.nav-item:hover {
  background-color: rgba(152, 155, 104, 0.1);
  /* color: var(--color-blue); */
}

.nav-item.active {
  color: var(--color-blue);
  background-color: transparent;
  font-weight: 700;
  /* border-bottom: none; */
}

.nav-indicator {
  display: inline-block;
  margin-right: -0.5rem;
  font-size: 1.5rem;
  line-height: 0.5;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: var(--spacing-md);
}

.logout-link {
  color: var(--color-olive);
  opacity: 0.8;
}

.logout-link:hover {
  opacity: 1;
  background-color: transparent;
  color: #dc2626;
  /* Warning color on hover */
}

/* Cards */
.card {
  background-color: var(--color-white);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  box-shadow: var(--shadow-sm);
  /* Using variable properly */
  margin-bottom: var(--spacing-lg);
  border: 1px solid rgba(0, 0, 0, 0.02);
}

/* Forms */
.form-group {
  margin-bottom: var(--spacing-md);
}

label {
  display: block;
  margin-bottom: var(--spacing-xs);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.9rem;
}

input,
select,
textarea {
  width: 100%;
  padding: var(--spacing-sm);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.2s;
  background-color: #fafafa;
  color: var(--text-primary);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--color-blue);
  background-color: var(--color-white);
  box-shadow: 0 0 0 3px rgba(121, 144, 199, 0.1);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-full);
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  gap: var(--spacing-xs);
  font-size: 1rem;
  font-family: 'Nunito', sans-serif;
}

.btn-primary {
  background-color: var(--color-blue);
  color: var(--color-white);
}

.btn-primary:hover {
  background-color: #647ab0;
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: var(--color-sand);
  color: var(--color-olive);
}

.btn-secondary:hover {
  background-color: #e8e4de;
}

.btn-danger {
  background-color: #fee2e2;
  color: #dc2626;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

/* Tables */
.table-container {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  /* Revert to collapse for clean 1px borders */
}

th {
  text-align: left;
  padding: var(--spacing-md);
  color: var(--text-secondary);
  border-bottom: 2px solid var(--color-sand);
  font-weight: 600;
  font-family: 'Literata', serif;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

td {
  padding: var(--spacing-md);
  border-bottom: 1px solid var(--border);
  color: #555;
  vertical-align: middle;
}

/* Action Buttons Column */
td:last-child {
  white-space: nowrap;
  width: 1%;
  /* Shrink to fit content */
  /* Remove display:flex here as it breaks table cell borders */
}

/* Ensure buttons stand in a row */
td button {
  display: inline-flex;
  vertical-align: middle;
  margin-right: 0.5rem !important;
  /* Force gap */
}

td button:last-child {
  margin-right: 0 !important;
}

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

/* Utilities */
.status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
}

.status-active,
.status-confirmed {
  background-color: #dcfce7;
  color: #166534;
}

.status-inactive,
.status-cancelled {
  background-color: #fee2e2;
  color: #991b1b;
}

.status-pending {
  background-color: #fef9c3;
  color: #854d0e;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.grid {
  display: grid;
  gap: var(--spacing-lg);
}

.grid-cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background-color: var(--color-white);
  padding: var(--spacing-xl);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px);
  transition: all 0.3s;
}

.modal-overlay.open .modal {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-lg);
}

.close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-secondary);
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: var(--spacing-xl);
  right: var(--spacing-xl);
  padding: var(--spacing-md) var(--spacing-lg);
  border-radius: var(--radius-md);
  background-color: #333;
  color: white;
  box-shadow: var(--shadow-lg);
  transform: translateY(150%);
  transition: transform 0.3s;
  z-index: 200;
}

.toast.show {
  transform: translateY(0);
}

.toast.success {
  background-color: #10b981;
}

.toast.error {
  background-color: #ef4444;
}/* Loading Indicator */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}

.loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--color-sand);
    border-top: 4px solid var(--color-blue);
    /* Brand Blue */
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}