/* ==========================================================================
   FindYourProperty — "Ink & Amber" design system
   Dark console shell: left icon rail on desktop, bottom tab bar on mobile.
   ========================================================================== */

:root {
    --ink-950: #05080F;
    --ink-900: #080D18;
    --ink-850: #0C1220;
    --ink-800: #111A2B;
    --ink-750: #162034;
    --ink-700: #1C2740;

    --line: rgba(148, 163, 184, 0.13);
    --line-strong: rgba(148, 163, 184, 0.26);

    --txt: #E8EDF7;
    --txt-dim: #97A5BF;
    --txt-faint: #61708D;

    --amber: #FFB020;
    --amber-2: #FF7A45;
    --amber-soft: rgba(255, 176, 32, 0.14);
    --teal: #2DD4BF;
    --violet: #8B7CF6;
    --danger: #FF5C63;
    --ok: #38D9A9;
    --warn: #FFC857;

    --rail-w: 244px;
    --radius-lg: 22px;
    --radius: 16px;
    --radius-sm: 11px;

    --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
    --shadow-sm: 0 10px 26px rgba(0, 0, 0, 0.32);

    --font-display: "Sora", "Segoe UI", sans-serif;
    --font-body: "Plus Jakarta Sans", "Segoe UI", sans-serif;
}

/* --------------------------------------------------------------- base ---- */

* {
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    background: var(--ink-950);
}

body {
    font-family: var(--font-body);
    color: var(--txt);
    margin: 0;
    padding: 0;
    font-size: 14px;
    line-height: 1.55;
    letter-spacing: 0.005em;
    min-height: 100vh;
    background-image:
        radial-gradient(900px 480px at 12% -8%, rgba(255, 176, 32, 0.11), transparent 62%),
        radial-gradient(760px 420px at 92% 4%, rgba(45, 212, 191, 0.09), transparent 60%),
        radial-gradient(700px 500px at 60% 108%, rgba(139, 124, 246, 0.08), transparent 62%);
    background-attachment: fixed;
}

h1, h2, h3, h4, h5, h6,
.fyp-display {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.018em;
    color: #fff;
}

a {
    color: var(--amber);
    text-decoration: none !important;
}

a:hover {
    color: var(--amber-2);
}

::-webkit-scrollbar {
    width: 9px;
    height: 9px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.22);
    border-radius: 99px;
    border: 2px solid transparent;
    background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.4);
    background-clip: content-box;
}

::selection {
    background: rgba(255, 176, 32, 0.3);
    color: #fff;
}

/* -------------------------------------------------------------- shell ---- */

.fyp-app {
    display: flex;
    min-height: 100vh;
}

.fyp-rail {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--rail-w);
    z-index: 1040;
    display: flex;
    flex-direction: column;
    padding: 26px 16px 20px;
    background: linear-gradient(180deg, rgba(12, 18, 32, 0.96), rgba(5, 8, 15, 0.96));
    border-right: 1px solid var(--line);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.fyp-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 8px 26px;
}

.fyp-brand-mark {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    background: linear-gradient(140deg, var(--amber), var(--amber-2));
    box-shadow: 0 10px 24px rgba(255, 122, 69, 0.32);
    color: #1A1206;
    font-size: 17px;
}

.fyp-brand-text {
    line-height: 1.15;
    min-width: 0;
}

.fyp-brand-text strong {
    display: block;
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #fff;
    white-space: nowrap;
}

.fyp-brand-text span {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--txt-faint);
}

.fyp-nav {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    overflow-y: auto;
}

.fyp-nav-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--txt-faint);
    padding: 14px 12px 6px;
}

.fyp-nav .nav-link,
.fyp-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border-radius: 13px;
    color: var(--txt-dim);
    font-size: 13.5px;
    font-weight: 600;
    border: 1px solid transparent;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.fyp-nav .nav-link i,
.fyp-nav a i {
    width: 18px;
    text-align: center;
    font-size: 15px;
    opacity: 0.85;
}

.fyp-nav .nav-link:hover,
.fyp-nav a:hover {
    background: rgba(148, 163, 184, 0.08);
    color: var(--txt);
}

.fyp-nav .nav-link.active,
.fyp-nav a.active {
    background: linear-gradient(100deg, rgba(255, 176, 32, 0.18), rgba(255, 122, 69, 0.07));
    border-color: rgba(255, 176, 32, 0.32);
    color: #FFD79A;
}

