/* Project overrides on top of the Zynix template (loaded after styles.css). */

/* Sidebar: hide the template's dot bullets in sub-menus (items use icons instead). */
.app-sidebar .slide-menu .side-menu__item:before {
    display: none !important;
}

.app-sidebar .slide-menu .side-menu__item .menu-icon {
    width: 1.25rem;
    margin-inline-end: 0.5rem;
    font-size: 1rem;
    text-align: center;
    flex-shrink: 0;
}

/* Keep the menu inside the sidebar: long labels wrap instead of widening the list. */
.app-sidebar .main-menu {
    width: 100%;
    min-width: 0;
}
.app-sidebar .side-menu__item {
    white-space: normal;
    min-width: 0;
}
.app-sidebar .side-menu__label {
    white-space: normal;
}
.app-sidebar #sidebar-scroll .simplebar-track.simplebar-horizontal {
    display: none;
}

/* ---------- Colorful touches ---------- */

/* Top-level sidebar icons sit in a soft colored square. */
.app-sidebar .side-menu__icon.menu-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    color: rgb(var(--badge-rgb)) !important;
    background-color: rgba(var(--badge-rgb), 0.12);
    transition: background-color 0.2s, color 0.2s;
}
.menu-badge-primary   { --badge-rgb: var(--primary-rgb); }
.menu-badge-success   { --badge-rgb: var(--success-rgb); }
.menu-badge-warning   { --badge-rgb: var(--warning-rgb); }
.menu-badge-info      { --badge-rgb: var(--info-rgb); }
.menu-badge-danger    { --badge-rgb: var(--danger-rgb); }
.menu-badge-secondary { --badge-rgb: var(--secondary-rgb); }

.app-sidebar .side-menu__item.active > .menu-badge,
.app-sidebar .side-menu__item:hover > .menu-badge {
    color: #fff !important;
    background-color: rgb(var(--badge-rgb));
}

/* Sidebar items that are POST buttons (clean-up links): look like the links, keep the template's hover colors. */
.app-sidebar .sidebar-button {
    border: 0;
    background: none;
    font: inherit;
}

/* Sidebar section titles in the brand color. */
.app-sidebar .slide__category .category-name {
    color: rgb(var(--primary-rgb));
    font-weight: 600;
    letter-spacing: 0.04em;
}

/* Page header cards (list pages): brand gradient with white title. */
.page-hero {
    border: 0;
    background: linear-gradient(120deg, rgb(var(--primary-rgb)) 0%, rgb(var(--info-rgb)) 100%);
    box-shadow: 0 0.5rem 1.25rem rgba(var(--primary-rgb), 0.25);
}
.page-hero .page-title,
.page-hero .page-title i {
    color: #fff;
}
.page-hero .page-hero-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    margin-inline-end: 0.75rem;
    border-radius: 0.75rem;
    font-size: 1.25rem;
    color: #fff;
    background-color: rgba(255, 255, 255, 0.2);
}
.page-hero .page-hero-sub {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8rem;
}
.page-hero .btn {
    color: rgb(var(--primary-rgb));
    background-color: #fff;
    border-color: #fff;
}
.page-hero .btn:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.2);
}
.page-hero .btn.btn-danger-light {
    color: #fff;
    background-color: rgb(var(--danger-rgb));
    border-color: rgb(var(--danger-rgb));
}

/* Data tables: tinted header, colored top border, soft row hover. */
.table-card {
    border-top: 3px solid rgb(var(--primary-rgb));
}
.table-card table.dataTable thead th {
    color: rgb(var(--primary-rgb));
    background-color: rgba(var(--primary-rgb), 0.07);
    font-weight: 600;
}
.table-card table.dataTable tbody tr:hover > * {
    background-color: rgba(var(--primary-rgb), 0.04);
}

