/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color: #222;
  margin: 0;
  padding: 1rem 1.5rem 3rem;
}

nav.main-nav {
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #ccc;
}

nav.main-nav a {
  margin-right: 1rem;
  text-decoration: none;
  color: #1a5276;
}

nav.main-nav a:hover {
  text-decoration: underline;
}

table {
  border-collapse: collapse;
  width: 100%;
  margin-bottom: 1.5rem;
}

th, td {
  text-align: left;
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid #ddd;
}

th {
  background: #f4f4f4;
}

form.record-form {
  max-width: 40rem;
}

form.record-form .field {
  margin-bottom: 0.9rem;
  display: flex;
  flex-direction: column;
}

form.record-form label {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

form.record-form input[type=text],
form.record-form input[type=number],
form.record-form input[type=date],
form.record-form select,
form.record-form textarea {
  padding: 0.35rem;
  font-size: 1rem;
}

form.record-form select[multiple] {
  min-height: 8rem;
}

.form-errors {
  background: #fdecea;
  border: 1px solid #f5c6cb;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.actions {
  margin-top: 1rem;
}

.actions a {
  margin-right: 1rem;
}

.notice {
  background: #eafaf1;
  border: 1px solid #a3e4bb;
  padding: 0.5rem 1rem;
  margin-bottom: 1rem;
}

footer.app-footer {
  margin-top: 3rem;
  padding-top: 0.75rem;
  border-top: 1px solid #ccc;
  color: #777;
  font-size: 0.85rem;
}

/* ---- Phase 5 UI: cards, badges, panels, tables ------------------------- */

nav.main-nav form.ticket-search {
  display: inline-flex;
  gap: 0.3rem;
  margin-left: 0.5rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.panel {
  margin-bottom: 2rem;
}

.panel h2 {
  font-size: 1.1rem;
  border-bottom: 1px solid #e2e2e2;
  padding-bottom: 0.3rem;
}

.panel h2 .panel-link {
  float: right;
  font-size: 0.8rem;
  font-weight: normal;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.card {
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 0.6rem 0.75rem;
  background: #fafafa;
}

.card-bad {
  border-color: #e6b0aa;
  background: #fdf3f2;
}

.card-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #666;
}

.card-value {
  font-size: 1.4rem;
  font-weight: 600;
}

.card-note {
  font-size: 0.78rem;
  color: #666;
}

.count-chip {
  display: inline-block;
  margin-right: 0.9rem;
  font-size: 0.8rem;
  color: #555;
}

.badge {
  display: inline-block;
  padding: 0.05rem 0.45rem;
  border-radius: 10px;
  font-size: 0.75rem;
  white-space: nowrap;
  border: 1px solid transparent;
}

.badge-new     { background: #e8f0fe; border-color: #adc6f5; color: #1a3f7a; }
.badge-open    { background: #e6f4ea; border-color: #a5d6b3; color: #14532d; }
.badge-hold    { background: #fef4e5; border-color: #f0cd8f; color: #7a4f10; }
.badge-solved  { background: #f0e9fb; border-color: #c9b3ec; color: #4a2a7a; }
.badge-closed  { background: #eeeeee; border-color: #cccccc; color: #555555; }
.badge-unknown { background: #fdecea; border-color: #f0b7b0; color: #7a1c14; }

.flag {
  font-size: 0.72rem;
  color: #7a4f10;
  border: 1px solid #f0cd8f;
  border-radius: 3px;
  padding: 0 0.25rem;
  margin-left: 0.3rem;
}

.caveat {
  font-size: 0.8rem;
  color: #666;
  border-left: 3px solid #ddd;
  padding-left: 0.6rem;
  margin: 0.5rem 0 1rem;
}

.empty {
  font-size: 0.85rem;
  color: #777;
}

td.num, th.num { text-align: right; }
.nowrap { white-space: nowrap; }
tr.total-row td { font-weight: 600; background: #f6f6f6; }

.period-selector {
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px dashed #ddd;
}

.period-presets a {
  margin-right: 0.75rem;
  font-size: 0.9rem;
}

.period-presets a.is-current {
  font-weight: 700;
  text-decoration: none;
}

.period-form {
  display: inline-flex;
  gap: 0.3rem;
  margin-top: 0.4rem;
}

.period-current {
  font-size: 0.8rem;
  color: #666;
  margin: 0.35rem 0 0;
}

.alert {
  background: #fdecea;
  border: 1px solid #f5c6cb;
  padding: 0.5rem 1rem;
  margin-bottom: 1rem;
}

.side-panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr));
  gap: 1.5rem;
}

.filters {
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.filters a { margin-right: 0.6rem; }
.filters a.is-current { font-weight: 700; text-decoration: none; }
