/* ==========================================================================
   Project Portal - AdminLTE 2 theme layer
   Loaded after Bootstrap 3, Font Awesome 4.7, AdminLTE 2.4.18 and skin-blue.
   Only presentation lives here; layout behaviour stays with AdminLTE/Bootstrap.
   ========================================================================== */

:root {
    --pm-brand: #2f6fed;
    --pm-brand-dark: #2459c9;
    --pm-brand-soft: #e8efff;
    --pm-ink: #1f2d3d;
    --pm-muted: #6b7c93;
    --pm-line: #e3e9f2;
    --pm-canvas: #f4f6fb;
    --pm-card: #ffffff;
    --pm-success: #0f9f6e;
    --pm-warning: #f59e0b;
    --pm-danger: #e04848;
    --pm-violet: #7c5cff;
    --pm-teal: #14b8a6;
    --pm-radius: 10px;
    --pm-radius-lg: 16px;
    --pm-shadow-sm: 0 2px 8px rgba(20, 39, 66, 0.06);
    --pm-shadow: 0 10px 28px rgba(17, 36, 63, 0.09);
}

/* --------------------------------------------------------------------------
   0. Base
   -------------------------------------------------------------------------- */

html,
body {
    height: 100%;
}

body {
    font-family: "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--pm-ink);
    background: var(--pm-canvas);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
}

a {
    color: var(--pm-brand);
}

a:hover,
a:focus {
    color: var(--pm-brand-dark);
    text-decoration: none;
}

:focus-visible {
    outline: 3px solid rgba(47, 111, 237, 0.35);
    outline-offset: 2px;
}

code {
    color: #33507a;
    background: #eef2f9;
    padding: 1px 5px;
    border-radius: 4px;
}

.text-muted,
.text-soft {
    color: var(--pm-muted) !important;
}

.wrapper {
    background: var(--pm-canvas);
}

/* --------------------------------------------------------------------------
   1. Login / setup (standalone pages)
   -------------------------------------------------------------------------- */

.login-page,
.portal-login {
    background: #0b1b33;
}

.login-shell {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
}

.login-brand {
    position: relative;
    display: flex;
    flex: 1 1 48%;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    padding: 48px 56px;
    color: #ffffff;
    background:
        radial-gradient(circle at 80% 12%, rgba(20, 184, 166, 0.3), transparent 42%),
        radial-gradient(circle at 10% 84%, rgba(47, 111, 237, 0.38), transparent 46%),
        linear-gradient(155deg, #10305a 0%, #0a1a30 100%);
}

.login-brand::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 54px 54px;
    -webkit-mask-image: radial-gradient(circle at 30% 20%, #000 0%, transparent 74%);
    mask-image: radial-gradient(circle at 30% 20%, #000 0%, transparent 74%);
    pointer-events: none;
}

.login-brand > * {
    position: relative;
    z-index: 1;
}

.brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    font-size: 20px;
    color: #ffffff;
    background: linear-gradient(140deg, #3b82f6, #14b8a6);
    box-shadow: 0 8px 22px rgba(20, 184, 166, 0.35);
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.brand-name {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.4px;
}

.brand-tag {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 0.3px;
}

.login-brand-mid {
    max-width: 520px;
    padding: 32px 0;
}

.login-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: #bfe9e2;
    background: rgba(20, 184, 166, 0.14);
    border: 1px solid rgba(20, 184, 166, 0.32);
}

.login-eyebrow .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.18);
}

.login-headline {
    margin: 22px 0 16px;
    font-size: 44px;
    line-height: 1.08;
    font-weight: 700;
    letter-spacing: -0.6px;
}

.login-subline {
    font-size: 16px;
    line-height: 1.65;
    color: rgba(230, 240, 255, 0.72);
    margin-bottom: 28px;
}

.feature-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.feature-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 7px 0;
    font-size: 14.5px;
    color: rgba(230, 240, 255, 0.82);
}

.feature-list .check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    margin-top: 1px;
    border-radius: 50%;
    font-size: 10px;
    color: #0b1b33;
    background: #34d399;
}

.login-brand-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    font-size: 12.5px;
    color: rgba(230, 240, 255, 0.55);
}

.login-brand-footer i {
    margin-right: 5px;
}

.login-panel {
    display: flex;
    flex: 0 0 44%;
    align-items: center;
    justify-content: center;
    padding: 40px 32px;
    background: #f7f9fc;
}

.login-card {
    width: 100%;
    max-width: 430px;
    padding: 36px 34px;
    background: #ffffff;
    border: 1px solid var(--pm-line);
    border-radius: var(--pm-radius-lg);
    box-shadow: 0 24px 60px rgba(8, 21, 42, 0.12);
}

.login-card-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
}

.login-card-brand .brand-mark {
    width: 36px;
    height: 36px;
    font-size: 16px;
    border-radius: 10px;
}

.login-card-brand-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--pm-ink);
}

.login-card-eyebrow {
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--pm-brand);
}

.login-card h1 {
    margin: 8px 0 6px;
    font-size: 27px;
    letter-spacing: -0.3px;
}

.login-intro {
    margin-bottom: 22px;
    color: var(--pm-muted);
    font-size: 14.5px;
}

.login-alert,
.setup-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    margin-bottom: 18px;
    border-radius: var(--pm-radius);
    font-size: 13.5px;
    background: #fdecec;
    border: 1px solid #f7c9c9;
    color: #9b2c2c;
}

.login-alert.is-info {
    background: #e9f1ff;
    border-color: #c6d9ff;
    color: #24478f;
}

.login-alert.is-success {
    background: #e7f8f0;
    border-color: #b9ebd6;
    color: #12674a;
}

.login-alert i,
.setup-alert i {
    margin-top: 2px;
}

.login-form .form-group {
    margin-bottom: 16px;
}

.login-form label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #3b4a5e;
}

.login-form .form-control,
.setup-form .form-control {
    height: 42px;
    border-radius: var(--pm-radius);
    border-color: #d7dfeb;
    box-shadow: none;
    font-size: 14.5px;
}

.login-form .form-control:focus,
.setup-form .form-control:focus {
    border-color: var(--pm-brand);
    box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.14);
}

.login-submit {
    width: 100%;
    height: 44px;
    margin-top: 6px;
    border: none;
    border-radius: var(--pm-radius);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.2px;
    color: #ffffff;
    background: linear-gradient(120deg, var(--pm-brand), var(--pm-brand-dark));
    box-shadow: 0 10px 24px rgba(47, 111, 237, 0.28);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.login-submit:hover,
.login-submit:focus {
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(47, 111, 237, 0.34);
}

.login-submit:disabled {
    opacity: 0.7;
    transform: none;
    box-shadow: none;
}

.login-footer-note {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--pm-line);
    font-size: 12.5px;
    color: var(--pm-muted);
}