/* Stretch tables: fixed-content columns shrink to fit, the rest share the width and wrap. */
.stretch-table th,
.stretch-table td {
    vertical-align: middle;
    white-space: normal;
    word-break: break-word;
}
.stretch-table .col-fit {
    width: 1%;
    white-space: nowrap;
}

/* "Plain" buttons: soft tinted, with no hover / focus / open / click effects. */
.btn-plain {
    --plain-rgb: var(--primary-rgb);
    color: rgb(var(--plain-rgb)) !important;
    background-color: rgba(var(--plain-rgb), 0.1) !important;
    border: 1px solid rgba(var(--plain-rgb), 0.15) !important;
    box-shadow: none !important;
    transform: none !important;
    transition: none !important;
    white-space: nowrap;
}
.btn-plain-primary { --plain-rgb: var(--primary-rgb); }
.btn-plain-success { --plain-rgb: var(--success-rgb); }
.btn-plain-info    { --plain-rgb: var(--info-rgb); }
.btn-plain-warning { --plain-rgb: var(--warning-rgb); }
.btn-plain-danger  { --plain-rgb: var(--danger-rgb); }
.btn-plain.dropdown-toggle::after {
    margin-inline-start: 0.35rem;
    vertical-align: 0.15em;
}

/* Company form tabs: one color + icon per tab, pill-style, wrapping onto several lines. */
.tab-color-primary   { --tab-rgb: var(--primary-rgb); }
.tab-color-secondary { --tab-rgb: var(--secondary-rgb); }
.tab-color-success   { --tab-rgb: var(--success-rgb); }
.tab-color-info      { --tab-rgb: var(--info-rgb); }
.tab-color-warning   { --tab-rgb: var(--warning-rgb); }
.tab-color-danger    { --tab-rgb: var(--danger-rgb); }
.tab-color-teal      { --tab-rgb: var(--teal-rgb); }
.tab-color-orange    { --tab-rgb: var(--orange-rgb); }
.tab-color-pink      { --tab-rgb: var(--pink-rgb); }
.tab-color-purple    { --tab-rgb: var(--purple-rgb); }

.company-tabs {
    flex-wrap: wrap;
}
.company-tabs .nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: 1px solid rgba(var(--tab-rgb), 0.25) !important;
    border-radius: 0.5rem !important;
    color: rgb(var(--tab-rgb));
    background-color: rgba(var(--tab-rgb), 0.08);
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.3rem 0.65rem;
}
.company-tabs .nav-link i {
    font-size: 0.9rem;
}
.company-tabs .nav-link:hover {
    color: rgb(var(--tab-rgb));
    background-color: rgba(var(--tab-rgb), 0.16);
}
.company-tabs .nav-link.active {
    color: #fff;
    background-color: rgb(var(--tab-rgb));
    border-color: rgb(var(--tab-rgb)) !important;
    box-shadow: 0 0.25rem 0.6rem rgba(var(--tab-rgb), 0.35);
}

/* Heading inside each tab, in the tab's color. */
.tab-heading {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: rgb(var(--tab-rgb));
}
.tab-heading-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 0.55rem;
    font-size: 1.2rem;
    color: #fff;
    background-color: rgb(var(--tab-rgb));
}

