/* -------------------------------------------------------------------
   Stage 105.2G CLEAN — Customer 360 Documents / Communication Tabs Polish
   Frontend-only styling layer for confirmed tabbed Customer 360 shell.
   Scope is limited to Documents and Communication tab internals.
   No routes, API calls, popup behaviour, save logic, app.js, backend,
   database, billing runtime, SageOne runtime, RADIUS, prepaid, products,
   Asset Register backend, Job Cards, Calendar, Android, workers, or
   protected-module logic changes.
------------------------------------------------------------------- */

:root{
  --stage1052g-gap: 14px;
  --stage1052g-card-radius: 15px;
  --stage1052g-line: rgba(148,163,184,.18);
  --stage1052g-surface: rgba(255,255,255,.80);
  --stage1052g-soft: rgba(248,250,252,.80);
  --stage1052g-soft-2: rgba(241,245,249,.72);
  --stage1052g-text: #0f172a;
  --stage1052g-muted: #64748b;
  --stage1052g-blue: #2563eb;
  --stage1052g-green: #0f766e;
  --stage1052g-shadow: 0 12px 26px rgba(15,23,42,.055);
}

html[data-theme="dark"], body.dark, body.theme-dark{
  --stage1052g-line: rgba(148,163,184,.24);
  --stage1052g-surface: rgba(15,23,42,.68);
  --stage1052g-soft: rgba(30,41,59,.62);
  --stage1052g-soft-2: rgba(15,23,42,.50);
  --stage1052g-text: #e5edf8;
  --stage1052g-muted: #9fb0c5;
  --stage1052g-blue: #60a5fa;
  --stage1052g-green: #5eead4;
  --stage1052g-shadow: 0 12px 26px rgba(0,0,0,.22);
}

.stage1052c-tabbed-profile.stage1052g-docs-comm-ready [data-stage1052c-panel="documents"] .stage1052c-panel-grid,
.stage1052c-tabbed-profile.stage1052g-docs-comm-ready [data-stage1052c-panel="communication"] .stage1052c-panel-grid{
  grid-template-columns: repeat(12, minmax(0,1fr)) !important;
  gap: var(--stage1052g-gap) !important;
  align-items: start !important;
}

.stage1052c-tabbed-profile.stage1052g-docs-comm-ready [data-stage1052c-panel="documents"] .stage822-card,
.stage1052c-tabbed-profile.stage1052g-docs-comm-ready [data-stage1052c-panel="communication"] .stage822-card{
  border-radius: var(--stage1052g-card-radius) !important;
  box-shadow: var(--stage1052g-shadow) !important;
  min-width: 0 !important;
  overflow: hidden !important;
  background: var(--stage1052g-surface) !important;
}

.stage1052c-tabbed-profile.stage1052g-docs-comm-ready [data-stage1052c-panel="documents"] .stage822-card-head,
.stage1052c-tabbed-profile.stage1052g-docs-comm-ready [data-stage1052c-panel="communication"] .stage822-card-head{
  min-height: 48px !important;
  padding: 12px 14px !important;
  gap: 10px !important;
  align-items: center !important;
}

.stage1052c-tabbed-profile.stage1052g-docs-comm-ready [data-stage1052c-panel="documents"] .stage822-card-body,
.stage1052c-tabbed-profile.stage1052g-docs-comm-ready [data-stage1052c-panel="communication"] .stage822-card-body{
  padding: 12px 14px !important;
  max-height: none !important;
  overflow-x: auto !important;
}

/* Documents tab: document/compliance tables need width, not tiny cards. */
.stage1052c-tabbed-profile.stage1052g-docs-comm-ready [data-stage1052c-panel="documents"] .stage822-card{
  grid-column: span 6 !important;
}

.stage1052c-tabbed-profile.stage1052g-docs-comm-ready [data-stage1052c-panel="documents"] .stage822-card[data-stage1052g-title="compliance documents"],
.stage1052c-tabbed-profile.stage1052g-docs-comm-ready [data-stage1052c-panel="documents"] .stage822-card[data-stage1052g-title="documents"],
.stage1052c-tabbed-profile.stage1052g-docs-comm-ready [data-stage1052c-panel="documents"] .stage822-card[data-stage1052g-title="customer documents"]{
  grid-column: 1 / -1 !important;
}

.stage1052c-tabbed-profile.stage1052g-docs-comm-ready [data-stage1052c-panel="documents"] table{
  width: 100% !important;
  min-width: 720px !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
}

