:root {
  --bg: #eef4ef;
  --panel: #ffffff;
  --panel-soft: rgba(255, 255, 255, 0.74);
  --line: rgba(23, 60, 44, 0.12);
  --ink: #17362a;
  --muted: #5f7569;
  --primary: #1d6b49;
  --primary-deep: #11402d;
  --primary-soft: #dcecdf;
  --warn: #c36c37;
  --danger: #bd4b4b;
  --shadow: 0 20px 45px rgba(17, 53, 39, 0.12);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Noto Sans SC", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(89, 161, 110, 0.18), transparent 26%),
    linear-gradient(180deg, #eef6f0 0%, #e8efea 100%);
}

body {
  min-height: 100vh;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
  border: none;
}

.hidden {
  display: none !important;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel,
.sidebar,
.main-shell {
  border: 1px solid var(--line);
  background: var(--panel-soft);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.login-panel {
  width: min(100%, 460px);
  padding: 32px;
  border-radius: var(--radius-xl);
}

.brand-lockup {
  display: flex;
  gap: 16px;
  align-items: center;
}

.brand-mark {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary), #2f875f);
  color: #fff;
  font-weight: 700;
  font-size: 20px;
}

.brand-overline,
.page-eyebrow,
.card-label,
.map-caption {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.brand-subtitle,
.sidebar-subtitle,
.muted,
.form-tip,
.form-message {
  color: var(--muted);
}

.login-form {
  margin-top: 28px;
  display: grid;
  gap: 16px;
}

.login-form label,
.stack-form label {
  display: grid;
  gap: 8px;
  font-size: 14px;
}

.login-form input,
.stack-form input,
.stack-form select,
.stack-form textarea,
.inline-select,
.table-input {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(23, 60, 44, 0.16);
  background: rgba(255, 255, 255, 0.94);
  padding: 12px 14px;
  color: var(--ink);
}

.stack-form textarea {
  min-height: 90px;
  resize: vertical;
}

.primary-button,
.secondary-button,
.ghost-button,
.chip-button {
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 600;
}

.primary-button {
  background: var(--primary);
  color: #fff;
}

.secondary-button {
  background: var(--primary-soft);
  color: var(--primary-deep);
}

.ghost-button {
  background: rgba(17, 64, 45, 0.08);
  color: var(--primary-deep);
}

.chip-button {
  padding: 8px 14px;
  background: rgba(29, 107, 73, 0.08);
  color: var(--primary);
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 20px;
  padding: 20px;
}

.sidebar {
  position: sticky;
  top: 20px;
  align-self: start;
  min-height: calc(100vh - 40px);
  padding: 22px 18px;
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(17, 64, 45, 0.97), rgba(28, 95, 65, 0.95));
  color: #f4fff7;
}

.sidebar-brand h2 {
  margin: 0;
  font-size: 22px;
}

.sidebar-brand .brand-overline,
.sidebar-brand .sidebar-subtitle,
.sidebar .muted,
.sidebar .card-label {
  color: rgba(244, 255, 247, 0.72);
}

.sidebar-card {
  margin-top: 22px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
}

.nav-menu {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.nav-button {
  width: 100%;
  text-align: left;
  border-radius: 14px;
  padding: 12px 14px;
  background: transparent;
  color: rgba(244, 255, 247, 0.88);
}

.nav-button.active {
  background: rgba(255, 255, 255, 0.14);
}

.sidebar-actions {
  margin-top: 18px;
  display: grid;
  gap: 10px;
}

.sidebar .ghost-button {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.main-shell {
  min-height: calc(100vh - 40px);
  padding: 24px;
  border-radius: var(--radius-xl);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}

.topbar h2 {
  margin: 4px 0 0;
  font-size: 30px;
}

.fishing-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.metric-card.compact {
  padding: 14px;
  border-radius: 16px;
}

.fishing-record,
.violation-record {
  border: 1px solid var(--line);
}

.quick-check-card {
  margin: 8px 0 18px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(29, 107, 73, 0.16);
  background: rgba(29, 107, 73, 0.06);
}

.warning-card {
  border-color: rgba(195, 108, 55, 0.24);
  background: rgba(195, 108, 55, 0.08);
}

.top-gap {
  margin-top: 20px;
}

.choice-group {
  margin: 0;
  padding: 0;
  border: none;
  display: grid;
  gap: 10px;
}

.choice-group legend {
  font-size: 14px;
}

.choice-list {
  display: grid;
  gap: 10px;
}

.choice-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(23, 60, 44, 0.12);
  background: rgba(255, 255, 255, 0.82);
}

.choice-option input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.village-choice-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 720px) {
  .fishing-metrics {
    grid-template-columns: 1fr;
  }

  .village-choice-list {
    grid-template-columns: 1fr;
  }
}

.topbar-user {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(29, 107, 73, 0.08);
  color: var(--primary-deep);
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-logout {
  padding: 8px 12px;
  border-radius: 999px;
}

.topbar-home {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(29, 107, 73, 0.12);
  color: var(--primary-deep);
}

.mobile-nav {
  display: none;
}

.page {
  display: grid;
  gap: 18px;
}

.section-card,
.metric-card,
.notice-item,
.table-wrap,
.map-panel,
.form-panel {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
}

.section-card,
.form-panel,
.map-panel {
  padding: 18px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 14px;
}

.section-head h3,
.section-card h3,
.form-panel h3 {
  margin: 0;
}

.section-actions,
.button-row,
.chip-row,
.inline-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.metric-card {
  padding: 16px;
}

.metric-label {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
}

.metric-value {
  display: block;
  font-size: 28px;
}

.metric-sub {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.dashboard-grid,
.two-column,
.admin-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 18px;
}

.stack-form {
  display: grid;
  gap: 14px;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 960px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px;
  text-align: left;
  vertical-align: top;
}

th {
  background: rgba(29, 107, 73, 0.07);
  font-size: 13px;
}

.table-cell-display {
  min-height: 44px;
  white-space: pre-line;
}

.week-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.schedule-toolbar {
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.schedule-footer-actions {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.save-state {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(29, 107, 73, 0.08);
  color: var(--primary-deep);
  font-size: 13px;
  font-weight: 700;
}

.slot-header-cell {
  min-width: 210px;
}

.slot-header-label {
  font-weight: 700;
  color: var(--primary-deep);
  margin-bottom: 8px;
}

.slot-input,
.slot-duty-input {
  width: 100%;
  border: 1px solid rgba(23, 60, 44, 0.14);
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
}

.slot-input {
  margin-bottom: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 700;
}

.slot-duty-input {
  min-height: 72px;
  padding: 10px 12px;
  border-radius: 12px;
  resize: vertical;
}

.slot-duty-text {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.schedule-picker {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
}

.schedule-picker summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 700;
  color: var(--primary-deep);
}

.schedule-picker summary::-webkit-details-marker {
  display: none;
}

.worker-picker {
  display: grid;
  gap: 8px;
  padding: 0 16px 14px;
}

.worker-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(29, 107, 73, 0.05);
}

.worker-option input {
  width: 16px;
  height: 16px;
}

.mobile-schedule-list {
  display: none;
}

.schedule-card {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(29, 107, 73, 0.04);
}

.schedule-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.schedule-card-grid {
  display: grid;
  gap: 10px;
}

.schedule-slot {
  display: grid;
  gap: 8px;
}

.schedule-slot > span {
  color: var(--muted);
  font-size: 12px;
}

.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) 320px;
  gap: 16px;
}

.map-canvas {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #dbeee2;
  background-size: cover;
  background-position: center;
}

.editable-map {
  cursor: crosshair;
}

.map-overlay {
  position: absolute;
  inset: 0;
}

.map-pin {
  position: absolute;
  transform: translate(-50%, -100%);
  display: grid;
  gap: 6px;
  pointer-events: auto;
  cursor: grab;
  touch-action: none;
}

.map-pin:active {
  cursor: grabbing;
}

.map-pin button {
  min-width: 78px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(23, 60, 44, 0.14);
  color: var(--ink);
}

.map-pin::after {
  content: "";
  justify-self: center;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--pin-color, #d85e4d);
  border: 3px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 6px 14px rgba(23, 60, 44, 0.18);
}

.map-sidebar {
  display: grid;
  gap: 16px;
}

.map-legend {
  display: grid;
  gap: 10px;
}

.legend-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(29, 107, 73, 0.06);
}

.legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 999px;
}