.login-footer-note i {
    margin-right: 5px;
}

.password-field {
    position: relative;
}

.password-field .form-control {
    padding-right: 46px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 8px;
    color: var(--pm-muted);
    background: transparent;
    cursor: pointer;
}

.password-toggle:hover,
.password-toggle:focus {
    color: var(--pm-brand);
    background: #eef3fc;
}

/* Setup wizard ------------------------------------------------------------ */

.setup-shell {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background:
        radial-gradient(circle at 15% 10%, rgba(47, 111, 237, 0.22), transparent 45%),
        radial-gradient(circle at 90% 90%, rgba(20, 184, 166, 0.18), transparent 45%),
        #0b1b33;
}

.setup-card {
    width: 100%;
    max-width: 640px;
    padding: 38px 40px;
    background: #ffffff;
    border-radius: var(--pm-radius-lg);
    box-shadow: 0 30px 70px rgba(4, 12, 25, 0.4);
}

.setup-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.setup-card h1 {
    margin: 0 0 6px;
    font-size: 27px;
    letter-spacing: -0.3px;
}

.setup-intro {
    margin-bottom: 24px;
    color: var(--pm-muted);
    font-size: 14.5px;
}

.setup-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 26px;
    padding: 0;
    list-style: none;
}

.setup-steps li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 600;
    color: #4a5b71;
    background: #f0f4fa;
}

.setup-steps li .step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 11px;
    color: #ffffff;
    background: var(--pm-brand);
}

.setup-form .form-group {
    margin-bottom: 16px;
}

.setup-form label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #3b4a5e;
}

.field-hint {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: var(--pm-muted);
}

.password-meters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
}

.password-meters li {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    color: var(--pm-muted);
}

.password-meters li::before {
    content: "\f00c";
    font-family: FontAwesome;
    font-size: 9px;
    color: #c3ccd9;
}

.password-meters li.is-met {
    color: var(--pm-success);
}

.password-meters li.is-met::before {
    color: var(--pm-success);
}

/* --------------------------------------------------------------------------
   2. Main header / logo / sidebar
   -------------------------------------------------------------------------- */

.main-header {
    max-height: 50px;
}

.main-header .logo {
    height: 50px;
    line-height: 50px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.main-header .logo .logo-lg {
    font-size: 18px;
    line-height: 50px;
}

.main-header .logo .logo-lg b {
    font-weight: 700;
}

.main-header .logo .logo-mini {
    font-size: 18px;
}

.main-header .navbar {
    min-height: 50px;
}

.navbar-label {
    display: flex;
    align-items: center;
    height: 50px;
    padding: 0 15px;
}

.navbar-label-text {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.9px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.62);
}

.main-sidebar {
    background: #152238;
}

.sidebar {
    padding-bottom: 30px;
}

.user-panel {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 15px;
}

.user-panel .image {
    float: none;
    width: auto;
    padding: 0;
}

.sidebar .user-panel .user-initials,
.user-initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #ffffff;
    background: linear-gradient(140deg, #3b82f6, #14b8a6);
    box-shadow: 0 6px 16px rgba(9, 24, 48, 0.35);
}

.sidebar .user-panel .info {
    float: none;
    padding: 0;
    min-width: 0;
}

.sidebar .user-panel .info p {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 2px;
    font-size: 11.5px;
    color: rgba(210, 224, 245, 0.72);
}

.sidebar-user-role i {
    font-size: 7px;
    color: #34d399;
}

.sidebar-menu {
    margin-top: 6px;
}

.sidebar-menu > li.header {
    padding: 14px 15px 6px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 1.1px;
    text-transform: uppercase;
    color: rgba(199, 215, 238, 0.5);
    background: transparent;
}

.sidebar-menu > li > a {
    margin: 2px 10px;
    padding: 10px 12px;
    border-radius: 9px;
    color: #cfe0f7;
    font-size: 14px;
    transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-menu > li > a > .fa {
    width: 24px;
    font-size: 15px;
    color: rgba(199, 215, 238, 0.75);
}

.sidebar-menu > li > a:hover,
.sidebar-menu > li > a:focus {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.sidebar-menu > li.active > a {
    color: #ffffff;
    background: linear-gradient(120deg, rgba(47, 111, 237, 0.9), rgba(47, 111, 237, 0.62));
    box-shadow: 0 6px 18px rgba(8, 21, 42, 0.32);
}

.sidebar-menu > li.active > a > .fa {
    color: #ffffff;
}

.sidebar-menu > li > a > .pull-right.label {
    margin-top: 2px;
    font-size: 10px;
}

.sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 24px 15px 0;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 11.5px;
    color: rgba(199, 215, 238, 0.5);
}

.sidebar-footer i {
    width: 16px;
}

.sidebar-mini.sidebar-collapse .sidebar-footer,
.sidebar-mini.sidebar-collapse .sidebar-menu > li.header {
    display: none !important;
}

.sidebar-mini.sidebar-collapse .sidebar-menu > li > a {
    margin: 2px 5px;
    border-radius: 9px;
}

.sidebar-mini.sidebar-collapse .sidebar-menu > li > a > span {
    display: none;
}

/* --------------------------------------------------------------------------
   3. Content topbar (page title + bell + user menu)
   -------------------------------------------------------------------------- */

.content-wrapper {
    background: var(--pm-canvas);
}

.content-header {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 22px 22px 0;
}

.content-header h1 {
    margin: 0;
    font-size: 25px;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: #16273d;
}

.content-header h1 small {
    display: block;
    margin-top: 5px;
    padding: 0;
    font-size: 13.5px;
    font-weight: 400;
    color: var(--pm-muted);
}

.topbar-actions {
    flex: 0 0 auto;
    margin-left: auto;
}

.topbar-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    float: none;
}

.topbar-nav > li {
    float: none;
}

.topbar-nav > li > a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 38px;
    padding: 0 13px;
    border-radius: 10px;
    color: #48586d;
    background: #ffffff;
    border: 1px solid var(--pm-line);
    box-shadow: var(--pm-shadow-sm);
    font-size: 14px;
    transition: color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.topbar-nav > li > a:hover,
