body { background:#f7f8fa; }
.card { border:0; box-shadow:0 2px 12px rgba(0,0,0,.06); }
.stat-card { min-height:120px; }
.hero { background:#fff; border-radius:16px; padding:48px 32px; box-shadow:0 2px 12px rgba(0,0,0,.06); }
.table td, .table th { vertical-align:middle; }
.timeline { border-left:3px solid #dee2e6; margin-left:12px; padding-left:24px; }
.timeline-item { margin-bottom:20px; }



/* ================================================================
   INUP PMS - Phase 2 Professional Role-Based UI
   ================================================================ */

:root {
    --ipms-sidebar-width: 250px;
    --ipms-topbar-height: 58px;
    --ipms-sidebar-bg: #17212b;
    --ipms-sidebar-hover: #22313f;
    --ipms-sidebar-active: #0d6efd;
    --ipms-border: #e5e7eb;
}

body {
    background: #f5f7fa;
}

.ipms-main {
    margin-left: var(--ipms-sidebar-width);
    min-height: 100vh;
}

.ipms-topbar {
    min-height: var(--ipms-topbar-height);
    position: sticky;
    top: 0;
    z-index: 1030;
    box-shadow: 0 1px 6px rgba(0,0,0,.08);
}

.ipms-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--ipms-sidebar-width);
    background: var(--ipms-sidebar-bg);
    color: #fff;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 10px rgba(0,0,0,.08);
}

.sidebar-header {
    min-height: var(--ipms-topbar-height);
    display: flex;
    align-items: center;
    padding: 0 18px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
}

.sidebar-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 30px;
    border: 1px solid rgba(255,255,255,.5);
    border-radius: 5px;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: .5px;
}

.sidebar-nav {
    padding: 14px 10px;
    overflow-y: auto;
    flex: 1;
}

.sidebar-section {
    padding: 16px 12px 7px;
    color: #8fa1b3;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    margin: 2px 0;
    color: #d7e0e8;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    transition: background .15s ease, color .15s ease;
}

.sidebar-link:hover {
    background: var(--ipms-sidebar-hover);
    color: #fff;
}

.sidebar-link.active {
    background: var(--ipms-sidebar-active);
    color: #fff;
}

.sidebar-icon {
    width: 22px;
    text-align: center;
    font-size: 15px;
}

.sidebar-user {
    padding: 14px 16px;
    border-top: 1px solid rgba(255,255,255,.08);
}

.sidebar-user-name {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    color: #8fa1b3;
    font-size: 10px;
    margin-top: 2px;
    letter-spacing: .8px;
}

.sidebar-toggle,
.sidebar-close {
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 22px;
    line-height: 1;
}

.sidebar-close {
    margin-left: auto;
}

.sidebar-overlay {
    display: none;
}

@media (max-width: 991.98px) {
    .ipms-main {
        margin-left: 0;
    }

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

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

    .sidebar-overlay.show {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.45);
        z-index: 1035;
    }
}

@media (max-width: 575.98px) {
    .ipms-sidebar {
        width: 280px;
    }

    .ipms-topbar .navbar-brand {
        font-size: 17px;
    }

    .ipms-topbar .btn {
        padding: 5px 8px;
    }
}

/* Phase 2 content polish */
.ipms-main .card {
    border: 1px solid var(--ipms-border);
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(15,23,42,.04);
}

.ipms-main h1,
.ipms-main h2,
.ipms-main h3 {
    letter-spacing: -.2px;
}

.ipms-main .table {
    vertical-align: middle;
}

.ipms-main .table thead th {
    white-space: nowrap;
    font-size: 13px;
}

.ipms-main .badge {
    font-weight: 600;
}

.dashboard-kpi-card {
    min-height: 120px;
    display: flex;
    justify-content: center;
}
.dashboard-kpi-card .display-6 {
    line-height: 1;
}

/* My Proposals */
#myProposalsTable td,
#myProposalsTable th {
    white-space: nowrap;
}

