/* --- CSS Variables & Reset --- */
:root {
  --primary-color: #2563eb; /* Professional Blue */
  --primary-hover: #1d4ed8;
  --text-main: #1f2937;
  --text-secondary: #6b7280;
  --bg-body: #f3f4f6;
  --bg-card: #ffffff;
  --border-color: #e5e7eb;
  --radius-md: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* --- Layout --- */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
}

h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
}

h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

#nav-controls {
  display: flex;
  gap: 4px;
  place-items: center;
}

#nav-controls a, #nav-controls a:visited {
  color: var(--text-main);
}

.nav-email {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* --- Components: Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition:
    background-color 0.2s,
    color 0.2s;
  text-decoration: none;
}

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

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

.btn-secondary {
  background-color: white;
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background-color: #f9fafb;
  border-color: #d1d5db;
}

.btn-block {
  width: 100%;
}

.btn-outline {
  --text-opacity: 1;
  color: #1a202c;
  color: rgba(26, 32, 44, var(--text-opacity));
  padding-left: 1.25rem;
  padding-right: 1.25rem;
  padding-top: .5rem;
  padding-bottom: .5rem;
  font-size: .875rem;
  font-weight: 500;
  border: 1px solid;
  border-radius: .5rem;
  --border-opacity: 1;
  border-color: #e2e8f0;
  border-color: rgba(226, 232, 240, var(--border-opacity));
  --bg-opacity: 1;
  background-color: #fff;
  background-color: rgba(255, 255, 255, var(--bg-opacity));
}
.btn-outline:hover {
  --bg-opacity: 1;
  background-color: #f7fafc;
  background-color: rgba(247, 250, 252, var(--bg-opacity));
}

.btn-big {
  font-size: 1rem;
}

.icon-btn {
  display: block;
  min-width: 36px;
}

a.icon-btn, a.icon-btn:visited {
  color: var(--text-main);
}

/* --- View: Home (Form List) --- */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.form-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.form-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.card-header a {
  text-decoration: none;
  color: var(--text-main);
}

.card-header a:hover {
  border-bottom: 1px solid black;
}

.card-title {
  font-weight: 600;
  font-size: 1.125rem;
}

.card-desc {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
  flex-grow: 1; /* Pushes button to bottom */
}

.tight-badge {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  font-weight: 600;
  text-transform: uppercase;
}

.status-open {
  background-color: #d1fae5;
  color: #065f46;
}

.status-closed {
  background-color: #f3f4f6;
  color: #374151;
}

.badge {
  font-weight: 500;
  padding: .4rem .6rem;
  border-radius: 9999px;
}
.badge-green {
  --bg-opacity: 1;
  background-color: #48bb78;
  background-color: rgba(72, 187, 120, var(--bg-opacity));
  --text-opacity: 1;
  color: #fff;
  color: rgba(255, 255, 255, var(--text-opacity));
}
.badge-indigo {
  --bg-opacity: 1;
  background-color: #667eea;
  background-color: rgba(102, 126, 234, var(--bg-opacity));
  --text-opacity: 1;
  color: #fff;
  color: rgba(255, 255, 255, var(--text-opacity));
}
.badge-blue {
  --bg-opacity: 1;
  background-color: #4299e1;
  background-color: rgba(66, 153, 225, var(--bg-opacity));
  --text-opacity: 1;
  color: #fff;
  color: rgba(255, 255, 255, var(--text-opacity));
}
a.badge, a.tight-badge {
  /* color: inherit; */
  text-decoration: none;
}

/* --- View: Detail (Form) --- */
.form-container {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

.form-control {
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-size: 0.95rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
  font-family: inherit;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

.form-actions {
  margin-top: 2rem;
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

.table {
  --text-opacity: 1;
  color: #4a5568;
  color: rgba(74, 85, 104, var(--text-opacity));
      text-align: left;
  font-size: .875rem;
      max-width: 100%;
    background-color: transparent;
    border-collapse: collapse;
    border-spacing: 0;
}
.table thead {
      --bg-opacity: 1;
    background-color: #f7fafc;
    background-color: rgba(247, 250, 252, var(--bg-opacity));
  text-transform: uppercase;
}
.table th, .table td {
  padding-left: .75rem;
  padding-right: .75rem;
  padding-top: .75rem;
  padding-bottom: .75rem;
}
.table th:first-child, .table td:first-child {
  padding-left: .375rem;
  padding-right: .375rem;
}
.table tbody tr {
  border-bottom-width: 1px;
      --bg-opacity: 1;
    background-color: #fff;
    background-color: rgba(255, 255, 255, var(--bg-opacity));
}
.table tbody tr:hover {
      --bg-opacity: 1;
    background-color: #f7fafc;
    background-color: rgba(247, 250, 252, var(--bg-opacity));
}
.table tbody input[type=checkbox], .table tbody tr.unpaid label {
  cursor: pointer;
}

.notice {
  --text-opacity: 1;
  color: #c53030;
  color: rgba(197, 48, 48, var(--text-opacity));
  position: relative;
  padding-left: 1rem;
  padding-right: 1rem;
  padding-top: .75rem;
  padding-bottom: .75rem;
  margin-top: .5rem;
  margin-bottom: .5rem;
  border-width: 1px;
  border-radius: .25rem;
  --border-opacity: 1;
  border-color: #fc8181;
  border-color: rgba(252, 129, 129, var(--border-opacity));
  --bg-opacity: 1;
  background-color: #fff5f5;
  background-color: rgba(255, 245, 245, var(--bg-opacity));
}

/* --- Utilities --- */
.hidden {
  display: none !important;
}
.overflow-hidden {
  overflow: hidden;
}
.mt-1 {
  margin-top: 1rem;
}
.horizontal-flow {
  overflow-x: auto !important;
  scrollbar-width: thin;
}
.text-right {
    text-align: right;
}
.p-1 {
  padding: .25rem;
}
.text-white {
      --text-opacity: 1;
    color: #fff;
    color: rgba(255, 255, 255, var(--text-opacity));
}
.bg-green-500 {
      --bg-opacity: 1;
    background-color: #48bb78;
    background-color: rgba(72, 187, 120, var(--bg-opacity));
}

/* --- Animations --- */
  .pulse-glow-element {
    outline: 1px solid rgba(21, 119, 209, 0.8);

    /* Applying the animation */
    animation: pulse-glow 2s infinite ease-in-out;
  }

  @keyframes pulse-glow {

    0%,
    100% {
      /* Subtle inner and outer glow */
      box-shadow: 0 0 5px rgba(21, 119, 209, 0.2),
        inset 0 0 2px rgba(21, 119, 209, 0.1);
      border-color: rgba(21, 119, 209, 0.4);
    }

    50% {
      /* Stronger, wider outer glow */
      box-shadow: 0 0 20px rgba(21, 119, 209, 0.6),
        inset 0 0 5px rgba(21, 119, 209, 0.3);
      border-color: rgba(21, 119, 209, 8);
    }
  }

.price-pop {
  animation: popEffect 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popEffect {
  0% {
    transform: scale(1);
    color: inherit;
  }
  50% {
    transform: scale(1.15);
    color: #48bb78;
    color: #289b58;
    color: #087b38;
  }
  100% {
    transform: scale(1);
    color: inherit;
  }
}

@media (max-width: 600px) {
  .form-actions {
    flex-direction: column-reverse;
  }
  .btn {
    width: 100%;
  }
  h1 {
    font-size: 1.3rem;
  }
}