.notice-list,
.record-list,
.profile-list,
.permission-list {
  display: grid;
  gap: 12px;
}

.notice-item,
.record-item,
.profile-item,
.permission-card {
  padding: 14px 16px;
}

.record-item,
.profile-item,
.permission-card {
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
}

.record-meta,
.notice-meta {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.record-body,
.notice-body {
  margin: 10px 0 0;
  line-height: 1.6;
}

.record-photo {
  display: block;
  width: 100%;
  max-width: 320px;
  margin-top: 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  object-fit: cover;
  background: rgba(29, 107, 73, 0.04);
}

.record-actions {
  margin-top: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(29, 107, 73, 0.08);
  color: var(--primary);
  font-size: 12px;
}

.split-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.empty-note {
  padding: 18px;
  border-radius: 18px;
  border: 1px dashed rgba(23, 60, 44, 0.18);
  color: var(--muted);
  text-align: center;
}

.danger-text {
  color: var(--danger);
}

@media (max-width: 1080px) {
  .app-shell,
  .dashboard-grid,
  .two-column,
  .admin-grid,
  .map-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    min-height: auto;
  }

  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .app-shell {
    display: block;
    padding: 12px;
  }

  .sidebar {
    display: none !important;
  }

  .main-shell {
    min-height: auto;
    width: 100%;
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 12px;
    gap: 12px;
  }

  .main-shell,
  .login-panel {
    padding: 18px;
    border-radius: 22px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    position: sticky;
    top: 0;
    z-index: 12;
    padding: 0 0 12px;
    background: rgba(238, 244, 239, 0.92);
    backdrop-filter: blur(12px);
  }

  .topbar h2 {
    font-size: 24px;
  }

  .main-shell {
    padding: 16px;
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  }

  .metrics-grid,
  .split-grid {
    grid-template-columns: 1fr;
  }

  .mobile-schedule-list {
    display: grid;
    gap: 12px;
    margin-top: 14px;
  }

  .table-wrap {
    display: none;
  }

  .map-canvas {
    aspect-ratio: 4 / 5;
  }

  .button-row,
  .section-actions,
  .inline-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .button-row > *,
  .section-actions > *,
  .inline-row > * {
    width: 100%;
  }

  .table-wrap {
    margin: 0 -6px;
  }

  .metric-card,
  .section-card,
  .form-panel,
  .map-panel,
  .notice-item,
  .record-item,
  .profile-item,
  .permission-card {
    border-radius: 16px;
  }

  .mobile-nav {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    padding: 10px;
    border-radius: 20px;
    border: 1px solid rgba(23, 60, 44, 0.12);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(18px);
    box-shadow: 0 16px 30px rgba(17, 53, 39, 0.14);
  }

  .mobile-nav-button {
    min-width: 0;
    padding: 10px 6px;
    border-radius: 14px;
    background: transparent;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.2;
    text-align: center;
  }

  .mobile-nav-button.active {
    background: rgba(29, 107, 73, 0.12);
    color: var(--primary-deep);
    font-weight: 700;
  }
}

