/* =====================================================================================================
   TACI premium theme for the Bulletin portal. Same design language as TACI Digital Campus (navy + gold, Fraunces
   headings, Inter text) with depth: layered shadows, pressable 3D buttons, and cards that tilt toward the pointer.
   It only restyles; no markup or behaviour of the existing pages changes. Selectors start with "html body" so they
   win over each page's own inline <style> without needing !important.
   ===================================================================================================== */
:root {
  --tp-navy: #14305f; --tp-navy-deep: #0b1f40; --tp-navy-mid: #1d4280;
  --tp-gold: #b8893a; --tp-gold-soft: #d9b574; --tp-gold-tint: #f6efe0;
  --tp-bg: #f4f6fa; --tp-surface: #ffffff; --tp-ink: #1b2433; --tp-soft: #4b5668; --tp-faint: #7a8496; --tp-line: #e3e8f0;
  --tp-ease: cubic-bezier(.2, .7, .2, 1);
  --tp-shadow: 0 1px 0 rgba(255, 255, 255, .85) inset, 0 1px 2px rgba(16, 30, 54, .06), 0 14px 28px -16px rgba(16, 30, 54, .28);
  --tp-shadow-lift: 0 1px 0 rgba(255, 255, 255, .85) inset, 0 28px 44px -22px rgba(16, 30, 54, .45), 0 10px 22px -12px rgba(16, 30, 54, .25);
}
@view-transition { navigation: auto; }
html { scroll-behavior: smooth; }
html body { background: radial-gradient(900px 420px at 100% -8%, rgba(184, 137, 58, .10), transparent 62%), radial-gradient(700px 360px at -6% 0, rgba(20, 48, 95, .07), transparent 60%), var(--tp-bg); color: var(--tp-ink); -webkit-font-smoothing: antialiased; }

