.topnav {
  background: #1f2937;
  color: white;
  height: 58px;
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 40px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.12);
}

.brand {
  font-size: 20px;
  font-weight: bold;
  white-space: nowrap;
}

.menu {
  list-style: none;
  display: flex;
  gap: 6px;
  margin: 0;
  padding: 0;
}

.menu > li {
  position: relative;
}

.menu a {
  display: block;
  color: white;
  text-decoration: none;
  padding: 18px 16px;
  font-weight: 500;
}

.menu a:hover {
  background: #374151;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 58px;
  left: 0;
  min-width: 190px;
  background: white;
  list-style: none;
  margin: 0;
  padding: 8px 0;
  border-radius: 0 0 10px 10px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.18);
  z-index: 1000;
}

.dropdown-menu li a {
  color: #222;
  padding: 11px 16px;
}

.dropdown-menu li a:hover {
  background: #f0f2f5;
}

.dropdown:hover .dropdown-menu {
  display: block;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f4f6f8;
  color: #222;
}

.container {
  width: min(1200px, 94%);
  margin: 30px auto;
}

header {
  margin-bottom: 24px;
}

header h1 {
  margin: 0;
  font-size: 32px;
}

header p {
  color: #666;
}

.card {
  background: white;
  border-radius: 14px;
  padding: 22px;
  margin-bottom: 22px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.06);
}

h2 {
  margin-top: 0;
}

input,
select,
button {
  width: 100%;
  padding: 11px;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-size: 15px;
}

button {
  border: none;
  background: #0078d4;
  color: white;
  cursor: pointer;
  font-weight: bold;
}

button:hover {
  background: #005fa3;
}

.alert-error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
  padding: 14px 18px;
  border-radius: 10px;
  margin-bottom: 18px;
  font-weight: 600;
}

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #111827, #1f2937);
}

.login-card {
  width: 380px;
  background: white;
  padding: 34px;
  border-radius: 18px;
  box-shadow: 0 22px 60px rgba(0,0,0,0.35);
}

.login-card h1 {
  margin: 0 0 8px;
  text-align: center;
}

.login-card p {
  margin-bottom: 24px;
  color: #666;
  text-align: center;
}

.login-card input {
  margin-bottom: 12px;
}

.login-card button {
  margin-top: 8px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-add,
.btn-back,
.btn-save,
.btn-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: none;
  color: white;
  font-weight: bold;
  border-radius: 10px;
  cursor: pointer;
}

.btn-add {
  width: 48px;
  height: 48px;
  background: #0078d4;
  font-size: 30px;
  line-height: 1;
}

.btn-add:hover {
  background: #005fa3;
}

.btn-back {
  width: 48px;
  height: 48px;
  background: #6b7280;
}

.btn-back:hover {
  background: #4b5563;
}

.btn-save {
  width: 70px;
  height: 48px;
  background: #16a34a;
}

.btn-save:hover {
  background: #15803d;
}

.btn-delete {
  width: 70px;
  height: 48px;
  background: #dc2626;
  margin-top: 18px;
}

.btn-delete:hover {
  background: #b91c1c;
}

.user-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.user-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 18px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  text-decoration: none;
  color: #111827;
  transition: 0.15s ease;
}

.user-row:hover {
  background: #eef2ff;
  border-color: #c7d2fe;
  transform: translateY(-1px);
}

.user-main strong {
  display: block;
  font-size: 17px;
}

.user-main span {
  display: block;
  color: #666;
  margin-top: 4px;
}

.user-meta {
  text-align: right;
  min-width: 120px;
}

.badge {
  display: inline-block;
  background: #e5e7eb;
  color: #111827;
  padding: 5px 10px;
  border-radius: 999px;
  margin-bottom: 5px;
  font-size: 13px;
}

.status-active {
  display: block;
  color: #16a34a;
  font-weight: bold;
}

.status-inactive {
  display: block;
  color: #dc2626;
  font-weight: bold;
}

.empty-list {
  padding: 18px;
  color: #666;
  text-align: center;
}

.pagination {
  display: flex;
  gap: 6px;
  justify-content: center;
  align-items: center;
  margin: 20px 0;
  flex-wrap: wrap;
}

.pagination a,
.pagination span {
  padding: 9px 13px;
  background: white;
  border-radius: 8px;
  text-decoration: none;
  color: #111827;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.pagination a.active {
  background: #0078d4;
  color: white;
}

.pagination .disabled {
  color: #aaa;
  background: #f3f4f6;
}

.detail-card {
  max-width: 700px;
}

.detail-form {
  display: grid;
  gap: 12px;
}

.detail-form label {
  font-weight: bold;
  margin-top: 4px;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: normal !important;
}

