/* ============================================================
   龙邦定制出行管理后台 · 全局样式
   ============================================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 14px;
  color: #333;
  background: #f0f2f5;
  line-height: 1.5;
}

.hidden { display: none !important; }
.text-center { text-align: center; }
.text-muted { color: #999; }
.text-primary { color: #1a73e8; }
.text-success { color: #52c41a; }
.text-warning { color: #faad14; }
.text-danger { color: #f5222d; }

/* ========== 登录页 ========== */
.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a73e8 0%, #4285f4 100%);
}

.login-container {
  width: 900px;
  max-width: 95%;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  display: flex;
}

.login-left {
  width: 45%;
  background: linear-gradient(160deg, #1a73e8, #0d47a1);
  padding: 50px 40px;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.brand-logo {
  width: 80px;
  height: 80px;
  border-radius: 16px;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  margin-bottom: 16px;
}

.brand-title {
  font-size: 28px;
  margin-bottom: 8px;
}

.brand-subtitle {
  font-size: 14px;
  opacity: 0.85;
}

.feature-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  opacity: 0.9;
}

.feature-icon {
  font-size: 20px;
}

.login-right {
  width: 55%;
  padding: 50px 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-title {
  font-size: 24px;
  margin-bottom: 8px;
}

.login-desc {
  color: #999;
  margin-bottom: 32px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  color: #555;
  font-weight: 500;
}

.form-group input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid #d9d9d9;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: #1a73e8;
  box-shadow: 0 0 0 3px rgba(26,115,232,0.1);
}

.form-error {
  color: #f5222d;
  font-size: 13px;
  margin-bottom: 16px;
  min-height: 18px;
}

.btn-login {
  width: 100%;
  height: 46px;
  background: linear-gradient(135deg, #1a73e8, #4285f4);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-login:hover { opacity: 0.9; }
.btn-login:disabled { opacity: 0.6; cursor: not-allowed; }

.login-footer {
  margin-top: 32px;
  text-align: center;
  color: #bbb;
  font-size: 12px;
}

/* ========== 主布局 ========== */
.topbar {
  height: 56px;
  background: #fff;
  border-bottom: 1px solid #e8e8e8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
}

.topbar-title {
  font-size: 16px;
  font-weight: 600;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.admin-role {
  font-size: 12px;
  padding: 2px 8px;
  background: #e6f4ff;
  color: #1a73e8;
  border-radius: 4px;
}

.admin-name {
  font-size: 14px;
  color: #555;
}

.btn-logout {
  padding: 6px 16px;
  border: 1px solid #d9d9d9;
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: #666;
}

.btn-logout:hover {
  border-color: #f5222d;
  color: #f5222d;
}

.main-layout {
  display: flex;
  padding-top: 56px;
  min-height: 100vh;
}

.sidebar {
  width: 200px;
  background: #001529;
  min-height: calc(100vh - 56px);
  position: fixed;
  left: 0;
  top: 56px;
}

.sidebar-nav {
  padding: 16px 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  color: rgba(255,255,255,0.65);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
}

.nav-item:hover {
  color: #fff;
  background: rgba(255,255,255,0.05);
}

.nav-item.active {
  color: #fff;
  background: #1a73e8;
}

.nav-icon {
  font-size: 16px;
}

.content {
  flex: 1;
  margin-left: 200px;
  padding: 24px;
}

.page-section {
  animation: fadeIn 0.2s;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-title {
  font-size: 20px;
  margin-bottom: 20px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.page-header .page-title {
  margin-bottom: 0;
}

/* ========== 统计卡片 ========== */
.stats-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: #fff;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.stat-label {
  font-size: 13px;
  color: #999;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 28px;
  font-weight: 600;
  color: #1a73e8;
}

/* ========== 面板/表格 ========== */
.panel {
  background: #fff;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.panel-title {
  font-size: 16px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f0f0f0;
}

.table-wrapper {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  background: #fafafa;
  padding: 12px;
  text-align: left;
  font-weight: 600;
  color: #555;
  border-bottom: 1px solid #f0f0f0;
  white-space: nowrap;
}

.data-table td {
  padding: 12px;
  border-bottom: 1px solid #f5f5f5;
  color: #333;
}

.data-table tr:hover td {
  background: #fafafa;
}

/* ========== 按钮 ========== */
.btn-primary {
  padding: 8px 20px;
  background: #1a73e8;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
}

.btn-primary:hover { background: #1557b0; }

.btn-outline {
  padding: 8px 20px;
  background: #fff;
  color: #1a73e8;
  border: 1px solid #1a73e8;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}

.btn-outline:hover { background: #e6f4ff; }

.btn-danger {
  padding: 6px 14px;
  background: #fff;
  color: #f5222d;
  border: 1px solid #f5222d;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
}

.btn-danger:hover { background: #fff1f0; }

.btn-sm {
  padding: 4px 12px;
  font-size: 12px;
}

/* ========== 表单 ========== */
.form-input, .form-select {
  height: 36px;
  padding: 0 12px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  font-size: 14px;
}

.form-input:focus, .form-select:focus {
  outline: none;
  border-color: #1a73e8;
}

.filter-bar {
  display: flex;
  gap: 10px;
  align-items: center;
}

.filter-bar .form-input {
  width: 200px;
}

/* ========== 状态标签 ========== */
.status-tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 12px;
}

.status-pending { background: #fff7e6; color: #fa8c16; }
.status-paid { background: #e6f4ff; color: #1a73e8; }
.status-onboard { background: #f6ffed; color: #52c41a; }
.status-completed { background: #f5f5f5; color: #8c8c8c; }
.status-cancelled { background: #fff1f0; color: #f5222d; }

/* ========== 围栏页面 ========== */
.fence-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
}

.fence-map {
  width: 100%;
  height: 500px;
  border-radius: 8px;
  border: 1px solid #e8e8e8;
}

.fence-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.fence-coords {
  margin-top: 12px;
  padding: 10px;
  background: #fafafa;
  border-radius: 6px;
  font-size: 12px;
  color: #666;
  max-height: 100px;
  overflow-y: auto;
  font-family: monospace;
}

.fence-item {
  padding: 12px;
  border: 1px solid #f0f0f0;
  border-radius: 8px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: border-color 0.2s;
}

.fence-item:hover {
  border-color: #1a73e8;
}

.fence-item.active {
  border-color: #1a73e8;
  background: #e6f4ff;
}

.fence-item-name {
  font-weight: 500;
  margin-bottom: 4px;
}

.fence-item-meta {
  font-size: 12px;
  color: #999;
}

.fence-item-actions {
  margin-top: 8px;
  display: flex;
  gap: 8px;
}

/* ========== 弹窗 ========== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal {
  background: #fff;
  border-radius: 12px;
  width: auto;
  min-width: 480px;
  max-width: 95vw;
  max-height: 85vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid #f0f0f0;
}

.modal-header h3 {
  font-size: 16px;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #999;
  line-height: 1;
}

.modal-close:hover { color: #333; }

.modal-body {
  padding: 24px;
}

.modal-body .form-group {
  margin-bottom: 16px;
}

.modal-body .form-group input,
.modal-body .form-group select,
.modal-body .form-group textarea {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  font-size: 14px;
}

.modal-body .form-group textarea {
  height: 80px;
  padding: 10px 12px;
  resize: vertical;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid #f0f0f0;
  margin-top: 8px;
}

/* ========== Toast ========== */
.toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.8);
  color: #fff;
  padding: 10px 24px;
  border-radius: 6px;
  font-size: 14px;
  z-index: 2000;
  animation: toastIn 0.2s;
}

@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, -10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
  .login-container { flex-direction: column; }
  .login-left, .login-right { width: 100%; }
  .sidebar { width: 60px; }
  .nav-item span:not(.nav-icon) { display: none; }
  .content { margin-left: 60px; }
  .fence-layout { grid-template-columns: 1fr; }
}