/* Edit Company right panel: collapsible link groups that stay in view while scrolling. */
.company-side-panel {
    position: sticky;
    top: 5.5rem;
}
.side-group {
    --group-rgb: var(--primary-rgb);
    overflow: hidden;
}
.side-group-primary { --group-rgb: var(--primary-rgb); }
.side-group-warning { --group-rgb: var(--warning-rgb); }
.side-group-danger  { --group-rgb: var(--danger-rgb); }
.side-group-info    { --group-rgb: var(--info-rgb); }
/* Beats the template's .custom-card .card-header background. */
.custom-card.side-group > .side-group-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1rem;
    text-align: start;
    color: #fff;
    background: linear-gradient(120deg, rgb(var(--group-rgb)) 0%, rgba(var(--group-rgb), 0.75) 100%) !important;
    border-radius: 0;
}
.custom-card.side-group > .side-group-header .card-title {
    flex: 1;
    color: #fff !important;
}
.custom-card.side-group > .side-group-header .card-title::before {
    display: none;
}
.side-group-count {
    color: rgb(var(--group-rgb));
    background-color: #fff;
}
.side-group-arrow {
    font-size: 1.1rem;
    transition: transform 0.2s;
}
.side-group-header.collapsed .side-group-arrow {
    transform: rotate(-90deg);
}
.side-group .list-group {
    background-color: rgba(var(--group-rgb), 0.03);
}
.side-group .list-group-item {
    background: transparent;
    border-color: rgba(var(--group-rgb), 0.1);
}
.side-group-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: inherit;
}
.side-link-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.1rem;
    height: 2.1rem;
    flex-shrink: 0;
    border-radius: 0.5rem;
    font-size: 1.15rem;
    color: rgb(var(--group-rgb));
    background-color: rgba(var(--group-rgb), 0.12);
}
.side-link-go {
    color: rgba(var(--group-rgb), 0.6);
}
.side-group-link:hover {
    color: rgb(var(--group-rgb));
    background-color: rgba(var(--group-rgb), 0.08);
}
.side-group-link:hover .side-link-icon {
    color: #fff;
    background-color: rgb(var(--group-rgb));
}

/* Dashboard: scrollable breakdown lists. */
.dash-list {
    max-height: 22rem;
    overflow-y: auto;
}
.dash-list .list-group-item {
    padding: 0.55rem 1rem;
}
/* Company detail (Screener style). */
.company-subnav {
    position: sticky;
    top: 4.6rem;
    z-index: 5;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    background-color: var(--custom-white, #fff);
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.05);
}
.company-subnav-link {
    padding: 0.35rem 0.7rem;
    border-radius: 0.35rem;
    font-size: 0.8rem;
    white-space: nowrap;
    color: var(--default-text-color);
}
.company-subnav-link:hover {
    color: rgb(var(--primary-rgb));
    background-color: rgba(var(--primary-rgb), 0.08);
}
[id="top"], [id="chart"], [id="analysis"], [id="peers"], [id="quarters"], [id="profit-loss"], [id="balance-sheet"],
[id="cash-flow"], [id="ratios"], [id="metrics"], [id="segments"], [id="business"], [id="profile"] {
    scroll-margin-top: 8.5rem;
}
.company-logo {
    width: 4rem;
    height: 4rem;
    object-fit: contain;
    border-radius: 0.5rem;
    border: 1px solid var(--default-border);
    background: #fff;
}
.company-ratios {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
    gap: 0.35rem 1.5rem;
    padding: 1rem 1.25rem;
    border-radius: 0.5rem;
    background-color: rgba(var(--primary-rgb), 0.04);
}
.company-ratio {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.3rem 0;
    font-size: 0.85rem;
    border-bottom: 1px dashed var(--default-border);
}
.company-ratio span {
    color: var(--text-muted);
}
.company-ratio b {
    text-align: end;
    font-weight: 600;
}
.company-about-text {
    max-height: 9.5rem;
    overflow: hidden;
    font-size: 0.85rem;
}
/* SWOT boxes: green border for Strengths / Opportunities, red for Weaknesses / Threats (beats .custom-card's border: 0). */
.card.custom-card.company-proscons {
    border: 1px solid rgba(var(--success-rgb), 0.55) !important;
    border-top-width: 4px !important;
}
.card.custom-card.company-proscons-danger {
    border-color: rgba(var(--danger-rgb), 0.55) !important;
}
.company-proscons-success { background-color: rgba(var(--success-rgb), 0.04); }
.company-proscons-danger  { background-color: rgba(var(--danger-rgb), 0.04); }
.company-table th {
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
    color: var(--text-muted);
}
.company-table td {
    font-size: 0.83rem;
    vertical-align: top;
}
.company-statement td:first-child,
.company-statement th:first-child {
    position: sticky;
    left: 0;
    min-width: 14rem;
    background-color: var(--custom-white, #fff);
}
.company-statement tbody tr:nth-child(even) td {
    background-color: rgba(var(--primary-rgb), 0.025);
}
/* Minimized section cards: only the header stays. */
.card.custom-card.is-collapsed > .card-body,
.card.custom-card.is-collapsed > .card-footer {
    display: none;
}
.card.custom-card.is-collapsed > .card-header {
    border-bottom: 0;
}
.card-minimize {
    flex-shrink: 0;
    margin-inline-start: 0.5rem;
}

/* Statement rows: click the name to chart it. */
.js-chart-row {
    cursor: pointer;
}
.chart-row-icon {
    margin-inline-end: 0.35rem;
    color: var(--default-border);
}
.js-chart-row:hover .chart-row-icon,
.js-chart-row.is-charted .chart-row-icon {
    color: rgb(var(--primary-rgb));
}
.js-chart-row.is-charted {
    font-weight: 600;
}
.company-self td {
    background-color: rgba(var(--primary-rgb), 0.07) !important;
}
.company-ai {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--default-border);
    background-color: rgba(var(--primary-rgb), 0.03);
}
.company-list {
    max-height: 26rem;
    overflow-y: auto;
}