.command-board {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.8fr);
  gap: 18px;
}

.hero-card {
  padding: 22px;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(29, 107, 73, 0.12);
  background:
    radial-gradient(circle at top right, rgba(83, 161, 108, 0.22), transparent 28%),
    linear-gradient(135deg, rgba(18, 71, 49, 0.98), rgba(34, 103, 71, 0.94));
  color: #f4fff7;
  box-shadow: var(--shadow);
}

.hero-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.hero-head h3 {
  margin: 6px 0 8px;
  font-size: 28px;
}

.hero-summary {
  margin: 0;
  color: rgba(244, 255, 247, 0.76);
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 12px;
}

.status-pill.subtle {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(244, 255, 247, 0.82);
}

.hero-focus {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.1);
}

.hero-focus strong {
  display: block;
  font-size: 16px;
}

.hero-focus p {
  margin: 8px 0 0;
  color: rgba(244, 255, 247, 0.84);
  line-height: 1.7;
}

.quick-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.quick-action-card {
  display: grid;
  gap: 6px;
  text-align: left;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.quick-action-card strong {
  font-size: 15px;
}

.quick-action-card span {
  color: rgba(244, 255, 247, 0.74);
  font-size: 12px;
  line-height: 1.5;
}

.command-side {
  align-self: stretch;
}

.focus-list {
  display: grid;
  gap: 12px;
}

.focus-item {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(23, 60, 44, 0.08);
  background: rgba(29, 107, 73, 0.05);
}

.focus-item strong {
  font-size: 15px;
}

.mobile-nav-button {
  display: grid;
  gap: 2px;
  justify-items: center;
}

.mobile-nav-label {
  font-weight: 700;
}

.mobile-nav-caption {
  font-size: 10px;
  letter-spacing: 0.02em;
  opacity: 0.72;
}

@media (max-width: 1080px) {
  .command-board {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar-user {
    width: 100%;
    justify-content: space-between;
    text-align: left;
  }

  .hero-card {
    padding: 18px;
    border-radius: 22px;
  }

  .hero-head {
    grid-template-columns: 1fr;
    display: grid;
  }

  .hero-head h3 {
    font-size: 22px;
  }

  .hero-badges {
    justify-content: flex-start;
  }

  .quick-action-grid {
    grid-template-columns: 1fr;
  }

  .metric-card {
    padding: 14px;
  }

  .metric-value {
    font-size: 22px;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .map-layout {
    gap: 12px;
  }

  .map-sidebar {
    order: -1;
  }

  .map-pin button {
    min-width: 64px;
    padding: 7px 8px;
    font-size: 12px;
  }

  .stack-form input,
  .stack-form select,
  .stack-form textarea,
  .primary-button,
  .secondary-button,
  .ghost-button {
    min-height: 46px;
  }
}