.topbar-nav > li > a:focus {
    color: var(--pm-brand);
    border-color: #c9d8f5;
    box-shadow: 0 4px 14px rgba(47, 111, 237, 0.12);
}

.topbar-nav > li > a .label {
    position: absolute;
    top: -6px;
    right: -6px;
    padding: 3px 6px;
    font-size: 9.5px;
    font-weight: 700;
    border-radius: 999px;
}

.topbar-icon {
    position: relative;
    width: 38px;
    padding: 0 !important;
    justify-content: center;
    font-size: 15px;
}

.topbar-initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 9px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.4px;
    color: #ffffff;
    background: linear-gradient(140deg, #3b82f6, #14b8a6);
}

.topbar-user-name {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
}

.topbar-caret {
    font-size: 11px;
    color: #9aa8ba;
}

.dropdown-notifications,
.dropdown-user {
    width: 340px;
    padding: 0;
    border-radius: 12px;
    border: 1px solid var(--pm-line);
    box-shadow: var(--pm-shadow);
    overflow: hidden;
}

.dropdown-user {
    width: 300px;
}

.dropdown-notifications > li.header {
    padding: 12px 16px;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.2px;
    color: #35465c;
    background: #f7f9fd;
    border-bottom: 1px solid var(--pm-line);
}

.dropdown-notifications > li > ul.menu {
    max-height: 320px;
    overflow-y: auto;
    margin: 0;
    padding: 0;
    list-style: none;
}

.dropdown-notifications > li > ul.menu > li > a {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    color: #33455c;
    white-space: normal;
    border-bottom: 1px solid #f1f4f9;
}

.dropdown-notifications > li > ul.menu > li > a:hover {
    background: #f5f8fe;
}

.notification-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    color: var(--pm-brand);
    background: var(--pm-brand-soft);
    font-size: 13px;
}

.notification-copy {
    display: block;
    font-size: 13.5px;
    line-height: 1.4;
}

.dropdown-notifications > li.footer {
    padding: 0;
}

.dropdown-notifications > li.footer > a {
    display: block;
    padding: 11px 16px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--pm-brand);
    background: #f7f9fd;
}

.dropdown-user .user-header {
    padding: 20px 16px 16px;
    text-align: center;
    background: linear-gradient(150deg, #17304f, #0f223a);
}

.dropdown-user .user-header .topbar-initials-lg {
    width: 56px;
    height: 56px;
    margin: 0 auto 10px;
    border-radius: 16px;
    font-size: 19px;
}

.dropdown-user .user-header p {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
}

.dropdown-user .user-header p small {
    display: block;
    margin-top: 3px;
    font-size: 12px;
    color: rgba(220, 233, 250, 0.7);
}

.dropdown-user .user-body {
    padding: 12px 16px;
    background: #fbfcfe;
    border-bottom: 1px solid var(--pm-line);
}

.user-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: #4d5f76;
    word-break: break-all;
}

.user-meta i {
    color: #93a2b6;
}

.dropdown-user .user-footer {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    background: #ffffff;
}

.dropdown-user .user-footer .btn {
    flex: 1 1 0;
    border-radius: 8px;
    font-size: 13px;
    float: none;
}

/* --------------------------------------------------------------------------
   4. Content, boxes and shared UI
   -------------------------------------------------------------------------- */

.content {
    padding: 18px 22px 26px;
}

.content > .row {
    margin-left: -8px;
    margin-right: -8px;
}

.content > .row > [class*="col-"] {
    padding-left: 8px;
    padding-right: 8px;
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.box {
    position: relative;
    margin-bottom: 18px;
    background: var(--pm-card);
    border: 1px solid var(--pm-line);
    border-radius: var(--pm-radius);
    box-shadow: var(--pm-shadow-sm);
}

.box-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 15px 18px;
    border-bottom: 1px solid #eef2f8;
    border-radius: var(--pm-radius) var(--pm-radius) 0 0;
    background: #fbfcfe;
}

.box-header .box-title {
    margin: 0;
    font-size: 14.5px;
    font-weight: 700;
    letter-spacing: 0.1px;
    color: #223549;
}

.box-header .box-subtitle {
    display: block;
    margin-top: 3px;
    font-size: 12px;
    font-weight: 400;
    color: var(--pm-muted);
}

.box-body {
    padding: 18px;
}

.box-body.is-flush {
    padding: 0;
}

.box-footer {
    padding: 14px 18px;
    border-top: 1px solid #eef2f8;
    border-radius: 0 0 var(--pm-radius) var(--pm-radius);
    background: #fbfcfe;
}

.portal-flash {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 16px;
    padding: 12px 16px;
    border-radius: var(--pm-radius);
    border-width: 1px;
    font-size: 13.5px;
}

.portal-flash .flash-icon {
    margin-top: 2px;
    font-size: 15px;
}

.portal-flash .flash-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.portal-flash .flash-detail {
    font-size: 12.5px;
    opacity: 0.8;
}

.pm-flash-leaving {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.btn {
    border-radius: 8px;
    font-weight: 600;
    font-size: 13.5px;
}

.btn-brand {
    color: #ffffff;
    background: linear-gradient(120deg, var(--pm-brand), var(--pm-brand-dark));
    border: 1px solid var(--pm-brand-dark);
    box-shadow: 0 6px 16px rgba(47, 111, 237, 0.24);
}

.btn-brand:hover,
.btn-brand:focus {
    color: #ffffff;
    filter: brightness(1.05);
}

.btn-soft {
    color: #3d4f66;
    background: #ffffff;
    border: 1px solid var(--pm-line);
    box-shadow: var(--pm-shadow-sm);
}

.btn-soft:hover,
.btn-soft:focus {
    color: var(--pm-brand);
    border-color: #c9d8f5;
    background: #ffffff;
}

.btn-danger-soft {
    color: #a52f2f;
    background: #fdeeee;
    border: 1px solid #f4cccc;
}

.btn-danger-soft:hover,
.btn-danger-soft:focus {
    color: #ffffff;
    background: var(--pm-danger);
    border-color: var(--pm-danger);
}

.btn.is-busy {
    opacity: 0.72;
    pointer-events: none;
}

.form-control {
    border-radius: 8px;
    border-color: #d7dfeb;
    box-shadow: none;
    height: 38px;
    font-size: 14px;
}

textarea.form-control {
    height: auto;
    min-height: 96px;
}

select.form-control {
    height: 38px;
}

.form-control:focus {
    border-color: var(--pm-brand);
    box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.13);
}

.form-group > label,
.control-label {
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #3b4a5e;
}

