/* AVYORA Connect R6.17 — Premium Responsive Native UX
   Final visual/responsive normalization layer. No business logic, RBAC or schema changes. */
:root{
  --r617-bg:#f4f7f9;--r617-panel:#fff;--r617-ink:#112b3b;--r617-muted:#6e8490;
  --r617-line:#dfe8ec;--r617-line-strong:#cfdae0;--r617-teal:#0b8f8a;--r617-teal2:#0b6f79;
  --r617-navy:#0a2637;--r617-soft:#f8fbfc;--r617-radius:18px;--r617-radius-lg:24px;
  --r617-shadow-sm:0 3px 14px rgba(13,42,59,.045);
  --r617-shadow-md:0 16px 38px rgba(10,37,52,.09);
  --r617-safe-top:env(safe-area-inset-top,0px);--r617-safe-bottom:env(safe-area-inset-bottom,0px);
  --r617-touch:46px;
}
html{background:var(--r617-bg);text-rendering:optimizeLegibility;-webkit-text-size-adjust:100%}
body{background:
  radial-gradient(circle at 12% -8%,rgba(14,153,145,.045),transparent 28rem),
  linear-gradient(180deg,#f8fafb 0,#f3f7f9 100%);color:var(--r617-ink)}
.uxr617-shell{background:transparent}
.uxr617-shell .main{min-width:0;background:transparent}
.uxr617-shell .content{width:100%;max-width:1600px;padding:24px 28px 44px}
.uxr617-shell .card{border:1px solid #e1e9ed;border-radius:20px;background:rgba(255,255,255,.97);box-shadow:var(--r617-shadow-sm)}
.uxr617-shell .card:hover{border-color:#d7e2e6;box-shadow:0 7px 24px rgba(13,42,59,.06)}
.uxr617-shell .headline{margin-bottom:18px;gap:16px}
.uxr617-shell .headline h1{font-size:27px;line-height:1.25;letter-spacing:-.02em;color:#102d3d}
.uxr617-shell .headline p{max-width:850px;color:var(--r617-muted);font-size:13px;line-height:1.7}
.uxr617-shell .kpis{gap:12px}
.uxr617-shell .kpi{min-height:110px;border-radius:18px;padding:17px 18px}
.uxr617-shell .kpi b{font-size:29px;line-height:1.15}
.uxr617-shell .kpi small{line-height:1.5}
.uxr617-shell .btn{min-height:40px;border-radius:12px;padding:9px 13px;font-weight:800;letter-spacing:0}
.uxr617-shell .btn.sm{min-height:36px}
.uxr617-shell .field input,.uxr617-shell .field select,.uxr617-shell .field textarea{
  border-color:#d8e3e8;border-radius:12px;background:#fff;box-shadow:inset 0 1px 0 rgba(10,40,55,.015)
}
.uxr617-shell .field input:focus,.uxr617-shell .field select:focus,.uxr617-shell .field textarea:focus{
  border-color:#63b9b3;box-shadow:0 0 0 4px rgba(11,143,138,.09)
}
.uxr617-shell .table-wrap{border-color:#dfe8ec;border-radius:17px;background:#fff;box-shadow:var(--r617-shadow-sm)}
.uxr617-shell .table th{background:#f7fafb;color:#536d7a;font-size:11px;font-weight:900;letter-spacing:.01em}
.uxr617-shell .table td{color:#263f4d}
.uxr617-shell .table tbody tr:last-child td{border-bottom:0}
.uxr617-shell .status{font-weight:850;padding:6px 9px}
.uxr617-shell .notice{border-radius:15px;box-shadow:none}

/* Sidebar: calmer hierarchy, less visual noise. */
.uxr617-shell.premium-shell-r614{grid-template-columns:276px minmax(0,1fr)}
.uxr617-shell .sidebar{
  background:linear-gradient(180deg,#0b293b 0%,#0b3142 52%,#092534 100%);
  border-inline-end:1px solid rgba(255,255,255,.055);
  box-shadow:8px 0 28px rgba(8,31,44,.07)
}
.uxr617-shell .brand{padding-bottom:16px;margin-bottom:7px}
.uxr617-shell .brand strong{font-size:16px}
.uxr617-shell .brand small{font-size:9px;color:#87a8b6}
.uxr617-shell .nav-group{margin-bottom:7px}
.uxr617-shell .nav-group-toggle{height:28px;padding-inline:9px;color:#779baa}
.uxr617-shell .nav button[data-view]{min-height:40px;border-radius:11px;padding:7px 9px}
.uxr617-shell .nav-icon{width:27px;height:27px;flex-basis:27px;border-radius:8px}
.uxr617-shell .sidebar-credit{border-top:1px solid rgba(255,255,255,.07);margin-top:8px;padding-top:12px}
.uxr617-shell .developer-credit{text-decoration:none}

/* Topbar: premium hierarchy and staff controls without desktop crowding. */
.uxr617-shell .topbar{
  min-height:72px;height:auto;padding:10px 20px;gap:14px;background:rgba(255,255,255,.94);
  backdrop-filter:saturate(155%) blur(18px);border-bottom:1px solid rgba(216,227,232,.92)
}
.uxr617-shell .top-title-box{flex:1 1 220px;min-width:150px}
.uxr617-shell .top-title-box #viewTitle{font-size:16px;line-height:1.25;color:#153647}
.uxr617-shell .top-eyebrow{font-size:9px;color:#0a7c7b}
.uxr617-shell .top-user{display:flex;align-items:center;gap:8px;min-width:0;flex:0 1 auto}
.uxr617-shell .uxr617-user-copy{min-width:0;max-width:180px}
.uxr617-shell .uxr617-user-copy>b,.uxr617-shell .uxr617-user-copy>.meta{
  display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis
}
.uxr617-shell .avatar{flex:0 0 36px;width:36px;height:36px}
.uxr617-shell .workspace-chip{white-space:nowrap}
.uxr617-shell .i18n-switch{flex:0 0 auto}
.uxr617-shell .staff-workspace-tools{
  display:flex;align-items:center;gap:6px;min-width:0;padding:4px;border:1px solid #e2eaee;
  background:#f8fbfc;border-radius:13px
}
.uxr617-shell .staff-workspace-badge{font-size:9px;font-weight:900;color:#3b6877;padding:0 6px;white-space:nowrap}
.uxr617-shell .staff-quick-btn,.uxr617-shell .staff-security-chip{
  border:0;border-radius:9px;min-height:32px;padding:6px 9px;background:#fff;color:#2a5666;font:inherit;
  font-size:10px;font-weight:850;white-space:nowrap;box-shadow:0 1px 2px rgba(14,46,61,.04)
}
.uxr617-shell .staff-quick-btn:hover,.uxr617-shell .staff-security-chip:hover{background:#eef7f7;color:#0b7474}
.uxr617-shell .staff-security-chip.warn{background:#fff9ed;color:#886019}
.uxr617-shell .staff-security-chip.ok{background:#eef8f3;color:#287258}

/* Data-heavy areas remain elegant on desktop. */
.uxr617-shell .filters{gap:8px}
.uxr617-shell .filters input,.uxr617-shell .filters select{min-height:40px;border-color:#dbe5e9;background:#fff}
.uxr617-shell .actions{align-items:center}
.uxr617-shell .split{gap:14px}
.uxr617-shell .detail-row{padding:8px 0;border-color:#e4ebef}
.uxr617-shell .modal{backdrop-filter:blur(5px)}
.uxr617-shell .modal-card{border-radius:24px;border-color:#dce6eb;box-shadow:0 28px 80px rgba(8,31,46,.2)}

/* Login: more premium, less oversized, better tablet balance. */
.glo2-entry.uxr617-entry{padding:24px}
.glo2-entry.uxr617-entry .glo2-entry-shell{max-width:1120px;border-radius:28px;box-shadow:0 30px 90px rgba(12,45,61,.15)}
.glo2-entry.uxr617-entry .glo2-hero{padding:42px 48px}
.glo2-entry.uxr617-entry .glo2-auth{padding:42px 40px}
.glo2-entry.uxr617-entry .glo2-hero h1{font-size:44px}
.glo2-entry.uxr617-entry .glo2-lead{font-size:16px;line-height:1.75}
.glo2-entry.uxr617-entry .glo2-journey{border-radius:15px;padding:13px 14px}
.glo2-entry.uxr617-entry .glo2-auth h2{font-size:29px}

/* Tablet landscape / compact laptop: where the old UX felt most squeezed. */
@media (min-width:901px) and (max-width:1180px){
  .uxr617-shell.premium-shell-r614{grid-template-columns:228px minmax(0,1fr)}
  .uxr617-shell .sidebar{padding-inline:9px}
  .uxr617-shell .brand{padding-inline:7px}
  .uxr617-shell .brand strong{font-size:15px}
  .uxr617-shell .nav button[data-view]{padding-inline:8px}
  .uxr617-shell .content{padding:20px 18px 36px}
  .uxr617-shell .topbar{padding:9px 14px;align-items:flex-start;flex-wrap:wrap}
  .uxr617-shell .top-title-box{flex:1 1 180px;padding-top:5px}
  .uxr617-shell .top-user{flex:1 1 520px;justify-content:flex-end;flex-wrap:wrap}
  .uxr617-shell .staff-workspace-tools{
    order:5;width:100%;justify-content:flex-start;overflow-x:auto;scrollbar-width:none;padding:5px
  }
  .uxr617-shell .staff-workspace-tools::-webkit-scrollbar{display:none}
  .uxr617-shell .uxr617-user-copy{max-width:145px}
  .uxr617-shell .kpis{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .uxr617-shell .pux3-actions,.uxr617-shell .integration-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .glo2-entry.uxr617-entry .glo2-entry-shell{grid-template-columns:1fr 1fr}
  .glo2-entry.uxr617-entry .glo2-hero{padding:34px}
  .glo2-entry.uxr617-entry .glo2-auth{padding:34px 28px}
  .glo2-entry.uxr617-entry .glo2-hero h1{font-size:36px}
  .glo2-entry.uxr617-entry .glo2-lead{font-size:14px}
}

/* Tablet portrait: navigation becomes a true drawer; content is no longer compressed. */
@media (max-width:900px){
  .uxr617-shell.premium-shell-r614,.uxr617-shell.premium-shell-r614.sidebar-collapsed{display:block}
  .uxr617-shell .content{max-width:none;padding:16px 16px 32px}
  .uxr617-shell .topbar{min-height:66px;padding:8px 11px;flex-wrap:wrap;align-items:center}
  .uxr617-shell .top-title-box{flex:1 1 220px}
  .uxr617-shell .top-user{flex:0 1 auto;gap:6px}
  .uxr617-shell .staff-workspace-tools{
    order:10;width:100%;overflow-x:auto;justify-content:flex-start;scrollbar-width:none;
    border-radius:12px;padding:5px 6px
  }
  .uxr617-shell .staff-workspace-tools::-webkit-scrollbar{display:none}
  .uxr617-shell .staff-workspace-badge{position:sticky;inset-inline-start:0;background:#f8fbfc;z-index:2}
  .uxr617-shell .workspace-chip,.uxr617-shell #workspaceSwitch{max-width:130px;overflow:hidden;text-overflow:ellipsis}
  .uxr617-shell .kpis{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .uxr617-shell .split,.uxr617-shell .tracking-grid,.uxr617-shell .integration-grid{grid-template-columns:1fr!important}
  .uxr617-shell .modal-card{max-width:min(94vw,760px)}
  .glo2-entry.uxr617-entry{padding:12px}
  .glo2-entry.uxr617-entry .glo2-entry-shell{grid-template-columns:1fr;max-width:760px}
  .glo2-entry.uxr617-entry .glo2-hero{padding:26px 28px}
  .glo2-entry.uxr617-entry .glo2-auth{padding:28px}
  .glo2-entry.uxr617-entry .glo2-kicker{margin-top:20px}
  .glo2-entry.uxr617-entry .glo2-hero h1{font-size:36px}
}

/* Phone: native app-like density, horizontal staff tools, card tables when safe. */
@media (max-width:600px){
  body{padding-bottom:var(--r617-safe-bottom)}
  .uxr617-shell .topbar{
    min-height:calc(60px + var(--r617-safe-top));padding:max(7px,var(--r617-safe-top)) 9px 7px;
    gap:6px;align-content:center
  }
  .uxr617-shell .mobile-menu-btn{width:40px!important;height:40px!important;min-height:40px!important;border-radius:12px}
  .uxr617-shell .top-title-box{flex:1 1 calc(100% - 96px);max-width:none!important;padding:0}
  .uxr617-shell .top-title-box #viewTitle{font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .uxr617-shell .top-eyebrow{font-size:8px}
  .uxr617-shell .top-user{margin-inline-start:auto}
  .uxr617-shell .premium-release-badge,.uxr617-shell .uxr617-user-copy,.uxr617-shell .avatar,
  .uxr617-shell .workspace-chip,.uxr617-shell #workspaceSwitch{display:none!important}
  .uxr617-shell .i18n-switch{min-width:38px;height:38px}
  .uxr617-shell .topbar .btn#logout{width:38px;height:38px;min-height:38px;padding:0!important;border-radius:11px}
  .uxr617-shell .staff-workspace-tools{margin-top:1px;background:#f7fafb;border-color:#e1e9ed}
  .uxr617-shell .staff-workspace-badge{display:none}
  .uxr617-shell .staff-quick-btn,.uxr617-shell .staff-security-chip{min-height:36px;padding:7px 10px;font-size:10px}
  .uxr617-shell .content{padding:12px 10px calc(28px + var(--r617-safe-bottom))!important}
  .uxr617-shell .headline{gap:8px;margin-bottom:13px}
  .uxr617-shell .headline h1{font-size:21px!important}
  .uxr617-shell .headline p{font-size:12px!important;line-height:1.6}
  .uxr617-shell .headline>.actions{width:100%;display:grid;grid-template-columns:1fr}
  .uxr617-shell .card{padding:13px!important;border-radius:16px}
  .uxr617-shell .kpis{grid-template-columns:1fr!important;gap:8px!important}
  .uxr617-shell .kpi{min-height:82px!important;padding:12px 13px!important}
  .uxr617-shell .kpi b{font-size:24px!important;margin-top:5px}
  .uxr617-shell .btn,.uxr617-shell button,.uxr617-shell [role="button"]{min-height:var(--r617-touch)}
  .uxr617-shell .btn.sm{min-height:40px}
  .uxr617-shell .actions{gap:7px}
  .uxr617-shell .actions>.btn{flex:1 1 145px}
  .uxr617-shell .filters{display:grid!important;grid-template-columns:1fr!important}
  .uxr617-shell .filters>*{width:100%;min-width:0}
  .uxr617-shell .field input,.uxr617-shell .field select,.uxr617-shell .field textarea{
    min-height:48px;font-size:16px!important
  }
  .uxr617-shell .form-grid{grid-template-columns:1fr!important}
  .uxr617-shell .detail-row{flex-direction:column;gap:3px}
  .uxr617-shell .detail-row>*{width:100%}
  .uxr617-shell .modal{align-items:end!important;padding:0!important;padding-top:var(--r617-safe-top)!important}
  .uxr617-shell .modal-card{
    width:100%!important;max-width:none!important;max-height:calc(94dvh - var(--r617-safe-top))!important;
    border-radius:24px 24px 0 0!important;padding:18px 15px calc(18px + var(--r617-safe-bottom))!important
  }
  .uxr617-shell .modal-x{width:38px;height:38px}
  .uxr617-shell .table-wrap.uxr617-table-cards{overflow:visible;border:0;background:transparent;box-shadow:none}
  .uxr617-shell .uxr617-table-cards .table{display:block;min-width:0!important;width:100%}
  .uxr617-shell .uxr617-table-cards .table thead{display:none}
  .uxr617-shell .uxr617-table-cards .table tbody{display:grid;gap:9px}
  .uxr617-shell .uxr617-table-cards .table tr{
    display:block;background:#fff;border:1px solid #dfe8ec;border-radius:15px;padding:6px 12px;
    box-shadow:var(--r617-shadow-sm)
  }
  .uxr617-shell .uxr617-table-cards .table td{
    display:grid;grid-template-columns:minmax(95px,38%) minmax(0,1fr);gap:10px;align-items:start;
    width:100%;padding:9px 0!important;border-bottom:1px solid #edf2f4!important;font-size:12px!important
  }
  .uxr617-shell .uxr617-table-cards .table td:last-child{border-bottom:0!important}
  .uxr617-shell .uxr617-table-cards .table td:before{
    content:attr(data-uxr-label);color:#70848e;font-size:10px;font-weight:850;line-height:1.45
  }
  .uxr617-shell .uxr617-table-scroll{position:relative}
  .uxr617-shell .uxr617-table-scroll:after{
    content:"↔";position:absolute;inset-inline-end:8px;top:8px;width:28px;height:28px;border-radius:9px;
    background:rgba(255,255,255,.92);border:1px solid #e0e8ec;color:#66808c;display:grid;place-items:center;
    pointer-events:none;box-shadow:0 2px 8px rgba(12,44,59,.07)
  }
  .glo2-entry.uxr617-entry{padding:0!important;display:block;background:#fff}
  .glo2-entry.uxr617-entry .glo2-entry-shell{border:0;border-radius:0;box-shadow:none}
  .glo2-entry.uxr617-entry .glo2-hero{padding:18px 16px 20px}
  .glo2-entry.uxr617-entry .glo2-auth{padding:22px 16px calc(26px + var(--r617-safe-bottom))}
  .glo2-entry.uxr617-entry .glo2-hero-top{align-items:flex-start}
  .glo2-entry.uxr617-entry .glo2-hero h1{font-size:31px;margin:8px 0}
  .glo2-entry.uxr617-entry .glo2-lead{font-size:13px;line-height:1.65}
  .glo2-entry.uxr617-entry .glo2-kicker{font-size:10px;margin-top:17px}
  .glo2-entry.uxr617-entry .glo2-journeys{gap:8px;margin-top:16px}
  .glo2-entry.uxr617-entry .glo2-journey{min-height:60px;padding:11px 12px;border-radius:14px}
  .glo2-entry.uxr617-entry .glo2-auth h2{font-size:25px}
  .glo2-entry.uxr617-entry .glo2-auth-head{margin-bottom:16px}
}
@media(max-width:380px){
  .uxr617-shell .content{padding-inline:8px!important}
  .uxr617-shell .staff-quick-btn,.uxr617-shell .staff-security-chip{padding-inline:8px}
  .glo2-entry.uxr617-entry .glo2-locale{gap:5px}
  .glo2-entry.uxr617-entry .glo2-locale select{max-width:126px;font-size:11px}
}
@media(hover:none) and (pointer:coarse){
  .uxr617-shell .btn,.uxr617-shell button,.glo2-entry.uxr617-entry button{touch-action:manipulation;-webkit-tap-highlight-color:transparent}
  .uxr617-shell .card:hover{transform:none}
}
@media(prefers-reduced-motion:reduce){
  .uxr617-shell *,.glo2-entry.uxr617-entry *{scroll-behavior:auto!important;transition:none!important;animation-duration:.001ms!important}
}

/* Modal and dense-action normalization lives outside #root. */
body.uxr617-active .uxr617-modal{backdrop-filter:blur(5px)}
body.uxr617-active .uxr617-modal .modal-card{border:1px solid #dce6eb;border-radius:24px;box-shadow:0 28px 80px rgba(8,31,46,.2)}
.uxr617-shell .uxr617-actions-dense{gap:6px}
@media(max-width:600px){
  body.uxr617-active .uxr617-modal{align-items:end!important;padding:0!important;padding-top:var(--r617-safe-top)!important}
  body.uxr617-active .uxr617-modal .modal-card{
    width:100%!important;max-width:none!important;max-height:calc(94dvh - var(--r617-safe-top))!important;
    border-radius:24px 24px 0 0!important;padding:18px 15px calc(18px + var(--r617-safe-bottom))!important
  }
  body.uxr617-active .uxr617-modal .modal-x{width:38px;height:38px}
  .uxr617-shell .uxr617-actions-dense{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:100%}
  .uxr617-shell .uxr617-actions-dense>.btn{width:100%}
}
