:root {
  --bg-surface: #f8f9fa;
  --bg-card: #ffffff;
  --bg-omnibox: #eef3fc;
  --bg-omnibox-focus: #ffffff;
  --bg-nav-active: #c2e7ff;
  --bg-nav-hover: #eaebef;
  --bg-table-hover: #f1f3f4;
  --border-subtle: #dadce0;
  --border-hairline: #e8eaed;
  --text-primary: #1f1f1f;
  --text-secondary: #444746;
  --text-muted: #5f6368;
  --text-nav-active: #001d35;
  --brand-blue: #0b57d0;
  --brand-blue-hover: #0842a0;
  --brand-blue-soft: #e8f0fe;
  --status-green-bg: #e6f4ea;
  --status-green-fg: #137333;
  --status-amber-bg: #fef7e0;
  --status-amber-fg: #b06000;
  --status-red-bg: #fce8e6;
  --status-red-fg: #c5221f;
  --status-gray-bg: #f1f3f4;
  --status-gray-fg: #3c4043;
  --font-display: 'Google Sans', 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'Roboto Mono', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-surface);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.45;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Top App Bar (Google Admin Console 64px header) */
.top-bar {
  height: 64px;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  flex-shrink: 0;
  z-index: 20;
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 248px;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
}

.brand-badge {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background-color: var(--brand-blue);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
  color: #3c4043;
  line-height: 1.15;
}

.brand-subtitle {
  font-size: 11px;
  color: var(--text-muted);
}

/* Google Admin Omnibox Search */
.top-bar-center {
  flex: 1;
  max-width: 720px;
  margin: 0 24px;
}

.omnibox {
  display: flex;
  align-items: center;
  background-color: var(--bg-omnibox);
  border: 1px solid transparent;
  border-radius: 24px;
  height: 46px;
  padding: 0 16px;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.omnibox:focus-within {
  background-color: var(--bg-omnibox-focus);
  border-color: var(--border-subtle);
  box-shadow: 0 1px 3px rgba(60, 64, 67, 0.25);
}

.omnibox-icon {
  color: var(--text-muted);
  margin-right: 12px;
  font-size: 20px;
}

.omnibox-input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text-primary);
  outline: none;
}

.omnibox-input::placeholder {
  color: var(--text-muted);
}

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