.form-horizontal .control-label {
    padding-top: 9px;
}

.required-mark {
    color: var(--pm-danger);
}

.help-block {
    font-size: 12px;
    color: var(--pm-muted);
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
}

.input-group .form-control {
    border-radius: 0;
}

.input-group .input-group-addon {
    border-color: #d7dfeb;
    background: #f5f7fb;
    border-radius: 0;
}

/* Tables ------------------------------------------------------------------ */

.pm-table {
    width: 100%;
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13.5px;
}

.pm-table > thead > tr > th {
    padding: 10px 14px;
    border-bottom: 1px solid var(--pm-line);
    background: #f7f9fd;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    color: #63758c;
    white-space: nowrap;
}

.pm-table > tbody > tr > td {
    padding: 12px 14px;
    border-top: 1px solid #eef2f8;
    vertical-align: middle;
    color: #33455c;
}

.pm-table > tbody > tr:hover > td {
    background: #fafcff;
}

.pm-table .cell-actions {
    text-align: right;
    white-space: nowrap;
}

.pm-table .cell-actions .btn {
    margin-left: 4px;
}

.pm-table .cell-actions form {
    display: inline-block;
    margin: 0;
}

.table-empty td {
    padding: 26px 14px;
    text-align: center;
    color: var(--pm-muted);
    background: #fbfcfe;
}

.table-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}

/* Badges ------------------------------------------------------------------ */

.role-badge,
.status-badge,
.priority-badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    line-height: 1.4;
    white-space: nowrap;
}

.role-badge.role-admin {
    color: #9b2c2c;
    background: #fdecec;
}

.role-badge.role-owner {
    color: #5b3bb8;
    background: #f0ecff;
}

.role-badge.role-manager {
    color: #1f5fa8;
    background: #e9f1ff;
}

.role-badge.role-programmer {
    color: #0d6f68;
    background: #e5f7f4;
}

.role-badge.role-viewer {
    color: #5b6b80;
    background: #eef2f7;
}

.status-badge.status-active,
.status-badge.status-is-active {
    color: #0d6b4b;
    background: #e5f7ef;
}

.status-badge.status-inactive {
    color: #8a5a00;
    background: #fdf3e0;
}

.priority-badge.priority-low {
    color: #54708f;
    background: #eef3f9;
}

.priority-badge.priority-normal {
    color: #2c5f8a;
    background: #e7f1fa;
}

.priority-badge.priority-high {
    color: #a35a05;
    background: #fdf1df;
}

.priority-badge.priority-urgent {
    color: #a02a2a;
    background: #fdeaea;
}

.project-status {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.project-status.status-active {
    color: #0d6b4b;
    background: #e5f7ef;
}

.project-status.status-closed {
    color: #5b6b80;
    background: #eef2f7;
}

.project-status.status-archived {
    color: #8a5a00;
    background: #fdf3e0;
}

/* Stats ------------------------------------------------------------------- */

.stat-card {
    position: relative;
    overflow: hidden;
    margin-bottom: 18px;
    padding: 18px 20px;
    border-radius: var(--pm-radius);
    background: var(--pm-card);
    border: 1px solid var(--pm-line);
    box-shadow: var(--pm-shadow-sm);
}

.stat-card .stat-value {
    margin: 0;
    font-size: 30px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.5px;
    color: #16273d;
}

.stat-card .stat-label {
    margin: 4px 0 0;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: var(--pm-muted);
}

.stat-card .stat-foot {
    margin-top: 12px;
    font-size: 12px;
    color: var(--pm-muted);
}

.stat-card .stat-icon {
    position: absolute;
    top: 16px;
    right: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    font-size: 19px;
    color: var(--pm-brand);
    background: var(--pm-brand-soft);
}

.stat-card.stat-danger .stat-icon {
    color: #c83737;
    background: #fdecec;
}

.stat-card.stat-warning .stat-icon {
    color: #b26a00;
    background: #fdf3e0;
}

.stat-card.stat-success .stat-icon {
    color: #0d7a58;
    background: #e5f7ef;
}

.stat-card.stat-teal .stat-icon {
    color: #0c7d71;
    background: #e0f7f4;
}

.stat-card.stat-violet .stat-icon {
    color: #5b3bb8;
    background: #f0ecff;
}

.stat-card a.stat-link {
    display: block;
    margin: 12px -20px -18px;
    padding: 9px 20px;
    border-top: 1px solid #eef2f8;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--pm-brand);
    background: #fbfcfe;
}

.stat-card a.stat-link:hover {
    background: #f3f7ff;
}

/* Project cards ----------------------------------------------------------- */

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.project-card {
    display: flex;
    flex-direction: column;
    min-height: 180px;
    background: var(--pm-card);
    border: 1px solid var(--pm-line);
    border-radius: var(--pm-radius);
    box-shadow: var(--pm-shadow-sm);
    overflow: hidden;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.project-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--pm-shadow);
}

.project-card-accent {
    height: 5px;
    background: var(--pm-brand);
}

.project-card-body {
    flex: 1 1 auto;
    padding: 16px 18px 14px;
}

.project-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.project-card-title {
    margin: 0;
    font-size: 16.5px;
    font-weight: 700;
    color: #1a2b40;
}

.project-card-title a {
    color: inherit;
}

.project-card-title a:hover {
    color: var(--pm-brand);
}

.project-key {
    display: inline-block;
    margin-top: 4px;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #3f5b7d;
    background: #eef3fa;
}

.project-card-desc {
    margin: 10px 0 0;
    font-size: 13px;
    line-height: 1.55;
    color: var(--pm-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
    font-size: 12px;
    color: #5c6d83;
}

.project-card-meta i {
    margin-right: 4px;
    color: #93a2b6;
}

.project-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 18px;
    border-top: 1px solid #eef2f8;
    background: #fbfcfe;
    font-size: 12px;
    color: var(--pm-muted);
}

.project-card-foot .btn {
    padding: 4px 12px;
    font-size: 12px;
}

/* Dashboard work list ----------------------------------------------------- */

.work-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.work-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 18px;
    border-top: 1px solid #eef2f8;
}

.work-item:first-child {
    border-top: none;
}

.work-item:hover {
    background: #fafcff;
}

.work-item-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 14px;
    color: #2c5f8a;
    background: #e9f2fb;
}

.work-item.is-overdue .work-item-icon {
    color: #c83737;
    background: #fdecec;
}

.work-item.is-due-soon .work-item-icon {
    color: #b26a00;
    background: #fdf3e0;
}