@media (max-width: 767.98px) {
    #myProposalsTable td,
    #myProposalsTable th {
        white-space: normal;
    }
}

/* Audit Trail */
#auditTable td,
#auditTable th {
    vertical-align: middle;
}

@media (max-width: 767.98px) {
    #auditTable td,
    #auditTable th {
        white-space: normal;
    }
}


/* =========================================================
   AUTH PAGES
   Common layout for Login and Registration
   ========================================================= */

.auth-page {
    width: calc(100% - 30px);
    max-width: 900px;
    margin: 30px auto 80px;
    box-sizing: border-box;
}

/* Page title */
.auth-page h2 {
    margin: 0 0 5px;
}

/* Page subtitle */
.auth-page > p {
    margin: 0 0 20px;
    color: #52627a;
}

/* Main card */
.auth-page .card {
    width: 100%;
    box-sizing: border-box;
    border: 0;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
}

/* Form labels */
.auth-page .form-label {
    display: block;
    margin-bottom: 6px;
}

/* Inputs and selects */
.auth-page .form-control,
.auth-page .form-select {
    width: 100%;
    box-sizing: border-box;
}

/* Textarea */
.auth-page textarea {
    width: 100%;
    box-sizing: border-box;
    resize: vertical;
}

/* Buttons */
.auth-page button {
    box-sizing: border-box;
}


/* =========================================================
   LOGIN
   ========================================================= */

.auth-page.login-page {
    max-width: 520px;
}

.login-page .card {
    padding: 24px !important;
}


/* =========================================================
   REGISTRATION
   ========================================================= */

.auth-page.register-page {
    max-width: 900px;
}

.register-page .card {
    padding: 22px !important;
}

/* Keep Bootstrap row inside card */
.register-page .row {
    margin-left: -8px;
    margin-right: -8px;
}

.register-page .row > * {
    padding-left: 8px;
    padding-right: 8px;
}


/* =========================================================
   CLOUDFLARE TURNSTILE
   ========================================================= */

.turnstile-wrapper {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.register-page .cf-turnstile {
    max-width: 100%;
}


/* =========================================================
   ALERTS
   ========================================================= */

.auth-page .alert {
    margin-bottom: 15px;
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 767px) {

    .auth-page {
        width: calc(100% - 24px);
        max-width: 100%;
        margin: 20px auto 50px;
    }

    .auth-page .card {
        width: 100%;
        max-width: 100%;
        padding: 18px !important;
        overflow: hidden;
    }

    /* Registration becomes one column */
    .register-page .row {
        margin-left: 0;
        margin-right: 0;
    }

    .register-page .row > * {
        padding-left: 0;
        padding-right: 0;
    }

    /* Full-width mobile controls */
    .auth-page .form-control,
    .auth-page .form-select,
    .auth-page textarea,
    .auth-page button {
        width: 100%;
        max-width: 100%;
    }

    /* Turnstile must stay inside card */
    .turnstile-wrapper {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }

    .register-page iframe {
        max-width: 100%;
    }
}


/* =========================================================
   VERY SMALL MOBILE
   ========================================================= */

@media (max-width: 400px) {

    .auth-page {
        width: calc(100% - 16px);
        margin-top: 15px;
    }

    .auth-page .card {
        padding: 15px !important;
    }

    .auth-page h2 {
        font-size: 1.7rem;
    }
}


/* =========================================================
   PREVENT HORIZONTAL OVERFLOW
   ========================================================= */

html,
body {
    max-width: 100%;
    overflow-x: hidden;
}
.category-cell {
    white-space: normal !important;
    overflow-wrap: break-word;
    word-break: normal;
    line-height: 1.4;
}

.sidebar-user-password {
    margin-top: 8px;
}

.sidebar-user-password a {
    color: #b9c4d0;
    font-size: 12px;
    text-decoration: none;
}

.sidebar-user-password a:hover {
    color: #ffffff;
    text-decoration: underline;
}