.avatar-chip {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background-color: #004a77;
  color: #c2e7ff;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Main App Layout */
.app-shell {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Google Admin Left Navigation Rail */
.nav-drawer {
  width: 256px;
  background-color: var(--bg-surface);
  padding: 12px 12px 16px 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-shrink: 0;
  overflow-y: auto;
  border-right: 1px solid var(--border-hairline);
  transition: width 0.2s ease;
}

.nav-drawer.collapsed {
  width: 0;
  padding: 0;
  overflow: hidden;
  border-right: none;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-section-label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: 14px 16px 6px 24px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 40px;
  padding: 0 16px 0 24px;
  border-radius: 0 20px 20px 0;
  text-decoration: none;
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  transition: background-color 0.12s ease;
}

.nav-item:hover {
  background-color: var(--bg-nav-hover);
}

.nav-item.active {
  background-color: var(--bg-nav-active);
  color: var(--text-nav-active);
}

.nav-item .material-symbols-outlined {
  font-size: 20px;
}

.nav-badge {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  background-color: rgba(0, 0, 0, 0.06);
  color: var(--text-secondary);
  padding: 2px 7px;
  border-radius: 10px;
}

.nav-badge-warn {
  background-color: var(--status-amber-bg);
  color: var(--status-amber-fg);
}

.nav-footer {
  padding: 12px 16px 0 24px;
  border-top: 1px solid var(--border-hairline);
  font-size: 12px;
  color: var(--text-muted);
}

.mono-xs {
  font-family: var(--font-mono);
  font-size: 11px;
  margin-top: 2px;
}

/* Main Workspace Content */
.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px 28px 40px;
}

/* Breadcrumb Bar */
.breadcrumb-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.breadcrumb-trail {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 400;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.breadcrumb-link {
  color: var(--brand-blue);
  cursor: pointer;
  text-decoration: none;
}

.breadcrumb-link:hover {
  text-decoration: underline;
}

/* Google Admin Modular Home Grid */
.home-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.admin-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

.admin-card-wide {
  grid-column: 1 / -1;
}

.admin-card-header {
  padding: 18px 20px 12px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.card-title-group {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.card-header-icon {
  color: var(--brand-blue);
  background-color: var(--brand-blue-soft);
  padding: 8px;
  border-radius: 8px;
  font-size: 22px;
}

.card-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
}

.card-subtitle {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.admin-card-body {
  padding: 8px 20px 18px;
  flex: 1;
}

.admin-card-body.no-padding {
  padding: 0;
}

.admin-card-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--border-hairline);
  background-color: #fafbfc;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Metrics inside Google Admin Cards */
.metric-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 6px;
}

.metric-box {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: 8px;
  padding: 12px 14px;
}

.metric-value {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 500;
  color: var(--text-primary);
}

.metric-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.text-primary { color: var(--brand-blue); }
.text-success { color: var(--status-green-fg); }
.text-warn { color: var(--status-amber-fg); }
.text-danger { color: var(--status-red-fg); }
.muted { color: var(--text-muted); }

/* Connector Mini List on Home Card */
.connector-mini-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.connector-mini-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-hairline);
  background: var(--bg-surface);
  font-size: 12.5px;
  font-weight: 500;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-healthy { background-color: #188038; }
.dot-warn { background-color: #f29900; }
.dot-down { background-color: #d93025; }

/* Data Tables (Google Admin Console Dense Table Standard) */
.table-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  overflow: hidden;
}

.table-toolbar {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.filter-chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.toolbar-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin-right: 4px;
}

.toolbar-divider {
  width: 1px;
  height: 20px;
  background-color: var(--border-subtle);
  margin: 0 8px;
}

.toolbar-meta {
  font-size: 12.5px;
  color: var(--text-muted);
}

.chip {
  border: 1px solid var(--border-subtle);
  background-color: #ffffff;
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.12s ease;
}

.chip:hover {
  background-color: var(--bg-table-hover);
}

.chip.active {
  background-color: var(--brand-blue-soft);
  border-color: var(--brand-blue);
  color: var(--brand-blue);
}

.table-scroll {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.admin-table th {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 11px 16px;
  border-bottom: 1px solid var(--border-subtle);
  background-color: #fafbfc;
  white-space: nowrap;
}

.admin-table td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border-hairline);
  color: var(--text-primary);
  vertical-align: middle;
}

.admin-table.compact-table td,
.admin-table.compact-table th {
  padding: 8px 14px;
  font-size: 13px;
}

.admin-table tbody tr {
  transition: background-color 0.1s ease;
}

.admin-table tbody tr:hover {
  background-color: var(--bg-table-hover);
}

.clickable-row {
  cursor: pointer;
}

.user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar-sm {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background-color: var(--brand-blue-soft);
  color: var(--brand-blue);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-name-primary {
  font-weight: 500;
  color: var(--brand-blue);
}

.user-name-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.mono-code {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
}

.empty-cell {
  text-align: center;
  padding: 32px !important;
  color: var(--text-muted);
}

.table-pagination {
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.page-info {
  font-size: 12.5px;
  color: var(--text-muted);
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 12px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.badge-active {
  background-color: var(--status-green-bg);
  color: var(--status-green-fg);
}

.badge-warn {
  background-color: var(--status-amber-bg);
  color: var(--status-amber-fg);
}

.badge-danger {
  background-color: var(--status-red-bg);
  color: var(--status-red-fg);
}

.badge-neutral {
  background-color: var(--status-gray-bg);
  color: var(--status-gray-fg);
}

.badge-blue {
  background-color: var(--brand-blue-soft);
  color: var(--brand-blue);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 18px;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.btn .material-symbols-outlined {
  font-size: 17px;
}

.btn-sm {
  padding: 5px 11px;
  font-size: 12.5px;
}

.btn-primary {
  background-color: var(--brand-blue);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--brand-blue-hover);
}

.btn-outlined {
  background-color: #ffffff;
  border-color: var(--border-subtle);
  color: var(--brand-blue);
}

.btn-outlined:hover {
  background-color: var(--brand-blue-soft);
}

.btn-outlined:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-text {
  background: transparent;
  border: none;
  color: var(--brand-blue);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
}

.btn-text:hover {
  background-color: var(--brand-blue-soft);
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.icon-btn:hover {
  background-color: rgba(60, 64, 67, 0.08);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 16px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 500;
}

.status-pill-info {
  background-color: var(--status-amber-bg);
  color: var(--status-amber-fg);
}

.pill-icon {
  font-size: 16px;
}

/* User Detail 2-Column Google Admin Layout */
.user-detail-layout {
  display: grid;
  grid-template-columns: 310px 1fr;
  gap: 18px;
  align-items: start;
}

.user-profile-card {
  padding: 22px 20px;
}

.profile-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border-hairline);
}

.profile-avatar-lg {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background-color: var(--brand-blue-soft);
  color: var(--brand-blue);
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.profile-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
}

.profile-email {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
  margin-bottom: 10px;
}

.profile-meta-list {
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.profile-meta-item {
  display: flex;
  flex-direction: column;
}

.profile-meta-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
}

.profile-meta-value {
  font-size: 13.5px;
  color: var(--text-primary);
  font-weight: 500;
}

/* Connectors Grid */
.connectors-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.toast-banner {
  background-color: #1f1f1f;
  color: #ffffff;
  padding: 10px 16px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hidden {
  display: none !important;
}

@media (max-width: 1100px) {
  .home-grid,
  .connectors-grid,
  .user-detail-layout {
    grid-template-columns: 1fr;
  }
  .metric-row {
    grid-template-columns: repeat(2, 1fr);
  }
}