.work-item-main {
    flex: 1 1 auto;
    min-width: 0;
}

.work-item-title {
    display: block;
    margin-bottom: 3px;
    font-size: 13.5px;
    font-weight: 600;
    color: #223549;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.work-item-title a {
    color: inherit;
}

.work-item-title a:hover {
    color: var(--pm-brand);
}

.work-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 11.5px;
    color: var(--pm-muted);
}

.work-item-meta i {
    margin-right: 3px;
}

.work-item-due {
    flex: 0 0 auto;
    font-size: 11.5px;
    font-weight: 600;
    color: #5c6d83;
    white-space: nowrap;
}

.work-item.is-overdue .work-item-due {
    color: #c83737;
}

.work-item.is-due-soon .work-item-due {
    color: #b26a00;
}

/* Notifications page ------------------------------------------------------ */

.notification-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.notification-list-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 18px;
    border-top: 1px solid #eef2f8;
}

.notification-list-item:first-child {
    border-top: none;
}

.notification-list-item.is-unread {
    background: #f5f9ff;
}

.notification-list-item .notification-icon {
    width: 38px;
    height: 38px;
    font-size: 15px;
}

.notification-list-item.is-unread .notification-icon {
    color: #ffffff;
    background: linear-gradient(140deg, #3b82f6, #2f6fed);
}

.notification-main {
    flex: 1 1 auto;
    min-width: 0;
}

.notification-title {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #21354c;
}

.notification-title a {
    color: inherit;
}

.notification-title a:hover {
    color: var(--pm-brand);
}

.notification-body {
    margin: 4px 0 0;
    font-size: 13px;
    line-height: 1.5;
    color: #5b6b80;
}

.notification-time {
    flex: 0 0 auto;
    font-size: 11.5px;
    color: var(--pm-muted);
    white-space: nowrap;
}

.unread-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 6px;
    border-radius: 50%;
    background: var(--pm-brand);
    vertical-align: middle;
}

/* Activity feed ----------------------------------------------------------- */

.activity-feed {
    position: relative;
    margin: 0;
    padding: 4px 0 4px 4px;
    list-style: none;
}

.activity-feed::before {
    content: "";
    position: absolute;
    top: 8px;
    bottom: 8px;
    left: 21px;
    width: 2px;
    background: #e6ecf5;
}

.activity-item {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 10px 0;
}

.activity-icon {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 14px;
    color: var(--pm-brand);
    background: #e9f1ff;
    border: 3px solid var(--pm-card);
    box-shadow: 0 0 0 1px #e6ecf5;
}

.activity-main {
    flex: 1 1 auto;
    padding-top: 2px;
    min-width: 0;
}

.activity-summary {
    margin: 0;
    font-size: 13.5px;
    color: #2a3d55;
    line-height: 1.5;
}

.activity-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 3px;
    font-size: 11.5px;
    color: var(--pm-muted);
}

.activity-meta strong {
    color: #40536b;
    font-weight: 600;
}

/* Profile ----------------------------------------------------------------- */

.profile-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 18px;
    margin-bottom: 18px;
    padding: 22px 24px;
    border-radius: var(--pm-radius-lg);
    color: #ffffff;
    background:
        radial-gradient(circle at 88% 12%, rgba(20, 184, 166, 0.34), transparent 45%),
        linear-gradient(150deg, #17304f, #0d1f36);
    box-shadow: var(--pm-shadow);
}

.profile-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 76px;
    height: 76px;
    border-radius: 22px;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #ffffff;
    background: linear-gradient(140deg, #3b82f6, #14b8a6);
    box-shadow: 0 10px 26px rgba(4, 12, 25, 0.4);
}

.profile-hero-main {
    flex: 1 1 260px;
    min-width: 0;
}

.profile-hero-main h2 {
    margin: 0;
    font-size: 23px;
    font-weight: 700;
    letter-spacing: -0.2px;
}

.profile-hero-main .profile-role {
    margin-top: 3px;
    font-size: 13px;
    color: rgba(224, 236, 252, 0.72);
}

.profile-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.profile-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11.5px;
    color: rgba(232, 242, 255, 0.86);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.profile-pill i {
    opacity: 0.8;
}

/* Tabs inside boxes ------------------------------------------------------- */

.pm-tabs {
    padding: 0 18px;
    border-bottom: 1px solid #eef2f8;
    background: #fbfcfe;
    border-radius: var(--pm-radius) var(--pm-radius) 0 0;
}

.pm-tabs > li > a {
    margin-right: 4px;
    padding: 11px 12px;
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    font-size: 13px;
    font-weight: 600;
    color: #61738b;
    background: transparent;
}

.pm-tabs > li > a:hover,
.pm-tabs > li > a:focus {
    color: var(--pm-brand);
    background: transparent;
    border-bottom-color: #c9d8f5;
}

.pm-tabs > li.active > a,
.pm-tabs > li.active > a:hover,
.pm-tabs > li.active > a:focus {
    color: var(--pm-brand);
    background: transparent;
    border: none;
    border-bottom: 2px solid var(--pm-brand);
}

.pm-tabs .badge {
    margin-left: 4px;
    font-size: 10px;
    font-weight: 700;
    color: #5b6b80;
    background: #e9eef6;
}

.pm-tabs > li.active .badge {
    color: #ffffff;
    background: var(--pm-brand);
}

.member-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 190px;
}

.member-cell .user-initials {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 12px;
    box-shadow: none;
}

.footer-note {
    margin-left: 8px;
    font-size: 12px;
    color: var(--pm-muted);
}

.footer-tech {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 12px;
    color: var(--pm-muted);
}

.footer-tech i {
    margin-right: 3px;
}

.server-time {
    font-size: 12px;
    color: var(--pm-muted);
}

/* Empty states ------------------------------------------------------------ */

.empty-state {
    padding: 30px 20px;
    text-align: center;
}

.empty-state .empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    margin-bottom: 12px;
    border-radius: 16px;
    font-size: 22px;
    color: #6c86a8;
    background: #eef2f8;
}

.empty-state h4 {
    margin: 0 0 6px;
    font-size: 15.5px;
    font-weight: 700;
    color: #2a3d55;
}

.empty-state p {
    max-width: 430px;
    margin: 0 auto;
    font-size: 13px;
    line-height: 1.6;
    color: var(--pm-muted);
}

/* Filters ----------------------------------------------------------------- */

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: var(--pm-card);
    border: 1px solid var(--pm-line);
    border-radius: var(--pm-radius);
    box-shadow: var(--pm-shadow-sm);
}

