/* G2 demo — style CRM léger (démo / UiPath) */

:root {
  --g2-bg: #f5f6f8;
  --g2-sidebar: #eceef2;
  --g2-border: #d6d9e0;
  --g2-text: #1a1d24;
  --g2-muted: #5c6370;
  --g2-accent: #2563eb;
  --g2-accent-hover: #1d4ed8;
  --g2-card: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  color: var(--g2-text);
  background: var(--g2-bg);
}

.g2-shell {
  display: flex;
  min-height: 100vh;
}

.g2-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--g2-sidebar);
  border-right: 1px solid var(--g2-border);
  padding: 1rem 0.75rem;
}

.g2-sidebar-label {
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  color: var(--g2-muted);
  font-weight: 600;
  margin: 0.75rem 0 0.35rem 0.5rem;
  text-transform: uppercase;
}

.g2-nav {
  list-style: none;
  margin: 0;
  padding: 0;
}

.g2-nav li {
  margin: 0;
  padding: 0;
}

.g2-nav a,
.g2-nav span {
  display: block;
  padding: 0.4rem 0.5rem;
  border-radius: 4px;
  color: var(--g2-text);
  text-decoration: none;
}

.g2-nav a:hover {
  background: rgba(37, 99, 235, 0.08);
}

.g2-nav-active {
  font-weight: 600;
  background: rgba(37, 99, 235, 0.12);
  border-left: 3px solid var(--g2-accent);
  padding-left: calc(0.5rem - 3px);
}

.g2-nav-muted {
  color: var(--g2-muted);
  font-size: 0.9rem;
}

.g2-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.g2-topbar {
  background: var(--g2-card);
  border-bottom: 1px solid var(--g2-border);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.g2-topbar-title {
  font-size: 1.1rem;
  font-weight: 600;
}

.g2-topbar-meta {
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.g2-code-header {
  font-size: 0.8rem;
  background: #eef2ff;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

.g2-content {
  padding: 1.25rem 1.5rem 2rem;
  flex: 1;
}

.g2-pill {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--g2-muted);
  border: 1px solid var(--g2-border);
  padding: 0.12rem 0.35rem;
  border-radius: 999px;
}

.g2-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.g2-toolbar-sub {
  margin-bottom: 1rem;
}

.g2-toolbar-sub .g2-btn {
  margin-left: auto;
}

.g2-page-heading {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.g2-card {
  background: var(--g2-card);
  border: 1px solid var(--g2-border);
  border-radius: 6px;
  padding: 0;
  overflow: hidden;
}

.g2-card-nested {
  border: none;
  border-radius: 0;
}

.g2-muted {
  color: var(--g2-muted);
  font-style: italic;
}

.g2-table {
  width: 100%;
  border-collapse: collapse;
}

.g2-table th,
.g2-table td {
  text-align: left;
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--g2-border);
}

.g2-table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--g2-muted);
  background: #fafbfc;
}

.g2-table tbody tr:last-child td {
  border-bottom: none;
}

.g2-table tbody tr:hover {
  background: #f9fafb;
}

.g2-table a {
  color: var(--g2-accent);
  font-weight: 500;
  text-decoration: none;
}

.g2-table a:hover {
  text-decoration: underline;
}

.g2-btn {
  display: inline-block;
  padding: 0.45rem 0.9rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 4px;
  border: 1px solid var(--g2-border);
  background: var(--g2-card);
  color: var(--g2-text);
  cursor: pointer;
  text-decoration: none;
}

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

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

.g2-btn-secondary:hover {
  background: #f3f4f6;
}

.g2-banner {
  padding: 0.65rem 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.g2-banner-success {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}

#g2-created-client-id {
  font-family: ui-monospace, monospace;
  font-weight: 600;
  margin-left: 0.35rem;
}

.g2-section {
  margin-bottom: 1.5rem;
}

.g2-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.g2-section-title {
  margin: 0 0 0.75rem 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--g2-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.g2-section-head .g2-section-title {
  margin-bottom: 0;
}

.g2-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 2rem;
  background: var(--g2-card);
  border: 1px solid var(--g2-border);
  border-radius: 6px;
  padding: 1rem 1.25rem;
}

@media (max-width: 840px) {
  .g2-field-grid {
    grid-template-columns: 1fr;
  }
}

.g2-field label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--g2-muted);
  margin-bottom: 0.25rem;
}

.g2-field input[type="text"],
.g2-field input[type="date"] {
  width: 100%;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--g2-border);
  border-radius: 4px;
  font-size: 0.9rem;
}

.g2-field input[readonly] {
  background: #f3f4f6;
  color: var(--g2-muted);
}

#nationalities_table input[type="text"] {
  width: 100%;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--g2-border);
  border-radius: 4px;
}
