*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f3f4f6;
  color: #111827;
}

.header-clean {
  background: #111827;
  color: #f9fafb;
  text-align: center;
  padding: 1.2rem 1rem 1rem;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.6);
}

.logo-mubea {
  height: 60px;
  width: auto;
  object-fit: contain;
  display: block;
  margin: 0 auto 0.4rem auto;
}

.app-title {
  margin: 0.3rem 0 0.8rem;
  font-size: 1.6rem;
  font-weight: 600;
}

.nav-center {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.nav-button {
  border: none;
  background: #1f2937;
  color: #e5e7eb;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s, transform 0.05s, box-shadow 0.15s;
}

.nav-button.active {
  background: #002F87;
  color: #f9fafb;
  box-shadow: 0 8px 15px -10px rgba(0, 47, 135, 0.9);
}

.nav-button:hover {
  background: #374151;
}

.nav-button:active {
  transform: translateY(1px);
}

main {
  padding: 1rem;
  max-width: 1200px;
  margin: 0 auto 2rem;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

h2 {
  margin-top: 0;
  margin-bottom: 0.8rem;
}

.card {
  background: #ffffff;
  border-radius: 0.9rem;
  padding: 1rem 1rem 1.1rem;
  margin-bottom: 1rem;
  box-shadow: 0 14px 25px -18px rgba(15, 23, 42, 0.5);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.8rem;
}

.card-header h3 {
  margin: 0;
}

.layout-two-columns {
  display: grid;
  gap: 1rem;
}

@media (min-width: 900px) {
  .layout-two-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.simple-form .form-row,
.complex-form .form-row {
  display: flex;
  flex-direction: column;
  margin-bottom: 0.6rem;
}

.form-row label {
  font-size: 0.85rem;
  margin-bottom: 0.15rem;
  color: #4b5563;
}

input[type="text"],
input[type="date"],
input[type="time"],
select,
textarea {
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  padding: 0.4rem 0.55rem;
  font-size: 0.9rem;
  font-family: inherit;
  width: 100%;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #002F87;
  box-shadow: 0 0 0 1px rgba(0, 47, 135, 0.4);
}

textarea {
  resize: vertical;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

button {
  font-family: inherit;
}

button[type="submit"],
button.primary {
  background: #002F87;
  color: #f9fafb;
  border: none;
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s, transform 0.05s, box-shadow 0.15s;
  box-shadow: 0 10px 18px -12px rgba(0, 47, 135, 0.9);
}

button[type="submit"]:hover,
button.primary:hover {
  background: #003da8;
}

button.secondary {
  background: #e5e7eb;
  color: #111827;
  border: none;
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  font-size: 0.9rem;
  cursor: pointer;
}

button.secondary:hover {
  background: #d1d5db;
}

button.small {
  padding: 0.25rem 0.55rem;
  font-size: 0.8rem;
  border-radius: 999px;
}

.table-wrapper {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

th,
td {
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid #e5e7eb;
  vertical-align: top;
}

th {
  text-align: left;
  background: #f9fafb;
  position: sticky;
  top: 0;
  z-index: 1;
}

tr:nth-child(even) td {
  background: #f9fafb;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.status-open {
  background: #fee2e2;
  color: #b91c1c;
}

.status-done {
  background: #dcfce7;
  color: #166534;
}

.hint {
  font-size: 0.8rem;
  color: #6b7280;
  margin-top: 0.4rem;
}

.form-grid {
  display: grid;
  gap: 0.6rem;
}

.form-row.full-width {
  grid-column: 1 / -1;
}

@media (min-width: 800px) {
  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.quarter-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

#quarter-label {
  font-weight: 600;
}

#quarter-calendar {
  margin-top: 0.5rem;
  display: grid;
  gap: 0.7rem;
}

@media (min-width: 900px) {
  #quarter-calendar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.month-column {
  background: #f9fafb;
  border-radius: 0.6rem;
  padding: 0.5rem;
  border: 1px solid #e5e7eb;
}

.month-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.2rem;
}

.month-header h4 {
  margin: 0;
  font-size: 0.9rem;
}

.month-header span {
  font-size: 0.75rem;
  color: #6b7280;
}

.weekday-row,
.month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.15rem;
}

.weekday-cell {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 500;
  color: #6b7280;
  padding: 0.1rem 0;
}

.day-cell {
  min-height: 3.4rem;
  background: #ffffff;
  border-radius: 0.4rem;
  padding: 0.2rem 0.25rem 0.25rem;
  border: 1px solid #e5e7eb;
  overflow: hidden;
  position: relative;
}

.day-cell.today {
  border-color: #002F87;
  box-shadow: 0 0 0 1px rgba(0, 47, 135, 0.6);
}

.date-number {
  font-size: 0.75rem;
  font-weight: 600;
}

.week-label {
  position: absolute;
  top: 0.15rem;
  right: 0.2rem;
  font-size: 0.6rem;
  color: #6b7280;
  font-weight: 500;
}

.day-holiday {
  background: #fee2e2;
}

.day-vacation {
  box-shadow: inset 0 -4px 0 #facc15;
}

.day-maintenance {
  outline: 2px solid #002F87;
  outline-offset: -2px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  background: #111827;
  color: #f9fafb;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  font-size: 0.85rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 1000;
}

.toast.visible {
  opacity: 1;
  transform: translate(-50%, -4px);
}

.month-summary {
  margin-top: 0.7rem;
  font-size: 0.95rem;
  line-height: 1.35;
  color: #374151;
}


.month-summary-line {
  margin-bottom: 0.35rem;
}

.calendar-legend {
  margin-top: 0.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.8rem;
  align-items: center;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.legend-color {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1px solid #9ca3af;
}

.legend-holiday {
  background: #fee2e2;
}

.legend-vacation {
  background: #facc15;
}

.legend-maintenance {
  background: #002F87;
}

.maintenance-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

#maintenance-bulk-delete-btn[disabled] {
  opacity: 0.4;
  cursor: default;
}

.footer {
  text-align: center;
  padding: 1rem;
  font-size: 0.8rem;
  color: #6b7280;
  border-top: 1px solid #e5e7eb;
  background: #f9fafb;
}

@media (max-width: 600px) {
  main {
    padding-inline: 0.6rem;
  }

  .card {
    padding-inline: 0.7rem;
  }
}


.asset-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin-right: 0.35rem;
  vertical-align: middle;
  border: 1px solid #9ca3af;
  background: var(--asset-color, #002F87);
}

.day-maintenance {
  outline: 2px solid var(--asset-color, #002F87);
  outline-offset: -2px;
}