/* AI Agent: generated summaries and prompt text. */
.ai-summary p {
    line-height: 1.7;
    margin-bottom: 0.75rem;
}
.ai-summary p:last-child {
    margin-bottom: 0;
}
.ai-prompt {
    max-height: 18rem;
    overflow: auto;
    padding: 0.85rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.78rem;
    white-space: pre-wrap;
    background-color: rgba(var(--primary-rgb), 0.05);
    border: 1px solid rgba(var(--primary-rgb), 0.12);
}
.spin {
    display: inline-block;
    animation: ai-spin 1s linear infinite;
}
@keyframes ai-spin {
    to { transform: rotate(360deg); }
}

/* Media Center thumbnails. */
.media-thumb {
    display: block;
    width: 90px;
    height: 70px;
    object-fit: cover;
    border-radius: 0.5rem;
    border: 1px solid rgba(var(--primary-rgb), 0.15);
}
.media-thumb-file {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: rgb(var(--primary-rgb));
    background-color: rgba(var(--primary-rgb), 0.08);
}
.media-thumb-file i {
    font-size: 1.5rem;
}

/* Form cards: colored header strip. */
.form-card > form > .card-header,
.form-card > .card-header {
    background: linear-gradient(90deg, rgba(var(--primary-rgb), 0.1), rgba(var(--info-rgb), 0.06));
    border-bottom: 1px solid rgba(var(--primary-rgb), 0.15);
}
.form-card .card-title {
    color: rgb(var(--primary-rgb));
}

/* Sidebar: small group heading inside a submenu (Missing tools) */
.app-sidebar .sidebar-group-label { font-size: 0.65rem; text-transform: uppercase; letter-spacing: .04em; opacity: .6; pointer-events: none; padding-block: .35rem .15rem; }