.fyp-nav .nav-link.active i,
.fyp-nav a.active i {
    color: var(--amber);
    opacity: 1;
}

.fyp-rail-foot {
    border-top: 1px solid var(--line);
    padding-top: 14px;
    margin-top: 10px;
}

.fyp-rail-foot .fyp-signout {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 13px;
    color: var(--txt-faint);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.fyp-rail-foot .fyp-signout:hover {
    background: rgba(255, 92, 99, 0.1);
    color: #FF9A9E;
}

.fyp-main {
    flex: 1;
    min-width: 0;
    margin-left: var(--rail-w);
    display: flex;
    flex-direction: column;
}

.fyp-topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 20px 32px 18px;
    background: linear-gradient(180deg, rgba(5, 8, 15, 0.92), rgba(5, 8, 15, 0.55));
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}

.fyp-topbar-title {
    min-width: 0;
}

.fyp-eyebrow {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.19em;
    color: var(--amber);
    margin-bottom: 5px;
}

.fyp-eyebrow::before {
    content: "";
    width: 16px;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--amber), transparent);
}

.fyp-topbar h1 {
    font-size: 25px;
    margin: 0;
}

.fyp-topbar p {
    margin: 4px 0 0;
    color: var(--txt-dim);
    font-size: 13px;
}

.fyp-topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.fyp-content {
    padding: 26px 32px 120px;
    max-width: 1560px;
    width: 100%;
}

/* mobile tab bar */
.fyp-tabbar {
    display: none;
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 1045;
    padding: 8px;
    border-radius: 20px;
    background: rgba(12, 18, 32, 0.93);
    border: 1px solid var(--line-strong);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--shadow);
}

.fyp-tabbar ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: space-around;
    align-items: stretch;
}

.fyp-tabbar li {
    flex: 1;
    min-width: 0;
}

.fyp-tabbar a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 7px 2px;
    border-radius: 13px;
    color: var(--txt-faint);
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
}

.fyp-tabbar a i {
    font-size: 16px;
}

/* admin accounts see up to six tabs, so shrink the labels on small phones */
@media (max-width: 390px) {
    .fyp-tabbar { padding: 6px; }
    .fyp-tabbar a { font-size: 8.5px; letter-spacing: 0; padding: 6px 1px; }
    .fyp-tabbar a i { font-size: 15px; }
}

.fyp-tabbar a.active {
    background: var(--amber-soft);
    color: var(--amber);
}

body.chrome-hidden .fyp-rail,
body.chrome-hidden .fyp-tabbar {
    display: none !important;
}

body.chrome-hidden .fyp-main {
    margin-left: 0;
}

/* ------------------------------------------------------------- panels ---- */

.fyp-panel {
    background: linear-gradient(180deg, rgba(22, 32, 52, 0.72), rgba(12, 18, 32, 0.72));
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

/* bootstrap-select menus sit inside the panel; keep them from being clipped */
.fyp-panel:has(.bootstrap-select) {
    overflow: visible;
}

.fyp-panel + .fyp-panel,
.fyp-section {
    margin-top: 22px;
}

.fyp-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    padding: 16px 20px;
    border-bottom: 1px solid var(--line);
}

.fyp-panel-head h2,
.fyp-panel-head h3 {
    font-size: 15px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.fyp-panel-head h2 i,
.fyp-panel-head h3 i {
    color: var(--amber);
    font-size: 13px;
}

.fyp-panel-head .fyp-count {
    font-size: 11px;
    font-weight: 700;
    color: var(--txt-faint);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.fyp-panel-body {
    padding: 20px;
}

.fyp-panel-body.tight {
    padding: 0;
}

/* stat tiles */
.fyp-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.fyp-stat {
    position: relative;
    padding: 18px 18px 16px;
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(22, 32, 52, 0.8), rgba(12, 18, 32, 0.75));
    border: 1px solid var(--line);
    overflow: hidden;
    transition: transform 0.16s ease, border-color 0.16s ease;
}

.fyp-stat::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: var(--accent, var(--amber));
}

.fyp-stat:hover {
    transform: translateY(-2px);
    border-color: var(--line-strong);
}

.fyp-stat .value {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 700;
    line-height: 1;
    color: #fff;
}

.fyp-stat .label {
    margin-top: 7px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--txt-faint);
}

/* ------------------------------------------------------------- inputs ---- */

.fyp-field {
    margin-bottom: 14px;
}