.filter-bar .filter-label {
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: #70829a;
}

.filter-bar .btn {
    padding: 5px 12px;
    font-size: 12.5px;
}

.filter-bar .btn.is-active {
    color: #ffffff;
    background: var(--pm-brand);
    border-color: var(--pm-brand);
}

/* --------------------------------------------------------------------------
   5. Toasts and confirm dialog
   -------------------------------------------------------------------------- */

.pm-toasts {
    position: fixed;
    top: 64px;
    right: 18px;
    z-index: 2200;
    display: flex;
    flex-direction: column;
    gap: 9px;
    width: 330px;
    max-width: calc(100vw - 36px);
    pointer-events: none;
}

.pm-toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--pm-radius);
    font-size: 13.5px;
    line-height: 1.45;
    color: #2a3d55;
    background: #ffffff;
    border: 1px solid var(--pm-line);
    box-shadow: var(--pm-shadow);
    pointer-events: auto;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.pm-toast > .fa {
    margin-top: 2px;
    color: var(--pm-brand);
}

.pm-toast-success > .fa {
    color: var(--pm-success);
}

.pm-toast-warning > .fa {
    color: var(--pm-warning);
}

.pm-toast-danger > .fa {
    color: var(--pm-danger);
}

.pm-toast-text {
    flex: 1 1 auto;
}

.pm-toast-close {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    margin: -2px -4px 0 0;
    padding: 0;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    line-height: 1;
    color: #93a2b6;
    background: transparent;
    cursor: pointer;
}

.pm-toast-close:hover {
    color: #33455c;
    background: #eef2f8;
}

.pm-toast-leaving {
    opacity: 0;
    transform: translateX(12px);
}

.pm-confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 2300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(9, 20, 38, 0.55);
}

.pm-confirm {
    width: 100%;
    max-width: 420px;
    padding: 24px 24px 20px;
    border-radius: var(--pm-radius-lg);
    background: #ffffff;
    box-shadow: 0 30px 80px rgba(4, 12, 25, 0.45);
}

.pm-confirm h4 {
    margin: 0 0 8px;
    font-size: 17px;
    font-weight: 700;
    color: #1a2b40;
}

.pm-confirm p {
    margin: 0 0 20px;
    font-size: 13.5px;
    line-height: 1.55;
    color: #5b6b80;
}

.pm-confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* --------------------------------------------------------------------------
   6. Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1100px) {
    .login-headline {
        font-size: 36px;
    }
}

@media (max-width: 991px) {
    .login-brand {
        flex: 1 1 40%;
        padding: 36px 34px;
    }

    .login-panel {
        flex: 1 1 60%;
        padding: 30px 20px;
    }

    .login-headline {
        font-size: 30px;
    }

    .login-subline {
        font-size: 14.5px;
    }

    .content-header {
        flex-direction: column;
        gap: 12px;
    }

    .topbar-actions {
        width: 100%;
    }

    .topbar-nav {
        justify-content: flex-end;
    }
}

@media (max-width: 767px) {
    .login-brand {
        display: none;
    }

    .login-panel {
        flex: 1 1 100%;
        min-height: 100vh;
        min-height: 100dvh;
        padding: 24px 16px;
    }

    .login-card {
        padding: 28px 22px;
    }

    .setup-shell {
        padding: 20px 12px;
    }

    .setup-card {
        padding: 26px 22px;
    }

    .content-header {
        padding: 16px 14px 0;
    }

    .content-header h1 {
        font-size: 21px;
    }

    .content {
        padding: 14px 14px 22px;
    }

    .content > .row {
        margin-left: -5px;
        margin-right: -5px;
    }

    .content > .row > [class*="col-"] {
        padding-left: 5px;
        padding-right: 5px;
    }

    .project-grid {
        grid-template-columns: 1fr;
    }

    .topbar-user-name {
        display: none;
    }

    .dropdown-notifications {
        width: 300px;
    }

    .dropdown-user {
        width: 280px;
    }

    .profile-hero {
        padding: 18px;
    }

    .pm-toasts {
        top: 58px;
        right: 12px;
        left: 12px;
        width: auto;
    }
}

/* Print */
@media print {
    .main-header,
    .main-sidebar,
    .main-footer,
    .topbar-actions,
    .page-actions,
    .filter-bar {
        display: none !important;
    }

    .content-wrapper {
        margin-left: 0 !important;
    }

    .box {
        box-shadow: none;
        border-color: #cccccc;
    }
}

/* ==========================================================================
   7. Board page (project.cfm + board.js)
   ========================================================================== */

#boardPage {
    position: relative;
}

.board-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.board-toolbar-left,
.board-toolbar-right {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.board-summary {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--pm-muted);
}

.board-filters {
    margin-bottom: 14px;
    padding: 12px 14px;
    background: var(--pm-card);
    border: 1px solid var(--pm-line);
    border-radius: var(--pm-radius);
    box-shadow: var(--pm-shadow-sm);
}

.board-filters > [class*="col-"] {
    margin-bottom: 6px;
}

.board-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 40px 16px;
    font-size: 13.5px;
}

.board-loading.hidden,
.board-empty.hidden,
.board-columns .hidden {
    display: none !important;
}

.board-empty .box {
    margin-bottom: 0;
}

.board-empty .box-body {
    text-align: center;
}

.board-columns {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    overflow-x: auto;
    padding: 2px 2px 14px;
    scroll-behavior: smooth;
}

.board-columns.board-is-dragging {
    cursor: grabbing;
}

.board-column {
    display: flex;
    flex-direction: column;
    flex: 0 0 290px;
    width: 290px;
    max-height: calc(100vh - 260px);
    padding: 0 0 8px;
    background: #eef2f8;
    border-top: 4px solid #3c8dbc;
    border-radius: var(--pm-radius);
    box-shadow: inset 0 0 0 1px #e2e8f1;
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

.board-column.is-drop-target {
    background: #e3ecfb;
    box-shadow: inset 0 0 0 2px rgba(47, 111, 237, 0.45);
}

.board-column[data-is-done="1"] {
    background: #eaf5ef;
    box-shadow: inset 0 0 0 1px #d8ecdf;
}

.board-column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 11px 12px 9px;
}

.board-column-title {
    margin: 0;
    font-size: 13.5px;
    font-weight: 700;
    letter-spacing: 0.1px;
    color: #2a3d55;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.board-column-meta {
    display: flex;
    align-items: center;
    gap: 5px;
    flex: 0 0 auto;
}