/* ---------- sidebar ---------- */
html body .sidebar { background: radial-gradient(420px 260px at 0 0, rgba(184, 137, 58, .24), transparent 70%), linear-gradient(190deg, #153363, #0a1a36); border-right: 1px solid rgba(255, 255, 255, .08); box-shadow: 10px 0 44px rgba(8, 18, 40, .28); }
html body .sidebar .logo-box { border-bottom-color: rgba(217, 181, 116, .22); }
html body .sidebar .logo-box img { filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .45)); transition: transform .4s var(--tp-ease); }
html body .sidebar .logo-box:hover img { transform: translateY(-3px) scale(1.06) rotate(-3deg); }
html body .sidebar .logo-box p { color: var(--tp-gold-soft); }
html body .sidebar .role-box { background: linear-gradient(145deg, rgba(255, 255, 255, .13), rgba(255, 255, 255, .04)); border: 1px solid rgba(255, 255, 255, .16); box-shadow: 0 10px 22px -12px rgba(0, 0, 0, .5), 0 1px 0 rgba(255, 255, 255, .12) inset; border-radius: 14px; }
html body .sidebar .role-box span { color: var(--tp-gold-soft); }
html body .sidebar-menu a { border-radius: 12px; border-left: 3px solid transparent; transition: background .2s var(--tp-ease), transform .2s var(--tp-ease), color .2s; }
html body .sidebar-menu a:hover { background: rgba(255, 255, 255, .09); color: #fff; border-left-color: var(--tp-gold); transform: translateX(3px); }
html body .sidebar-menu a.is-active { background: linear-gradient(90deg, rgba(255, 255, 255, .18), rgba(255, 255, 255, .05)); color: #fff; border-left-color: var(--tp-gold); box-shadow: 0 1px 0 rgba(255, 255, 255, .12) inset; }
html body .sidebar-menu i { color: var(--tp-gold-soft); }
html body .sidebar-menu a.hub-link { margin-top: 14px; border: 1px dashed rgba(217, 181, 116, .45); color: var(--tp-gold-soft); }
html body .sidebar-menu a.hub-link:hover { background: rgba(184, 137, 58, .18); color: #fff; }

/* ---------- top bar ---------- */
html body .top-header { background: rgba(255, 255, 255, .82); backdrop-filter: saturate(160%) blur(14px); border-bottom: 1px solid var(--tp-line); box-shadow: 0 8px 24px -18px rgba(16, 30, 54, .35); }

/* ---------- headings ---------- */
html body .page-title, html body .section-title { color: var(--tp-navy); letter-spacing: -.01em; }
html body .page-title i { color: var(--tp-gold) !important; }
html body .page-subtitle { color: var(--tp-soft); }

/* ---------- cards: depth, lift, and a gold hairline ---------- */
html body .summary-card, html body .stat-card, html body .dashboard-card, html body .editor-card, html body .board-card, html body .forum-card,
html body .featured-card, html body .card-box, html body .stat-box, html body .scope-card, html body .action-card, html body .template-card,
html body .report-card, html body .page-card {
  background: var(--tp-surface); border: 1px solid var(--tp-line); border-radius: 18px; box-shadow: var(--tp-shadow);
  transition: transform .25s var(--tp-ease), box-shadow .25s var(--tp-ease), border-color .25s;
}
html body .summary-card:hover, html body .stat-card:hover, html body .dashboard-card:hover, html body .editor-card:hover, html body .board-card:hover,
html body .forum-card:hover, html body .featured-card:hover, html body .stat-box:hover, html body .scope-card:hover, html body .action-card:hover, html body .report-card:hover {
  box-shadow: var(--tp-shadow-lift); border-color: rgba(184, 137, 58, .45);
}
html body .summary-card .num, html body .summary-number, html body .stat-num { color: var(--tp-navy); }
html body .summary-card i, html body .card-icon, html body .stat-icon { filter: drop-shadow(0 6px 8px rgba(20, 48, 95, .2)); }

/* ---------- tables ---------- */
html body .table-dark { --bs-table-bg: var(--tp-navy); --bs-table-border-color: var(--tp-navy-mid); --bs-table-hover-bg: var(--tp-navy-mid); border-bottom: 3px solid var(--tp-gold); }
html body .table-dark th { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
html body .table-hover > tbody > tr:hover > * { --bs-table-hover-bg: rgba(20, 48, 95, .05); }
html body .table-responsive { border-radius: 14px; }

/* ---------- buttons: pressable, three-dimensional ---------- */
html body .btn-dark, html body .btn-theme, html body .btn-primary, html body .submit-btn {
  background: linear-gradient(180deg, #2a5199, var(--tp-navy)); border-color: var(--tp-navy-deep); color: #fff; border-radius: 10px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .22) inset, 0 -3px 0 rgba(0, 0, 0, .26) inset, 0 10px 18px -8px rgba(20, 48, 95, .8);
  transition: transform .15s var(--tp-ease), box-shadow .2s var(--tp-ease), filter .2s;
}
html body .btn-dark:hover, html body .btn-theme:hover, html body .btn-primary:hover, html body .submit-btn:hover { background: linear-gradient(180deg, #2a5199, var(--tp-navy)); color: #fff; transform: translateY(-2px); filter: brightness(1.08); box-shadow: 0 1px 0 rgba(255, 255, 255, .22) inset, 0 -3px 0 rgba(0, 0, 0, .26) inset, 0 16px 24px -10px rgba(20, 48, 95, .9); }
html body .btn-dark:active, html body .btn-theme:active, html body .btn-primary:active, html body .submit-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(255, 255, 255, .15) inset, 0 -1px 0 rgba(0, 0, 0, .26) inset, 0 3px 8px -4px rgba(20, 48, 95, .8); }
html body .btn-brass { background: linear-gradient(180deg, #d1a355, var(--tp-gold)); border-color: #96702c; color: #fff; border-radius: 10px; box-shadow: 0 1px 0 rgba(255, 255, 255, .35) inset, 0 -3px 0 rgba(0, 0, 0, .2) inset, 0 10px 18px -8px rgba(184, 137, 58, .85); transition: transform .15s var(--tp-ease), box-shadow .2s, filter .2s; }
html body .btn-brass:hover { color: #fff; transform: translateY(-2px); filter: brightness(1.07); }
html body .btn-brass:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 -1px 0 rgba(0, 0, 0, .2) inset; }
html body .btn-outline-dark, html body .btn-outline-secondary { border-radius: 10px; transition: transform .15s var(--tp-ease), box-shadow .2s; }
html body .btn-outline-dark:hover, html body .btn-outline-secondary:hover { transform: translateY(-1px); box-shadow: 0 8px 16px -10px rgba(16, 30, 54, .5); }

/* ---------- forms ---------- */
html body .form-control:focus, html body .form-select:focus { border-color: var(--tp-navy); box-shadow: 0 0 0 4px rgba(20, 48, 95, .12); }

/* ---------- entrance ---------- */
html body .content > * { animation: tp-rise .5s var(--tp-ease) both; }
html body .content > *:nth-child(2) { animation-delay: .06s; } html body .content > *:nth-child(n+3) { animation-delay: .12s; }
@keyframes tp-rise { from { opacity: 0; transform: translateY(10px); } }

/* ---------- 3D tilt (JS sets --rx --ry --gx --gy while the pointer is over a card) ---------- */
.tp-tilt { --rx: 0deg; --ry: 0deg; --gx: 50%; --gy: 0%; position: relative; }
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  html body .tp-tilt.tp-tilt, html body .tp-tilt.tp-tilt:hover { transform: perspective(1000px) rotateX(var(--rx)) rotateY(var(--ry)) translateY(var(--lift, 0px)); will-change: transform; }
  html body .tp-tilt.tp-tilt:hover { --lift: -4px; }
  html body .tp-tilt.is-tilting { transition: transform .06s linear, box-shadow .25s, border-color .25s; box-shadow: var(--tp-shadow-lift); }
  .tp-tilt::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .25s; background: radial-gradient(420px 260px at var(--gx) var(--gy), rgba(255, 255, 255, .6), transparent 60%); mix-blend-mode: soft-light; }
  .tp-tilt.is-tilting::after { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { html body .content > * { animation: none; } html { scroll-behavior: auto; } }

/* ---------- sign-in / register pages ---------- */
html body.tp-auth { background: radial-gradient(760px 460px at 92% 6%, rgba(184, 137, 58, .45), transparent 62%), radial-gradient(620px 420px at -8% 108%, rgba(106, 143, 232, .42), transparent 64%), linear-gradient(150deg, #0a1a36, #14305f); overflow-x: hidden; }
html body.tp-auth::before, html body.tp-auth::after { content: ""; position: fixed; border-radius: 50%; filter: blur(60px); pointer-events: none; z-index: 0; }
html body.tp-auth::before { width: 340px; height: 340px; right: 10%; top: -80px; background: rgba(184, 137, 58, .45); animation: tp-drift 14s ease-in-out infinite alternate; }
html body.tp-auth::after { width: 280px; height: 280px; left: 6%; bottom: -90px; background: rgba(122, 162, 255, .38); animation: tp-drift 18s ease-in-out infinite alternate-reverse; }
@keyframes tp-drift { to { transform: translate(46px, 30px) scale(1.15); } }
html body.tp-auth .auth-card { position: relative; z-index: 1; background: rgba(255, 255, 255, .96); border: 1px solid rgba(255, 255, 255, .6); border-top: 0; border-radius: 22px; box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .65), 0 1px 0 rgba(255, 255, 255, .9) inset; overflow: hidden; }
html body.tp-auth .auth-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: linear-gradient(90deg, var(--tp-gold), var(--tp-gold-soft), var(--tp-gold)); }
html body.tp-auth .logo img { filter: drop-shadow(0 10px 16px rgba(184, 137, 58, .45)); animation: tp-float 5s ease-in-out infinite; }
@keyframes tp-float { 50% { transform: translateY(-6px); } }
html body.tp-auth .logo h2, html body.tp-auth .page-title { color: var(--tp-navy); }
html body.tp-auth .form-control { border-radius: 10px; }
html body.tp-auth .btn-theme { width: 100%; padding: 13px; font-weight: 700; }
html body.tp-auth .bottom-link a { color: var(--tp-gold); }
@media (prefers-reduced-motion: reduce) { html body.tp-auth::before, html body.tp-auth::after, html body.tp-auth .logo img { animation: none; } }
@media (max-width: 520px) { html body.tp-auth .auth-card { width: auto; margin: 16px; padding: 32px 22px; } }

/* ---------- page-specific leftovers of the old near-black ---------- */
html body .review-table thead, html body .admin-table thead, html body .announce-table thead, html body .table thead { background: var(--tp-navy); }
html body .review-table thead th, html body .admin-table thead th, html body .announce-table thead th, html body .table thead th { background: var(--tp-navy); color: #fff; border-bottom: 3px solid var(--tp-gold); }
html body .btn-view-all, html body .btn-primary-custom, html body .btn-current, html body .btn-primary.action-btn, html body .filter-box .btn-dark, html body .search-form button {
  background: linear-gradient(180deg, #2a5199, var(--tp-navy)); border-color: var(--tp-navy-deep); color: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .22) inset, 0 -3px 0 rgba(0, 0, 0, .26) inset, 0 10px 18px -8px rgba(20, 48, 95, .8); transition: transform .15s var(--tp-ease), box-shadow .2s, filter .2s;
}
html body .btn-view-all:hover, html body .btn-primary-custom:hover, html body .btn-current:hover, html body .btn-primary.action-btn:hover, html body .filter-box .btn-dark:hover, html body .search-form button:hover { transform: translateY(-2px); filter: brightness(1.08); color: #fff; }
html body .btn-view-all:active, html body .btn-primary-custom:active, html body .btn-primary.action-btn:active, html body .search-form button:active { transform: translateY(2px); }
html body .welcome-panel, html body .stats-box { background: radial-gradient(500px 220px at 100% 0, rgba(184, 137, 58, .45), transparent 65%), linear-gradient(130deg, var(--tp-navy-deep), var(--tp-navy)); border: 1px solid rgba(255, 255, 255, .08); border-bottom: 3px solid var(--tp-gold); border-radius: 18px; box-shadow: 0 30px 50px -28px rgba(8, 18, 40, .7), 0 1px 0 rgba(255, 255, 255, .12) inset; }
html body .dropdown-header { background: var(--tp-navy); }
html body .chip[aria-pressed="true"] { background: var(--tp-navy); border-color: var(--tp-navy); }
html body .icon-btn:hover { background: var(--tp-navy); }

/* ---- Phone and tablet: the sidebar becomes a slide-in menu opened from a top bar (added with the TACI Campus phone apps) ---- */
.tp-topbar, .tp-overlay { display: none; }
@media (max-width: 991.98px) {
  html body .sidebar {
    transform: translateX(-105%); transition: transform .3s cubic-bezier(.2, .8, .2, 1), box-shadow .3s;
    width: min(84vw, 310px); max-width: 100%; z-index: 1101; box-shadow: none; padding-top: calc(22px + env(safe-area-inset-top)); overscroll-behavior: contain;
  }
  html body.tp-menu-open .sidebar { transform: none; box-shadow: 0 0 60px rgba(0, 0, 0, .55); }
  html body .content { margin-left: 0 !important; padding: 18px 14px 32px !important; padding-top: calc(74px + env(safe-area-inset-top)) !important; max-width: 100vw; overflow-x: hidden; }
  .tp-topbar {
    display: flex; position: fixed; top: 0; left: 0; right: 0; z-index: 1000; align-items: center; gap: 12px; min-height: 58px;
    padding: env(safe-area-inset-top) 14px 0 10px; background: linear-gradient(180deg, #0b1420, #141f36); border-bottom: 1px solid rgba(231, 211, 163, .16); color: #fdfbf6;
  }
  .tp-topbar button { all: unset; box-sizing: border-box; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; color: #e7d3a3; font-size: 20px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .tp-topbar button:active { background: rgba(231, 211, 163, .14); }
  .tp-topbar img { width: 30px; height: 30px; border-radius: 8px; background: #fff; padding: 3px; }
  .tp-topbar strong { font-family: 'Fraunces', serif; font-weight: 600; font-size: 17px; letter-spacing: .2px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tp-overlay { display: block; position: fixed; inset: 0; z-index: 1100; background: rgba(5, 10, 20, .55); opacity: 0; pointer-events: none; transition: opacity .3s; -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
  html body.tp-menu-open .tp-overlay { opacity: 1; pointer-events: auto; }
  html body.tp-menu-open { overflow: hidden; }
  /* wide tables scroll sideways inside the page instead of pushing the whole page out */
  html body .content table { max-width: 100%; }
  html body .content .table-responsive, html body .content .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  html body .content table:not(.table-responsive table) { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: normal; }
  html body .content img, html body .content canvas, html body .content iframe { max-width: 100%; }
  html body .content h1 { font-size: 1.55rem; } html body .content h2 { font-size: 1.3rem; }
  html body .content .btn, html body .content button, html body .content a.btn { min-height: 42px; }
  html body .content input, html body .content select, html body .content textarea { font-size: 16px; }   /* no zoom-in when a field is tapped on iPhone */
}
@media (min-width: 992px) { .tp-topbar, .tp-overlay { display: none !important; } }
@media (prefers-reduced-motion: reduce) { html body .sidebar, .tp-overlay { transition: none; } }