.fyp-label {
    display: block;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--txt-faint);
    margin-bottom: 7px;
}

input.fyp-input,
textarea.fyp-input,
select.fyp-input,
.form-control {
    width: 100%;
    height: 46px;
    padding: 0 15px;
    margin: 0;
    background: rgba(7, 11, 21, 0.72);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    color: var(--txt);
    font-family: var(--font-body);
    font-size: 14px;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

textarea.fyp-input,
textarea.form-control {
    height: auto;
    padding: 12px 15px;
}

input.fyp-input::placeholder,
.form-control::placeholder {
    color: var(--txt-faint);
}

input.fyp-input:focus,
textarea.fyp-input:focus,
.form-control:focus {
    outline: none;
    background: rgba(7, 11, 21, 0.95);
    border-color: rgba(255, 176, 32, 0.55);
    box-shadow: 0 0 0 4px rgba(255, 176, 32, 0.12);
    color: var(--txt);
}

.form-control:disabled,
.form-control[readonly] {
    background: rgba(7, 11, 21, 0.4);
    color: var(--txt-faint);
}

.fyp-input.is-invalid,
.form-control.is-invalid {
    border-color: rgba(255, 92, 99, 0.7);
    box-shadow: 0 0 0 4px rgba(255, 92, 99, 0.12);
}

.fyp-input.is-valid,
.form-control.is-valid {
    border-color: rgba(56, 217, 169, 0.5);
}

/* input with leading icon */
.fyp-input-icon {
    position: relative;
}

.fyp-input-icon > i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--txt-faint);
    font-size: 13px;
    pointer-events: none;
    z-index: 2;
}

.fyp-input-icon input,
.fyp-input-icon .form-control {
    padding-left: 40px;
}

/* date pickers keep the calendar affordance on the right.
   We flatten Bootstrap's flex input-group to a block shell, so its
   default .form-control { width:1% } must be overridden or the field
   collapses to a square (seen on master-list). */
.input-group {
    position: relative;
    display: block;
    width: 100%;
}

.input-group > .form-control,
.input-group > .fyp-input,
.input-group > .custom-select {
    position: relative;
    width: 100%;
    flex: none;
    margin-bottom: 0;
}

.input-group-addon {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    color: var(--txt-faint);
    pointer-events: none;
    z-index: 3;
}

.input-group .fyp-input,
.input-group .form-control {
    padding-right: 42px;
}

/* bootstrap-select
   Important: only style the OUTER > .dropdown-menu. Live-search mode also
   nests a .dropdown-menu.inner list, and painting borders/max-height onto
   that inner list produces the empty gold bars under the field.

   Bootstrap 4 + Popper stretches the menu across the panel inside our
   grid layout — pin the menu to the select and prefer data-display="static". */
.bootstrap-select {
    width: 100% !important;
    position: relative;
}

.bootstrap-select.show,
.bootstrap-select.dropup {
    z-index: 1080;
}

.bootstrap-select > .dropdown-toggle,
.bootstrap-select > button.btn {
    height: 46px;
    padding: 0 34px 0 15px !important;
    margin: 0;
    line-height: 1.25 !important;
    background: rgba(7, 11, 21, 0.72) !important;
    border: 1px solid var(--line-strong) !important;
    border-radius: var(--radius-sm) !important;
    color: var(--txt) !important;
    font-family: var(--font-body);
    font-size: 14px;
    box-shadow: none !important;
    display: flex !important;
    align-items: center;
    text-align: left;
}

.bootstrap-select > .dropdown-toggle:focus,
.bootstrap-select.show > .dropdown-toggle {
    outline: none !important;
    border-color: rgba(255, 176, 32, 0.55) !important;
    box-shadow: 0 0 0 4px rgba(255, 176, 32, 0.12) !important;
}

/* bootstrap-select parks the label in an absolute .filter-option; flex-center
   that stack so selected text sits in the middle of the 46px control */
.bootstrap-select > .dropdown-toggle .filter-option {
    position: absolute;
    inset: 0;
    height: auto;
    width: auto;
    padding: 0 34px 0 15px;
    display: flex;
    align-items: center;
    overflow: hidden;
    text-align: left;
    box-sizing: border-box;
}

.bootstrap-select > .dropdown-toggle .filter-option-inner {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    padding-right: 0;
}

.bootstrap-select > .dropdown-toggle .filter-option-inner-inner {
    color: var(--txt);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.25;
}