.stage1052c-tabbed-profile.stage1052g-docs-comm-ready [data-stage1052c-panel="documents"] th,
.stage1052c-tabbed-profile.stage1052g-docs-comm-ready [data-stage1052c-panel="documents"] td{
  padding: 8px 10px !important;
  vertical-align: top !important;
}

/* Communication tab: two useful work columns, with notes becoming wider. */
.stage1052c-tabbed-profile.stage1052g-docs-comm-ready [data-stage1052c-panel="communication"] .stage822-card{
  grid-column: span 6 !important;
}

.stage1052c-tabbed-profile.stage1052g-docs-comm-ready [data-stage1052c-panel="communication"] .stage822-card[data-stage1052g-title="customer notes"]{
  grid-column: 1 / -1 !important;
}

.stage1052c-tabbed-profile.stage1052g-docs-comm-ready [data-stage1052c-panel="communication"] .stage822-card[data-stage1052g-title="messages sent"],
.stage1052c-tabbed-profile.stage1052g-docs-comm-ready [data-stage1052c-panel="communication"] .stage822-card[data-stage1052g-title="usage notification settings"],
.stage1052c-tabbed-profile.stage1052g-docs-comm-ready [data-stage1052c-panel="communication"] .stage822-card[data-stage1052g-title="customer notes"]{
  min-height: 132px !important;
}

.stage1052c-tabbed-profile.stage1052g-docs-comm-ready [data-stage1052c-panel="communication"] .stage822-empty,
.stage1052c-tabbed-profile.stage1052g-docs-comm-ready [data-stage1052c-panel="communication"] .stage822-empty-box,
.stage1052c-tabbed-profile.stage1052g-docs-comm-ready [data-stage1052c-panel="documents"] .stage822-empty,
.stage1052c-tabbed-profile.stage1052g-docs-comm-ready [data-stage1052c-panel="documents"] .stage822-empty-box{
  border-radius: 12px !important;
  background: var(--stage1052g-soft) !important;
  border-color: var(--stage1052g-line) !important;
  min-height: 76px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: var(--stage1052g-muted) !important;
}

.stage1052c-tabbed-profile.stage1052g-docs-comm-ready [data-stage1052c-panel="communication"] .stage822-card-head button,
.stage1052c-tabbed-profile.stage1052g-docs-comm-ready [data-stage1052c-panel="documents"] .stage822-card-head button,
.stage1052c-tabbed-profile.stage1052g-docs-comm-ready [data-stage1052c-panel="communication"] .btn,
.stage1052c-tabbed-profile.stage1052g-docs-comm-ready [data-stage1052c-panel="documents"] .btn{
  max-width: 100% !important;
  white-space: nowrap !important;
}

/* Keep message/note bodies calm and readable. */
.stage1052c-tabbed-profile.stage1052g-docs-comm-ready [data-stage1052c-panel="communication"] .stage822-card-body p,
.stage1052c-tabbed-profile.stage1052g-docs-comm-ready [data-stage1052c-panel="communication"] .stage822-card-body div{
  overflow-wrap: anywhere;
}

/* Laptop / half-screen: switch these tabs to one clean column early. */
@media(max-width: 1280px){
  .stage1052c-tabbed-profile.stage1052g-docs-comm-ready [data-stage1052c-panel="documents"] .stage822-card,
  .stage1052c-tabbed-profile.stage1052g-docs-comm-ready [data-stage1052c-panel="communication"] .stage822-card{
    grid-column: 1 / -1 !important;
  }
}

@media(max-width: 860px){
  .stage1052c-tabbed-profile.stage1052g-docs-comm-ready [data-stage1052c-panel="documents"] table{
    min-width: 620px !important;
  }
  .stage1052c-tabbed-profile.stage1052g-docs-comm-ready [data-stage1052c-panel="documents"] .stage822-card-head,
  .stage1052c-tabbed-profile.stage1052g-docs-comm-ready [data-stage1052c-panel="communication"] .stage822-card-head{
    align-items: flex-start !important;
    gap: 8px !important;
  }
}

@media(max-width: 640px){
  .stage1052c-tabbed-profile.stage1052g-docs-comm-ready [data-stage1052c-panel="documents"] .stage822-card-body,
  .stage1052c-tabbed-profile.stage1052g-docs-comm-ready [data-stage1052c-panel="communication"] .stage822-card-body{
    padding: 10px 12px !important;
  }
}