.checkbox-line input {
  width: auto;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

@media (max-width: 850px) {
  .topnav {
    height: auto;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 14px 20px;
  }

  .menu {
    flex-direction: column;
    width: 100%;
  }

  .menu a {
    padding: 12px;
  }

  .dropdown-menu {
    position: static;
    box-shadow: none;
    border-radius: 8px;
    width: 100%;
  }

  .page-header {
    align-items: flex-start;
    gap: 14px;
  }

  .user-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .user-meta {
    text-align: left;
  }

  .detail-card {
    max-width: none;
  }
}
.password-wrapper {
  position: relative;
}

.password-wrapper input {
  padding-right: 55px;
}

.toggle-password {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 18px;
  padding: 0;
}

.toggle-password:hover {
  background: transparent;
}

.btn-save,
.btn-delete,
.btn-back {
  font-size: 20px;
}

.password-wrapper {
  position: relative;
  width: 100%;
}

.password-wrapper input {
  width: 100%;
  padding-right: 56px;
}

.password-wrapper .toggle-password {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 42px !important;
  height: 42px !important;
  padding: 0 !important;
  border: none;
  background: transparent !important;
  color: #333;
  box-shadow: none;
  font-size: 20px;
  line-height: 1;
}
.detail-card {
  position: relative;
}

.delete-form {
  position: absolute;
  right: 22px;
  bottom: 22px;
}

.permissions-table th:first-child { text-align: left; }
.search-form {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-form input[type="text"] {
  flex: 1;
  position: relative;
  padding-right: 40px;
}

.btn-clear-search {
  position: absolute;
  right: 70px;
  top: 50%;
  transform: translateY(-50%);
  text-decoration: none;
  font-size: 18px;
  color: #999;
}

.search-card {
  position: relative;
}

.search-form button {
  width: 42px;
  min-width: 42px;
  height: 42px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
}
.btn-clear-search {
  position: absolute;
  right: 62px;
  top: 50%;
  transform: translateY(-50%);
  text-decoration: none;
  font-size: 22px;
  color: #999;
  z-index: 5;
}
.search-form {
  position: relative;
}

.main-menu {
  height: 64px;
  background: #172235;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  box-sizing: border-box;
}

.menu-left,
.menu-right {
  display: flex;
  align-items: center;
  height: 100%;
}

.main-menu a {
  color: white;
  text-decoration: none;
  padding: 0 18px;
  height: 64px;
  display: flex;
  align-items: center;
  font-size: 16px;
  transition: background .2s;
}

.main-menu a:hover {
  background: rgba(255,255,255,.08);
}

.logo {
  font-weight: 700;
  font-size: 30px;
  padding-left: 0 !important;
  margin-right: 20px;
}

.menu-dropdown {
  position: relative;
  height: 100%;
}

.submenu {
  display: none;
  position: absolute;
  top: 64px;
  left: 0;
  min-width: 240px;
  background: #1f2d44;
  border-radius: 0 0 12px 12px;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0,0,0,.25);
  z-index: 9999;
}

.submenu-right {
  left: auto;
  right: 0;
}

.menu-dropdown:hover .submenu {
  display: block;
}

.submenu a {
  height: auto;
  padding: 14px 18px;
  white-space: nowrap;
}

.user-dropdown > a {
  font-size: 22px;
  color: #fff !important;
  text-decoration: none;
}
.user-icon {
  color: #fff;
  font-size: 22px;
  line-height: 1;
}

/* VESSEL TILE VIEW */

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-view {
  min-width: 110px;
  height: 48px;
  padding: 0 16px;

  border-radius: 14px;
  background: #ffffff;
  color: #1e2b45;

  display: flex;
  align-items: center;
  justify-content: center;

  text-decoration: none;
  font-size: 15px;
  font-weight: 600;

  white-space: nowrap;

  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  transition: all 0.2s ease;
}

.btn-view:hover {
  background: #0d6efd;
  color: #ffffff;
}
.btn-view.active {
  background: #0d6efd;
  color: #ffffff;
}

.vessel-tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 20px;
}

.vessel-tile {
  position: relative;
  min-height: 140px;
  border-radius: 20px;
  background: #ffffff;
  padding: 22px;
  text-decoration: none;
  color: #1e2b45;
  box-shadow: 0 2px 14px rgba(0,0,0,0.06);
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.vessel-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.10);
}

.vessel-tile-number {
  font-size: 34px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 12px;
}

.vessel-tile-name {
  font-size: 16px;
  opacity: 0.75;
  text-align: center;
}

.vessel-tile-status {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 6px;
  border-radius: 0 0 20px 20px;
}

.vessel-tile-status.active {
  background: #17c653;
}

.vessel-tile-status.inactive {
  background: #ff3b30;
}

.vessel-tile-mac {
  font-size: 14px;
  font-weight: 400;
  opacity: 0.70;
  text-align: center;
  margin-top: 10px;
  word-break: break-word;
  line-height: 1.3;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}



.btn-disabled {
  opacity: 0.38;
  cursor: not-allowed;
  pointer-events: none;
  filter: grayscale(1);
}