.bootstrap-select > .dropdown-toggle.bs-placeholder .filter-option-inner-inner {
    color: var(--txt-faint);
}

.bootstrap-select > .dropdown-toggle::after {
    position: absolute;
    top: 50%;
    right: 14px;
    margin: 0;
    transform: translateY(-50%);
}

.bootstrap-select > .dropdown-menu {
    position: absolute !important;
    top: calc(100% + 4px) !important;
    left: 0 !important;
    right: auto !important;
    bottom: auto !important;
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    transform: none !important;
    float: none !important;
    will-change: auto !important;
    background: var(--ink-800);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    padding: 6px;
    z-index: 1080;
    box-sizing: border-box;
}

.bootstrap-select.dropup > .dropdown-menu {
    top: auto !important;
    bottom: calc(100% + 4px) !important;
}

/* reset chrome that would otherwise bleed onto the nested option list */
.bootstrap-select .dropdown-menu.inner {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    margin: 0;
    position: static !important;
    float: none;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    max-height: none !important;
    transform: none !important;
}

.bootstrap-select > .dropdown-menu .inner {
    max-height: 240px;
    overflow-x: hidden;
    overflow-y: auto;
}

.bootstrap-select .dropdown-menu li a,
.bootstrap-select .dropdown-menu .dropdown-item {
    color: var(--txt-dim);
    border-radius: 9px;
    padding: 8px 11px;
    font-size: 13.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bootstrap-select .dropdown-menu .dropdown-item:hover,
.bootstrap-select .dropdown-menu .dropdown-item:focus,
.bootstrap-select .dropdown-menu li a:hover {
    background: rgba(148, 163, 184, 0.1);
    color: var(--txt);
}

.bootstrap-select .dropdown-menu .dropdown-item.active,
.bootstrap-select .dropdown-menu .dropdown-item.selected {
    background: var(--amber-soft) !important;
    color: #FFD79A !important;
}

.bootstrap-select .bs-searchbox {
    padding: 0 0 6px;
}

.bootstrap-select .bs-searchbox .form-control {
    height: 38px;
    margin: 0;
    width: 100%;
}

.bootstrap-select .no-results {
    color: var(--txt-faint);
    background: transparent;
    font-size: 13px;
}

/* when selectpicker portals into a .bs-container (data-container) */
.bs-container.bootstrap-select {
    position: absolute;
    z-index: 1080;
}

.bs-container.bootstrap-select > .dropdown-menu {
    position: static !important;
    top: auto !important;
    left: auto !important;
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    transform: none !important;
}

/* bootstrap-datepicker — scoped to the popup, since inputs also carry
   the .datepicker class as their JS hook.
   Keep width:auto: a fixed .datepicker-days width + Bootstrap's
   table { width:100% } stretches the chrome wider than the 7 day
   cells, which is the empty strip on the right. */
.datepicker.dropdown-menu {
    width: auto;
    min-width: 0;
    padding: 12px;
    background: var(--ink-800) !important;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    color: var(--txt);
    z-index: 1080 !important;
}

.datepicker.datepicker-dropdown:before {
    border-bottom-color: var(--line-strong);
}

.datepicker.datepicker-dropdown:after {
    border-bottom-color: var(--ink-800);
}

.datepicker.datepicker-dropdown.datepicker-orient-top:before {
    border-top-color: var(--line-strong);
}

.datepicker.datepicker-dropdown.datepicker-orient-top:after {
    border-top-color: var(--ink-800);
}

.datepicker table {
    width: auto !important;
    margin: 0;
}

.datepicker-days,
.datepicker-months,
.datepicker-years,
.datepicker-decades,
.datepicker-centuries {
    width: auto;
    font-size: 13px;
}

.datepicker table tr td,
.datepicker table tr th {
    border-radius: 9px;
    color: var(--txt-dim);
    border: none;
    background: transparent;
    width: 36px;
    height: 34px;
    padding: 0;
    text-align: center;
}

.datepicker table tr td.day:hover,
.datepicker table tr td.focused {
    background: rgba(148, 163, 184, 0.14) !important;
    color: var(--txt);
}

.datepicker table tr td.active,
.datepicker table tr td.active:hover,
.datepicker table tr td.today {
    background: linear-gradient(135deg, var(--amber), var(--amber-2)) !important;
    color: #1A1206 !important;
    text-shadow: none;
    font-weight: 700;
}

.datepicker table tr td.old,
.datepicker table tr td.new {
    color: var(--txt-faint);
}

.datepicker .datepicker-switch,
.datepicker thead th {
    color: var(--txt);
}

.datepicker .datepicker-switch:hover,
.datepicker .prev:hover,
.datepicker .next:hover {
    background: rgba(148, 163, 184, 0.14) !important;
}

.datepicker table tr td span {
    border-radius: 9px;
    height: 48px;
    line-height: 48px;
}

/* google places autocomplete */
.pac-container {
    z-index: 9999;
    background: var(--ink-800);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    margin-top: 6px;
    padding: 5px;
    font-family: var(--font-body);
}

.pac-item {
    border: none;
    border-radius: 9px;
    padding: 8px 10px;
    color: var(--txt-dim);
    font-size: 13px;
    cursor: pointer;
}

.pac-item:hover,
.pac-item-selected {
    background: rgba(148, 163, 184, 0.12);
}

.pac-item-query,
.pac-matched {
    color: var(--txt);
}

.pac-icon {
    display: none;
}

/* ------------------------------------------------------------ buttons ---- */

.fyp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    padding: 0 20px;
    margin: 0;
    border: 1px solid transparent;
    border-radius: 999px;
    font-family: var(--font-body);
    font-size: 13.5px;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.14s ease, box-shadow 0.16s ease, background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.fyp-btn:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(255, 176, 32, 0.18);
}

