/*
  Atease v3 – Core Style Deck
  Theme tokens, element defaults, Bootstrap theming, and key components.
  Scope: light, clean, modern surfaces with sharp contrast and soft shadows.
*/

/* Tokens */
:root {
  /* Typography */
  --font-sans: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  /* Palette */
  --brand: #2f5fff;
  --brand-600: #2349cc;
  --brand-700: #1a399f;
  --text: #202123;
  --muted: #6e6e80;
  --bg: #f6f6f6;
  --surface: #ffffff;
  --surface-2: #f7f7f9;
  --border: #e4e5eb;
  --shadow: 0 6px 18px rgba(0,0,0,.06);

  /* Semantic */
  --success: #1f8a5a;
  --danger: #d14343;
  --warning: #cc8b18;
  --info: #2e7ab8;

  /* Radii & spacing */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;

  /* Focus */
  --focus-ring: 0 0 0 3px color-mix(in srgb, var(--brand) 30%, transparent);

  /* Button neutrals */
  --btn-bg: #2c3038;
  --btn-bg-hover: #353a43;
  --btn-border: #434955;
  --btn-text: #f2f3f7;
  --btn-shadow: 0 3px 10px rgba(0,0,0,0.18);

  /* Layout dims */
  --nav-h: 56px;
  --aside-w: 222px;
}