.board-column-meta .label {
    padding: 3px 7px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
}

.board-column-count {
    background: #dde4ee;
    color: #4d5f76;
}

.board-column-done {
    background: #0f9f6e;
}

.board-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 40px;
    padding: 0 10px 4px;
    overflow-y: auto;
    border-radius: 8px;
}

.board-cards:empty::after {
    content: "Drop cards here";
    display: block;
    padding: 16px 8px;
    border: 1.5px dashed #c8d3e2;
    border-radius: 8px;
    text-align: center;
    font-size: 11.5px;
    color: #8a99ad;
}

.board-card {
    position: relative;
    padding: 10px 11px;
    background: var(--pm-card);
    border: 1px solid #dfe6f0;
    border-radius: 9px;
    box-shadow: 0 2px 6px rgba(20, 39, 66, 0.06);
    cursor: pointer;
    transition: box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}

.board-card:hover,
.board-card:focus {
    border-color: #c9d8f5;
    box-shadow: 0 8px 20px rgba(20, 39, 66, 0.12);
    outline: none;
}

.board-card.is-draggable {
    cursor: grab;
}

.board-card.is-dragging {
    opacity: 0.45;
    cursor: grabbing;
    transform: rotate(-0.6deg);
}

.board-card.is-completed .board-card-title {
    color: #6d7c90;
    text-decoration: line-through;
}

.board-card-placeholder {
    min-height: 56px;
    background: rgba(47, 111, 237, 0.06);
    border: 1.5px dashed #9fb9e8;
    border-radius: 9px;
    box-shadow: none;
}

.board-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 5px;
}

.board-card-ref {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 5px;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.3px;
    color: #44608a;
    background: #eef3fb;
}

.board-card-priority {
    padding: 3px 7px;
    border-radius: 999px;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.board-card-title {
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.4;
    color: #223549;
    word-break: break-word;
    margin-bottom: 7px;
}

.board-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: #6b7c93;
}

.board-card-meta > span {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.board-card-due {
    font-weight: 600;
    color: #5b6b80;
}

.board-card-due.is-overdue {
    color: #c83737;
}

.board-card-avatars {
    gap: 3px !important;
}

.board-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.3px;
    color: #ffffff;
    background: linear-gradient(140deg, #3b82f6, #14b8a6);
    border: 2px solid #ffffff;
    box-shadow: 0 1px 4px rgba(20, 39, 66, 0.18);
}

.board-card-stat {
    font-weight: 600;
}

.board-card-blocked {
    color: #c83737;
}

.board-card-labels {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 0 0 7px;
}

.board-label-dot {
    display: inline-block;
    width: 20px;
    height: 6px;
    border-radius: 999px;
    background: #9aa8ba;
}

.board-add {
    padding: 6px 10px 2px;
}

.board-add-toggle {
    width: 100%;
    padding: 6px 10px;
    color: #5b6b80;
    background: rgba(255, 255, 255, 0.65);
    border: 1px dashed #c8d3e2;
    border-radius: 8px;
    font-size: 12.5px;
    text-align: left;
}

.board-add-toggle:hover,
.board-add-toggle:focus {
    color: var(--pm-brand);
    background: #ffffff;
    border-color: #9fb9e8;
}

.board-add-form {
    padding: 9px 10px;
    background: #ffffff;
    border: 1px solid var(--pm-line);
    border-radius: 9px;
    box-shadow: var(--pm-shadow-sm);
}

.board-add-form .form-group {
    margin-bottom: 8px;
}

.board-add-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Card modal -------------------------------------------------------------- */

#cardModal .modal-content {
    border: none;
    border-radius: var(--pm-radius-lg);
    box-shadow: 0 30px 80px rgba(4, 12, 25, 0.4);
    overflow: hidden;
}

#cardModal .modal-header {
    padding: 16px 20px;
    background: #f7f9fd;
    border-bottom: 1px solid var(--pm-line);
}

#cardModal .modal-title {
    font-size: 16px;
    font-weight: 700;
    color: #1f2d3d;
}

#cardModal .modal-body {
    padding: 18px 20px;
}

#cardModal hr {
    margin: 18px 0;
    border-top-color: #eef2f8;
}

.card-modal-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 4px;
}

.card-modal-section-title {
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.2px;
    color: #33455c;
}

.card-modal-section-title .fa {
    margin-right: 5px;
    color: #7588a0;
}

.card-assignee-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-bottom: 10px;
}

.card-assignee-list .checkbox-inline {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: 0;
    padding: 5px 10px;
    border: 1px solid var(--pm-line);
    border-radius: 8px;
    background: #fbfcfe;
    font-size: 13px;
}

.card-assignee-list .checkbox-inline small {
    color: var(--pm-muted);
}

.card-inline-form {
    margin-top: 12px;
    padding: 12px;
    background: #f8fafd;
    border: 1px solid #e8eef7;
    border-radius: var(--pm-radius);
}

.card-inline-form .form-group {
    margin-bottom: 8px;
}

.card-checklist,
.card-comments,
.card-attachments,
.card-dependencies {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.card-checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 9px 12px;
    background: #fbfcfe;
    border: 1px solid #e8eef7;
    border-radius: 9px;
    flex-wrap: wrap;
}

.card-checklist-item.is-done .card-checklist-title {
    color: #6d7c90;
    text-decoration: line-through;
}

.card-checklist-check {
    flex: 0 0 auto;
    margin: 2px 0 0;
    font-weight: normal;
}

.card-checklist-body {
    flex: 1 1 220px;
    min-width: 0;
}

.card-checklist-title {
    font-size: 13.5px;
    font-weight: 600;
    color: #2a3d55;
    word-break: break-word;
}

.card-checklist-detail {
    margin-top: 2px;
    white-space: pre-wrap;
}

.card-checklist-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
}

.checklist-edit-form {
    flex: 1 1 100%;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-top: 6px;
}

.checklist-edit-form.hidden {
    display: none !important;
}

.checklist-edit-actions {
    display: flex;
    gap: 6px;
}

.card-comment {
    padding: 9px 12px;
    background: #fbfcfe;
    border: 1px solid #e8eef7;
    border-radius: 9px;
}

.card-comment-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 3px;
    margin-bottom: 4px;
    font-size: 13px;
}

.card-comment-body {
    font-size: 13.5px;
    line-height: 1.55;
    color: #3c4f66;
    white-space: pre-wrap;
    word-break: break-word;
}

