:root {
  --bg: #ffffff;
  --card: #ffffff;
  --muted: #6b7280;
  --text: #111827;
  --accent: #bd1d23;
  --accent-600: #9f171c;
  --border: #e5e7eb;
  --surface: #f8fafc;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: Inter, system-ui, Arial;
  background: var(--surface);
  color: var(--text);
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  position: sticky;
  top: 0;
  border-bottom: 1px solid var(--border);
  z-index: 50;
}
.topbar .brand {
  font-weight: 700;
}
.container {
  max-width: 1400px;
  margin: 24px auto;
  padding: 0 16px;
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
button,
.button {
  background: var(--accent);
  border: 0;
  color: #fff;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 4px 10px rgba(189, 29, 35, 0.15);
}
button:hover,
.button:hover {
  background: var(--accent-600);
}
.card {
  background: var(--card);
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
  margin-bottom: 16px;
}
.grid.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 900px) {
  .grid.two {
    grid-template-columns: 1fr;
  }
}
label {
  display: block;
  margin: 8px 0;
}
input {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  outline: none;
}
table {
  width: 100%;
  border-collapse: collapse;
}
th,
td {
  border-bottom: 1px solid var(--border);
  padding: 10px;
  text-align: left;
}
tr:hover {
  background: #fff8f8;
}
.row-actions form {
  display: inline;
}
.footer {
  opacity: 0.6;
  text-align: center;
  padding: 20px;
}
.login-body {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  background: radial-gradient(1000px 600px at 10% 30%, #11204a, transparent);
}
.login-card {
  width: 360px;
}
.alert {
  background: #3b1f1f;
  color: #ffb3b3;
  padding: 8px;
  border-radius: 8px;
  margin-bottom: 8px;
  border: 1px solid #633;
}
.compact th,
.compact td {
  padding: 6px;
}

.topbar .brand {
  font-weight: 800;
  letter-spacing: 0.2px;
  color: var(--accent);
  display: flex;
  gap: 10px;
  align-items: center;
}
.topbar .brand img {
  height: 34px;
  width: auto;
  display: inline-block;
}
.topbar nav a,
.topbar nav span {
  color: #374151;
  margin-left: 12px;
  text-decoration: none;
}
.topbar nav a:hover {
  color: var(--accent);
}
a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(189, 29, 35, 0.15);
}
label {
  color: #374151;
}
.section-head h2 {
  color: #111827;
}
/* Employees table rules */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
table.employees {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}
table.employees th,
table.employees td {
  padding: 10px;
  border-bottom: 1px solid var(--border);
}
table.employees th:nth-child(1),
table.employees td:nth-child(1) {
  width: 22%;
}
table.employees th:nth-child(2),
table.employees td:nth-child(2) {
  width: 26%;
}
table.employees th:nth-child(3),
table.employees td:nth-child(3) {
  width: 10%;
}
table.employees th:nth-child(4),
table.employees td:nth-child(4) {
  width: 12%;
}
table.employees th:nth-child(5),
table.employees td:nth-child(5) {
  width: 10%;
}
table.employees th:nth-child(6),
table.employees td:nth-child(6) {
  width: 20%;
}
.row-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  align-items: center;
}
.row-actions form {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.row-actions button {
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.9rem;
}
@media (max-width: 800px) {
  table.employees th,
  table.employees td {
    padding: 10px;
    border-bottom: 1px solid var(--border);
  }
}

/* Employees table refinement */
table.employees th {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}
table.employees td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
table.employees td.row-actions {
  white-space: normal;
  overflow: visible;
}

/* Actions column width targets */
table.employees th.actions-col,
table.employees td.row-actions {
  width: 420px;
}

@media (max-width: 1280px) {
  table.employees th.actions-col,
  table.employees td.row-actions {
    width: 360px;
  }
}
@media (max-width: 1024px) {
  table.employees th.actions-col,
  table.employees td.row-actions {
    width: 320px;
  }
}
@media (max-width: 860px) {
  table.employees th.actions-col,
  table.employees td.row-actions {
    width: auto;
  }
}

/* Row actions layout: tidy, wrapping flex */
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  align-items: center;
}
.row-actions form {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.row-actions select,
.row-actions input[type="password"] {
  min-width: 160px;
  max-width: 240px;
}
.row-actions button {
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.9rem;
}

/* Add Employee standalone page form width */
.card form label {
  display: block;
  margin-bottom: 12px;
}
.card form label input {
  margin-top: 6px;
}
.section .table-wrap {
  margin-top: 8px;
}

/* Wider admin directory + email wrapping */
table.employees td:nth-child(2),
table.employees th:nth-child(2) {
  overflow-wrap: anywhere;
}

/* Disabled employee row styling */
table.employees tr.disabled-row {
  background-color: #f9fafb;
  color: #a8a8a8;
}

/* Disabled form elements within disabled rows */
table.employees tr.disabled-row select:disabled,
table.employees tr.disabled-row input:disabled,
table.employees tr.disabled-row button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Remove hover effects on disabled buttons */
table.employees tr.disabled-row button:disabled:hover {
  background: var(--accent);
}

/* Keep active buttons (Enable/Delete) at full opacity */
table.employees tr.disabled-row .active-button {
  opacity: 1;
  cursor: pointer;
}

@media (min-width: 1600px) {
  .container {
    max-width: 1500px;
  }
}
