/* Ocean Monitor Design System - Arco Design Theme */
:root {
  /* Brand Colors - Arco Blue */
  --om-primary: #165DFF;
  --om-primary-hover: #0E42D2;
  --om-primary-light: #E8F3FF;
  --om-primary-bg: #F2F3FC;

  /* Semantic Colors */
  --om-success: #00B42A;
  --om-success-light: #E8FFEA;
  --om-warning: #FF7D00;
  --om-warning-light: #FFF7E8;
  --om-danger: #F53F3F;
  --om-danger-light: #FFECE8;
  --om-info: #86909C;

  /* Neutral Colors */
  --om-bg: #F7F8FA;
  --om-bg-white: #FFFFFF;
  --om-border: #E5E6EB;
  --om-border-hover: #C9CDD4;
  --om-fill: #F2F3F5;
  --om-fill-hover: #E5E6EB;

  /* Text */
  --om-text-1: #1D2129;
  --om-text-2: #4E5969;
  --om-text-3: #86909C;
  --om-text-4: #C9CDD4;

  /* Font */
  --om-font: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;

  /* Shadows */
  --om-shadow-1: 0 0 1px rgba(0,0,0,0.3), 0 2px 4px rgba(0,0,0,0.08);
  --om-shadow-2: 0 0 1px rgba(0,0,0,0.25), 0 4px 10px rgba(0,0,0,0.08);
  --om-shadow-3: 0 0 1px rgba(0,0,0,0.2), 0 8px 24px rgba(0,0,0,0.1);

  /* Radius */
  --om-radius-sm: 4px;
  --om-radius: 6px;
  --om-radius-lg: 8px;
  --om-radius-xl: 12px;

  /* Transition */
  --om-transition: 200ms cubic-bezier(0.34, 0.69, 0.1, 1);

  /* Layout */
  --sidebar-width: 220px;
  --sidebar-collapsed-width: 64px;
  --header-height: 60px;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--om-font);
  font-size: 14px;
  line-height: 1.6;
  color: var(--om-text-1);
  background: var(--om-bg);
  -webkit-font-smoothing: antialiased;
}

/* ========== Layout ========== */
.layout-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar Mask (Mobile) */
.sidebar-mask {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 999;
  animation: fadeIn 200ms ease;
}

/* Sidebar */
.layout-sidebar {
  width: var(--sidebar-width);
  background: #1D2129;
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 1000;
  transition: width var(--om-transition), transform var(--om-transition);
  overflow: hidden;
}

.layout-sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
}

/* Sidebar Brand */
.sidebar-brand {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
  font-weight: 600;
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
}

.brand-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.brand-text {
  opacity: 1;
  transition: opacity var(--om-transition);
}

.collapse-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--om-radius);
  transition: all var(--om-transition);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.collapse-btn:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

/* Sidebar Nav */
.sidebar-menu {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  margin-bottom: 2px;
  border-radius: var(--om-radius-lg);
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  font-size: 14px;
  transition: all var(--om-transition);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
}

.menu-item:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}

.menu-item.active {
  background: var(--om-primary);
  color: #fff;
  font-weight: 500;
}

.menu-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.menu-icon svg {
  width: 20px;
  height: 20px;
}

.menu-label {
  opacity: 1;
  transition: opacity var(--om-transition);
}

.layout-sidebar.collapsed .menu-item {
  justify-content: center;
  padding: 10px;
}

.layout-sidebar.collapsed .menu-label,
.layout-sidebar.collapsed .brand-text,
.layout-sidebar.collapsed .user-info,
.layout-sidebar.collapsed .collapse-btn { }

/* Sidebar Footer */
.sidebar-footer {
  padding: 12px 8px;
  border-top: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.user-block {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--om-radius-lg);
  transition: background var(--om-transition);
  cursor: pointer;
  overflow: hidden;
}

.user-block:hover {
  background: rgba(255,255,255,0.08);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #165DFF, #722ED1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}

.user-name {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.9);
  white-space: nowrap;
}

.user-role {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
}

/* ========== Main ========== */
.layout-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left var(--om-transition);
}

.layout-main.collapsed {
  margin-left: var(--sidebar-collapsed-width);
}

/* Header */
.layout-header {
  height: var(--header-height);
  background: var(--om-bg-white);
  border-bottom: 1px solid var(--om-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.mobile-trigger {
  background: none;
  border: none;
  color: var(--om-text-2);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--om-radius);
  display: flex;
  align-items: center;
  transition: all var(--om-transition);
}

.mobile-trigger:hover {
  background: var(--om-fill);
}

.header-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--om-text-1);
  line-height: 1.3;
  margin: 0;
}

.header-desc {
  font-size: 13px;
  color: var(--om-text-3);
  margin: 2px 0 0 0;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Content */
.layout-content {
  flex: 1;
  padding: 20px 24px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

/* ========== Common Components ========== */

/* Card */
.om-card {
  background: var(--om-bg-white);
  border: 1px solid var(--om-border);
  border-radius: var(--om-radius-xl);
  padding: 20px;
  margin-bottom: 16px;
  transition: box-shadow var(--om-transition), border-color var(--om-transition);
}

.om-card:hover {
  box-shadow: var(--om-shadow-1);
  border-color: var(--om-border-hover);
}

.om-card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--om-text-1);
  margin-bottom: 16px;
}