.card-attachment {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #fbfcfe;
    border: 1px solid #e8eef7;
    border-radius: 9px;
    font-size: 13px;
}

.card-attachment-link {
    flex: 1 1 auto;
    min-width: 0;
    color: #2c5f8a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-attachment-link:hover {
    color: var(--pm-brand);
}

.card-dependency-group {
    padding: 10px 12px;
    background: #fbfcfe;
    border: 1px solid #e8eef7;
    border-radius: 9px;
}

.card-dependency-label {
    margin-bottom: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: #70829a;
}

.card-dependency-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 4px 0;
    font-size: 13px;
    color: #33455c;
}

/* ==========================================================================
   8. Project settings page (project-settings.cfm + settings.js)
   ========================================================================== */

#projectSettings .box {
    margin-bottom: 20px;
}

.settings-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.settings-project-ref {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: #44608a;
    background: #eef3fb;
    border: 1px solid #dbe5f4;
}

.settings-subtitle {
    margin: 4px 0 12px;
    font-size: 14px;
    font-weight: 700;
    color: #2a3d55;
}

.settings-delete-column {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 0 6px;
    vertical-align: middle;
}

.settings-delete-column select.form-control {
    width: auto;
    min-width: 130px;
}

.column-color {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 6px;
    border-radius: 50%;
    vertical-align: middle;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
}

#workflowColumns td,
#workflowColumns th {
    vertical-align: middle !important;
}

#workflowColumns .btn-group {
    white-space: nowrap;
}

.transition-matrix {
    background: #ffffff;
    border-color: #e3e9f2;
    font-size: 12.5px;
}

.transition-matrix > thead > tr > th {
    padding: 8px 10px;
    background: #f7f9fd;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #63758c;
    white-space: nowrap;
}

.transition-matrix > tbody > tr > td {
    padding: 6px 8px;
    text-align: center;
}

.transition-matrix > tbody > tr > td .form-control {
    display: inline-block;
    width: auto;
}

.transition-matrix .matrix-row-head,
.transition-matrix > tbody > tr > th {
    position: sticky;
    left: 0;
    z-index: 2;
    min-width: 170px;
    padding: 7px 10px;
    text-align: left;
    background: #ffffff;
    border-right: 1px solid #e3e9f2;
    font-size: 12.5px;
    font-weight: 600;
    color: #2a3d55;
    white-space: nowrap;
}

.transition-matrix > tbody > tr > th .btn-group {
    margin-left: 8px;
    vertical-align: middle;
}

.transition-matrix > thead > tr > th:first-child {
    position: sticky;
    left: 0;
    z-index: 3;
    background: #f7f9fd;
    text-align: left;
    min-width: 170px;
}

.transition-matrix input[type="checkbox"] {
    width: 15px;
    height: 15px;
    cursor: pointer;
}

.transition-matrix tr.has-enabled > .matrix-row-head {
    box-shadow: inset 3px 0 0 var(--pm-brand);
    background: #f5f9ff;
}

.matrix-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}

.matrix-toolbar .btn:last-child {
    margin-left: auto;
}

.automation-rule {
    padding: 14px 16px;
    margin-bottom: 12px;
    background: #fbfcfe;
    border: 1px solid #e8eef7;
    border-radius: var(--pm-radius);
}

.automation-rule:last-child {
    margin-bottom: 0;
}

.automation-rule .checkbox {
    margin: 0 0 2px;
}

.automation-rule .checkbox label {
    font-size: 13.5px;
}

.automation-rule .help-block {
    margin-bottom: 0;
}

.rule-config {
    margin-top: 10px;
    padding: 12px;
    background: #ffffff;
    border: 1px solid #e3e9f2;
    border-left: 3px solid var(--pm-brand);
    border-radius: 8px;
    transition: opacity 0.15s ease;
}

.rule-config.is-disabled {
    opacity: 0.55;
    pointer-events: none;
}

.danger-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
}

.danger-actions form {
    margin: 0;
}

/* Board / settings responsive --------------------------------------------- */

@media (max-width: 991px) {
    .board-column {
        flex-basis: 270px;
        width: 270px;
    }

    .board-toolbar {
        align-items: flex-start;
    }

    .board-toolbar-right {
        width: 100%;
    }
}

@media (max-width: 767px) {
    .board-columns {
        gap: 10px;
    }

    .board-column {
        flex-basis: 84vw;
        width: 84vw;
        max-height: none;
    }

    .board-filters .col-sm-3 .btn {
        width: 100%;
    }

    .board-toolbar-left,
    .board-toolbar-right {
        width: 100%;
    }

    .board-toolbar-left .btn,
    .board-toolbar-right .btn {
        flex: 1 1 auto;
    }

    .board-summary {
        width: 100%;
    }

    .card-modal-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .card-modal-actions .btn {
        width: 100%;
    }

    .settings-delete-column {
        display: flex;
        flex-wrap: wrap;
        margin: 6px 0 0;
    }

    .transition-matrix > thead > tr > th:first-child,
    .transition-matrix .matrix-row-head {
        min-width: 130px;
    }
}


/* AI settings ---------------------------------------------------------- */
.ai-settings-page .ai-endpoint {
    display: inline-block;
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}
.ai-settings-page .ai-provider-row td {
    vertical-align: middle;
}
.ai-settings-page .ai-row-actions .btn {
    margin-left: 2px;
}
.ai-settings-page .ai-modal-result {
    margin-top: 14px;
    padding: 12px 14px;
    border: 1px solid #d2d6de;
    border-radius: 4px;
    background: #f7f7f7;
    max-height: 300px;
    overflow: auto;
}
.ai-settings-page .ai-model-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 8px;
}
.ai-settings-page .ai-model-pick {
    margin: 0 4px 4px 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* AI intake ------------------------------------------------------------ */
.ai-create-page .ai-task-preview {
    border: 1px solid #e1e6ec;
    border-radius: 6px;
    padding: 14px 16px;
    margin-bottom: 16px;
    background: #fbfcfe;
}
.ai-create-page .ai-task-preview .ai-task-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}
.ai-create-page .ai-task-checklist {
    margin: 0;
    padding-left: 18px;
    color: #55606c;
}
.ai-create-page .ai-task-checklist li {
    margin-bottom: 3px;
}
.ai-create-page .hidden {
    display: none !important;
}

/* Login screen: the AdminLTE skin leaves the logo dark (#444) on the portal's
   dark login background, so force a light logo. */
.login-page .login-logo,
.login-page .login-logo a {
    color: #ffffff;
}
