:root {
    --pms-sidebar-width: 252px;
    --pms-sidebar-bg: #0f172a;
    --pms-sidebar-text: #cbd5e1;
    --pms-topbar-height: 58px;
    --pms-accent: #0d6efd;
}

* {
    letter-spacing: 0;
}

body {
    background: #f1f5f9;
    min-height: 100vh;
}

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

.pms-sidebar {
    width: var(--pms-sidebar-width);
    background: var(--pms-sidebar-bg);
    color: var(--pms-sidebar-text);
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    overflow-y: auto;
    z-index: 1040;
    padding-bottom: 1.5rem;
    scrollbar-width: thin;
}

.pms-brand {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: 1.05rem 1.15rem;
    color: #fff;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    margin-bottom: .5rem;
}

.pms-brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: linear-gradient(135deg, #0d6efd, #6610f2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    flex: 0 0 auto;
}

.pms-brand-name {
    font-weight: 600;
    font-size: .98rem;
    line-height: 1.1;
}

.pms-brand-sub {
    font-size: .68rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.pms-section-title {
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: #64748b;
    padding: .95rem 1.15rem .35rem;
}

.pms-nav-link {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .5rem 1.15rem;
    color: var(--pms-sidebar-text);
    text-decoration: none;
    font-size: .9rem;
    border-left: 3px solid transparent;
    transition: background .15s ease, color .15s ease;
}

.pms-nav-link i {
    font-size: 1rem;
    width: 1.1rem;
    text-align: center;
    opacity: .85;
}

.pms-nav-link:hover {
    background: rgba(255, 255, 255, .06);
    color: #fff;
}

.pms-nav-link.active {
    background: rgba(13, 110, 253, .18);
    color: #fff;
    border-left-color: var(--pms-accent);
    font-weight: 500;
}

.pms-main {
    flex: 1;
    min-width: 0;
    margin-left: var(--pms-sidebar-width);
    display: flex;
    flex-direction: column;
}

.pms-topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    min-height: var(--pms-topbar-height);
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: .45rem 1.25rem;
}

.pms-topbar-title {
    font-size: .95rem;
    font-weight: 600;
    color: #0f172a;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pms-content {
    padding: 1.35rem 1.35rem 2.5rem;
    flex: 1;
    max-width: 1500px;
    width: 100%;
}

.pms-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #0d6efd;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: .82rem;
    flex: 0 0 auto;
}

.pms-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    color: #334155;
    text-decoration: none;
    font-size: 1.15rem;
}

.pms-bell:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.pms-bell .pms-bell-count {
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: .62rem;
    padding: .12em .4em;
    line-height: 1;
}