.om-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.om-card-body {
  padding: 0;
}

/* Toolbar */
.om-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.om-toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.om-toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Form */
.om-form {
  max-width: 800px;
}

.om-form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--om-border);
}

/* Empty State */
.om-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  color: var(--om-text-3);
}

.om-empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.om-empty-text {
  font-size: 16px;
  font-weight: 500;
  color: var(--om-text-2);
  margin-bottom: 8px;
}

.om-empty-hint {
  font-size: 13px;
  color: var(--om-text-3);
}

/* Loading State */
.om-loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  color: var(--om-text-3);
}

/* Tabs */
.om-tabs .arco-tabs-nav-tab {
  margin-bottom: 0;
}

/* Tag/Badge */
.om-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--om-radius-sm);
  font-size: 12px;
  font-weight: 500;
  line-height: 20px;
}

.om-tag-success {
  background: var(--om-success-light);
  color: var(--om-success);
}

.om-tag-danger {
  background: var(--om-danger-light);
  color: var(--om-danger);
}

.om-tag-warning {
  background: var(--om-warning-light);
  color: var(--om-warning);
}

.om-tag-primary {
  background: var(--om-primary-light);
  color: var(--om-primary);
}

/* Button */
.om-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 16px;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--om-radius);
  border: 1px solid var(--om-border);
  background: var(--om-bg-white);
  color: var(--om-text-2);
  cursor: pointer;
  transition: all var(--om-transition);
  white-space: nowrap;
  line-height: 22px;
}

.om-btn:hover {
  border-color: var(--om-border-hover);
  background: var(--om-fill);
}

.om-btn-primary {
  background: var(--om-primary);
  border-color: var(--om-primary);
  color: #fff;
}

.om-btn-primary:hover {
  background: var(--om-primary-hover);
  border-color: var(--om-primary-hover);
}

.om-btn-success {
  background: var(--om-success);
  border-color: var(--om-success);
  color: #fff;
}

.om-btn-success:hover {
  background: #009A29;
  border-color: #009A29;
}

.om-btn-danger {
  background: var(--om-danger);
  border-color: var(--om-danger);
  color: #fff;
}

.om-btn-danger:hover {
  background: #CB272D;
  border-color: #CB272D;
}

.om-btn-warning {
  background: var(--om-warning);
  border-color: var(--om-warning);
  color: #fff;
}

.om-btn-warning:hover {
  background: #D25F00;
  border-color: #D25F00;
}

.om-btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Stat Grid */
.om-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 12px;
  padding: 12px 16px;
  background: var(--om-fill);
  border-radius: var(--om-radius-lg);
}

.om-stat {
  text-align: center;
}

.om-stat-label {
  font-size: 12px;
  color: var(--om-text-3);
  margin-bottom: 4px;
}

.om-stat-value {
  font-size: 16px;
  font-weight: 600;
  color: var(--om-text-1);
  font-variant-numeric: tabular-nums;
}

/* ========== Menu Groups ========== */
.menu-group-title {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 16px 12px 6px;
  white-space: nowrap;
  overflow: hidden;
}

.menu-group-divider {
  height: 1px;
  background: rgba(255,255,255,0.08);
  margin: 8px;
}

/* ========== Bottom Navigation (Mobile) ========== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--om-bg-white);
  border-top: 1px solid var(--om-border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 200;
  padding: 0 4px;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.06);
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 0;
  min-width: 56px;
  text-decoration: none;
  color: var(--om-text-3);
  transition: color var(--om-transition);
  -webkit-tap-highlight-color: transparent;
}

.bottom-nav-item.active {
  color: var(--om-primary);
}

.bottom-nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.bottom-nav-icon svg {
  width: 22px;
  height: 22px;
}

.bottom-nav-label {
  font-size: 10px;
  font-weight: 500;
  line-height: 1;
}

/* ========== Animations ========== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ========== Mobile ========== */
@media (max-width: 768px) {
  .layout-sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-width);
  }

  .layout-sidebar.open {
    transform: translateX(0);
  }

  .layout-main {
    margin-left: 0;
  }

  .layout-header {
    padding: 0 16px;
  }

  .layout-content {
    padding: 16px;
  }

  .header-title {
    font-size: 16px;
  }

  .header-desc {
    display: none;
  }
}

/* Tablet */
@media (min-width: 769px) and (max-width: 1024px) {
  :root {
    --sidebar-width: 200px;
  }

  .layout-content {
    padding: 20px;
  }
}

/* Large */
@media (min-width: 1400px) {
  .layout-content {
    max-width: 1600px;
  }
}

/* Print */
@media print {
  .layout-sidebar,
  .layout-header,
  .sidebar-mask,
  .bottom-nav { display: none !important; }

  .layout-main { margin-left: 0; }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
