/* Flash messages used by Laravel sessions */
.flash {
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 13px;
}
.flash-ok {
  background: #ecfdf3;
  border: 1px solid #c8e6c9;
  color: #016833;
}
.flash-ng {
  background: #fff0f0;
  border: 1px solid #ffcccc;
  color: #c0392b;
}

.page-note {
  color: #64748b;
  font-size: 13px;
  margin: 0 0 16px;
}

.login-error {
  background: #fff0f0;
  border: 1px solid #ffcccc;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: #c0392b;
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #d7efe3;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-main);
}

.page-user-chip svg { flex-shrink: 0; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.role-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--color-main-light);
  color: var(--color-main);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.sidebar-user .role-chip {
  margin: 0 0 8px;
}

.sidebar-footer {
  margin-top: auto;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--color-border);
}

.sidebar-footer a {
  font-size: 12px;
  color: #666;
  text-decoration: none;
  font-weight: 600;
}

.sidebar-footer a:hover { color: var(--color-main); }

.perm-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.perm-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}

.perm-card-head {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: flex-end;
  margin-bottom: 14px;
}

.perm-card-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-main);
}

.perm-card-mail {
  font-size: 12px;
  color: #64748b;
}

.perm-card-role label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  margin-bottom: 4px;
}

.perm-card-role .form-control {
  width: 180px;
}

.perm-status {
  margin-left: auto;
  font-size: 12px;
  color: #64748b;
}

.perm-status.is-saving { color: #b45309; }
.perm-status.is-ok { color: #016833; }
.perm-status.is-ng { color: #c0392b; }

.perm-card .table-wrapper {
  overflow: visible;
}

.perm-matrix th,
.perm-matrix td {
  text-align: center;
  vertical-align: middle;
}

.perm-matrix thead th {
  position: sticky;
  top: var(--header-height);
  z-index: 4;
}

.perm-matrix th:first-child,
.perm-matrix td:first-child {
  text-align: left;
}

.perm-matrix td:not(:first-child) {
  padding: 0;
}

.perm-matrix-group td {
  background: #f8fafc;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  padding: 10px 14px;
}

.perm-matrix-check {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  cursor: pointer;
  user-select: none;
}

.perm-matrix-check:hover {
  background: rgba(1, 104, 51, 0.08);
}

.perm-matrix-check input {
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: var(--color-main);
  pointer-events: none;
}

.perm-farm-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}

.perm-farm-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 6px 10px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  cursor: pointer;
}

.perm-farm-item:hover {
  background: rgba(1, 104, 51, 0.06);
}

.perm-farm-item input {
  width: 18px;
  height: 18px;
  accent-color: var(--color-main);
}

.perm-farm-item small {
  color: #94a3b8;
  margin-left: 4px;
}


.incident-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.incident-tabs a {
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid #ddd;
  background: #fff;
  color: #555;
  text-decoration: none;
}
.incident-tabs a.active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
}

.ns-sidebar-footer form { margin: 0; }
.ns-sidebar-footer button {
  display: block;
  width: 100%;
  background: none;
  border: none;
  padding: 0;
  font-size: 12px;
  color: #90a4ae;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}
.ns-sidebar-footer button:hover { color: white; }

.page-actions form { margin: 0; }

a.dash-period-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

a.nav-btn-double {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: inherit;
}

.search-bar { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.search-label { font-size:12px; font-weight:600; color:#555; white-space:nowrap; }
.radio-group { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.radio-item { display:flex; gap:4px; align-items:center; font-size:12px; }
.radio-item input { accent-color:var(--color-main); }
.status-dots { display:flex; gap:8px; align-items:center; }
.status-dot-btn { width:14px; height:14px; border-radius:50%; border:2px solid #ccc; cursor:pointer; padding:0; background:#fff; }
.status-dot-btn.green { background:#27ae60; border-color:#27ae60; }
.status-dot-btn.gray { background:#95a5a6; border-color:#95a5a6; }
.status-dot-btn.red { background:#e74c3c; border-color:#e74c3c; }
.status-dot-btn.is-selected { box-shadow:0 0 0 3px rgba(1,104,51,.25); }
.status-dot.gray { background:#95a5a6; }
.user-toolbar { display:flex; gap:8px; margin-bottom:16px; align-items:center; }

.ns-labor-neg { color: #c0392b; font-weight: 600; }

.ns-autosave-status {
  font-size: 12px;
  color: #546e7a;
  white-space: nowrap;
}
.ns-autosave-status.is-saving { color: #64748b; }
.ns-autosave-status.is-ok { color: #166534; }
.ns-autosave-status.is-ng { color: #b91c1c; }