.fyp-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.fyp-btn-primary {
    background: linear-gradient(135deg, var(--amber), var(--amber-2));
    color: #1A1206;
    box-shadow: 0 12px 26px rgba(255, 122, 69, 0.26);
}

.fyp-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 32px rgba(255, 122, 69, 0.34);
    color: #1A1206;
}

.fyp-btn-ghost {
    background: rgba(148, 163, 184, 0.08);
    border-color: var(--line-strong);
    color: var(--txt-dim);
}

.fyp-btn-ghost:hover {
    background: rgba(148, 163, 184, 0.16);
    color: var(--txt);
}

.fyp-btn-danger {
    background: rgba(255, 92, 99, 0.14);
    border-color: rgba(255, 92, 99, 0.35);
    color: #FF9A9E;
}

.fyp-btn-danger:hover {
    background: rgba(255, 92, 99, 0.24);
    color: #fff;
}

.fyp-btn-sm {
    height: 34px;
    padding: 0 14px;
    font-size: 12px;
}

.fyp-btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 12px;
    background: rgba(148, 163, 184, 0.08);
    border: 1px solid var(--line-strong);
    color: var(--txt-dim);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.16s ease, color 0.16s ease;
}

.fyp-btn-icon:hover {
    background: rgba(148, 163, 184, 0.16);
    color: var(--txt);
}

/* export button (JS toggles .fa-beat-fade + disabled) */
.btn-export {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 14px;
    margin: 0;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.08);
    color: var(--txt-dim);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.16s ease, color 0.16s ease;
}

.btn-export:hover {
    background: rgba(255, 176, 32, 0.14);
    border-color: rgba(255, 176, 32, 0.35);
    color: #FFD79A;
}

.btn-export svg {
    height: 16px;
    fill: currentColor;
}

.btn-export:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.btn-export.fa-beat-fade {
    animation: fypBeat 1.4s infinite;
}

@keyframes fypBeat {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.55; transform: scale(1.06); }
}

#back-to-top {
    display: none;
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 1050;
    width: 44px;
    height: 44px;
    padding: 0;
    margin: 0;
    border: 1px solid var(--line-strong);
    border-radius: 14px;
    background: rgba(12, 18, 32, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    color: var(--amber);
    font-size: 17px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

#back-to-top:hover {
    background: rgba(255, 176, 32, 0.16);
    color: #fff;
}

/* ------------------------------------------------------------- tables ---- */

.fyp-table-wrap {
    overflow: auto;
    max-height: 620px;
}

table.fyp-table {
    width: 100%;
    margin: 0;
    border: none;
    border-collapse: separate;
    border-spacing: 0;
    color: var(--txt-dim);
    font-size: 13.5px;
}

table.fyp-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: #0E1626;
    border: none;
    border-bottom: 1px solid var(--line-strong);
    padding: 12px 16px;
    text-align: left;
    font-family: var(--font-body);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--txt-faint);
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
}

