/* ENOVAR shared design system */
:root {
  --brand: #0b6e4f;
  --brand-dark: #084c36;
  --brand-light: #e7f5ef;
  --ink: #12221c;
  --muted: #5b6b64;
  --card: #ffffff;
  --border: #e2e8e4;
  --shadow: 0 10px 30px rgba(8, 76, 54, 0.10);
  --ok: #0b6e4f;
  --ok-bg: #e7f5ef;
  --warn: #b45309;
  --warn-bg: #fef3c7;
  --bad: #b91c1c;
  --bad-bg: #fee2e2;
  --radius: 12px;
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* Shared select styling */
select {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  background: #fbfdfc;
  color: var(--ink);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%235b6b64' stroke-width='1.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
select:focus { outline: none; border-color: var(--brand); background-color: #fff; }

/* Horizontal-scroll wrapper for tables on mobile */
.table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Row-selection checkboxes */
.row-check { width: 18px; height: 18px; accent-color: var(--brand); cursor: pointer; }

/* Bulk action bar */
.bulk-bar {
  display: none;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--brand-light);
  border: 1px solid #bfe3d3;
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 12px;
}
.bulk-bar.show { display: flex; }
.bulk-bar .bulk-count { font-weight: 700; color: var(--brand-dark); margin-right: 4px; }
.bulk-bar button { padding: 8px 14px; font-size: 13px; border-radius: 8px; }
.bulk-bar button.danger { background: var(--bad); color: #fff; border: 1px solid #a51616; }
.bulk-bar button.danger:hover { background: #a51616; }
.bulk-bar .bulk-close { background: transparent; color: var(--muted); border: none; font-size: 18px; line-height: 1; cursor: pointer; margin-left: auto; }

/* Toast notifications */
#toastRoot {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9999;
  width: min(92vw, 420px);
  pointer-events: none;
}
.toast {
  background: var(--ink);
  color: #fff;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.4;
  box-shadow: 0 8px 24px rgba(0,0,0,0.22);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: auto;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.ok { background: var(--brand-dark); }
.toast.bad { background: var(--bad); }
.toast.warn { background: var(--warn); }

/* Notification dropdown */
.notif-wrap { position: relative; display: inline-block; }
.notif-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 320px;
  max-height: 360px;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(8, 76, 54, 0.16);
  z-index: 100;
  display: none;
  text-align: left;
}
.notif-menu.show { display: block; }
.notif-menu .notif-item { padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 13px; line-height: 1.4; }
.notif-menu .notif-item:last-child { border-bottom: none; }
.notif-menu .notif-item.unread { background: var(--brand-light); }
.notif-menu .notif-empty { padding: 16px; color: var(--muted); font-size: 13px; text-align: center; }
.notif-menu .notif-actions { padding: 8px 10px; text-align: center; border-top: 1px solid var(--border); }
.notif-menu .notif-actions button { background: none; border: none; color: var(--brand); font-weight: 600; font-size: 13px; cursor: pointer; padding: 6px; }

/* Badge */
.badge { display: inline-block; background: var(--brand); color: #fff; font-size: 10px; font-weight: 700; letter-spacing: 1px; padding: 2px 8px; border-radius: 20px; vertical-align: 2px; }

/* Buttons (base) */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 20px; border: none; border-radius: 10px; background: var(--brand);
  color: #fff; font-size: 15px; font-weight: 600; cursor: pointer;
}
.btn:disabled { opacity: .5; cursor: wait; }
.btn.secondary { background: #e7f5ef; color: var(--brand-dark); border: 1px solid #bfe3d3; }
.btn.ghost { background: #fff; color: var(--muted); border: 1px solid var(--border); }
.btn.danger { background: var(--bad); color: #fff; }

/* ---- Professional polish ---- */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
}

button:not(:disabled) {
  cursor: pointer;
  transition: filter .15s ease, transform .06s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
}
button:not(:disabled):hover { filter: brightness(0.97); }
button:not(:disabled):active { transform: translateY(1px); }
button.secondary:not(:disabled):hover { background: #dcf1e7; }

.card { transition: box-shadow .2s ease; }
.card:hover { box-shadow: 0 6px 22px rgba(8, 76, 54, 0.10); }

table tbody tr { transition: background .12s ease; }
table tbody tr:nth-child(even) { background: #fafdfb; }
table tbody tr:hover { background: #f1f8f4; }
table tbody tr:nth-child(even):hover { background: #ecf5f0; }

.notif-menu { width: min(320px, 88vw); }

/* Small screens: give touch targets a bit more room, keep tables scrollable */
@media (max-width: 600px) {
  .notif-menu { max-height: 60vh; }
  .badge { font-size: 9px; }
}


/* Brand logo: icon + two-line "ENOVAR Karigor" */
.logo-row { display: inline-flex; align-items: center; gap: 10px; text-align: left; }
.logo-icon { height: 46px; width: auto; display: block; }
.logo-text { display: inline-flex; flex-direction: column; line-height: 1.05; font-weight: 800; color: #285454; }
.logo-text .ln1 { font-size: 22px; letter-spacing: 1px; }
.logo-text .ln2 { font-size: 14px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: #0b6e4f; }
.logo-wordmark { height: 26px; width: auto; display: block; }
.logo-full { height: 64px; width: auto; display: block; margin: 0 auto; }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { width: 100%; padding-right: 44px !important; }
.pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  border: none; background: transparent; cursor: pointer; font-size: 18px;
  padding: 6px; line-height: 1; color: #5b6b64; border-radius: 6px;
}
.pw-toggle:hover { color: #0b6e4f; }