/* Click to copy ([data-copy], assets/js/copy-text.js) */
.copy-text { position: relative; cursor: pointer; white-space: nowrap; }
.copy-text i { font-size: .8em; opacity: .45; transition: opacity .15s; }
.copy-text:hover { color: var(--primary-color); }
.copy-text:hover i { opacity: 1; }
.copy-text.copied::after { content: attr(data-copied-label); position: absolute; left: 50%; bottom: 100%; transform: translate(-50%, -4px); padding: 2px 8px; border-radius: 4px; background: #212529; color: #fff; font-size: 11px; white-space: nowrap; pointer-events: none; }

/* Header analog clock + date (assets/js/header-clock.js) */
.header-clock-face .clock-ring { fill: var(--custom-white); stroke: var(--primary-color); stroke-width: 4; }
.header-clock-face .clock-ticks line { stroke: var(--default-text-color); stroke-width: 2.5; stroke-linecap: round; opacity: .6; }
.header-clock-face .clock-hour { stroke: var(--default-text-color); stroke-width: 6; stroke-linecap: round; }
.header-clock-face .clock-minute { stroke: var(--default-text-color); stroke-width: 4; stroke-linecap: round; }
.header-clock-face .clock-second { stroke: var(--primary-color); stroke-width: 2; stroke-linecap: round; }
.header-clock-face .clock-center { fill: var(--primary-color); }
.header-clock-text { min-width: 92px; white-space: nowrap; }

/* Header company search results (assets/js/company-search.js) */
.company-search-results { min-width: 300px; max-height: 360px; overflow-y: auto; }
.company-search-results .list-group-item.active { background: var(--primary01, rgba(124, 92, 252, .1)); color: inherit; }

/* Company detail: Collapse / Expand all on the company name's line, right side (own line on small screens) */
.detail-section-toggle { display: flex; justify-content: flex-end; margin-bottom: 1rem; }
@media (min-width: 992px) {
    .detail-section-toggle { position: absolute; top: 1.5rem; right: 1.5rem; margin-bottom: 0; z-index: 2; }
    #top .card-body > .d-flex:first-of-type > .d-flex:first-child { padding-right: 15rem; } /* name never under the buttons */
}

/* Company add / edit: name, Update button and tabs stay on top while scrolling the form */
.card.custom-card.company-form > .card-header {
    position: sticky;
    top: 4.25rem;
    z-index: 6;
    background-color: var(--custom-white, #fff) !important; /* the template's see-through gradient stays on top of it */
    box-shadow: 0 0.25rem 0.5rem -0.25rem rgba(0, 0, 0, 0.08);
}

/* Company detail: Financial Writeup under each statement */
.company-writeup { padding: 1rem 1.25rem; border-top: 1px dashed var(--default-border); background-color: rgba(var(--danger-rgb, 230, 83, 60), 0.03); }

/* "Refresh Data" job menu (admin.missing.partials.run-menu): above the sidebar / sticky bars, scrolls when long */
.job-run-menu { min-width: 15rem; max-height: 50vh; overflow-y: auto; z-index: 1060; }

/* Company detail: small trend chart on every ratio row */
.ratio-spark-head { width: 150px; }
.ratio-spark-cell { width: 150px; padding-top: .15rem !important; padding-bottom: .15rem !important; }
.js-ratio-spark { width: 130px; height: 34px; margin: 0 auto; }

/* Company detail: a chart card per ratio, three per row */
.ratio-chart-grid { padding: 1rem; margin: 0; border-top: 1px dashed var(--default-border); background-color: rgba(var(--primary-rgb), 0.02); }
.ratio-chart-card { height: 100%; padding: .75rem .75rem .25rem; border: 1px solid var(--default-border); border-radius: .6rem; background-color: var(--custom-white, #fff); transition: box-shadow .15s, transform .15s; }
.ratio-chart-card:hover { box-shadow: 0 .5rem 1.25rem rgba(var(--primary-rgb), 0.12); transform: translateY(-2px); }
.ratio-chart-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding-bottom: .5rem; margin-bottom: .25rem; border-bottom: 1px dashed var(--default-border); }
.ratio-chart-title { font-weight: 600; font-size: .8rem; color: var(--default-text-color); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.js-ratio-chart { min-height: 220px; }

/* Company detail: Annual / Quarterly tabs on each statement card */
.statement-tabs .nav-link { padding: .3rem .8rem; font-size: .8rem; border-radius: .4rem; }
.statement-tabs .nav-link:not(.active) { background-color: rgba(var(--primary-rgb), 0.06); color: var(--default-text-color); }
