/* Trinity Update - Modern SaaS UI (Bootstrap 5.3 theme-aware) */

/* ---------- Local fonts ---------- */
@font-face{
  font-family: "Poppins";
  src: url("/assets/fonts/poppins-v24-latin-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face{
  font-family: "Poppins";
  src: url("/assets/fonts/poppins-v24-latin-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face{
  font-family: "Poppins";
  src: url("/assets/fonts/poppins-v24-latin-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face{
  font-family: "Poppins";
  src: url("/assets/fonts/poppins-v24-latin-500italic.woff2") format("woff2");
  font-weight: 500;
  font-style: italic;
  font-display: swap;
}

@font-face{
  font-family: "Poppins";
  src: url("/assets/fonts/poppins-v24-latin-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face{
  font-family: "Poppins";
  src: url("/assets/fonts/poppins-v24-latin-600italic.woff2") format("woff2");
  font-weight: 600;
  font-style: italic;
  font-display: swap;
}

@font-face{
  font-family: "Poppins";
  src: url("/assets/fonts/poppins-v24-latin-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face{
  font-family: "Poppins";
  src: url("/assets/fonts/poppins-v24-latin-700italic.woff2") format("woff2");
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

/* ---------- Theme tokens ---------- */
:root{
  --bs-body-font-family: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bg: #f3f3f9;
  --bs-body-bg: #f3f3f9;
  --bs-body-color: #495057;
  --surface: rgba(255,255,255,.92);
  --surface-solid: #ffffff;
  --surface-2: #f2f5fb;

  --text: #495057;
  --muted: #878a99;

  --border: rgba(15,23,42,.10);
  --shadow: none;
  --shadow-soft: none;

  --radius: 18px;
  --radius-sm: 14px;

  --accent: #4f46e5;
  --accent-2: #06b6d4;
  --focus: rgba(79,70,229,.22);

  --thead: rgba(15,23,42,.04);
  --row-hover: rgba(79,70,229,.06);
}

[data-bs-theme="dark"]{
  --bg: #1b1e22;
  --bs-body-bg: #1b1e22;
  --bs-body-color: #ced4da;
  --bs-table-bg: #212428;
  --surface: #212428;
  --surface-solid: #212428;
  --surface-2: rgba(255,255,255,.06);

  --text: #ced4da;
  --muted: #878a99;

  --border: #292e32;
  --shadow: none;
  --shadow-soft: none;

  --focus: rgba(56,189,248,.22);

  --thead: #27292c;
  --row-hover: rgba(56,189,248,.02);
}

.table{
  --bs-table-color: var(--bs-body-color);
  --bs-table-border-color: var(--border);
}

/* ---------- Base ---------- */
html, body { height: 100%; }
body{
  min-height: 100vh;
  position: relative;
  background: var(--bs-body-bg);
  font-family: var(--bs-body-font-family);
}

body::before{
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-repeat: no-repeat;
}

.app-shell{
  min-height: 100vh;
}

.app-main{
  min-height: 100vh;
  margin-left: 260px;
  display: flex;
  flex-direction: column;
  transition: margin-left .24s ease;
}

.app-main > main{
  flex: 1 0 auto;
}

.app-main > footer{
  flex-shrink: 0;
}

.app-backdrop{
  display: none;
}

.topbar{
  position: sticky;
  top: 0;
  z-index: 1040;
  background: var(--surface) !important;
  border-bottom: 1px solid var(--border) !important;
  backdrop-filter: blur(14px);
}

.topbar-inner{
  min-height: 64px;
  padding: .75rem 1rem;
  display: flex;
  align-items: center;
  gap: .75rem;
}

.topbar-actions{
  width: auto;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: .5rem;
}
.topbar-inner .bx {
  font-size: 1.375rem;
}
.topbar-search{
  width: min(320px, 42vw);
}

.sidebar-collapse-toggle{
  width: 36px;
  height: 36px;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sidebar-collapse-toggle i{
  font-size: 1.15rem;
  line-height: 1;
}

.topbar-search .form-control{
  min-height: 34px;
  background: #f3f3f9 !important;
}

.topbar-search .input-group-text.topbar-search-icon{
  background: #f3f3f9 !important;
  color: var(--muted) !important;
}

.topbar-search .input-group-text.topbar-search-icon .bx{
  font-size: 1rem;
  line-height: 1;
}

[data-bs-theme="dark"] .topbar-search .form-control{
  background: #1b1e22 !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}

[data-bs-theme="dark"] .topbar-search .form-control::placeholder{
  color: var(--muted) !important;
  opacity: .9;
}

[data-bs-theme="dark"] .topbar-search .input-group-text.topbar-search-icon{
  background: #1b1e22 !important;
  color: var(--muted) !important;
  border-color: var(--border) !important;
}

[data-bs-theme="dark"] .topbar-search .btn.btn-outline-secondary{
  background: #1b1e22 !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}

[data-bs-theme="dark"] .topbar-search .btn.btn-outline-secondary:hover{
  background: color-mix(in srgb, #1b1e22 82%, #ffffff) !important;
}

[data-bs-theme="dark"] .topbar{
  background: #292e32 !important;
}

.theme-toggle-btn{
  width: 36px;
  height: 36px;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle-btn i{
  font-size: 1.1rem;
  line-height: 1;
}

.notification-dropdown .notification-toggle{
  position: relative;
}

.notification-counter{
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  padding: 0 .3rem;
  background: #f06548;
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  line-height: 18px;
  border: 2px solid var(--surface-solid);
}

.notification-menu{
  width: min(340px, calc(100vw - 1.5rem));
  border: none;
  border-radius: 10px;
  background: var(--surface-solid);
  overflow: hidden;
  box-shadow: 0 16px 42px rgba(19, 26, 44, .16);
}

.notification-menu-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  padding: .9rem 1rem;
  background: #44528c;
  color: #fff;
}

.notification-menu-title{
  font-size: 1rem;
  font-weight: 600;
}

.notification-new-badge{
  border-radius: 6px;
  font-size: .78rem;
  font-weight: 700;
}

.notification-tabs{
  border-bottom: 1px solid var(--border);
  background: var(--surface-solid);
  padding: 0 .65rem;
}

.notification-tabs .nav-link{
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  color: var(--muted);
  font-weight: 600;
  font-size: .88rem;
  padding: .72rem .35rem;
  margin: 0 .35rem;
}

.notification-tabs .nav-link:hover,
.notification-tabs .nav-link:focus{
  color: var(--text);
}

.notification-tabs .nav-link.active{
  color: var(--accent);
  background: transparent;
  border-bottom-color: var(--accent);
}

.notification-list{
  max-height: 380px;
  overflow: auto;
}

.notification-item{
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .9rem 1rem;
  white-space: normal;
  border-bottom: 1px solid var(--border);
}

.notification-item:last-child{
  border-bottom: 0;
}

.notification-item:hover{
  background: var(--surface-2);
}

.notification-avatar{
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 50%;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #d8ecfa;
  color: #2b8fd8;
}

.notification-avatar img{
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.notification-avatar-fallback{
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .02em;
}

.notification-avatar-system{
  background: #d8ecfa;
  color: #2b8fd8;
}

.notification-avatar-message{
  background: #ffe7e3;
  color: #f06548;
}

.notification-content{
  display: inline-flex;
  flex-direction: column;
  gap: .35rem;
  min-width: 0;
}

.notification-text{
  color: var(--text);
  font-size: 0.8125rem;
  line-height: 1.4;
}

.notification-time{
  display: inline-flex;
  align-items: center;
  gap: .2rem;
  color: var(--muted);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: .02em;
}

[data-bs-theme="dark"] .notification-menu-head{
  background: #3d4a7f;
}

[data-bs-theme="dark"] .notification-item:hover{
  background: #272d31;
}

[data-bs-theme="dark"] .notification-counter{
  border-color: #212428;
}

.user-menu-toggle{
  border: 1px solid var(--border) !important;
  background: var(--surface-solid) !important;
  color: var(--text) !important;
  min-height: 40px;
  padding: .3rem .55rem .3rem .35rem;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: .55rem;
}

.user-menu-toggle:hover{
  background: var(--surface-2) !important;
}

.user-menu-toggle::after{
  margin-left: .45rem;
}

.user-avatar{
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: color-mix(in srgb, var(--accent) 16%, #ffffff);
  border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
}

.user-avatar img{
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-avatar-fallback{
  font-size: .76rem;
  font-weight: 700;
  line-height: 1;
}

.user-meta{
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  line-height: 1.1;
}

.user-name{
  font-size: .88rem;
  font-weight: 600;
}

.user-role{
  font-size: .73rem;
  color: var(--muted);
}

.user-dropdown-menu{
  min-width: 190px;
}

a { text-underline-offset: 3px; }

/* ---------- Sidebar ---------- */
.app-sidebar{
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 260px;
  background: #44528c;
  color: #dbe3ff;
  border-right: 1px solid rgba(255,255,255,.09);
  padding: .5rem .8rem 1rem;
  overflow-y: auto;
  z-index: 1050;
  transition: width .24s ease, padding .24s ease, transform .24s ease;
}

.brand-icon{
  display: inline-block;
  width: 22px;
  height: 22px;
  filter: invert(1);
}

.sidebar-brand{
  min-height: 64px;
  padding: .35rem .4rem;
  display: flex;
  align-items: center;
}

.sidebar-logo{
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  color: #f4f7ff;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: .01em;
}

.sidebar-logo-text{
  white-space: nowrap;
  overflow: hidden;
  transition: width .2s ease, opacity .2s ease;
}

.sidebar-logo:hover{
  color: #ffffff;
}

.sidebar-nav{
  margin-top: .4rem;
  display: grid;
  gap: .2rem;
}

.sidebar-section{
  margin-top: .9rem;
  padding: .45rem .7rem .25rem;
  font-size: .73rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: rgba(232,238,255,.75);
}

.sidebar-link{
  display: flex;
  align-items: center;
  gap: .55rem;
  white-space: nowrap;
  overflow: hidden;
  border-radius: 4px;
  color: rgba(242,246,255,.94);
  text-decoration: none;
  padding: .55rem .7rem;
  font-weight: 500;
  transition: background-color .18s ease, transform .18s ease;
}

.sidebar-link-icon{
  width: 1.2rem;
  min-width: 1.2rem;
  font-size: 1.05rem;
  line-height: 1;
}

.sidebar-link-text{
  overflow: hidden;
  transition: width .2s ease, opacity .2s ease;
}

.sidebar-link:hover{
  background: rgba(255,255,255,.05);
  color: #ffffff;
  transform: translateX(1px);
}

.sidebar-link.active{
  background: rgba(255,255,255,.05);
  color: #ffffff;
}

[data-bs-theme="dark"] .app-sidebar{
  background: #212529;
  color: #c4cedf;
  border-right-color: #232b35;
}

[data-bs-theme="dark"] .sidebar-logo,
[data-bs-theme="dark"] .sidebar-link:hover,
[data-bs-theme="dark"] .sidebar-link.active{
  color: #f3f6fb;
}

[data-bs-theme="dark"] .sidebar-link{
  color: #ced8ea;
}

[data-bs-theme="dark"] .sidebar-section{
  color: #95a4bc;
}

@media (min-width: 992px){
  body.sidebar-collapsed .app-sidebar{
    width: 74px;
    padding-left: .5rem;
    padding-right: .5rem;
  }

  body.sidebar-collapsed .app-main{
    margin-left: 74px;
  }

  body.sidebar-collapsed .sidebar-brand{
    justify-content: center;
  }

  body.sidebar-collapsed .sidebar-logo{
    justify-content: center;
    width: 100%;
    gap: 0;
  }

  body.sidebar-collapsed .sidebar-logo-text{
    width: 0;
    opacity: 0;
  }

  body.sidebar-collapsed .sidebar-section{
    display: none;
  }

  body.sidebar-collapsed .sidebar-link{
    justify-content: center;
    gap: 0;
    padding-left: .45rem;
    padding-right: .45rem;
  }

  body.sidebar-collapsed .sidebar-link-text{
    width: 0;
    opacity: 0;
  }

  body.sidebar-collapsed .sidebar-link-icon{
    width: auto;
    min-width: 0;
    font-size: 1.15rem;
  }
}

/* ---------- Page headings ---------- */
h1.h4{
  position: relative;
  display: inline-block;
  color: var(--text);
  font-weight: 700;
  letter-spacing: .015em;
  line-height: 1.2;
  padding-bottom: .28rem;
}

h1.h4::after{
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.2rem;
  width: 100%;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    var(--accent) 0%,
    color-mix(in srgb, var(--accent-2) 62%, var(--accent)) 100%
  );
  opacity: .88;
}

/* ---------- Buttons ---------- */
.btn{ border-radius: var(--radius-sm); }

.btn-primary{
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  box-shadow: none !important;
}

.btn-primary:hover{
  filter: brightness(0.98);
}

.btn-outline-secondary{
  color: var(--text) !important;
  border-color: var(--border) !important;
}

.btn-outline-secondary:hover{
  background: var(--surface-2) !important;
}

/* ---------- Cards ---------- */
.card{
  background: var(--surface-solid) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

[data-bs-theme="dark"] .card{
  background: var(--surface-solid) !important;
}

.card-header{
  background: transparent !important;
  border-bottom: 1px solid var(--border) !important;
}

/* ---------- Forms ---------- */
.form-control, .form-select{
  background: var(--surface-solid) !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-sm);
}

.form-control::placeholder{
  color: color-mix(in srgb, var(--muted) 92%, transparent);
}

.form-control:focus, .form-select:focus{
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border)) !important;
  box-shadow: 0 0 0 .25rem var(--focus) !important;
}

.input-group-text{
  background: var(--surface-2) !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
}

/* ---------- Table ---------- */
.table-wrap{
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.table{
  margin: 0;
  color: var(--bs-body-color) !important;
}

.table thead th{
  background: var(--thead) !important;
  color: var(--bs-body-color) !important;
  border-bottom: 1px solid var(--border) !important;
  font-weight: 700;
  white-space: nowrap;
  padding-top: .85rem;
  padding-bottom: .85rem;
}

.table td{
  color: var(--bs-body-color) !important;
}

.table td{
  border-top: 1px solid var(--border) !important;
  padding-top: .7rem;
  padding-bottom: .7rem;
}

.table-hover tbody tr:hover{
  background: var(--row-hover) !important;
}

[data-bs-theme="dark"] .table tbody tr.table-danger{
  --bs-table-bg: rgba(220, 53, 69, .11);
  --bs-table-accent-bg: transparent;
  --bs-table-hover-bg: rgba(220, 53, 69, .15);
  --bs-table-border-color: rgba(220, 53, 69, .22);
  --bs-table-color: var(--text);
  --bs-table-hover-color: var(--text);
}

[data-bs-theme="dark"] .table tbody tr.table-warning{
  --bs-table-bg: rgba(255, 193, 7, .10);
  --bs-table-accent-bg: transparent;
  --bs-table-hover-bg: rgba(255, 193, 7, .14);
  --bs-table-border-color: rgba(255, 193, 7, .20);
  --bs-table-color: var(--text);
  --bs-table-hover-color: var(--text);
}

[data-bs-theme="dark"] .table tbody tr.table-info{
  --bs-table-bg: rgba(13, 202, 240, .09);
  --bs-table-accent-bg: transparent;
  --bs-table-hover-bg: rgba(13, 202, 240, .12);
  --bs-table-border-color: rgba(13, 202, 240, .18);
  --bs-table-color: var(--text);
  --bs-table-hover-color: var(--text);
}

.table td:first-child, .table th:first-child { padding-left: 1rem; }
.table td:last-child, .table th:last-child { padding-right: 1rem; }

/* ---------- Footer ---------- */
footer{
  background: var(--surface) !important;
  border-top: 1px solid var(--border) !important;
  backdrop-filter: blur(14px);
}

.text-muted{ color: var(--muted) !important; }

/* --- Table: sticky header + column polish --- */
.table-sticky thead th{
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--thead) !important;
}

.table-saas td, .table-saas th{
  font-size: .88rem;
}

.td-wrap{
  white-space: normal !important;
  word-break: break-word;
}

.u-nowrap{
  white-space: nowrap !important;
}

.table-link{ color: inherit; text-decoration: none; }
.table-link:hover{ text-decoration: underline; }
.pricecat-label{ font-weight: 600; }

.btn-icon{
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.dashboard-wrap{
  max-width: 1400px;
  margin: 0 auto;
}

.dropdown-menu{ z-index: 2000; }

.table-sticky thead th{
  position: sticky;
  top: 0;
  z-index: 1;
}

.dashboard-table-min{ min-width: 1400px; }
.dashboard-artist { font-size: 1.2rem; }
.dashboard-support { font-size: .95rem; }
.dashboard-col-prices { min-width: 100px; }
.col-artist-min { min-width: 240px; }
.col-presales-min { min-width: 320px; }

.guestlists-wrap{
  max-width: 1100px;
}

.guestlists-table .guestlists-date-col{
  width: 150px;
  min-width: 150px;
}

.guestlists-table .guestlists-count-col{
  width: 120px;
  min-width: 120px;
  white-space: nowrap;
}

.guestlists-table .guestlists-action-col{
  width: 1%;
  white-space: nowrap;
}

.guestlists-table .guestlists-event-col{
  width: 100%;
}

@media (max-width: 991.98px){
  body.sidebar-collapsed .app-main{
    margin-left: 0;
  }

  .app-main{
    margin-left: 0;
  }

  .app-sidebar{
    transform: translateX(-100%);
    transition: transform .22s ease;
  }

  body.sidebar-open .app-sidebar{
    transform: translateX(0);
  }

  .app-backdrop{
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(8,11,18,.35);
    opacity: 0;
    pointer-events: none;
    z-index: 1045;
    transition: opacity .2s ease;
  }

  body.sidebar-open .app-backdrop{
    opacity: 1;
    pointer-events: auto;
  }

  .topbar-search{
    width: min(220px, 52vw);
  }

  .user-meta{
    display: none;
  }
}
