* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #f4f5f7;
  color: #1f2430;
}

/* ---------- Login page ---------- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1f2430, #33405c);
}

.login-card {
  background: #fff;
  padding: 40px;
  border-radius: 12px;
  width: 100%;
  max-width: 360px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.login-card h1 {
  margin: 0 0 8px;
  font-size: 22px;
}

.login-card .subtitle {
  margin: 0 0 24px;
  color: #666;
  font-size: 13px;
}

.login-card label {
  display: block;
  font-size: 13px;
  color: #444;
  margin-bottom: 16px;
}

.login-card input {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid #d5d8de;
  border-radius: 8px;
  font-size: 15px;
}

.login-card button {
  width: 100%;
  padding: 11px;
  border: none;
  border-radius: 8px;
  background: #2952e3;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.login-card button:disabled {
  opacity: 0.6;
  cursor: default;
}

.error {
  color: #d33;
  font-size: 13px;
  min-height: 18px;
  margin: 10px 0 0;
}

/* ---------- Layout ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #1f2430;
  color: #fff;
  padding: 16px 24px;
}

.topbar h1 {
  font-size: 18px;
  margin: 0;
}

.tabs {
  display: flex;
  gap: 4px;
  background: #fff;
  padding: 0 24px;
  border-bottom: 1px solid #e2e4e9;
}

.tab-btn {
  border: none;
  background: none;
  padding: 14px 16px;
  font-size: 14px;
  cursor: pointer;
  color: #666;
  border-bottom: 2px solid transparent;
}

.tab-btn.active {
  color: #2952e3;
  border-bottom-color: #2952e3;
  font-weight: 600;
}

main {
  padding: 24px;
  max-width: 1100px;
  margin: 0 auto;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.panel-head h2 {
  margin: 0;
  font-size: 18px;
}

.hint {
  color: #888;
  font-size: 13px;
  margin: 4px 0 16px;
}

.status {
  min-height: 20px;
  font-size: 13px;
  color: #2952e3;
  margin-bottom: 12px;
}

/* ---------- Buttons ---------- */
.btn-primary {
  background: #2952e3;
  color: #fff;
  border: none;
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.btn-ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #fff;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
}

.tab-panel .btn-ghost {
  border-color: #d5d8de;
  color: #444;
}

.upload-btn {
  display: inline-block;
}

.btn-delete {
  background: #fff0f0;
  color: #c0392b;
  border: 1px solid #f0c9c5;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
}

.save-btn {
  margin-top: 8px;
}

/* ---------- Image grid ---------- */
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}

.image-card {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #e2e4e9;
  cursor: grab;
}

.image-card.dragging {
  opacity: 0.4;
}

.image-card img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
  background: #eee;
}

.image-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 8px;
}

.image-name {
  font-size: 11px;
  color: #888;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

/* ---------- Packages ---------- */
.package-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 16px;
}

.package-card {
  background: #fff;
  border: 1px solid #e2e4e9;
  border-radius: 10px;
  padding: 14px;
}

.package-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.package-row input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid #d5d8de;
  border-radius: 6px;
  font-size: 14px;
}

.pkg-features {
  width: 100%;
  min-height: 80px;
  padding: 8px 10px;
  border: 1px solid #d5d8de;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
}

/* ---------- Contacts ---------- */
.table-wrap {
  overflow-x: auto;
  background: #fff;
  border-radius: 10px;
  border: 1px solid #e2e4e9;
}

.contact-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.contact-table th,
.contact-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid #eee;
  vertical-align: top;
}

.contact-table .empty {
  text-align: center;
  color: #999;
  padding: 24px;
}