table.fyp-table tbody td {
    border: none;
    border-bottom: 1px solid rgba(148, 163, 184, 0.07);
    padding: 13px 16px;
    vertical-align: middle;
    color: var(--txt-dim);
    word-break: break-word;
}

table.fyp-table tbody tr {
    transition: background 0.14s ease;
}

table.fyp-table tbody tr:hover > td {
    background: rgba(148, 163, 184, 0.05);
    color: var(--txt);
}

table.fyp-table tbody tr:last-child td {
    border-bottom: none;
}

table.fyp-table a.cursor-pointer,
table.fyp-table a {
    color: var(--teal);
    font-weight: 600;
    cursor: pointer;
    border-bottom: 1px dashed rgba(45, 212, 191, 0.35);
}

table.fyp-table a:hover {
    color: #7FF3E4;
}

/* sort indicators added by initTableSorting()/report page */
table.fyp-table thead th.sort-asc,
table.fyp-table thead th.sort-desc,
table.fyp-table thead th.sortable {
    position: sticky;
    padding-right: 26px;
}

table.fyp-table thead th.sortable::after,
table.fyp-table thead th.sort-asc::after,
table.fyp-table thead th.sort-desc::after {
    content: "\f0dc";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    position: absolute;
    right: 9px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    color: rgba(148, 163, 184, 0.45);
}

table.fyp-table thead th.sort-asc::after {
    content: "\f0de";
    color: var(--amber);
}

table.fyp-table thead th.sort-desc::after {
    content: "\f0dd";
    color: var(--amber);
}

/* nested "card" table used on phones — these are built by page scripts and
   still carry Bootstrap's .table classes, so neutralise the light theme. */
table.fyp-table .table {
    color: inherit;
    background-color: transparent;
    margin-bottom: 0;
}

table.fyp-table .table-striped tbody tr:nth-of-type(odd) {
    background-color: transparent;
}

table.fyp-table .table-condensed {
    width: 100%;
    margin: 0;
    border: none;
    background: transparent;
}

table.fyp-table .table-condensed tr {
    background: transparent !important;
}

table.fyp-table .table-condensed td {
    border: none;
    border-bottom: 1px solid rgba(148, 163, 184, 0.07);
    padding: 8px 14px;
    font-size: 13px;
}

table.fyp-table .table-condensed tr:last-child td {
    border-bottom: none;
}

table.fyp-table .table-condensed td:first-child {
    width: 118px;
    color: var(--txt-faint);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

table.fyp-table > tbody > tr > td.d-table-cell {
    padding: 0;
}

/* loading + empty states */
.fyp-table tr.table-loading td {
    padding: 34px 16px;
    text-align: center;
}

.fyp-table tr.table-loading .tbl-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    color: var(--txt-faint);
    font-size: 13px;
}

.fyp-table tr.table-loading .tbl-spinner div {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(148, 163, 184, 0.2);
    border-left-color: var(--amber);
    border-radius: 50%;
    animation: fypSpin 0.9s linear infinite;
}

@keyframes fypSpin {
    to { transform: rotate(360deg); }
}

td.empty-record,
.fyp-empty {
    text-align: center;
    padding: 40px 16px !important;
    color: var(--txt-faint);
    font-size: 13px;
}

.fyp-empty i {
    display: block;
    font-size: 30px;
    margin-bottom: 10px;
    color: rgba(148, 163, 184, 0.3);
}

/* pills */
.fyp-pill,
.ratio-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 54px;
    padding: 4px 11px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
    background: var(--amber-soft);
    color: #FFD79A;
    border: 1px solid rgba(255, 176, 32, 0.24);
}

.fyp-mono {
    font-family: "SFMono-Regular", Consolas, "Roboto Mono", monospace;
    font-size: 12px;
    letter-spacing: -0.01em;
}

/* ------------------------------------------------------------- alerts ---- */

.alert {
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: rgba(148, 163, 184, 0.07);
    color: var(--txt-dim);
    font-size: 13.5px;
    padding: 13px 16px;
}

.alert-info {
    background: rgba(45, 212, 191, 0.1);
    border-color: rgba(45, 212, 191, 0.28);
    color: #9DEFE3;
}

.alert-success {
    background: rgba(56, 217, 169, 0.1);
    border-color: rgba(56, 217, 169, 0.3);
    color: #A7F3D0;
}

.alert-warning {
    background: rgba(255, 200, 87, 0.1);
    border-color: rgba(255, 200, 87, 0.3);
    color: #FFE3A3;
}

