/*
  LawApp full-interface refinement layer
  Purpose: keep existing PHP flows intact while modernizing the entire UI system.
*/
:root {
  --law-navy-950: #07111f;
  --law-navy-900: #0f172a;
  --law-navy-800: #18243a;
  --law-teal-700: #0f766e;
  --law-teal-600: #11857d;
  --law-gold-500: #d6b55f;
  --law-gold-400: #efd77f;
  --law-surface: #ffffff;
  --law-surface-soft: #f8fafc;
  --law-line: rgba(15, 23, 42, 0.10);
  --law-text: #111827;
  --law-muted: #64748b;
  --law-focus: rgba(214, 181, 95, 0.28);
  --law-shadow-md: 0 16px 38px rgba(15, 23, 42, 0.08);
  --law-shadow-lg: 0 26px 70px rgba(15, 23, 42, 0.15);
  --law-radius-xl: 24px;
  --law-radius-lg: 18px;
  --law-radius-md: 14px;
}

html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body.lawapp-shell {
  background:
    radial-gradient(circle at top left, rgba(214,181,95,.16), transparent 24rem),
    radial-gradient(circle at top right, rgba(15,118,110,.10), transparent 22rem),
    linear-gradient(180deg, #f8fafc 0%, #f3f6fb 100%);
}

/* Header and navigation cohesion */
.app-navbar {
  background:
    linear-gradient(135deg, rgba(7,17,31,.98), rgba(15,23,42,.96) 58%, rgba(15,118,110,.88)) !important;
  border-bottom: 1px solid rgba(214,181,95,.22);
}
.brand-mark,
.login-brand-mark {
  background: linear-gradient(135deg, var(--law-gold-400), var(--law-gold-500)) !important;
  color: var(--law-navy-950) !important;
  box-shadow: 0 12px 28px rgba(214,181,95,.22);
}
.app-user-chip .dropdown-menu,
.dropdown-menu {
  border: 1px solid rgba(226,232,240,.95) !important;
  border-radius: 18px;
  box-shadow: var(--law-shadow-md) !important;
  padding: .55rem;
}
.dropdown-item { border-radius: 12px; font-weight: 600; padding: .65rem .85rem; }
.dropdown-item:hover { background: rgba(214,181,95,.14); color: var(--law-navy-950); }

.app-sidebar {
  background: rgba(255,255,255,.90) !important;
  border-right: 1px solid rgba(15,23,42,.10);
}
.sidebar-section-label { color: #7c8797; }
.app-sidebar .nav-link { color: #28364d; }
.app-sidebar .nav-link i { width: 22px; text-align: center; color: rgba(15,23,42,.55); }
.app-sidebar .nav-link:hover,
.app-sidebar .nav-link.active {
  background: linear-gradient(135deg, var(--law-navy-900), var(--law-teal-700)) !important;
  color: #fff !important;
  box-shadow: 0 14px 32px rgba(15,23,42,.16);
}
.app-sidebar .nav-link:hover i,
.app-sidebar .nav-link.active i { color: var(--law-gold-400); }

/* Page framing */
.app-main { min-width: 0; }
.page-header,
.hero-panel {
  border-radius: var(--law-radius-xl) !important;
  border: 1px solid rgba(226,232,240,.9) !important;
  box-shadow: var(--law-shadow-md) !important;
}
.page-title,
.hero-title,
h1, h2, h3, h4, h5, h6 { color: var(--law-text); }
.eyebrow,
.hero-kicker { color: var(--law-teal-700) !important; }
.hero-panel {
  background:
    radial-gradient(circle at right bottom, rgba(214,181,95,.18), transparent 34%),
    linear-gradient(135deg, #fff, #f6fbfb 62%, #fff8e6) !important;
}

/* Cards and panels application-wide */
.card,
.modern-card,
.stat-card,
.filter-toolbar-card,
.assignment-form-card,
.tasks-table-card,
.timeline-content,
.quick-link-tile,
.mini-metric,
.metric-row {
  border-radius: var(--law-radius-xl) !important;
  border: 1px solid rgba(226,232,240,.95) !important;
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(250,252,255,.95)) !important;
  box-shadow: var(--law-shadow-md) !important;
}
.card-header,
.modern-card-header {
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,250,252,.96)) !important;
  border-bottom: 1px solid rgba(226,232,240,.95) !important;
  color: var(--law-navy-900);
}
.card-footer { background: rgba(248,250,252,.92); border-top: 1px solid rgba(226,232,240,.95); }

/* Buttons */
.btn {
  border-radius: 14px !important;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  box-shadow: none;
}
.btn-sm { min-height: 34px; border-radius: 11px !important; }
.btn-primary,
.bg-primary {
  background: linear-gradient(135deg, var(--law-navy-900), var(--law-teal-700)) !important;
  border-color: transparent !important;
}
.btn-primary:hover { filter: brightness(1.07); transform: translateY(-1px); }
.btn-outline-primary {
  border-color: rgba(15,118,110,.35) !important;
  color: var(--law-teal-700) !important;
}
.btn-outline-primary:hover {
  background: rgba(15,118,110,.08) !important;
  color: var(--law-navy-900) !important;
}
.btn-warning,
.bg-warning {
  background: linear-gradient(135deg, #d6b55f, #b98922) !important;
  color: #111827 !important;
  border-color: transparent !important;
}

/* Forms and select controls */
.form-label { font-weight: 700; color: #334155; margin-bottom: .45rem; }
.form-control,
.form-select,
.input-group-text,
.select2-container .select2-selection--single,
.select2-container .select2-selection--multiple {
  border-radius: 14px !important;
  min-height: 46px;
  border: 1px solid rgba(148,163,184,.38) !important;
  background-color: #fff !important;
  color: var(--law-text) !important;
}
.form-control::placeholder { color: #94a3b8; }
.form-control:focus,
.form-select:focus,
.select2-container--focus .select2-selection,
.select2-container--open .select2-selection {
  border-color: rgba(214,181,95,.86) !important;
  box-shadow: 0 0 0 .24rem var(--law-focus) !important;
}
.input-group-text { background: #f8fafc !important; color: var(--law-teal-700); }
.form-text, .text-muted { color: var(--law-muted) !important; }
.select2-dropdown {
  border: 1px solid rgba(148,163,184,.36) !important;
  border-radius: 14px !important;
  box-shadow: var(--law-shadow-md);
  overflow: hidden;
  z-index: 2055 !important;
}
.select2-container--default .select2-results__option--highlighted[aria-selected] {
  background-color: var(--law-teal-700) !important;
}

/* Tables and datatables */
.table-responsive,
.dataTables_wrapper { width: 100%; }
.table { vertical-align: middle; }
.table thead th {
  background: linear-gradient(180deg, #f8fafc, #eef3f8) !important;
  color: #26364c !important;
  font-weight: 800;
  white-space: nowrap;
}
.table tbody td { color: #334155; }
.table-hover > tbody > tr:hover > * { background-color: rgba(214,181,95,.10) !important; }
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
  border: 1px solid rgba(148,163,184,.38);
  border-radius: 12px;
  min-height: 38px;
  padding: .35rem .65rem;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.page-item .page-link {
  border-radius: 10px;
  margin: 0 .12rem;
}

/* Modals are modernized globally without changing each PHP page */
.modal-backdrop.show { opacity: .42; backdrop-filter: blur(3px); }
.modal-content {
  border: 1px solid rgba(226,232,240,.98) !important;
  border-radius: 24px !important;
  box-shadow: var(--law-shadow-lg) !important;
  overflow: hidden;
}
.modal-header {
  background:
    radial-gradient(circle at top right, rgba(214,181,95,.22), transparent 44%),
    linear-gradient(135deg, #ffffff, #f6fbfb) !important;
  border-bottom: 1px solid rgba(226,232,240,.95) !important;
  padding: 1.1rem 1.25rem;
}
.modal-title { font-weight: 800; color: var(--law-navy-900); }
.modal-body { padding: 1.25rem; }
.modal-footer {
  background: rgba(248,250,252,.92);
  border-top: 1px solid rgba(226,232,240,.95) !important;
  padding: 1rem 1.25rem;
}
.btn-close { opacity: .8; }

/* Calendar readability */
.calendar-page .fc,
.fc {
  --fc-border-color: rgba(100,116,139,.28);
  --fc-neutral-text-color: #334155;
  --fc-today-bg-color: rgba(214,181,95,.18);
  color: #1f2937;
}
.calendar-page .fc .fc-col-header-cell-cushion,
.fc .fc-col-header-cell-cushion { color: #0f172a; font-weight: 800; }
.calendar-page .fc .fc-daygrid-day-number,
.fc .fc-daygrid-day-number { color: #334155; font-weight: 700; }
.calendar-page .fc .fc-button,
.fc .fc-button {
  background: var(--law-navy-900) !important;
  border-color: transparent !important;
  color: #fff !important;
  border-radius: 12px !important;
}
.calendar-page .fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled).fc-button-active {
  background: var(--law-teal-700) !important;
}
.calendar-page .fc-event,
.fc-event {
  border: 0 !important;
  box-shadow: 0 8px 18px rgba(15,23,42,.12);
  font-weight: 700;
}

/* Alerts and badges */
.alert { border-radius: 16px; box-shadow: 0 10px 24px rgba(15,23,42,.05); }
.badge { border-radius: 999px; font-weight: 800; }

/* Login page aligned with the application color system */
.login-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 16% 20%, rgba(214,181,95,.36), transparent 18rem),
    radial-gradient(circle at 84% 80%, rgba(15,118,110,.28), transparent 22rem),
    linear-gradient(135deg, var(--law-navy-950), var(--law-navy-900) 56%, #112f35) !important;
}
.login-stage {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 4vw, 3rem);
}
.login-card-pro {
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, .92fr);
  min-height: min(720px, calc(100vh - 4rem));
  border: 1px solid rgba(214,181,95,.28);
  border-radius: 32px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 34px 90px rgba(0,0,0,.34);
  overflow: hidden;
}
.login-welcome-pro {
  position: relative;
  padding: clamp(2rem, 5vw, 4rem);
  color: #fff;
  background:
    radial-gradient(circle at 82% 24%, rgba(214,181,95,.35), transparent 10rem),
    linear-gradient(135deg, var(--law-navy-900), var(--law-teal-700));
  overflow: hidden;
}
.login-welcome-pro::after {
  content: '';
  position: absolute;
  width: 24rem;
  height: 24rem;
  border-radius: 50%;
  right: -10rem;
  bottom: -8rem;
  border: 1px solid rgba(214,181,95,.22);
  background: rgba(255,255,255,.05);
}
.login-brand-lockup,
.login-trust-grid { position: relative; z-index: 1; }
.login-brand-lockup { display: flex; align-items: center; gap: .85rem; }
.login-brand-lockup strong { display:block; color:#fff; font-size:1.1rem; }
.login-brand-lockup small { color: rgba(255,255,255,.74); }
.login-copy { position: relative; z-index: 1; margin-top: clamp(2rem, 6vh, 5rem); max-width: 34rem; }
.login-copy h1 { color: #fff; font-size: clamp(2rem, 4.2vw, 3.5rem); line-height: 1.02; letter-spacing: -.05em; }
.login-copy p { color: rgba(255,255,255,.78); font-size: 1.02rem; line-height: 1.7; }
.login-trust-grid { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.35rem; }
.login-trust-grid span { background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.16); border-radius: 999px; padding: .55rem .8rem; color: rgba(255,255,255,.92); }
.login-form-pro { display: grid; place-items: center; padding: clamp(1.5rem, 4vw, 3rem); background: linear-gradient(180deg, #fff, #f8fafc); }
.login-form-inner { width: min(420px, 100%); }
.login-form-inner h2 { color: var(--law-navy-900); font-weight: 800; letter-spacing: -.03em; }
.login-help-text { color: var(--law-muted); font-size: .9rem; text-align: center; }
.login-art-board { min-height: 170px; position: relative; margin: 2rem 0; opacity: .9; }
.art-icon { position: absolute; width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; background: rgba(255,255,255,.11); border: 1px solid rgba(255,255,255,.18); color: var(--law-gold-400); }
.icon-scale { left: 42%; top: 22%; transform: scale(1.9); }
.icon-folder { left: 10%; bottom: 8%; }
.icon-calendar { right: 12%; top: 12%; }
.icon-shield { right: 30%; bottom: 4%; }
.art-ring { position:absolute; border:1px solid rgba(214,181,95,.22); border-radius:50%; }
.ring-one { width:110px;height:110px;left:16%;top:20%; }
.ring-two { width:170px;height:170px;right:18%;bottom:-28%; }
.art-line { position:absolute;height:1px;background:rgba(214,181,95,.24); }
.line-one { width:38%;left:22%;top:35%;transform:rotate(8deg); }
.line-two { width:44%;right:18%;bottom:30%;transform:rotate(-10deg); }
.letter-spaced { letter-spacing: .22em; }

/* Mobile-first corrections */
@media (max-width: 991.98px) {
  body.lawapp-shell { padding-top: 72px; }
  .app-navbar { min-height: 72px; }
  .app-sidebar {
    top: 72px;
    width: min(88vw, 330px) !important;
    max-width: 330px !important;
    box-shadow: var(--law-shadow-lg);
  }
  .app-main { margin-left: 0 !important; padding: 1rem !important; }
  .page-header { padding: 1rem !important; }
  .page-title { font-size: 1.45rem; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .dataTables_wrapper .row { gap: .65rem; }
  .modal-dialog { margin: .75rem; }
  .modal-content { border-radius: 20px !important; }
  .login-card-pro { grid-template-columns: 1fr; min-height: 0; border-radius: 24px; }
  .login-welcome-pro { min-height: auto; padding: 1.5rem; }
  .login-art-board { display: none; }
  .login-copy { margin-top: 1.5rem; }
  .login-copy h1 { font-size: 1.85rem; }
  .login-form-pro { padding: 1.5rem; }
}

@media (max-width: 575.98px) {
  .brand-mark { width: 38px; height: 38px; border-radius: 12px; }
  .navbar-brand small { display: none !important; }
  .app-main { padding: .85rem !important; }
  .card-body, .modal-body { padding: 1rem !important; }
  .card-header, .modal-header, .modal-footer { padding: .9rem 1rem !important; }
  .btn { width: auto; }
  .btn-group, .btn-toolbar { flex-wrap: wrap; }
  .stat-grid { grid-template-columns: 1fr !important; }
  .login-stage { padding: .75rem; }
  .login-card-pro { border-radius: 20px; }
}

/* ------------------------------------------------------------------
   Final contrast + professional refinement pass
   Focus: Clients, Cases, Documents, Billing, Assign Tasks, Users
   ------------------------------------------------------------------ */
body.page-clients,
body.page-cases,
body.page-documents,
body.page-billing,
body.page-assign-tasks,
body.page-users {
  --page-accent-soft: rgba(214, 181, 95, .14);
  --page-accent-line: rgba(214, 181, 95, .42);
}

body.page-clients .page-header,
body.page-cases .page-header,
body.page-documents .page-header,
body.page-billing .page-header,
body.page-assign-tasks .page-header,
body.page-users .page-header {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255,255,255,.98), rgba(246,251,251,.96) 58%, rgba(255,248,230,.92)) !important;
}
body.page-clients .page-header::before,
body.page-cases .page-header::before,
body.page-documents .page-header::before,
body.page-billing .page-header::before,
body.page-assign-tasks .page-header::before,
body.page-users .page-header::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: linear-gradient(180deg, var(--law-teal-700), var(--law-gold-500));
}
body.page-clients .page-header::after,
body.page-cases .page-header::after,
body.page-documents .page-header::after,
body.page-billing .page-header::after,
body.page-assign-tasks .page-header::after,
body.page-users .page-header::after {
  content: '';
  position: absolute;
  right: -70px;
  top: -90px;
  width: 210px;
  height: 210px;
  border-radius: 50%;
  border: 1px solid rgba(214,181,95,.22);
  background: radial-gradient(circle, rgba(214,181,95,.16), transparent 68%);
  pointer-events: none;
}
body.page-clients .page-header > *,
body.page-cases .page-header > *,
body.page-documents .page-header > *,
body.page-billing .page-header > *,
body.page-assign-tasks .page-header > *,
body.page-users .page-header > * { position: relative; z-index: 1; }

/* Stronger but still restrained button contrast */
.btn-outline-secondary {
  color: #334155 !important;
  border-color: rgba(51,65,85,.36) !important;
  background: rgba(255,255,255,.86) !important;
}
.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
  background: #334155 !important;
  color: #fff !important;
  border-color: #334155 !important;
}
.btn-outline-danger {
  color: #991b1b !important;
  border-color: rgba(153,27,27,.34) !important;
  background: rgba(255,255,255,.88) !important;
}
.btn-outline-danger:hover,
.btn-outline-danger:focus {
  background: #991b1b !important;
  color: #fff !important;
  border-color: #991b1b !important;
}
.btn-outline-warning {
  color: #7c4a03 !important;
  border-color: rgba(180,124,31,.42) !important;
  background: rgba(255,251,235,.88) !important;
}
.btn-outline-warning:hover,
.btn-outline-warning:focus {
  background: #b7791f !important;
  color: #111827 !important;
  border-color: #b7791f !important;
}
.btn-secondary {
  background: #475569 !important;
  border-color: #475569 !important;
  color: #fff !important;
}
.btn-light {
  color: #1f2937 !important;
  border-color: rgba(148,163,184,.35) !important;
}

/* Make action icons readable and neatly sized on dense pages */
.action-buttons,
.user-actions,
.table td:last-child .btn-group,
.table td:last-child .d-flex {
  gap: .35rem;
  flex-wrap: nowrap;
}
.action-buttons .btn,
.user-actions .btn,
.table .btn-sm {
  min-width: 36px;
  min-height: 34px;
  padding-inline: .55rem;
  font-weight: 800;
}
.table .btn-sm i { font-size: .86rem; }

/* Page cards: a little more definition without becoming decorative */
body.page-clients .card,
body.page-cases .card,
body.page-documents .card,
body.page-billing .card,
body.page-assign-tasks .card,
body.page-users .card {
  border-color: rgba(203,213,225,.96) !important;
  box-shadow: 0 18px 42px rgba(15,23,42,.075) !important;
}
body.page-clients .card-header,
body.page-cases .card-header,
body.page-documents .card-header,
body.page-billing .card-header,
body.page-assign-tasks .card-header,
body.page-users .card-header {
  background:
    linear-gradient(90deg, rgba(15,23,42,.04), transparent 30%),
    linear-gradient(180deg, #fff, #f8fafc) !important;
}
body.page-clients .card-header h5,
body.page-cases .card-header h5,
body.page-documents .card-header h5,
body.page-billing .card-header h5,
body.page-assign-tasks .card-header h5,
body.page-users .card-header h5 {
  color: #0f172a;
  font-weight: 850;
}

/* Table readability for law-office data pages */
body.page-clients .table thead th,
body.page-cases .table thead th,
body.page-documents .table thead th,
body.page-billing .table thead th,
body.page-assign-tasks .table thead th,
body.page-users .table thead th {
  background: linear-gradient(180deg, #eef3f8, #e6edf5) !important;
  color: #0f172a !important;
  border-bottom: 1px solid rgba(15,23,42,.18) !important;
}
body.page-clients .table tbody tr,
body.page-cases .table tbody tr,
body.page-documents .table tbody tr,
body.page-billing .table tbody tr,
body.page-assign-tasks .table tbody tr,
body.page-users .table tbody tr {
  transition: background-color .18s ease, box-shadow .18s ease;
}
body.page-clients .table tbody tr:hover,
body.page-cases .table tbody tr:hover,
body.page-documents .table tbody tr:hover,
body.page-billing .table tbody tr:hover,
body.page-assign-tasks .table tbody tr:hover,
body.page-users .table tbody tr:hover {
  box-shadow: inset 4px 0 0 rgba(15,118,110,.55);
}
.table a { color: #0f766e; font-weight: 700; }
.table a:hover { color: #0f172a; }
.case-count,
.client-contact a,
.document-type,
.amount-value { font-weight: 750; }

/* Search boxes and filters should stand out more clearly */
.search-container { position: relative; }
.search-container .search-icon {
  position: absolute;
  left: .95rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--law-teal-700) !important;
  z-index: 2;
}
.search-container .form-control { padding-left: 2.65rem !important; }
.filter-toolbar-card,
.assignment-form-card {
  background:
    radial-gradient(circle at right top, rgba(214,181,95,.12), transparent 18rem),
    linear-gradient(180deg, #fff, #f8fafc) !important;
}

/* Badges: prevent pale text / low contrast combinations */
.badge.bg-secondary { background-color: #475569 !important; color: #fff !important; }
.badge.bg-primary { background: linear-gradient(135deg, var(--law-navy-900), var(--law-teal-700)) !important; color: #fff !important; }
.badge.bg-success { background-color: #166534 !important; color: #fff !important; }
.badge.bg-danger { background-color: #991b1b !important; color: #fff !important; }
.badge.bg-warning { background-color: #d6b55f !important; color: #111827 !important; }

/* Modern modals: more polished, still conservative */
.modal-content.modern-modal,
.modal-content.law-modal-enhanced {
  background:
    linear-gradient(180deg, #ffffff 0%, #fbfdff 100%) !important;
  border: 1px solid rgba(203,213,225,.98) !important;
}
.modal-content.law-modal-enhanced::before {
  content: '';
  display: block;
  height: 5px;
  background: linear-gradient(90deg, var(--law-navy-900), var(--law-teal-700), var(--law-gold-500));
}
.modal-content.law-modal-enhanced .modal-header {
  padding-block: 1rem;
  background:
    radial-gradient(circle at 100% 0%, rgba(214,181,95,.18), transparent 14rem),
    linear-gradient(180deg, #ffffff, #f8fafc) !important;
}
.modal-title {
  display: flex;
  align-items: center;
  gap: .7rem;
}
.modal-title .modal-title-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--law-navy-900), var(--law-teal-700));
  color: var(--law-gold-400);
  box-shadow: 0 10px 22px rgba(15,23,42,.14);
  flex: 0 0 auto;
}
.modal-body .form-label {
  color: #1f2937;
  font-size: .88rem;
}
.modal-body .mb-3 {
  position: relative;
}
.modal-body .form-control,
.modal-body .form-select {
  background: #fff !important;
  border-color: rgba(100,116,139,.34) !important;
}
.modal-footer .modal-action-btn,
.modal-footer .btn {
  min-width: 108px;
  font-weight: 800;
}
.modal .text-muted { color: #64748b !important; }

/* DataTables controls contrast */
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label { color: #334155 !important; font-weight: 650; }
.dataTables_wrapper .page-item.active .page-link {
  background: linear-gradient(135deg, var(--law-navy-900), var(--law-teal-700)) !important;
  border-color: transparent !important;
  color: #fff !important;
}
.dataTables_wrapper .page-link { color: #0f766e; font-weight: 750; }

/* Mobile refinements for the highlighted pages */
@media (max-width: 767.98px) {
  body.page-clients .page-header .d-flex,
  body.page-cases .page-header .d-flex,
  body.page-documents .page-header .d-flex,
  body.page-billing .page-header .d-flex,
  body.page-assign-tasks .page-header .d-flex,
  body.page-users .page-header .d-flex {
    align-items: stretch !important;
    gap: .9rem;
  }
  body.page-clients .page-header .btn-toolbar,
  body.page-cases .page-header .btn-toolbar,
  body.page-documents .page-header .btn-toolbar,
  body.page-billing .page-header .btn-toolbar,
  body.page-assign-tasks .page-header .btn-toolbar,
  body.page-users .page-header .btn-toolbar { width: 100%; }
  body.page-clients .page-header .btn-toolbar .btn,
  body.page-cases .page-header .btn-toolbar .btn,
  body.page-documents .page-header .btn-toolbar .btn,
  body.page-billing .page-header .btn-toolbar .btn,
  body.page-assign-tasks .page-header .btn-toolbar .btn,
  body.page-users .page-header .btn-toolbar .btn { width: 100%; }
  .action-buttons,
  .user-actions { justify-content: flex-start !important; }
  .modal-footer { gap: .5rem; }
  .modal-footer .btn { flex: 1 1 auto; }
}

/* ------------------------------------------------------------------
   Final tune: Documents view switch, Assign Tasks contrast, login height
   ------------------------------------------------------------------ */

/* Login: keep the polished design but fit common laptop screens without scrolling. */
body.login-page {
  min-height: 100dvh;
  overflow: hidden;
}
body.login-page .login-stage {
  min-height: 100dvh;
  height: 100dvh;
  box-sizing: border-box;
  padding: clamp(.65rem, 1.8vw, 1.35rem);
  overflow: hidden;
}
body.login-page .login-card-pro {
  min-height: 0;
  height: min(650px, calc(100dvh - 1.5rem));
  max-height: calc(100dvh - 1.5rem);
}
body.login-page .login-welcome-pro {
  padding: clamp(1.6rem, 3vw, 2.65rem);
}
body.login-page .login-copy {
  margin-top: clamp(1.2rem, 3.5vh, 2.6rem);
}
body.login-page .login-copy h1 {
  font-size: clamp(1.85rem, 3.15vw, 2.75rem);
  line-height: 1.05;
}
body.login-page .login-copy p {
  font-size: .97rem;
  line-height: 1.58;
}
body.login-page .login-art-board {
  min-height: 125px;
  margin: 1.1rem 0;
}
body.login-page .login-form-pro {
  padding: clamp(1.2rem, 2.6vw, 2.2rem);
}
body.login-page .login-form-inner .mb-4 {
  margin-bottom: 1.1rem !important;
}
body.login-page .form-label {
  margin-bottom: .35rem;
}
body.login-page .input-group-modern .form-control,
body.login-page .input-group-modern .input-group-text,
body.login-page .input-group-modern .btn {
  min-height: 44px;
}

@media (max-height: 760px) and (min-width: 992px) {
  body.login-page .login-card-pro {
    height: calc(100dvh - 1rem);
    max-height: calc(100dvh - 1rem);
  }
  body.login-page .login-art-board {
    min-height: 96px;
    margin: .75rem 0;
  }
  body.login-page .login-trust-grid {
    margin-top: .85rem;
  }
  body.login-page .login-trust-grid span {
    padding: .42rem .68rem;
    font-size: .86rem;
  }
  body.login-page .login-form-inner h2 {
    font-size: 1.55rem;
  }
  body.login-page .login-help-text {
    font-size: .82rem;
  }
}

@media (max-width: 991.98px) {
  body.login-page {
    overflow: auto;
  }
  body.login-page .login-stage {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }
  body.login-page .login-card-pro {
    height: auto;
    max-height: none;
  }
}

/* Documents: treat Active/Trash/View All as a view toggle, not bright Bootstrap blue buttons. */
body.page-documents .page-header .btn-group {
  gap: .25rem;
  padding: .25rem;
  border: 1px solid rgba(148,163,184,.35);
  border-radius: 999px;
  background: rgba(255,255,255,.9);
  box-shadow: 0 10px 22px rgba(15,23,42,.06);
}
body.page-documents .page-header .btn-group .btn {
  border-radius: 999px !important;
  border: 0 !important;
  min-height: 36px;
  padding: .42rem .85rem;
  font-weight: 850;
  color: #334155 !important;
  background: transparent !important;
  box-shadow: none !important;
}
body.page-documents .page-header .btn-group .btn:hover,
body.page-documents .page-header .btn-group .btn:focus {
  color: #0f172a !important;
  background: rgba(15,118,110,.10) !important;
}
body.page-documents .page-header .btn-group .btn.active,
body.page-documents .page-header .btn-group .btn-outline-primary.active,
body.page-documents .page-header .btn-group .btn-outline-danger.active,
body.page-documents .page-header .btn-group .btn-outline-secondary.active {
  color: #fff !important;
  background: linear-gradient(135deg, var(--law-navy-900), var(--law-teal-700)) !important;
  box-shadow: 0 10px 20px rgba(15,118,110,.22) !important;
}
body.page-documents .page-header .btn-group .btn-outline-danger:not(.active) {
  color: #8a1f1f !important;
}
body.page-documents .page-header .btn-primary {
  background: linear-gradient(135deg, var(--law-navy-900), var(--law-teal-700)) !important;
  border-color: transparent !important;
  color: #fff !important;
}
body.page-documents .filter-section .card-header,
body.page-documents .card .card-header {
  border-bottom-color: rgba(15,23,42,.12) !important;
}
body.page-documents .document-type,
body.page-documents .table td,
body.page-documents .table th {
  color: #1f2937;
}

/* Assign Tasks: align contrast and density closer to User Management. */
body.page-assign-tasks .row > .col-md-4 .card,
body.page-assign-tasks .row > .col-md-8 .card {
  background: #fff !important;
  border: 1px solid rgba(203,213,225,.98) !important;
}
body.page-assign-tasks .card-header {
  color: #0f172a !important;
  border-bottom: 1px solid rgba(15,23,42,.12) !important;
  background: linear-gradient(180deg, #ffffff, #f8fafc) !important;
}
body.page-assign-tasks .card-header h5 {
  color: #0f172a !important;
  font-weight: 850;
}
body.page-assign-tasks .card-body .card.card-body,
body.page-assign-tasks #filtersCollapse .card-body,
body.page-assign-tasks #filtersCollapse.card,
body.page-assign-tasks .collapse .card {
  background: linear-gradient(180deg, #ffffff, #f8fafc) !important;
  border-color: rgba(148,163,184,.32) !important;
}
body.page-assign-tasks .form-label,
body.page-assign-tasks .form-text,
body.page-assign-tasks .table,
body.page-assign-tasks .table td {
  color: #334155 !important;
}
body.page-assign-tasks .form-label {
  font-weight: 750;
}
body.page-assign-tasks .form-control,
body.page-assign-tasks .form-select,
body.page-assign-tasks textarea.form-control {
  background-color: #fff !important;
  border-color: rgba(71,85,105,.34) !important;
  color: #0f172a !important;
}
body.page-assign-tasks .form-control:focus,
body.page-assign-tasks .form-select:focus,
body.page-assign-tasks textarea.form-control:focus {
  border-color: var(--law-teal-700) !important;
  box-shadow: 0 0 0 .2rem rgba(15,118,110,.13) !important;
}
body.page-assign-tasks .btn-outline-secondary {
  color: #0f172a !important;
  background: #fff !important;
  border-color: rgba(71,85,105,.42) !important;
}
body.page-assign-tasks .btn-outline-secondary:hover,
body.page-assign-tasks .btn-outline-secondary:focus {
  color: #fff !important;
  background: #334155 !important;
  border-color: #334155 !important;
}
body.page-assign-tasks .table thead th {
  background: linear-gradient(180deg, #eef3f8, #e6edf5) !important;
  color: #0f172a !important;
  font-weight: 850;
}
body.page-assign-tasks .table tbody tr:hover {
  background: rgba(15,118,110,.055) !important;
}
body.page-assign-tasks .badge,
body.page-assign-tasks .task-status,
body.page-assign-tasks .priority-badge {
  font-weight: 850;
}

@media (max-width: 767.98px) {
  body.page-documents .page-header .btn-toolbar {
    gap: .65rem;
  }
  body.page-documents .page-header .btn-group {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-radius: 18px;
  }
  body.page-documents .page-header .btn-group .btn {
    width: 100%;
  }
  body.page-documents .page-header .btn-toolbar > .btn-primary {
    width: 100%;
  }
  body.page-assign-tasks .col-md-2.d-flex.align-items-end {
    gap: .5rem;
  }
  body.page-assign-tasks .col-md-2.d-flex.align-items-end .btn {
    flex: 1 1 auto;
  }
}

/* ------------------------------------------------------------------
   Login clipping correction
   Keeps the professional split-screen design while preventing the
   welcome content and trust badges from being clipped on laptop-height
   screens such as 1366x768 or browser windows around 600px tall.
   ------------------------------------------------------------------ */
body.login-page {
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
}

body.login-page .login-stage {
  min-height: 100vh;
  min-height: 100dvh;
  height: 100vh;
  height: 100dvh;
  padding: clamp(.5rem, 1.4vw, 1rem);
  overflow: hidden;
}

body.login-page .login-card-pro {
  height: min(610px, calc(100vh - 1rem));
  height: min(610px, calc(100dvh - 1rem));
  max-height: calc(100vh - 1rem);
  max-height: calc(100dvh - 1rem);
  min-height: 0;
}

body.login-page .login-welcome-pro {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: clamp(1.35rem, 2.4vw, 2.35rem);
}

body.login-page .login-art-board {
  position: absolute;
  inset: 4.75rem 1rem 1rem 1rem;
  height: auto;
  min-height: 0;
  margin: 0;
  opacity: .48;
  z-index: 0;
  pointer-events: none;
}

body.login-page .login-brand-lockup,
body.login-page .login-copy,
body.login-page .login-trust-grid {
  position: relative;
  z-index: 2;
}

body.login-page .login-copy {
  margin-top: auto;
  padding-top: 1rem;
  max-width: 32rem;
}

body.login-page .login-copy .eyebrow {
  font-size: .72rem;
  letter-spacing: .16em;
}

body.login-page .login-copy h1 {
  font-size: clamp(1.72rem, 2.65vw, 2.35rem);
  line-height: 1.08;
  margin-bottom: .75rem;
  letter-spacing: -.045em;
}

body.login-page .login-copy p {
  font-size: .92rem;
  line-height: 1.5;
  margin-bottom: 0;
}

body.login-page .login-trust-grid {
  gap: .45rem;
  margin-top: .9rem;
}

body.login-page .login-trust-grid span {
  padding: .38rem .62rem;
  font-size: .76rem;
  line-height: 1.1;
}

body.login-page .login-form-pro {
  padding: clamp(1rem, 2.2vw, 1.8rem);
}

body.login-page .login-form-inner {
  width: min(390px, 100%);
}

body.login-page .login-form-inner h2 {
  font-size: clamp(1.55rem, 2.2vw, 2rem);
}

body.login-page .login-form-inner p.text-muted {
  font-size: .95rem;
}

body.login-page .login-form-inner .mb-4 {
  margin-bottom: .95rem !important;
}

body.login-page .login-form-inner .mb-3 {
  margin-bottom: .8rem !important;
}

body.login-page .input-group-modern .form-control,
body.login-page .input-group-modern .input-group-text,
body.login-page .input-group-modern .btn {
  min-height: 42px;
}

body.login-page .btn-lg {
  min-height: 46px;
  padding-top: .55rem;
  padding-bottom: .55rem;
  font-size: 1rem;
}

body.login-page .login-help-text {
  font-size: .82rem;
  line-height: 1.35;
}

@media (max-height: 640px) and (min-width: 992px) {
  body.login-page .login-card-pro {
    height: calc(100vh - .75rem);
    height: calc(100dvh - .75rem);
    max-height: calc(100vh - .75rem);
    max-height: calc(100dvh - .75rem);
  }

  body.login-page .login-welcome-pro {
    padding: 1.25rem 1.6rem;
  }

  body.login-page .login-brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 13px;
  }

  body.login-page .login-brand-lockup strong {
    font-size: 1rem;
  }

  body.login-page .login-brand-lockup small {
    font-size: .78rem;
  }

  body.login-page .login-copy h1 {
    font-size: clamp(1.55rem, 2.45vw, 2.05rem);
    margin-bottom: .6rem;
  }

  body.login-page .login-copy p {
    font-size: .86rem;
    line-height: 1.42;
  }

  body.login-page .login-trust-grid span {
    padding: .32rem .54rem;
    font-size: .72rem;
  }

  body.login-page .login-art-board {
    opacity: .32;
  }

  body.login-page .login-form-pro {
    padding: 1rem 1.55rem;
  }
}

@media (max-width: 991.98px) {
  body.login-page {
    overflow: auto;
  }

  body.login-page .login-stage {
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: visible;
  }

  body.login-page .login-card-pro {
    height: auto;
    max-height: none;
  }

  body.login-page .login-welcome-pro {
    display: block;
  }

  body.login-page .login-art-board {
    display: none;
  }

  body.login-page .login-copy {
    margin-top: 1.25rem;
    padding-top: 0;
  }
}

/* ------------------------------------------------------------------
   Login trust badge position refinement
   Moves the MFA ready / Responsive UI / Clear scheduling badges a bit
   lower without changing authentication logic or the split-login layout.
   ------------------------------------------------------------------ */
body.login-page .login-trust-grid {
  margin-top: 1.35rem;
}

@media (max-height: 640px) and (min-width: 992px) {
  body.login-page .login-trust-grid {
    margin-top: 1.05rem;
  }
}

@media (max-width: 991.98px) {
  body.login-page .login-trust-grid {
    margin-top: 1.2rem;
  }
}

/* ------------------------------------------------------------------
   App-wide table consistency + Assign Tasks badge contrast refinement
   Purpose: ensure row striping/hover behavior is consistent across the
   application and make task priority/status badges easier to read.
   ------------------------------------------------------------------ */
.table {
  --law-table-row: #ffffff;
  --law-table-row-alt: #f7fafc;
  --law-table-row-hover: rgba(15, 118, 110, .075);
  --law-table-border: rgba(203, 213, 225, .75);
}

.table > :not(caption) > * > * {
  border-bottom-color: var(--law-table-border) !important;
}

.table tbody tr > *,
.table.table-striped > tbody > tr > *,
.table-striped > tbody > tr > * {
  background-color: var(--law-table-row) !important;
}

.table.table-striped > tbody > tr:nth-of-type(odd) > *,
.table-striped > tbody > tr:nth-of-type(odd) > * {
  background-color: var(--law-table-row-alt) !important;
}

.table-hover > tbody > tr:hover > *,
.table tbody tr:hover > *,
body.page-assign-tasks .table tbody tr:hover > * {
  background-color: var(--law-table-row-hover) !important;
}

body.page-clients .table tbody tr:hover,
body.page-cases .table tbody tr:hover,
body.page-documents .table tbody tr:hover,
body.page-billing .table tbody tr:hover,
body.page-assign-tasks .table tbody tr:hover,
body.page-users .table tbody tr:hover {
  box-shadow: inset 4px 0 0 rgba(15,118,110,.55);
}

/* Assign Tasks priority and status badges: higher contrast, refined colors. */
body.page-assign-tasks .table .badge,
body.page-assign-tasks .badge[class*="task-priority-"],
body.page-assign-tasks .badge[class*="task-status-"] {
  border-radius: 999px !important;
  padding: .42rem .72rem !important;
  min-width: 82px;
  text-align: center;
  letter-spacing: .01em;
  border: 1px solid transparent !important;
  box-shadow: none !important;
  color: #ffffff !important;
}

body.page-assign-tasks .task-priority-Low {
  background: #475569 !important;
  border-color: #334155 !important;
}

body.page-assign-tasks .task-priority-Medium {
  background: #0f766e !important;
  border-color: #0b5f59 !important;
}

body.page-assign-tasks .task-priority-High {
  background: #9a5b00 !important;
  border-color: #7a4700 !important;
}

body.page-assign-tasks .task-priority-Urgent {
  background: #9f1239 !important;
  border-color: #881337 !important;
}

body.page-assign-tasks .task-status-Not-Started,
body.page-assign-tasks .task-status-Pending {
  background: #475569 !important;
  border-color: #334155 !important;
}

body.page-assign-tasks .task-status-In-Progress {
  background: #075985 !important;
  border-color: #0c4a6e !important;
}

body.page-assign-tasks .task-status-On-Hold {
  background: #854d0e !important;
  border-color: #713f12 !important;
}

body.page-assign-tasks .task-status-Completed {
  background: #166534 !important;
  border-color: #14532d !important;
}

body.page-assign-tasks .task-status-Overdue {
  background: #991b1b !important;
  border-color: #7f1d1d !important;
}

body.page-assign-tasks .task-status-Cancelled,
body.page-assign-tasks .task-status-Canceled {
  background: #374151 !important;
  border-color: #1f2937 !important;
}

/* ------------------------------------------------------------------
   Assign Tasks final palette alignment
   Purpose: make Assign Tasks visually match the rest of LawApp.
   ------------------------------------------------------------------ */
body.page-assign-tasks .card,
body.page-assign-tasks .row > .col-md-4 .card,
body.page-assign-tasks .row > .col-md-8 .card {
  background: #ffffff !important;
  border-color: rgba(203,213,225,.96) !important;
  box-shadow: 0 18px 42px rgba(15,23,42,.075) !important;
}

body.page-assign-tasks .card-header {
  background:
    linear-gradient(90deg, rgba(15,23,42,.04), transparent 30%),
    linear-gradient(180deg, #fff, #f8fafc) !important;
  color: #0f172a !important;
}

body.page-assign-tasks .table,
body.page-assign-tasks #tasksTable {
  --law-table-row: #ffffff;
  --law-table-row-alt: #f8fafc;
  --law-table-row-hover: rgba(15, 118, 110, .075);
}

body.page-assign-tasks .table thead th,
body.page-assign-tasks #tasksTable thead th {
  background: linear-gradient(180deg, #eef3f8, #e6edf5) !important;
  color: #0f172a !important;
  border-bottom: 1px solid rgba(15,23,42,.18) !important;
}

body.page-assign-tasks .table-striped > tbody > tr > *,
body.page-assign-tasks .table-striped > tbody > tr:nth-of-type(odd) > *,
body.page-assign-tasks #tasksTable tbody tr > *,
body.page-assign-tasks #tasksTable tbody tr:nth-of-type(odd) > * {
  color: #334155 !important;
}

body.page-assign-tasks #tasksTable tbody tr:hover > * {
  background-color: var(--law-table-row-hover) !important;
}

body.page-assign-tasks .btn-outline-primary {
  color: var(--law-teal-700) !important;
  border-color: rgba(15,118,110,.42) !important;
  background: rgba(255,255,255,.9) !important;
}
body.page-assign-tasks .btn-outline-primary:hover,
body.page-assign-tasks .btn-outline-primary:focus {
  color: #fff !important;
  background: linear-gradient(135deg, var(--law-navy-900), var(--law-teal-700)) !important;
  border-color: transparent !important;
}

body.page-assign-tasks .btn-outline-warning {
  color: #7c4a03 !important;
  border-color: rgba(180,124,31,.42) !important;
  background: rgba(255,251,235,.9) !important;
}
body.page-assign-tasks .btn-outline-warning:hover,
body.page-assign-tasks .btn-outline-warning:focus {
  color: #111827 !important;
  background: linear-gradient(135deg, #d6b55f, #b98922) !important;
  border-color: transparent !important;
}

body.page-assign-tasks .task-priority-Low,
body.page-assign-tasks .task-status-Not-Started,
body.page-assign-tasks .task-status-Pending,
body.page-assign-tasks .task-status-Cancelled,
body.page-assign-tasks .task-status-Canceled {
  background: #475569 !important;
  border-color: #475569 !important;
  color: #fff !important;
}

body.page-assign-tasks .task-priority-Medium,
body.page-assign-tasks .task-status-In-Progress {
  background: linear-gradient(135deg, var(--law-navy-900), var(--law-teal-700)) !important;
  border-color: transparent !important;
  color: #fff !important;
}

body.page-assign-tasks .task-priority-High,
body.page-assign-tasks .task-status-On-Hold {
  background: linear-gradient(135deg, #d6b55f, #b98922) !important;
  border-color: transparent !important;
  color: #111827 !important;
}

body.page-assign-tasks .task-priority-Urgent,
body.page-assign-tasks .task-status-Overdue {
  background: #991b1b !important;
  border-color: #991b1b !important;
  color: #fff !important;
}

body.page-assign-tasks .task-status-Completed {
  background: #166534 !important;
  border-color: #166534 !important;
  color: #fff !important;
}

/* ------------------------------------------------------------------
   Deep table/color consistency pass
   Purpose: remove the remaining Assign Tasks-only table appearance and
   force the same row, header, hover, action button, and badge language
   across Clients, Cases, Documents, Billing, Assign Tasks, and Users.
   ------------------------------------------------------------------ */
body.page-refined .table,
body.page-refined .dataTable {
  --law-table-head-top: #eef3f8;
  --law-table-head-bottom: #e6edf5;
  --law-table-row-odd: #ffffff;
  --law-table-row-even: #f8fafc;
  --law-table-row-hover: rgba(15, 118, 110, .085);
  --law-table-border: rgba(203, 213, 225, .78);
  border-collapse: separate !important;
  border-spacing: 0 !important;
  color: #334155 !important;
}

body.page-refined .table-responsive {
  background: #ffffff;
  border: 1px solid rgba(203, 213, 225, .78);
  border-radius: 16px;
  overflow: auto;
}

body.page-refined .table thead th,
body.page-refined table.dataTable thead th,
body.page-refined #tasksTable thead th {
  background: linear-gradient(180deg, var(--law-table-head-top), var(--law-table-head-bottom)) !important;
  color: #0f172a !important;
  border-bottom: 1px solid rgba(15, 23, 42, .18) !important;
  font-weight: 850 !important;
  letter-spacing: .01em;
  white-space: nowrap;
}

body.page-refined .table tbody td,
body.page-refined .table tbody th,
body.page-refined table.dataTable tbody td,
body.page-refined table.dataTable tbody th,
body.page-refined #tasksTable tbody td,
body.page-refined #tasksTable tbody th {
  color: #334155 !important;
  border-bottom: 1px solid var(--law-table-border) !important;
  background-color: transparent !important;
}

body.page-refined .table tbody tr:nth-of-type(odd) > *,
body.page-refined .table.table-striped tbody tr:nth-of-type(odd) > *,
body.page-refined table.dataTable tbody tr:nth-of-type(odd) > *,
body.page-refined #tasksTable tbody tr:nth-of-type(odd) > * {
  background-color: var(--law-table-row-odd) !important;
}

body.page-refined .table tbody tr:nth-of-type(even) > *,
body.page-refined .table.table-striped tbody tr:nth-of-type(even) > *,
body.page-refined table.dataTable tbody tr:nth-of-type(even) > *,
body.page-refined #tasksTable tbody tr:nth-of-type(even) > * {
  background-color: var(--law-table-row-even) !important;
}

body.page-refined .table tbody tr:hover > *,
body.page-refined .table-hover tbody tr:hover > *,
body.page-refined table.dataTable tbody tr:hover > *,
body.page-refined #tasksTable tbody tr:hover > * {
  background-color: var(--law-table-row-hover) !important;
}

body.page-refined .table tbody tr,
body.page-refined table.dataTable tbody tr,
body.page-refined #tasksTable tbody tr {
  transition: background-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

body.page-refined .table tbody tr:hover,
body.page-refined table.dataTable tbody tr:hover,
body.page-refined #tasksTable tbody tr:hover {
  box-shadow: inset 4px 0 0 rgba(15, 118, 110, .55) !important;
}

/* Make Assign Tasks inherit the same table shell and avoid any special row palette. */
body.page-assign-tasks #tasksTable,
body.page-assign-tasks .table {
  --law-table-row: var(--law-table-row-odd) !important;
  --law-table-row-alt: var(--law-table-row-even) !important;
  --law-table-row-hover: rgba(15, 118, 110, .085) !important;
}

/* Uniform table action buttons across pages, including Assign Tasks. */
body.page-refined .table .btn-sm,
body.page-refined #tasksTable .btn-sm {
  border-radius: 10px !important;
  min-width: 36px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: none !important;
}

body.page-refined .table .btn-outline-primary,
body.page-refined #tasksTable .btn-outline-primary {
  color: var(--law-teal-700) !important;
  border-color: rgba(15, 118, 110, .42) !important;
  background: #ffffff !important;
}

body.page-refined .table .btn-outline-primary:hover,
body.page-refined .table .btn-outline-primary:focus,
body.page-refined #tasksTable .btn-outline-primary:hover,
body.page-refined #tasksTable .btn-outline-primary:focus {
  color: #ffffff !important;
  border-color: transparent !important;
  background: linear-gradient(135deg, var(--law-navy-900), var(--law-teal-700)) !important;
}

body.page-refined .table .btn-outline-warning,
body.page-refined #tasksTable .btn-outline-warning {
  color: #7c4a03 !important;
  border-color: rgba(180, 124, 31, .45) !important;
  background: #ffffff !important;
}

body.page-refined .table .btn-outline-warning:hover,
body.page-refined .table .btn-outline-warning:focus,
body.page-refined #tasksTable .btn-outline-warning:hover,
body.page-refined #tasksTable .btn-outline-warning:focus {
  color: #111827 !important;
  border-color: transparent !important;
  background: linear-gradient(135deg, #d6b55f, #b98922) !important;
}

body.page-refined .table .btn-outline-danger,
body.page-refined #tasksTable .btn-outline-danger {
  color: #991b1b !important;
  border-color: rgba(153, 27, 27, .38) !important;
  background: #ffffff !important;
}

body.page-refined .table .btn-outline-danger:hover,
body.page-refined .table .btn-outline-danger:focus,
body.page-refined #tasksTable .btn-outline-danger:hover,
body.page-refined #tasksTable .btn-outline-danger:focus {
  color: #ffffff !important;
  border-color: transparent !important;
  background: #991b1b !important;
}

/* Assign Tasks priority/status badges using the same professional palette rhythm. */
body.page-assign-tasks #tasksTable .badge,
body.page-assign-tasks .task-priority-Low,
body.page-assign-tasks .task-priority-Medium,
body.page-assign-tasks .task-priority-High,
body.page-assign-tasks .task-priority-Urgent,
body.page-assign-tasks .task-status-Not-Started,
body.page-assign-tasks .task-status-Pending,
body.page-assign-tasks .task-status-In-Progress,
body.page-assign-tasks .task-status-On-Hold,
body.page-assign-tasks .task-status-Completed,
body.page-assign-tasks .task-status-Overdue,
body.page-assign-tasks .task-status-Cancelled,
body.page-assign-tasks .task-status-Canceled {
  border-radius: 999px !important;
  padding: .42rem .72rem !important;
  min-width: 86px;
  text-align: center;
  font-weight: 850 !important;
  letter-spacing: .01em;
  border: 1px solid transparent !important;
  box-shadow: none !important;
}

body.page-assign-tasks .task-priority-Low,
body.page-assign-tasks .task-status-Not-Started,
body.page-assign-tasks .task-status-Pending,
body.page-assign-tasks .task-status-Cancelled,
body.page-assign-tasks .task-status-Canceled {
  background: #475569 !important;
  color: #ffffff !important;
}

body.page-assign-tasks .task-priority-Medium,
body.page-assign-tasks .task-status-In-Progress {
  background: linear-gradient(135deg, var(--law-navy-900), var(--law-teal-700)) !important;
  color: #ffffff !important;
}

body.page-assign-tasks .task-priority-High,
body.page-assign-tasks .task-status-On-Hold {
  background: #d6b55f !important;
  color: #111827 !important;
}

body.page-assign-tasks .task-priority-Urgent,
body.page-assign-tasks .task-status-Overdue {
  background: #991b1b !important;
  color: #ffffff !important;
}

body.page-assign-tasks .task-status-Completed {
  background: #166534 !important;
  color: #ffffff !important;
}

/* ------------------------------------------------------------------
   Paralegal/My Tasks visual alignment pass
   Purpose: the new paralegal task workspace must use the same restrained
   LawApp table, card, button, and badge language as the rest of the app.
   This is CSS-only and does not alter task functionality.
   ------------------------------------------------------------------ */
body.page-my-tasks {
  background: #f6f8fb;
  color: #334155;
}

body.page-my-tasks .custom-container,
body.page-my-tasks .page-shell {
  max-width: 100%;
}

body.page-my-tasks .page-header {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #ffffff 0%, #f7fafc 58%, rgba(15, 118, 110, .08) 100%) !important;
  border: 1px solid rgba(203, 213, 225, .8) !important;
  border-left: 5px solid var(--law-teal-700, #0f766e) !important;
  border-radius: 18px !important;
  padding: 1.25rem 1.35rem !important;
  margin-bottom: 1.35rem !important;
  box-shadow: 0 14px 34px rgba(15, 23, 42, .08) !important;
}

body.page-my-tasks .page-header::after {
  content: "";
  position: absolute;
  right: -38px;
  top: -52px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(214, 181, 95, .22), rgba(214, 181, 95, 0) 68%);
  pointer-events: none;
}

body.page-my-tasks .page-title {
  color: var(--law-navy-900, #0f172a) !important;
  font-weight: 850 !important;
  letter-spacing: -.025em;
}

body.page-my-tasks .text-muted,
body.page-my-tasks .form-text,
body.page-my-tasks .panel-subtitle,
body.page-my-tasks small.text-muted {
  color: #64748b !important;
}

body.page-my-tasks .card,
body.page-my-tasks .table-shell,
body.page-my-tasks .filter-section {
  border: 1px solid rgba(203, 213, 225, .82) !important;
  border-radius: 18px !important;
  background: #ffffff !important;
  box-shadow: 0 14px 34px rgba(15, 23, 42, .075) !important;
  overflow: hidden;
}

body.page-my-tasks .card-header {
  background: linear-gradient(180deg, #ffffff, #f8fafc) !important;
  border-bottom: 1px solid rgba(203, 213, 225, .82) !important;
  color: #0f172a !important;
  padding: 1rem 1.15rem !important;
}

body.page-my-tasks .card-header h5,
body.page-my-tasks .section-card-title,
body.page-my-tasks .card-title {
  color: #0f172a !important;
  font-weight: 850 !important;
  letter-spacing: -.01em;
  margin-bottom: 0;
}

body.page-my-tasks .form-label,
body.page-my-tasks table th {
  color: #0f172a !important;
  font-weight: 800 !important;
}

body.page-my-tasks .form-control,
body.page-my-tasks .form-select,
body.page-my-tasks textarea.form-control {
  color: #0f172a !important;
  background-color: #ffffff !important;
  border: 1px solid rgba(148, 163, 184, .78) !important;
  border-radius: 12px !important;
  box-shadow: none !important;
}

body.page-my-tasks .form-control:focus,
body.page-my-tasks .form-select:focus,
body.page-my-tasks textarea.form-control:focus {
  border-color: var(--law-teal-700, #0f766e) !important;
  box-shadow: 0 0 0 .2rem rgba(15, 118, 110, .16) !important;
}

body.page-my-tasks .btn-primary,
body.page-my-tasks .btn-success {
  color: #ffffff !important;
  border-color: transparent !important;
  background: linear-gradient(135deg, var(--law-navy-900, #0f172a), var(--law-teal-700, #0f766e)) !important;
  box-shadow: 0 10px 22px rgba(15, 118, 110, .18) !important;
}

body.page-my-tasks .btn-primary:hover,
body.page-my-tasks .btn-primary:focus,
body.page-my-tasks .btn-success:hover,
body.page-my-tasks .btn-success:focus {
  filter: brightness(.98);
  transform: translateY(-1px);
}

body.page-my-tasks .btn-outline-primary {
  color: var(--law-teal-700, #0f766e) !important;
  border-color: rgba(15, 118, 110, .45) !important;
  background: #ffffff !important;
}

body.page-my-tasks .btn-outline-primary:hover,
body.page-my-tasks .btn-outline-primary:focus {
  color: #ffffff !important;
  border-color: transparent !important;
  background: linear-gradient(135deg, var(--law-navy-900, #0f172a), var(--law-teal-700, #0f766e)) !important;
}

body.page-my-tasks .btn-secondary,
body.page-my-tasks .btn-outline-secondary {
  color: #334155 !important;
  border-color: rgba(100, 116, 139, .38) !important;
  background: #ffffff !important;
}

body.page-my-tasks .btn-secondary:hover,
body.page-my-tasks .btn-secondary:focus,
body.page-my-tasks .btn-outline-secondary:hover,
body.page-my-tasks .btn-outline-secondary:focus {
  color: #ffffff !important;
  border-color: #475569 !important;
  background: #475569 !important;
}

/* Use exactly the same neutral table language as the rest of LawApp. */
body.page-my-tasks .table,
body.page-my-tasks .dataTable {
  --law-table-head-top: #eef3f8;
  --law-table-head-bottom: #e6edf5;
  --law-table-row-odd: #ffffff;
  --law-table-row-even: #f8fafc;
  --law-table-row-hover: rgba(15, 118, 110, .085);
  --law-table-border: rgba(203, 213, 225, .78);
  border-collapse: separate !important;
  border-spacing: 0 !important;
  color: #334155 !important;
}

body.page-my-tasks .table-responsive {
  background: #ffffff !important;
  border: 1px solid rgba(203, 213, 225, .78) !important;
  border-radius: 16px !important;
  overflow: auto !important;
}

body.page-my-tasks .table thead th,
body.page-my-tasks table.dataTable thead th {
  background: linear-gradient(180deg, var(--law-table-head-top), var(--law-table-head-bottom)) !important;
  color: #0f172a !important;
  border-bottom: 1px solid rgba(15, 23, 42, .18) !important;
  font-weight: 850 !important;
  letter-spacing: .01em;
  white-space: nowrap;
}

body.page-my-tasks .table tbody td,
body.page-my-tasks .table tbody th,
body.page-my-tasks table.dataTable tbody td,
body.page-my-tasks table.dataTable tbody th {
  color: #334155 !important;
  border-bottom: 1px solid var(--law-table-border) !important;
  background-color: transparent !important;
}

body.page-my-tasks .table tbody tr:nth-of-type(odd) > *,
body.page-my-tasks table.dataTable tbody tr:nth-of-type(odd) > * {
  background-color: var(--law-table-row-odd) !important;
}

body.page-my-tasks .table tbody tr:nth-of-type(even) > *,
body.page-my-tasks table.dataTable tbody tr:nth-of-type(even) > * {
  background-color: var(--law-table-row-even) !important;
}

body.page-my-tasks .table tbody tr:hover > *,
body.page-my-tasks .table-hover tbody tr:hover > *,
body.page-my-tasks table.dataTable tbody tr:hover > * {
  background-color: var(--law-table-row-hover) !important;
}

body.page-my-tasks .table tbody tr:hover,
body.page-my-tasks table.dataTable tbody tr:hover {
  box-shadow: inset 4px 0 0 rgba(15, 118, 110, .55) !important;
}

/* Override bright Bootstrap task badges with the LawApp palette for contrast. */
body.page-refined .badge.text-bg-primary,
body.page-refined .badge.bg-primary,
body.page-my-tasks .badge.text-bg-primary,
body.page-my-tasks .badge.bg-primary {
  color: #ffffff !important;
  background: linear-gradient(135deg, var(--law-navy-900, #0f172a), var(--law-teal-700, #0f766e)) !important;
}

body.page-refined .badge.text-bg-info,
body.page-refined .badge.bg-info,
body.page-my-tasks .badge.text-bg-info,
body.page-my-tasks .badge.bg-info {
  color: #ffffff !important;
  background: #0f766e !important;
}

body.page-refined .badge.text-bg-warning,
body.page-refined .badge.bg-warning,
body.page-my-tasks .badge.text-bg-warning,
body.page-my-tasks .badge.bg-warning {
  color: #111827 !important;
  background: #d6b55f !important;
}

body.page-refined .badge.text-bg-secondary,
body.page-refined .badge.bg-secondary,
body.page-my-tasks .badge.text-bg-secondary,
body.page-my-tasks .badge.bg-secondary {
  color: #ffffff !important;
  background: #475569 !important;
}

body.page-refined .badge.text-bg-success,
body.page-refined .badge.bg-success,
body.page-my-tasks .badge.text-bg-success,
body.page-my-tasks .badge.bg-success {
  color: #ffffff !important;
  background: #166534 !important;
}

body.page-refined .badge.text-bg-danger,
body.page-refined .badge.bg-danger,
body.page-my-tasks .badge.text-bg-danger,
body.page-my-tasks .badge.bg-danger {
  color: #ffffff !important;
  background: #991b1b !important;
}

body.page-my-tasks .table .badge,
body.page-my-tasks .card-header .badge,
body.page-my-tasks .card-body .badge {
  border-radius: 999px !important;
  padding: .42rem .72rem !important;
  font-weight: 850 !important;
  letter-spacing: .01em;
  border: 1px solid transparent !important;
  box-shadow: none !important;
}

body.page-my-tasks .stat-card {
  border: 1px solid rgba(203, 213, 225, .82) !important;
  border-radius: 18px !important;
  background: #ffffff !important;
  box-shadow: 0 14px 30px rgba(15, 23, 42, .07) !important;
}

body.page-my-tasks .stat-card-label {
  color: #64748b !important;
  font-weight: 800 !important;
}

body.page-my-tasks .stat-card-value {
  color: #0f172a !important;
  font-weight: 850 !important;
}

/* Task details progress notes: keep the useful chat layout but align colors. */
body.page-paralegal-task-details .progress-chat {
  background: #f8fafc !important;
  padding: 1rem !important;
  max-height: 540px;
  overflow-y: auto;
}

body.page-paralegal-task-details .chat-message {
  border: 1px solid rgba(203, 213, 225, .82) !important;
  border-radius: 16px !important;
  background: #ffffff !important;
  color: #334155 !important;
  box-shadow: 0 10px 22px rgba(15, 23, 42, .055) !important;
  margin: 0 0 .85rem 0 !important;
  padding: .9rem 1rem !important;
}

body.page-paralegal-task-details .chat-message.admin,
body.page-paralegal-task-details .chat-message.lawyer,
body.page-paralegal-task-details .chat-message.assigned-by {
  border-left: 4px solid var(--law-teal-700, #0f766e) !important;
}

body.page-paralegal-task-details .chat-message.staff {
  border-left: 4px solid #d6b55f !important;
}

body.page-paralegal-task-details .chat-header {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  color: #64748b !important;
  font-size: .82rem;
  margin-bottom: .35rem;
}

body.page-paralegal-task-details .chat-sender {
  color: #0f172a !important;
  font-weight: 850 !important;
}

body.page-paralegal-task-details .chat-content,
body.page-paralegal-task-details .status-update {
  color: #334155 !important;
}

@media (max-width: 767.98px) {
  body.page-my-tasks .page-header {
    padding: 1rem !important;
  }
  body.page-my-tasks .stat-grid {
    grid-template-columns: 1fr !important;
  }
  body.page-my-tasks .card-header {
    padding: .9rem 1rem !important;
  }
}

/* Permission management */
.page-permissions .permission-card {
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}
.page-permissions .permission-card .card-header {
    background: linear-gradient(135deg, #0f172a, #164e63);
    color: #fff;
}
.page-permissions .permission-check {
    padding: .65rem .75rem .65rem 2.15rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: .75rem;
    background: #fff;
}
.sticky-action-bar {
    position: sticky;
    bottom: 0;
    z-index: 20;
    background: rgba(248, 250, 252, .94);
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    padding: 1rem;
    backdrop-filter: blur(8px);
}


/* Company settings and configurable branding */
.brand-logo-wrap {
    overflow: hidden;
    background: rgba(255, 255, 255, 0.95) !important;
}

.brand-logo-wrap img,
.login-logo-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.login-logo-mark {
    overflow: hidden;
    background: rgba(255, 255, 255, 0.95) !important;
    padding: 4px;
}

.company-logo-preview img {
    max-height: 160px;
    max-width: 100%;
    object-fit: contain;
    background: #fff;
    padding: 12px;
    border: 1px solid rgba(15, 23, 42, 0.12);
}

.empty-logo-preview {
    min-height: 160px;
    border: 1px dashed rgba(15, 23, 42, 0.25);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #475569;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.035), rgba(20, 184, 166, 0.055));
}

.empty-logo-preview i {
    font-size: 2rem;
    color: #0f766e;
}

/* ------------------------------------------------------------------
   Login logo border/placeholder cleanup
   Shows the uploaded company logo by itself on the login page, without
   the white/gold placeholder tile, padding, border, or shadow.
   ------------------------------------------------------------------ */
body.login-page .login-brand-mark.login-logo-mark {
  width: auto !important;
  min-width: 0 !important;
  height: 52px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible !important;
}

body.login-page .login-brand-mark.login-logo-mark img {
  width: auto !important;
  height: 52px !important;
  max-width: 180px !important;
  max-height: 52px !important;
  object-fit: contain !important;
  display: block !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

@media (max-height: 640px) and (min-width: 992px) {
  body.login-page .login-brand-mark.login-logo-mark {
    height: 44px !important;
  }

  body.login-page .login-brand-mark.login-logo-mark img {
    height: 44px !important;
    max-height: 44px !important;
  }
}

@media (max-width: 575.98px) {
  body.login-page .login-brand-mark.login-logo-mark {
    height: 42px !important;
  }

  body.login-page .login-brand-mark.login-logo-mark img {
    height: 42px !important;
    max-height: 42px !important;
    max-width: 145px !important;
  }
}


/* ------------------------------------------------------------------
   Lawyer Teams page polish
   Aligns the new lawyer/paralegal assignment screen with User Management,
   Assign Tasks, and the rest of the refined application pages.
   ------------------------------------------------------------------ */
body.page-lawyer-teams .page-header {
  border: 1px solid rgba(203, 213, 225, .88) !important;
  border-radius: 20px !important;
  box-shadow: 0 18px 42px rgba(15, 23, 42, .07) !important;
}

body.page-lawyer-teams .page-title {
  color: #0f172a !important;
  font-weight: 850 !important;
}

body.page-lawyer-teams .page-header .text-muted,
body.page-lawyer-teams .modern-card-header .text-muted,
body.page-lawyer-teams .form-text,
body.page-lawyer-teams .table .text-muted {
  color: #475569 !important;
}

body.page-lawyer-teams .modern-card {
  border: 1px solid rgba(203, 213, 225, .96) !important;
  border-radius: 18px !important;
  overflow: hidden !important;
  box-shadow: 0 18px 42px rgba(15, 23, 42, .075) !important;
}

body.page-lawyer-teams .modern-card-header {
  background:
    linear-gradient(90deg, rgba(15,23,42,.04), transparent 30%),
    linear-gradient(180deg, #fff, #f8fafc) !important;
  border-bottom: 1px solid rgba(203, 213, 225, .9) !important;
  padding: 1rem 1.15rem !important;
}

body.page-lawyer-teams .modern-card-header h5 {
  color: #0f172a !important;
  font-weight: 850 !important;
}

body.page-lawyer-teams #lawyerTeamsTable {
  color: #334155 !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
}

body.page-lawyer-teams #lawyerTeamsTable thead th {
  background: linear-gradient(180deg, #eef3f8, #e6edf5) !important;
  color: #0f172a !important;
  border-bottom: 1px solid rgba(15,23,42,.18) !important;
  font-weight: 850 !important;
  letter-spacing: .01em !important;
  vertical-align: middle !important;
}

body.page-lawyer-teams #lawyerTeamsTable tbody tr > * {
  color: #334155 !important;
  border-bottom: 1px solid rgba(226, 232, 240, .96) !important;
  vertical-align: middle !important;
}

body.page-lawyer-teams #lawyerTeamsTable tbody tr:nth-of-type(odd) > * {
  background-color: var(--law-table-row-odd, #ffffff) !important;
}

body.page-lawyer-teams #lawyerTeamsTable tbody tr:nth-of-type(even) > * {
  background-color: var(--law-table-row-even, #f8fafc) !important;
}

body.page-lawyer-teams #lawyerTeamsTable tbody tr:hover > * {
  background-color: var(--law-table-row-hover, rgba(15, 118, 110, .085)) !important;
}

body.page-lawyer-teams #lawyerTeamsTable tbody tr:hover {
  box-shadow: inset 4px 0 0 rgba(15, 118, 110, .55) !important;
}

body.page-lawyer-teams .lawyer-team-form .form-select,
body.page-lawyer-teams .lawyer-paralegal-select {
  min-height: 136px !important;
  border: 1px solid rgba(148, 163, 184, .65) !important;
  border-radius: 14px !important;
  background-color: #ffffff !important;
  color: #0f172a !important;
  font-weight: 650 !important;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, .035) !important;
}

body.page-lawyer-teams .lawyer-team-form .form-select:focus,
body.page-lawyer-teams .lawyer-paralegal-select:focus {
  border-color: var(--law-teal-700, #0f766e) !important;
  box-shadow: 0 0 0 .2rem rgba(15, 118, 110, .14) !important;
}

body.page-lawyer-teams .lawyer-paralegal-select option {
  padding: .38rem .45rem !important;
  color: #0f172a !important;
}

body.page-lawyer-teams .lawyer-paralegal-select option:checked {
  background: linear-gradient(135deg, var(--law-teal-700, #0f766e), #164e63) !important;
  color: #ffffff !important;
}

body.page-lawyer-teams .btn-primary,
body.page-lawyer-teams .btn-outline-secondary:hover,
body.page-lawyer-teams .btn-outline-secondary:focus {
  background: linear-gradient(135deg, #0f172a, #164e63) !important;
  border-color: #164e63 !important;
  color: #ffffff !important;
}

body.page-lawyer-teams .btn-outline-secondary {
  color: #334155 !important;
  border-color: rgba(51, 65, 85, .36) !important;
  background: rgba(255, 255, 255, .92) !important;
  font-weight: 800 !important;
}

body.page-lawyer-teams .btn-sm {
  border-radius: 10px !important;
  font-weight: 850 !important;
  min-height: 34px !important;
}

body.page-lawyer-teams .alert {
  border-radius: 14px !important;
  font-weight: 700 !important;
}

@media (max-width: 767.98px) {
  body.page-lawyer-teams .page-header {
    padding: 1rem !important;
  }

  body.page-lawyer-teams #lawyerTeamsTable td:last-child {
    text-align: left !important;
  }

  body.page-lawyer-teams #lawyerTeamsTable .btn {
    width: 100% !important;
  }
}


/* Lawyer-team scoped workspace fixes */
.hero-panel::after {
  pointer-events: none !important;
  z-index: 0 !important;
}
.hero-panel > * {
  position: relative;
  z-index: 1;
}
.hero-actions,
.hero-actions .btn {
  position: relative;
  z-index: 2;
}