.card {
    border: 1px solid #e9ecef;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}

.card-header {
    background: #fff;
    font-weight: 600;
    border-bottom: 1px solid #e9ecef;
}

.stat-card .stat-value {
    font-size: 1.65rem;
    font-weight: 700;
    line-height: 1.1;
    color: #0f172a;
}

.stat-card .stat-label {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #64748b;
}

.stat-card .stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.table > :not(caption) > * > * {
    vertical-align: middle;
    padding: .62rem .8rem;
}

.table thead th {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #64748b;
    background: #f8fafc;
    border-bottom-width: 1px;
    white-space: nowrap;
}

.table-hover tbody tr:hover {
    background: #f8fafc;
}

.filter-bar {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: .5rem;
    padding: .85rem;
    margin-bottom: 1rem;
}

.pms-kbd {
    font-size: .78rem;
}

.progress {
    height: .55rem;
}

.pms-progress-lg {
    height: .9rem;
}

.pms-empty {
    padding: 2.5rem 1rem;
    text-align: center;
    color: #94a3b8;
}

.pms-timeline {
    position: relative;
    padding-left: 1.35rem;
}

.pms-timeline::before {
    content: "";
    position: absolute;
    left: 6px;
    top: .35rem;
    bottom: .35rem;
    width: 2px;
    background: #e2e8f0;
}

.pms-timeline-item {
    position: relative;
    padding-bottom: 1rem;
}

.pms-timeline-item::before {
    content: "";
    position: absolute;
    left: -1.35rem;
    top: .35rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #cbd5e1;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #cbd5e1;
}

.pms-timeline-item.is-status::before {
    background: #0d6efd;
    box-shadow: 0 0 0 1px #0d6efd;
}

.pms-timeline-item.is-comment::before {
    background: #198754;
    box-shadow: 0 0 0 1px #198754;
}

.pms-timeline-item.is-attachment::before {
    background: #fd7e14;
    box-shadow: 0 0 0 1px #fd7e14;
}

.pms-kanban {
    display: flex;
    gap: .9rem;
    align-items: flex-start;
    overflow-x: auto;
    padding-bottom: .5rem;
}

.pms-kanban-col {
    flex: 0 0 285px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: .5rem;
    padding: .6rem;
    min-height: 180px;
}

.pms-kanban-col h6 {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #475569;
    margin: 0 0 .55rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pms-kanban-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: .45rem;
    padding: .6rem .65rem;
    margin-bottom: .55rem;
    box-shadow: 0 1px 1px rgba(15, 23, 42, .04);
}

.pms-kanban-card .task-title {
    font-size: .86rem;
    font-weight: 600;
    color: #0f172a;
    display: block;
    text-decoration: none;
}

.pms-kanban-card .task-title:hover {
    color: var(--pms-accent);
}

.pms-calendar {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}

.pms-calendar th {
    font-size: .7rem;
    text-transform: uppercase;
    color: #64748b;
    padding: .4rem;
    text-align: center;
}

.pms-calendar td {
    border: 1px solid #e2e8f0;
    vertical-align: top;
    height: 96px;
    padding: .3rem;
    background: #fff;
    font-size: .75rem;
}

.pms-calendar td.is-muted {
    background: #f8fafc;
    color: #cbd5e1;
}

.pms-calendar td.is-today {
    box-shadow: inset 0 0 0 2px var(--pms-accent);
}

.pms-calendar-day {
    font-weight: 600;
    font-size: .72rem;
    color: #475569;
}

.pms-cal-event {
    display: block;
    border-radius: .25rem;
    padding: .1rem .3rem;
    margin-top: .2rem;
    color: #fff;
    text-decoration: none;
    font-size: .68rem;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pms-comment {
    border-bottom: 1px solid #f1f5f9;
    padding: .7rem 0;
}

.pms-comment:last-child {
    border-bottom: 0;
}

.pms-login-bg {
    min-height: 100vh;
    background: radial-gradient(circle at top left, #1d4ed8 0%, #0f172a 55%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.pms-login-card {
    width: 100%;
    max-width: 430px;
}

.pms-assignee-chip {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    padding: .12rem .55rem;
    font-size: .75rem;
    color: #334155;
    margin: 0 .2rem .2rem 0;
}

.pms-details-list dt {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #64748b;
    font-weight: 600;
}

.pms-details-list dd {
    margin-bottom: .7rem;
    font-size: .9rem;
    color: #0f172a;
}

.pms-json {
    font-size: .7rem;
    background: #f8fafc;
    border: 1px dashed #e2e8f0;
    border-radius: .35rem;
    padding: .4rem .5rem;
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0;
    max-height: 160px;
    overflow: auto;
}

/* Kanban board -------------------------------------------------------- */
.pms-board {
    display: flex;
    gap: .9rem;
    align-items: flex-start;
    overflow-x: auto;
    padding-bottom: .5rem;
}

.pms-board-column {
    flex: 0 0 272px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: .5rem;
    padding: .6rem;
    min-height: 220px;
}

.pms-board-column-header {
    font-size: .76rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #475569;
    margin-bottom: .55rem;
}

.pms-board-cards {
    display: flex;
    flex-direction: column;
    gap: .55rem;
}

.pms-board-card {
    display: block;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: .45rem;
    padding: .6rem .65rem;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 1px 1px rgba(15, 23, 42, .04);
}

.pms-board-card:hover {
    border-color: #cbd5e1;
    background: #fff;
    color: inherit;
}

.pms-board-empty {
    text-align: center;
    padding: 1rem .25rem;
}

/* Month calendar grid ------------------------------------------------- */
.pms-calendar {
    width: 100%;
}

.pms-cal-head {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.pms-cal-head div {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #64748b;
    padding: .45rem;
    text-align: center;
}

.pms-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.pms-cal-cell {
    border-right: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    min-height: 104px;
    padding: .35rem;
    background: #fff;
    font-size: .72rem;
}

.pms-cal-cell:nth-child(7n) {
    border-right: 0;
}

.pms-cal-cell.is-outside {
    background: #f8fafc;
}

.pms-cal-cell.is-today {
    box-shadow: inset 0 0 0 2px var(--pms-accent);
}

.pms-cal-day-num {
    font-weight: 600;
    font-size: .74rem;
    color: #475569;
    margin-bottom: .2rem;
}

.pms-cal-time {
    opacity: .8;
}

/* Avatars & misc ------------------------------------------------------ */
.avatar-initials {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #334155;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: .8rem;
    flex: 0 0 auto;
}

.avatar-initials.avatar-lg {
    width: 54px;
    height: 54px;
    font-size: 1.25rem;
}

.pms-task-description {
    font-size: .93rem;
    color: #334155;
}

@media (max-width: 991.98px) {
    .pms-sidebar {
        transform: translateX(-100%);
        transition: transform .2s ease;
    }

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

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

    .pms-content {
        padding: 1rem;
    }

    .pms-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, .45);
        z-index: 1035;
        display: none;
    }

    .pms-backdrop.show {
        display: block;
    }
}
