/* ---------------------------------------------------------------------------
   Syndicate Project Portal — application shell.
   Replaces the Metronic theme; everything here layers on Bootstrap 5.
   --------------------------------------------------------------------------- */

:root {
    --ss-orange: #f26722;
    --ss-orange-dark: #d2530f;
    --ss-blue: #2aa4dd;
    --ss-sidebar: #2f3640;
    --ss-sidebar-hover: #3b4450;
    --ss-sidebar-active: #f26722;
    --ss-sidebar-text: #c3cad4;
    --ss-header-h: 3.75rem;
    --ss-sidebar-w: 15rem;
    --ss-body-bg: #f4f6f9;
    --ss-border: #e3e7ee;
}

body {
    background-color: var(--ss-body-bg);
    color: #3c4257;
    font-size: 0.9375rem;
}

/* --- Brand colour mapped onto Bootstrap's primary ------------------------- */
.btn-primary {
    --bs-btn-bg: var(--ss-orange);
    --bs-btn-border-color: var(--ss-orange);
    --bs-btn-hover-bg: var(--ss-orange-dark);
    --bs-btn-hover-border-color: var(--ss-orange-dark);
    --bs-btn-active-bg: var(--ss-orange-dark);
    --bs-btn-active-border-color: var(--ss-orange-dark);
    --bs-btn-disabled-bg: var(--ss-orange);
    --bs-btn-disabled-border-color: var(--ss-orange);
}

a {
    color: var(--ss-orange-dark);
    text-decoration: none;
}

a:hover {
    color: var(--ss-orange);
    text-decoration: underline;
}

.form-control:focus,
.form-select:focus {
    border-color: #f7a97e;
    box-shadow: 0 0 0 0.2rem rgba(242, 103, 34, 0.15);
}

.form-check-input:checked {
    background-color: var(--ss-orange);
    border-color: var(--ss-orange);
}

/* --- Fixed header -------------------------------------------------------- */
.ss-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--ss-header-h);
    background: #fff;
    border-bottom: 1px solid var(--ss-border);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 1rem;
    z-index: 1030;
}

.ss-header__logo img {
    height: 2rem;
    width: auto;
}

/* --- Sidebar ------------------------------------------------------------- */
.ss-sidebar {
    position: fixed;
    top: var(--ss-header-h);
    bottom: 0;
    left: 0;
    width: var(--ss-sidebar-w);
    background: var(--ss-sidebar);
    overflow-y: auto;
    z-index: 1020;
}

.ss-sidebar__nav {
    list-style: none;
    margin: 0;
    padding: 0.5rem 0;
}

.ss-sidebar__nav a {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.6875rem 1.125rem;
    color: var(--ss-sidebar-text);
    font-size: 0.9375rem;
    text-decoration: none;
    border-left: 3px solid transparent;
}

.ss-sidebar__nav a:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    text-decoration: none;
}

.ss-sidebar__nav a.active {
    background: rgba(255, 255, 255, 0.09);
    color: #fff;
    border-left-color: var(--ss-sidebar-active);
}

.ss-sidebar__nav i {
    font-size: 1rem;
    width: 1.25rem;
    text-align: center;
    flex: none;
}

/* --- Main content -------------------------------------------------------- */
.ss-main {
    margin-left: var(--ss-sidebar-w);
    padding: calc(var(--ss-header-h) + 1.5rem) 1.5rem 1.5rem;
    min-height: 100vh;
}

.ss-page-title {
    font-size: 1.5rem;
    font-weight: 400;
    margin: 0 0 1.25rem;
    color: #2f3640;
}

.ss-page-subtitle {
    font-size: 0.875rem;
    color: #6b7280;
    margin: -0.75rem 0 1.25rem;
}

/* --- Cards (replaces Metronic "portlet") --------------------------------- */
.card {
    border: 1px solid var(--ss-border);
    border-radius: 0.5rem;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
    margin-bottom: 1.5rem;
}

.card-header {
    background: #fff;
    border-bottom: 1px solid var(--ss-border);
    padding: 0.875rem 1.125rem;
    font-weight: 600;
    font-size: 0.9375rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 0.5rem 0.5rem 0 0 !important;
}

.card-header i {
    color: var(--ss-orange);
}

.card-body {
    padding: 1.125rem;
}

.card-footer {
    background: #fbfcfe;
    border-top: 1px solid var(--ss-border);
    padding: 0.875rem 1.125rem;
    border-radius: 0 0 0.5rem 0.5rem !important;
}

/* --- Tables -------------------------------------------------------------- */
.table {
    --bs-table-hover-bg: #fbf7f4;
    margin-bottom: 0;
}

.table > thead > tr > th {
    background: #f7f9fc;
    border-bottom: 1px solid var(--ss-border);
    font-weight: 600;
    font-size: 0.8125rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #5b6472;
    white-space: nowrap;
}

.table > tbody > tr > td {
    vertical-align: middle;
}

/* Long free-text columns truncate rather than stretching the table. */
.ss-truncate {
    max-width: 28rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ss-empty {
    text-align: center;
    color: #8a929e;
    padding: 1.75rem 0;
}

/* --- Login / public pages ------------------------------------------------ */
.ss-login {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    /* White rather than the app's grey: the logo asset has a white matte. */
    background: #fff;
}

.ss-login__logo {
    margin-bottom: 1.75rem;
}

.ss-login__logo img {
    max-width: 16rem;
    height: auto;
}

.ss-login__card {
    width: 100%;
    max-width: 24rem;
}

.ss-login__footer {
    margin-top: 1.5rem;
    font-size: 0.8125rem;
}

/* --- Footer -------------------------------------------------------------- */
.ss-footer {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--ss-border);
    font-size: 0.8125rem;
    color: #8a929e;
}

/* --- Validation ---------------------------------------------------------- */
.field-validation-error,
.text-danger {
    color: #d6336c !important;
    font-size: 0.8125rem;
}

.input-validation-error {
    border-color: #d6336c !important;
}

/* --- Responsive: collapse the sidebar off-canvas ------------------------- */
@media (max-width: 991.98px) {
    .ss-sidebar {
        transform: translateX(-100%);
        transition: transform 0.2s ease-in-out;
    }

    .ss-sidebar.show {
        transform: translateX(0);
    }

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

@media (min-width: 992px) {
    .ss-sidebar-toggle {
        display: none;
    }
}

/* --- Pagination (markup comes from the PagedList tag helper) -------------- */
.pagination {
    --bs-pagination-color: #5b6472;
    --bs-pagination-hover-color: var(--ss-orange-dark);
    --bs-pagination-focus-color: var(--ss-orange-dark);
    --bs-pagination-focus-box-shadow: 0 0 0 0.2rem rgba(242, 103, 34, 0.15);
    --bs-pagination-active-bg: var(--ss-orange);
    --bs-pagination-active-border-color: var(--ss-orange);
    margin-bottom: 0;
}

/* The tag helper marks disabled steps on the <li>, not the <a>. */
.pagination .page-item.disabled .page-link {
    color: #adb5bd;
    pointer-events: none;
}