.alert-danger {
    background: rgba(255, 92, 99, 0.1);
    border-color: rgba(255, 92, 99, 0.32);
    color: #FFB4B7;
}

.alert b,
.alert strong {
    color: #fff;
}

.fyp-note {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 16px 18px;
    border-radius: var(--radius);
    border: 1px dashed var(--line-strong);
    background: rgba(148, 163, 184, 0.04);
    color: var(--txt-dim);
    font-size: 13px;
}

.fyp-note i {
    color: var(--amber);
    margin-top: 2px;
}

/* ------------------------------------------------------------- modals ---- */

.modal-backdrop.show {
    opacity: 0.72;
    background: #03060C;
}

.modal-content {
    background: linear-gradient(180deg, #162034, #0C1220);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    color: var(--txt);
    overflow: hidden;
}

.modal-header {
    border-bottom: 1px solid var(--line);
    padding: 18px 22px;
    align-items: center;
}

.modal-title {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    color: #fff;
}

.modal-header .close {
    color: var(--txt-faint);
    opacity: 1;
    text-shadow: none;
    font-weight: 400;
    font-size: 26px;
    padding: 0 4px;
}

.modal-header .close:hover {
    color: #fff;
}

.modal-body {
    padding: 20px 22px;
}

.modal-body.padding-0 {
    padding: 0;
}

.modal-footer {
    border-top: 1px solid var(--line);
    padding: 16px 22px;
    gap: 10px;
}

.modal-footer > * {
    margin: 0 !important;
}

/* detail tables inside modals */
.modal .fyp-detail {
    width: 100%;
    margin: 0;
    border: none;
    border-collapse: collapse;
    font-size: 13.5px;
}

.modal .fyp-detail td {
    border: none;
    border-bottom: 1px solid rgba(148, 163, 184, 0.08);
    padding: 11px 22px;
    color: var(--txt);
    white-space: normal !important;
    vertical-align: top;
}

.modal .fyp-detail tr:last-child td {
    border-bottom: none;
}

.modal .fyp-detail td.k {
    width: 132px;
    color: var(--txt-faint);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding-top: 13px;
}

.modal .fyp-detail a {
    color: var(--teal);
}

.modal .alert {
    margin: 16px 22px 0;
}

/* ------------------------------------------------------------ overlays --- */

#loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(5, 8, 15, 0.86);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

#loader .spinner-border {
    width: 42px;
    height: 42px;
    border-width: 3px;
    color: var(--amber);
}

.spinner-border {
    color: var(--amber);
}

/* ------------------------------------------------------------ helpers ---- */

.fyp-muted { color: var(--txt-dim); }
.fyp-faint { color: var(--txt-faint); }
.fyp-strong { color: #fff; }
.cursor-pointer { cursor: pointer; }

.fyp-divider {
    height: 1px;
    background: var(--line);
    margin: 22px 0;
}

.fyp-grid {
    display: grid;
    gap: 14px;
}

/* --------------------------------------------------------- responsive ---- */

@media (max-width: 1199.98px) {
    :root { --rail-w: 84px; }

    .fyp-brand { justify-content: center; padding-bottom: 20px; }
    .fyp-brand-text { display: none; }
    .fyp-nav .nav-link,
    .fyp-nav a { flex-direction: column; gap: 4px; padding: 10px 4px; font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.06em; text-align: center; }
    .fyp-nav .nav-link i,
    .fyp-nav a i { font-size: 16px; }
    .fyp-nav-label { display: none; }
    .fyp-rail-foot .fyp-signout { flex-direction: column; gap: 4px; font-size: 9.5px; text-align: center; }
}

@media (max-width: 991.98px) {
    .fyp-rail { display: none; }
    .fyp-tabbar { display: block; }
    .fyp-main { margin-left: 0; }
    .fyp-topbar { padding: 16px 18px 14px; }
    .fyp-topbar h1 { font-size: 21px; }
    .fyp-content { padding: 18px 18px 130px; }
    #back-to-top { bottom: 92px; }
}

@media (max-width: 575.98px) {
    .fyp-panel-body { padding: 15px; }
    .fyp-topbar-actions { width: 100%; }
    .fyp-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .fyp-stat { padding: 14px; }
    .fyp-stat .value { font-size: 21px; }
    .modal .fyp-detail td { padding: 10px 15px; }
    .modal .fyp-detail td.k { width: 104px; }
}
