:root {
  --sea-red: #A31D1D;
  --sea-red-dark: #8B1818;
  --sea-red-soft: #FEE2E2;
  --sea-green: #0F766E;
  --sea-bg: #F8F9FA;
  --sea-surface: #FFFFFF;
  --sea-text: #1F2937;
  --sea-muted: #4B5563;
  --sea-border: #D1D5DB;
  --period-yellow-bg: #FEF08A;
  --period-yellow-row: #FEF9C3;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--sea-bg);
  color: var(--sea-text);
  display: flex;
  min-height: 100vh;
}
.sidebar {
  width: 265px;
  background: var(--sea-surface);
  border-right: 1px solid var(--sea-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.brand-header {
  padding: 16px 20px;
  background: var(--sea-red);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.3px;
}
.nav-list {
  list-style: none;
  padding: 12px 8px;
  overflow-y: auto;
  flex: 1;
}
.nav-item {
  padding: 9px 12px;
  border-radius: 6px;
  font-size: 14px;
  color: var(--sea-text);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}
.nav-item.active {
  background: var(--sea-red-soft);
  color: var(--sea-red);
  font-weight: 600;
}
.badge-audit {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  background: #F3F4F6;
  color: var(--sea-muted);
}
.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.topbar {
  height: 56px;
  background: var(--sea-surface);
  border-bottom: 1px solid var(--sea-border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.content {
  padding: 20px 24px;
  overflow-y: auto;
}
.toolbar-card {
  background: var(--sea-surface);
  border: 1px solid var(--sea-border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
}
.tabs-row {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.btn {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--sea-border);
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-primary {
  background: var(--sea-red);
  color: #fff;
  border-color: var(--sea-red);
}
.btn-outline-red {
  background: #fff;
  color: var(--sea-red);
  border: 1.5px solid var(--sea-red);
}
.btn-sign-green {
  background: var(--sea-green);
  color: #fff;
  border-color: var(--sea-green);
  padding: 9px 18px;
  border-radius: 8px;
}
.input-control {
  width: 100%;
  padding: 7px 11px;
  border: 1px solid var(--sea-border);
  border-radius: 8px;
  font-size: 13px;
}
.day-frame {
  background: var(--sea-surface);
  border: 1.5px solid var(--sea-red);
  border-radius: 10px;
  margin-bottom: 18px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}
.day-frame-header {
  background: var(--sea-red);
  color: #fff;
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 14.5px;
}
.shift-count-pill {
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  font-size: 11.5px;
  padding: 3px 10px;
  border-radius: 999px;
  margin-left: 8px;
  font-weight: 600;
}
.btn-header-add {
  background: rgba(0, 0, 0, 0.22);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.25);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.btn-header-template {
  background: #FFFFFF;
  color: #1F2937;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.table-scroll {
  overflow-x: auto;
}
table.sea-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
table.sea-table th, table.sea-table td {
  border: 1px solid var(--sea-border);
  padding: 7px 10px;
  text-align: center;
}
table.sea-table th {
  background: #F8FAFC;
  font-weight: 700;
  color: #1E293B;
}
tr.period-location-row {
  background: var(--period-yellow-row);
}
td.period-label-cell {
  background: var(--period-yellow-bg);
  font-weight: 800;
  color: #1E293B;
  width: 95px;
  text-align: center;
}
.location-4-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  align-items: center;
}
.loc-box {
  display: flex;
  align-items: center;
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-radius: 6px;
  padding: 5px 10px;
  gap: 6px;
}
.loc-prefix {
  color: var(--sea-red);
  font-weight: 700;
  white-space: nowrap;
  font-size: 12.5px;
}
.loc-input {
  border: none;
  outline: none;
  width: 100%;
  font-size: 12.5px;
  color: #334155;
  background: transparent;
}
.action-mini-btns {
  display: inline-flex;
  gap: 4px;
  justify-content: center;
}
.btn-mini {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  border: 1px solid #CBD5E1;
  background: #fff;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
}
.btn-mini-del {
  color: var(--sea-red);
}
.sync-banner {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  margin-bottom: 16px;
}
.sync-badge-green {
  background: #ECFDF5;
  color: #047857;
  border: 1px solid #A7F3D0;
  padding: 3px 10px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 12px;
}
.sheet-scan-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
  flex-wrap: wrap;
}
.sea-toast-stack {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 380px;
  width: 100%;
}
.sea-toast-item {
  position: relative;
  background: #FFFFFF;
  border: 1.5px solid var(--sea-border);
  border-left: 5px solid var(--sea-red);
  border-radius: 6px;
  padding: 14px 40px 14px 14px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  font-size: 13px;
}
.sea-toast-close-x-red-square {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  background: #DC2626;
  color: #FFFFFF;
  border: none;
  border-radius: 2px;
  font-weight: 700;
  font-size: 13px;
  line-height: 24px;
  text-align: center;
  cursor: pointer;
}
.sea-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9500;
  padding: 20px;
}
.sea-modal-dialog {
  background: #FFFFFF;
  border-radius: 14px;
  max-width: 820px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.22);
  overflow: hidden;
}
.sea-modal-header {
  padding: 18px 24px 12px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid #F3F4F6;
}
.sea-modal-close-x {
  width: 28px;
  height: 28px;
  border: 1px solid #9CA3AF;
  background: #FFFFFF;
  color: #374151;
  border-radius: 4px;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sea-modal-body {
  padding: 16px 24px;
  overflow-y: auto;
  flex: 1;
}
.form-section-title {
  color: var(--sea-red);
  font-size: 13px;
  font-weight: 700;
  padding-bottom: 6px;
  border-bottom: 1px solid #F3F4F6;
  margin: 14px 0 12px;
}
.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}
.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}
.field-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 5px;
}
.role-checkbox-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.role-card {
  border: 1px solid var(--sea-border);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.sea-modal-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--sea-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #FFFFFF;
  flex-wrap: wrap;
  gap: 10px;
}