/* Reboot / Base */
html { -webkit-text-size-adjust: 100%; touch-action: manipulation; }
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  touch-action: manipulation;
}
img, svg, video, canvas, audio, iframe { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: color-mix(in srgb, var(--brand) 92%, black 0%); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Document elements */
main { display: block; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1rem 0; }
pre, code, kbd, samp { font-family: var(--font-mono); font-size: 0.95em; }
pre { background: var(--surface-2); padding: var(--space-4); border-radius: var(--radius-sm); overflow:auto; }
code { background: var(--surface-2); padding: 2px 6px; border-radius: 6px; }
blockquote { border-left: 3px solid var(--border); margin: 1rem 0; padding: .5rem 1rem; color: var(--muted); background: var(--surface-2); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

/* Headings */
h1, h2, h3, h4, h5, h6 {
  margin: .2em 0 .4em;
  font-weight: 100;
  line-height: 1.25;
}
h1 { font-size: clamp(2rem, 2.4vw, 2.4rem); }
h2 { font-size: clamp(1.6rem, 2vw, 2rem); }
h3 { font-size: clamp(1.4rem, 1.6vw, 1.6rem); }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.05rem; }
h6 { font-size: .95rem; color: var(--muted); }

p { margin: 0 0 .8rem; }
small, .small { font-size: .875em; color: var(--muted); }

/* Layout chrome used by app layout */
.navbar {
  display: flex; align-items: center; justify-content: space-between;
  height: var(--nav-h); padding: 0 16px; background: var(--surface); position: sticky; top: 0; z-index: 1000;
  border-bottom: 1px solid var(--border); box-shadow: var(--shadow);
}
.navbar .navbar-brand { display:flex; align-items:center; gap: 6px; }
.navbar .navbar-brand .desktop-logo { height: 22px; width: auto; }
.navbar .nav-link { color: var(--muted); font-size: 14px; font-weight: 400; }
.navbar .nav-link.active { color: var(--text); font-weight: 600; }
.navbar .notification-link { position: relative; }
.navbar .notification-badge {
  position: absolute;
  top: 0px;
  right: 0px;
  background: #f04438;
  color: #fff;
  font-size: 11px;
  min-width: 18px;
  padding: 2px 6px;
  border-radius: 999px;
}
.navbar .nav-item { position: relative; }

.menu-btn { background: none; border: 0; font-size: 24px; cursor: pointer; position: relative; }
/* Hide the menu toggle button on desktop */
@media (min-width: 992px) {
  .menu-btn { display: none; }
}
/* Only show the burger icon on mobile/tablet */
.mobile-burger { display: none; }
@media (max-width: 991px) {
  .mobile-burger { display: block; }
}

.main {
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 20px; margin-top: 10px; min-height: calc(100dvh - var(--nav-h));
  box-shadow: var(--shadow);
}

.main.dashboard-ambience {
  background: linear-gradient(120deg, #ffffff, #f5f7ff, #ffffff);
  background-size: 200% 200%;
  animation: dashboardGradient 30s ease infinite;
}

@keyframes dashboardGradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@media (prefers-reduced-motion: reduce) {
  .main.dashboard-ambience {
    animation: none;
    background-position: 0% 50%;
  }
}

/* Let dropdown menus in responsive tables fully escape vertically while preserving horizontal scroll */
.table-responsive { overflow-x: auto; overflow-y: visible; position: relative; }

@media (max-width: 991px) {
  .menu-btn { display: block; position: absolute; right: 15px; top: 50%; transform: translateY(-50%); }
  .navbar-nav { display: none; }
  /* Ensure 10px gap under nav and 10px from bottom on mobile */
  .main { width: 100%; margin-left: 0; margin-top: 10px; min-height: calc(100dvh - var(--nav-h)); }
}

@media (max-width: 576px) {
  body:not(.messages-view) .main {
    padding: 0 1.3rem !important;
    margin-top: 0 !important;
    min-height: 95vh;
    border: 0 !important;
    border-radius: 0 !important;
  }

  .container,
  .container-fluid,
  .container-lg,
  .container-md,
  .container-sm,
  .container-xl,
  .container-xxl {
    --bs-gutter-x: 0px !important;
  }

}

/* Sidebar items */

/* Accordion in sidebar */
.accordion-button { background: transparent; padding: 10px 8px; border: 0; color: #6b6f7b; font-weight: 600; font-size: 12px; box-shadow: none; text-transform: none; letter-spacing: .2px; }
.accordion-button:hover { background: transparent; color: #525762; }
.accordion-button.is-active { color: #202123; }
/* Ensure no bottom border/line under headers */
.accordion-header { border: 0 !important; margin-bottom: 0; }
.accordion-item, .accordion-item .accordion-button, .accordion-button:focus { border: 0 !important; box-shadow: none !important; }
/* Remove focus ring/highlight */
.accordion-button:focus, .accordion-button:focus-visible { box-shadow: none !important; outline: none !important; }
.accordion-item { border: 0; border-radius: 8px; }
.accordion-item:hover { background: transparent; border-radius: 8px; }
.accordion-button { color: #474a57; }
.accordion-button:not(.collapsed) { background: transparent; color:#6b6f7b; }
.accordion-collapse.show { background: transparent; }
.accordion-body { position: relative; padding: 6px 8px 12px 14px; }
.accordion-body::before { content: none; }
/* Remove default chevron arrows */
.accordion-button::after { background-image: none !important; content: none !important; transform: none !important; }

/* Right dropdown (user) */
.user-dropdown { min-width: 240px; }
.user-dropdown .dropdown-item { padding: 6px 10px; font-size: 13px; }
.user-info { border-bottom: 1px solid var(--border); margin-bottom: 8px; padding-bottom: 8px; }
.svg-dark { stroke: #000 !important; stroke-width: 1.6px; height: 26px; width: 26px; }
.user-avatar { height: 30px; width: 30px; border-radius: 50%; border: 1px solid #d9d9e3; object-fit: cover; }
.profile-dropdown { position: relative; top: 0px; margin-left: 10px; }

/* Notification menu */
.notification-menu { display: none; position: absolute; right: 0; top: calc(100% + 8px); }
.notification-menu .dropdown-menu {
  display: block;
  position: static;
  min-width: 320px;
  max-height: 400px;
  overflow-y: auto;
}

.notification-menu .dropdown-item { white-space: normal; font-size: 13px; }

/* Generic dropdown styling (action menus) */
.dropdown { position: relative; }
.dropdown-menu {
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: 10px;
  padding: 6px 0;
  z-index: 9999 !important; /* ensure above tables and sticky elements */
  background: #fff;
  min-width: 180px;
}
.action-cell .dropdown-menu { z-index: 10000 !important; }
.dropdown-item { font-size: 14px; color: #202123; padding: 8px 12px; }
.dropdown-item:hover, .dropdown-item:focus { background: #f5f6fa; color: #111827; }
.dropdown-divider { margin: 6px 0; }

/* Icon-only dropdown toggles (e.g., settings): hide default caret */
.dropdown-toggle.no-caret::after { content: none !important; display: none !important; }
/* Modern selector to auto-detect icon-only buttons */
.dropdown-toggle:has(> svg)::after { content: none !important; display: none !important; }

/* Badges for environment */
.wowpa-badge { display:inline-flex; align-items:center; justify-content:center; padding: 3px 8px; font-size: 10px; border-radius: 20px; text-transform: uppercase; border:1px solid currentColor; background: transparent; }
.wowpa-testing { color:#22b383; }
.wowpa-beta { color:#ffcc00; }

/* Fallbacks for legacy utility classes (Material Dashboard-like) */
.avatar { display:inline-block; width: 36px; height: 36px; border-radius: 50%; overflow:hidden; }
.avatar img { width:100%; height:100%; object-fit: cover; }
.avatar-sm { width: 28px; height: 28px; }
.avatar-md { width: 48px; height: 48px; }
.avatar-lg { width: 64px; height: 64px; }
.avatar-xl { width: 96px; height: 96px; }

.badge-sm { font-size: .65rem; padding: .25em .4em; }
.border-radius-sm { border-radius: var(--radius-sm) !important; }
.border-radius-md { border-radius: var(--radius-md) !important; }
.border-radius-lg { border-radius: var(--radius-lg) !important; }
.shadow-blur { box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.blur { backdrop-filter: blur(6px); }
.max-height-vh-70 { max-height: 70vh; }

/* Provide color backgrounds for gradient helpers */
.bg-gradient-dark { background: #343a40 !important; color: #fff !important; }
.bg-gradient-secondary { background: #6c757d !important; color: #fff !important; }
.bg-gradient-primary { background: var(--brand) !important; color: #fff !important; }
.bg-gradient-success { background: var(--success) !important; color: #fff !important; }
.bg-gradient-danger { background: var(--danger) !important; color: #fff !important; }
.bg-gradient-warning { background: var(--warning) !important; color: #111 !important; }
.bg-gradient-info { background: var(--info) !important; color: #fff !important; }

/* Typographic utilities seen across views */
.text-xs { font-size: .75rem !important; }
.text-sm { font-size: .875rem !important; }
.text-md { font-size: 1rem !important; }
.text-lg { font-size: 1.125rem !important; }
.font-weight-normal { font-weight: 400 !important; }
.font-weight-bold { font-weight: 700 !important; }
.font-weight-bolder { font-weight: 800 !important; }

/* Tables — refreshed workspace style */
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  border: 1px solid #e4e7ec;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 25px 55px rgba(15, 23, 42, 0.08);
  font-size: clamp(.88rem, .95vw, .98rem);
  color: #111827;
}
.table caption { caption-side: top; padding: 0 24px 16px; font-weight: 600; color: #475467; }
.table thead th {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: .68rem;
  font-weight: 600;
  color: #667085;
  background: #f7f8fb;
  border: 0;
  padding: 18px 20px;
}
.table thead th:first-child { text-align: left; }
.table tbody tr { background: #fff; transition: background .18s ease, transform .18s ease; }
.table tbody tr + tr td,
.table tbody tr + tr th { border-top: 1px solid #eceff5; }
.table tbody tr:hover { background: #f9fafc; }
.table tbody td, .table tbody th {
  padding: 18px 20px;
  vertical-align: middle;
  border: 0;
}
.table tbody td:first-child,
.table thead th:first-child { padding-left: 28px; }
.table tbody td:last-child,
.table thead th:last-child { padding-right: 28px; }
.table .table-label { font-size: .82rem; color: #475467; text-transform: uppercase; letter-spacing: .12em; }
.table .table-subtext { font-size: .8rem; color: #98a2b3; display: block; }
.table .status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 600;
  background: rgba(14,165,233,.12);
  color: #0ea5e9;
}
.table .status-pill[data-variant="success"] { background: rgba(16,185,129,.16); color:#059669; }
.table .status-pill[data-variant="warning"] { background: rgba(245,158,11,.15); color:#b45309; }
.table .status-pill[data-variant="danger"] { background: rgba(248,113,113,.18); color:#b91c1c; }
.table thead th:first-child { border-top-left-radius: 24px; }
.table thead th:last-child { border-top-right-radius: 24px; }
.table tbody tr:last-child td:first-child { border-bottom-left-radius: 24px; }
.table tbody tr:last-child td:last-child { border-bottom-right-radius: 24px; }
.table-responsive { padding: 0; }
.table-responsive .table { margin-bottom: 0; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow); }
.card-header, .card-footer { background: var(--surface-2); border-color: var(--border); }

/* Forms */
.form-label { font-weight: 500; color: var(--muted); margin-bottom: .35rem; }
.form-control, .form-select, textarea {
  background: #fff; color: var(--text); border: 1px solid #cfd2d9; border-radius: 10px; padding: 10px 12px; box-shadow: none;
}
.form-control:focus, .form-select:focus, textarea:focus, input:focus { outline: none; border-color: #9aa1b2; box-shadow: var(--focus-ring); }
.form-text { color: var(--muted); }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-range::-webkit-slider-thumb { background: var(--brand); }
.form-floating>.form-control:focus~label { color: var(--brand-700); }
.is-valid, .form-control.is-valid, .form-select.is-valid { border-color: var(--success); }
.is-invalid, .form-control.is-invalid, .form-select.is-invalid { border-color: var(--danger); }
.invalid-feedback, .valid-feedback { font-size: .875rem; }

/* Buttons (migrated from buttons.css) */
.atease-btn,
.btn.atease-btn {
  --bg: var(--btn-bg);
  --bg-hover: var(--btn-bg-hover);
  --border: var(--btn-border);
  --text: var(--btn-text);
  --shadow: var(--btn-shadow);

  appearance: none;
  display: inline-flex; align-items: center; justify-content: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-weight: 600;
  line-height: 1.2;
  transition: background .18s ease, border-color .18s ease, box-shadow .18s ease, transform .08s ease;
  text-decoration: none;
  box-shadow: var(--shadow);
}
.atease-btn:hover, .btn.atease-btn:hover { background: var(--bg-hover); }
.atease-btn:active, .btn.atease-btn:active { transform: translateY(1px); }
.atease-btn:focus-visible, .btn.atease-btn:focus-visible { outline: 0; box-shadow: var(--focus-ring); }

/* Variants */
.atease-btn--primary, .btn.atease-btn--primary {
  --bg: linear-gradient(180deg, #1b2030 0%, #171b27 100%);
  --bg-hover: linear-gradient(180deg, #22283a 0%, #1b2030 100%);
  --border: #2a3140;
}
.atease-btn--accent, .btn.atease-btn--accent {
  --bg: linear-gradient(180deg, var(--brand) 0%, var(--brand-600) 100%);
  --bg-hover: linear-gradient(180deg, color-mix(in srgb, var(--brand) 92%, black 8%) 0%, var(--brand-600) 100%);
  --border: transparent;
}
.atease-btn--secondary, .btn.atease-btn--secondary { --bg: #242932; --bg-hover: #2b303a; --border: #3a4252; }
.atease-btn--success, .btn.atease-btn--success { --bg: #1c2a26; --bg-hover: #22322d; --border: #2f4f44; color: #c7f5df; }
.atease-btn--danger, .btn.atease-btn--danger { --bg: #d14343; --bg-hover: #b83a3a; --border: #a23333; color: #fff; }
.atease-btn--ghost, .btn.atease-btn--ghost {
  --bg: #f7f8fb;
  --bg-hover: #eef0f6;
  --border: #cfd2d9;
  box-shadow: none;
  color: #111827;
}

@media (max-width: 767.98px) {
  .atease-btn,
  .btn.atease-btn {
    --bg: var(--btn-bg);
    --bg-hover: var(--btn-bg-hover);
    --border: var(--btn-border);
    --text: var(--btn-text);
    --shadow: var(--btn-shadow);

    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0;
    border-radius: 22px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-weight: 600;
    line-height: 1.2;
    transition: background .18s ease, border-color .18s ease, box-shadow .18s ease, transform .08s ease;
    text-decoration: none;
    box-shadow: var(--shadow);
  }

  .mobile-create-icon svg {
    width: 30px;
    height: 30px;
  }
}

/* Sizes */
.atease-btn--sm, .btn.atease-btn--sm { padding: 7px 12px; border-radius: 10px; font-size: 13px; }
.atease-btn--lg, .btn.atease-btn--lg { padding: 13px 18px; border-radius: 14px; font-size: 16px; }
.atease-btn__icon { width: 18px; height: 18px; display: inline-block; }
.atease-btn__icon svg { width: 18px; height: 18px; }
.atease-btn--arrow .atease-btn__icon { transition: transform .18s ease; }
.atease-btn--arrow:hover .atease-btn__icon { transform: translateX(2px); }
.atease-btn-group { display: inline-flex; gap: 8px; }

/* Bootstrap buttons baseline (for pages still using .btn) */
.btn { border-radius: 12px; font-weight: 600; padding: 10px 16px; }
.btn-primary { background: #242932; border-color: #3a4252; color: #fff; }
.btn-primary:hover { background: #2b303a; border-color: #444c5e; color: #fff; }
.btn-outline-primary { color: #3C3C43; border-color: #cfd2d9; background: #fff; }
.btn-outline-primary:hover { background: #f5f6fa; border-color: #cfd2d9; color: #111; }
.btn-outline-secondary { color: #3C3C43; border-color: #cfd2d9; background: #fff; }
.btn-outline-secondary:hover { background: #f5f6fa; border-color: #cfd2d9; color: #111; }
.btn-success { background: var(--success); border-color: var(--success); }
.btn-danger { background: var(--danger); border-color: var(--danger); }
.btn-warning { background: var(--warning); border-color: var(--warning); color: #111; }
.btn-info { background: var(--info); border-color: var(--info); }
/* neutralize bootstrap gradient helper classes */
[class^="bg-gradient-"], [class*=" bg-gradient-"] { background-image: none !important; }

/* Alerts, Badges */
.alert { border-radius: var(--radius-sm); border: 1px solid var(--border); }
.alert-success { background: #e9fbf1; color: #165b3a; border-color: #b8e9cf; }
.alert-danger { background: #ffeef0; color: #7f1d1d; border-color: #f3c5c8; }
.alert-warning { background: #fff8e6; color: #7a4a00; border-color: #f0ddae; }
.alert-info { background: #e7f3ff; color: #104a75; border-color: #bad8f5; }
.badge { border-radius: 999px; padding: 4px 8px; font-weight: 600; }
.badge-primary { background: var(--brand); color:#fff; }
.badge-secondary { background: #6c757d; color:#fff; }
.badge-success { background: var(--success); color:#fff; }
.badge-danger { background: var(--danger); color:#fff; }
.badge-warning { background: var(--warning); color:#111; }
.badge-info { background: var(--info); color:#fff; }
.badge-dark { background: #343a40; color:#fff; }
.badge-light { background: #f8f9fa; color:#111; }

/* Navbar, Navs & Tabs */
.nav-tabs .nav-link { border: 0; color: var(--muted); }
.nav-tabs .nav-link.active { color: var(--text); border-bottom: 2px solid var(--brand); font-weight: 600; }
.nav-pills .nav-link { border-radius: 999px; }

/* Dropdowns */
.dropdown-menu { border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow); }
.dropdown-item { padding: 8px 12px; }
.dropdown-item:hover { background: var(--surface-2); color: #111; }
/* Neutralize Bootstrap blue active styles in dropdowns */
.dropdown-item.active, .dropdown-item:active { background: var(--surface-2) !important; color: #111 !important; }
.dropdown-item.active:hover { background: var(--surface-2) !important; color: #111 !important; }
/* Make status dropdown match search height */
.atease-table__controls .dropdown-toggle.atease-btn { height: 48px; padding: 0 12px; border-radius: 12px; }

/* Modal */
.modal-content { background: var(--surface); color: inherit; border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow); }
.modal-header, .modal-footer { background: var(--surface-2); border-color: var(--border); }
.btn-close { filter: none; }

/* Pagination */
.pagination .page-link { color: var(--text); border-radius: 10px; border-color: var(--border); }
.pagination .page-item.active .page-link { background: var(--btn-bg); border-color: var(--btn-bg); color: var(--btn-text); }

/* List group */
.list-group-item { border-color: var(--border); }
.list-group-item.active { background: var(--brand); border-color: var(--brand); }

/* Breadcrumb */
.breadcrumb { --bs-breadcrumb-divider-color: var(--muted); color: var(--muted); }
.breadcrumb .breadcrumb-item.active { color: var(--text); font-weight: 600; }

/* Utilities */
.shadow-sm { box-shadow: 0 2px 6px rgba(0,0,0,.06) !important; }
.shadow { box-shadow: var(--shadow) !important; }
.rounded { border-radius: var(--radius-sm) !important; }
.rounded-lg { border-radius: var(--radius-lg) !important; }
.bg-surface { background: var(--surface) !important; }
.bg-surface-2 { background: var(--surface-2) !important; }
.text-muted { color: var(--muted) !important; }
.border { border-color: var(--border) !important; }

/* Link buttons used in headings */
.btn-link-arrow, .btn-link-back { display: inline-flex; align-items: center; font-size: 15px; font-weight: 500; color: #3C3C43; text-decoration: none; }
.btn-link-arrow svg, .btn-link-back svg { width: 16px; height: 16px; }
.btn-link-arrow svg { margin-left: 3px; transform: rotate(-45deg); transition: transform .2s ease; }
.btn-link-arrow:hover svg { transform: rotate(-45deg) translateX(3px); }
.btn-link-back svg { margin-right: 3px; transform: rotate(135deg); transition: transform .2s ease; }
.btn-link-back:hover svg { transform: rotate(135deg) translateX(3px); }

/* Table control bar */
.atease-table__controls { display:flex; align-items:center; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.atease-table__controls .dropdown-toggle::after { margin-left: 8px; }
.atease-table__controls .dropdown-menu { min-width: 260px; }
/* Wider menu for advanced filters */
.filters-dropdown .dropdown-menu { min-width: 520px; }

/* Search field (inline, with icon left and button right inside) */
.atease-search { position: relative; display:flex; align-items:center; width: min(620px, 100%); border:1px solid #d9d9e3; border-radius: 12px; padding: 0 8px; background:#f9f9f9; height: 48px; transition: box-shadow .15s ease, border-color .15s ease, background .15s ease; }
/* Remove blue focus on input; add neutral ring on container */
.atease-search:focus-within { box-shadow: 0 0 0 3px rgba(17,24,39,0.10); border-color: #cfd2d9; background:#fff; }
.atease-search__icon { position:absolute; left: 12px; width: 18px; height: 18px; color: #8d90a0; pointer-events:none; }
.atease-search__input { width: 100%; height: 100%; border:0; outline:0; background:transparent; padding-left: 36px; padding-right: 96px; font-size: 14px; }
.atease-search__input:focus { outline: none; box-shadow: none; }
.atease-search__btn { position:absolute; right: 8px; top: 8px; height: 32px; padding: 0 12px; }

/* Table layout helpers */
.table-card { background:#fff; border-radius:28px; padding:24px; box-shadow:0 12px 40px rgba(15,23,42,.08); border:1px solid #e4e7ec; }
.table-row-actions { display:flex; align-items:center; justify-content:flex-end; gap:10px; }
.table-row-actions .btn { min-width:36px; height:36px; padding:0 12px; }
.table-compact tbody td, .table-compact tbody th { padding:12px 16px; }
.table-stacked td { display:flex; flex-direction:column; }
.table-stacked td span { margin-top:2px; }
.table thead .checkbox-cell, .table tbody .checkbox-cell { width:48px; text-align:center; }
.table-wrap { border-radius:28px; overflow:hidden; }

.table > :not(caption) > * > * { padding: 16px 18px; }
.table { margin-bottom: 0; }
.table-hover tbody tr:hover { background: #f9fafc; }

/* Standard list thumbnail (rectangular, slightly larger) */
.list-thumb {
  width: 80px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  display: block;
}
/* User avatar in tables */
.list-avatar {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  display: block;
}

/* Accessible helpers */
.is-hidden { display: none !important; }
.is-visually-hidden { position: absolute !important; width: 1px; height: 1px; padding:0; margin:-1px; overflow:hidden; clip: rect(0,0,0,0); white-space: nowrap; border:0; }

span.d-none.d-sm-inline { margin-left: 0px; }

/* Pagination (sitewide) */
.pagination { display: flex; gap: 6px; justify-content: center; margin: 16px 0; }
.page-item .page-link {
  border:1px solid #d9d9e3; background:#fff; color:#3C3C43;
  border-radius: 10px; padding: 8px 12px; min-width: 36px; text-align: center;
}
.page-item.active .page-link { background: var(--btn-bg); border-color: var(--btn-bg); color: var(--btn-text); }
.page-item.disabled .page-link { color:#9aa1b2; background:#f7f7f9; border-color:#e5e7eb; }
.page-link:hover { background:#f5f6fa; border-color:#cfd2d9; color:#111; text-decoration: none; }
.page-link:focus { box-shadow: none; outline: none; }

@media (max-width: 575.98px) {
  .pagination { gap: 4px; flex-wrap: wrap; }
  .page-item .page-link { padding: 8px 10px; min-width: 34px; font-size: 14px; border-radius: 8px; }
}

/* Announcement Modal (slick, card-like notification) */
.announcement-modal .modal-dialog {
  max-width: 420px;
  margin: 1.25rem auto;
}
@media (max-width: 480px) {
  .announcement-modal .modal-dialog { max-width: 92vw; margin: 10px auto; }
}
.announcement-modal .modal-content {
  border-radius: 16px;
  border: 1px solid rgba(17, 24, 39, 0.08);
  background: color-mix(in srgb, #ffffff 82%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 8px 30px rgba(0,0,0,.10), 0 2px 10px rgba(0,0,0,.06);
  overflow: hidden;
  position: relative;
}
/* Soft gradient edge accent */
.announcement-modal .modal-content::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: 16px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(84,56,255,.35), rgba(47,95,255,.15), rgba(17,24,39,.06));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
}
.announcement-modal .modal-header,
.announcement-modal .modal-footer {
  border: 0;
  background: transparent;
}
.announcement-modal .modal-header { padding: 14px 16px 6px 16px; }
.announcement-modal .modal-body { padding: 2px 16px 6px 16px; }
.announcement-modal .modal-footer { padding: 10px 16px 16px 16px; }
.announcement-modal .modal-title { font-weight: 700; letter-spacing: -0.01em; }
.announcement-modal .badge { border-radius: 999px; padding: 4px 8px; margin-right: 6px; font-weight: 600; }
/* Close button subtle */
.announcement-modal .btn-close { opacity: .6; transition: opacity .15s ease; }
.announcement-modal .btn-close:hover { opacity: .9; }

/* Buttons & links inside announcement */
.announcement-modal .announcement-cta.btn {
  border-radius: 999px;
  padding: 8px 14px;
  box-shadow: 0 3px 10px rgba(0,0,0,.12);
}
.announcement-modal .announcement-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 999px;
  background: #f4f6ff; color: #243aff;
  text-decoration: none;
}
.announcement-modal .announcement-link::after {
  content: "→"; font-weight: 700; line-height: 1;
}
.announcement-modal .announcement-link:hover { background: #eef1ff; text-decoration: none; }

/* Entry animation */
.announcement-modal.show .modal-dialog {
  animation: am-pop 260ms cubic-bezier(.2,.8,.2,1);
}
@keyframes am-pop {
  from { transform: translateY(6px) scale(.98); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .announcement-modal.show .modal-dialog { animation: none; }
}

/* Subtle custom backdrop for announcement (no opacity override to avoid jitter) */
.announcement-backdrop-active .modal-backdrop {
  background: radial-gradient(1200px 600px at 50% 10%, rgba(47,95,255,.10), rgba(0,0,0,.45)) !important;
  backdrop-filter: blur(2px);
}

/* Dark mode touch-ups */
@media (prefers-color-scheme: dark) {
  .announcement-modal .modal-content {
    background: color-mix(in srgb, #0f1220 86%, transparent);
    border-color: rgba(255,255,255,0.06);
    box-shadow: 0 10px 34px rgba(0,0,0,.45), 0 2px 10px rgba(0,0,0,.35);
  }
  .announcement-modal .announcement-link { background: #171b35; color: #8ea2ff; }
  .announcement-modal .announcement-link:hover { background: #1b2040; }
}

/* Notifications Page */
.notifications-page .page-head {
  display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom: 14px;
}
.notif-list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow); overflow: hidden; }
.notif-empty { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 14px; }
.notif-item { display:flex; gap:12px; align-items:flex-start; padding: 12px 14px; border-top: 1px solid var(--border); position: relative; transition: background .15s ease, box-shadow .15s ease; }
.notif-item:first-child { border-top: 0; }
.notif-item:hover { background: #f8f9fb; }
.notif-item.unread::before { content:""; position:absolute; left:0; top:0; bottom:0; width:3px; background: var(--brand); border-radius: 0 3px 3px 0; }
.notif-thumb { width:60px; height:60px; border-radius: 12px; object-fit: cover; border:1px solid #e5e7eb; background:#fafafa; }
.notif-thumb.notif-thumb-wow { padding: 11px; object-fit: contain; }
.notif-title { font-weight: 700; margin-bottom: 0; }
.notif-snippet { color:#4b5563; word-break: break-word; }
.notif-meta { font-size: .85rem; color: var(--muted); }
.notif-badge { display:inline-flex; align-items:center; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 600; color:#fff; }
.notif-badge.ann { background:#111214; }
.notif-badge.article { background:#3b82f6; }
.notif-badge.offering { background:#10b981; }
.notif-badge.social { background:#f59e0b; color:#111; }
.notif-badge.generic { background:#6b7280; }
.notif-actions { white-space: nowrap; text-align: right; }
@media (max-width: 576.98px){
  .notif-item{ display:grid; grid-template-columns: 56px 1fr; grid-template-areas: 'thumb content' 'thumb actions'; gap:8px 12px; align-items:start; }
  .notif-thumb{ grid-area: thumb; width:48px; height:48px; border-radius:10px; }
  .notif-item > .flex-grow-1{ grid-area: content; }
  .notif-actions{ grid-area: actions; display:flex; gap:8px; justify-content:flex-start; text-align:left; white-space:normal; }
  .notif-actions form{ display:inline-block; }
  .notif-actions a, .notif-actions button{ min-height:36px; }
  .notif-title{ font-size:1rem; }
  .notif-snippet{ font-size:.92rem; }
}
