/* Spark Agency HR — country branches (v49) */
@media screen {
  /* header chip */
  .branch-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 6px 14px 6px 10px;
    border: 1px solid #d6e2e1;
    border-radius: 999px;
    background: #fff;
    color: var(--text, #10262f);
    font-weight: 700;
    font-size: 14px;
    box-shadow: none;
    white-space: nowrap;
  }
  button.branch-chip { cursor: pointer; transition: border-color 0.15s, background-color 0.15s; }
  button.branch-chip:hover { border-color: #0a9a9c; background: #f3fbfa; }
  .branch-flag { font-size: 20px; line-height: 1; }
  .branch-chip svg { color: #5b7178; }
  @media (max-width: 640px) {
    .branch-chip .branch-name { display: none; }
    .branch-chip { padding: 6px 10px; }
  }

  /* combined view: only Branches (and Settings) in the menu */
  body.branch-combined .workspace-nav button[data-tab]:not([data-tab="branches"]):not([data-tab="settings"]) { display: none !important; }
  body.branch-combined .workspace-nav .nv-group:not([data-nv="home"]):not([data-nv="admin"]) { display: none !important; }
  body.branch-combined .nv-group[data-nv="admin"] .nv-sum { display: none; }

  /* page */
  #branches .br-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    margin-bottom: 18px;
  }
  #branches .br-hero h2 { margin: 0 0 4px; font-size: 26px; }
  #branches .br-hero p { margin: 0; max-width: 62ch; }
  #branches .br-hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
  #branches .br-hero-actions button { display: inline-flex; align-items: center; gap: 8px; }

  .br-totals {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1px;
    margin-bottom: 22px;
    border-radius: 16px;
    overflow: hidden;
    background: #d9e4e3;
    border: 1px solid #d9e4e3;
  }
  .br-totals > div { background: #fff; padding: 14px 18px; display: grid; gap: 4px; }
  .br-totals .br-wide { grid-column: span 2; }
  .br-totals span { color: #5b7178; font-size: 12.5px; font-weight: 600; }
  .br-totals b { font-size: 22px; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
  .br-totals .br-wide b { font-size: 18px; }
  @media (max-width: 700px) { .br-totals .br-wide { grid-column: auto; } }

  .br-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
  }
  .br-card {
    display: grid;
    grid-template-rows: auto 1fr auto;
    border: 1px solid #d9e4e3;
    border-radius: 18px;
    background: #fff;
    overflow: hidden;
    animation: br-in 0.35s cubic-bezier(.22,.8,.3,1) both;
  }
  .br-card:nth-child(2) { animation-delay: 0.05s; }
  .br-card:nth-child(3) { animation-delay: 0.1s; }
  .br-card:nth-child(4) { animation-delay: 0.15s; }
  .br-card.is-here { border-color: #0a9a9c; box-shadow: 0 0 0 3px #0a9a9c22; }
  .br-card.is-off { opacity: 0.65; }
  .br-card .br-head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px 14px;
    background: linear-gradient(135deg, #0f2a36, #17485a);
    color: #fff;
  }
  .br-card .br-head .br-flag { font-size: 34px; }
  .br-card .br-head div { flex: 1; min-width: 0; }
  .br-card h3 { margin: 0; font-size: 18px; color: #fff; }
  .br-card .br-head p { margin: 2px 0 0; color: #a9c9cf; font-size: 13px; }
  .br-here, .br-off { padding: 4px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 800; background: #5fe0dc; color: #0f2a36; }
  .br-off { background: #ffffff26; color: #fff; }
  .br-card dl { margin: 0; padding: 14px 20px; display: grid; gap: 10px; }
  .br-card dl div { display: flex; justify-content: space-between; gap: 12px; }
  .br-card dt { color: #5b7178; font-size: 13px; }
  .br-card dd { margin: 0; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
  .br-card .br-foot { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 20px 18px; }

  .br-people .br-people-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
  .br-people h2 { display: flex; align-items: center; gap: 8px; margin: 0; }
  .br-filters { display: flex; gap: 8px; flex-wrap: wrap; }
  .br-filters input { min-width: 220px; }
  .br-table-wrap { overflow-x: auto; }
  .br-table { width: 100%; border-collapse: collapse; }
  .br-table th { text-align: left; font-size: 12.5px; color: #5b7178; font-weight: 700; padding: 8px 10px; border-bottom: 1px solid #e3ecea; }
  .br-table td { padding: 10px; border-bottom: 1px solid #eef3f2; }
  .br-table tr.br-left td { color: #8aa0a6; }
  .br-tag { display: inline-flex; gap: 6px; align-items: center; padding: 3px 10px; border-radius: 999px; background: #eef5f4; font-weight: 600; font-size: 13px; white-space: nowrap; }

  /* picker */
  dialog.br-pick, dialog.br-dialog {
    width: min(560px, calc(100vw - 32px));
    padding: 0;
    border: 0;
    border-radius: 22px;
    box-shadow: 0 30px 80px #0f2a3640;
  }
  dialog.br-pick::backdrop, dialog.br-dialog::backdrop { background: #0f2a36b3; backdrop-filter: blur(3px); }
  dialog.br-pick[open], dialog.br-dialog[open] { animation: br-pop 0.3s cubic-bezier(.22,.8,.3,1); }
  .br-pick-in, .br-form { padding: 24px; display: grid; gap: 14px; }
  .br-pick-head { display: flex; gap: 14px; align-items: center; }
  .br-pick-head h2, .br-form h2 { margin: 0; display: flex; align-items: center; gap: 8px; }
  .br-pick-head p, .br-form > p { margin: 2px 0 0; }
  .br-pick-ico { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: #0f2a36; color: #5fe0dc; flex: none; }
  .br-pick-list { display: grid; gap: 8px; max-height: 50vh; overflow: auto; }
  .br-pick-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid #d9e4e3;
    border-radius: 14px;
    cursor: pointer;
    margin: 0;
    transition: border-color 0.15s, background-color 0.15s;
  }
  .br-pick-row:hover { border-color: #0a9a9c; }
  .br-pick-row:has(input:checked) { border-color: #0a9a9c; background: #f1fbfa; }
  .br-pick-row input { width: 18px; height: 18px; margin: 0; accent-color: #0a9a9c; }
  .br-pick-row .br-flag { font-size: 28px; }
  .br-pick-name { flex: 1; display: grid; }
  .br-pick-name small { color: #5b7178; letter-spacing: 0; text-transform: none; font-size: 13px; }
  .br-pick-foot { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
  .br-pick-foot button { display: inline-flex; align-items: center; gap: 8px; }

  .br-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
  .br-fields label { display: grid; gap: 6px; margin: 0; font-weight: 600; }
  .br-mgr { border: 1px solid #d9e4e3; border-radius: 14px; padding: 14px; margin: 0; display: grid; gap: 12px; }
  .br-mgr legend { padding: 0 6px; font-weight: 800; }
  .br-seg { display: flex; gap: 8px; flex-wrap: wrap; }
  .br-seg label { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid #d9e4e3; border-radius: 999px; margin: 0; cursor: pointer; font-weight: 600; }
  .br-seg label:has(input:checked) { border-color: #0a9a9c; background: #f1fbfa; }
  .br-seg label.is-dis { opacity: 0.5; cursor: not-allowed; }
  .br-seg input { margin: 0; accent-color: #0a9a9c; }
  .br-switch { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-weight: 600; }
  .br-error { margin: 0; color: #b42318; font-weight: 600; }
  .br-actions { display: flex; justify-content: flex-end; gap: 10px; }
  .br-login { display: grid; gap: 1px; background: #d9e4e3; border-radius: 14px; overflow: hidden; border: 1px solid #d9e4e3; }
  .br-login div { background: #f7faf9; padding: 10px 14px; display: flex; justify-content: space-between; gap: 12px; }
  .br-login span { color: #5b7178; }
  .br-login b { font-family: ui-monospace, Menlo, Consolas, monospace; word-break: break-all; text-align: right; }

  @keyframes br-in { from { opacity: 0; transform: translateY(8px); } }
  @keyframes br-pop { from { opacity: 0; transform: translateY(10px) scale(0.98); } }
  @media (prefers-reduced-motion: reduce) {
    .br-card, dialog.br-pick[open], dialog.br-dialog[open] { animation: none; }
  }
}
@media screen {
  .br-seg input, .br-switch input { width: auto; flex: none; }
  .br-seg label { white-space: nowrap; }
}
@media screen {
  .br-usd { display: block; color: #5b7178; font-size: 12px; font-weight: 600; margin-top: 2px; }
  .br-card dd .br-usd { text-align: right; }
  .branch-time { padding: 2px 8px; border-radius: 999px; background: #eef5f4; color: #47616b; font-size: 12px; font-variant-numeric: tabular-nums; }
  .br-fx { margin-bottom: 22px; }
  .br-fx summary { cursor: pointer; display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; }
  .br-fx-form { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
  .br-fx-form label { display: grid; gap: 4px; margin: 0; font-weight: 600; }
  .br-fx-form input { width: 160px; }
  .usd-eq { display: block; font-size: 12px; opacity: 0.8; margin-top: 2px; }
}
@media screen {
  .br-target { grid-column: 1 / -1; display: grid !important; gap: 6px; padding: 12px 14px; border-radius: 12px; background: #f1fbfa; border: 1px solid #bfe7e3; font-weight: 700; }
  .br-target small { letter-spacing: 0; font-size: 12px; text-transform: none; font-weight: 500; }
}
