:root {
    --navy: #063a63;
    --blue: #0373bd;
    --sky: #e8f3fb;
    --ink: #1b2834;
    --muted: #5d6b77;
    --line: #d7e2ea;
}

html, body {
    height: 100%;
}

body {
    margin: 0;
    color: var(--ink);
    background: #f4f7fa;
    font-family: "Segoe UI", Tahoma, sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-header {
    background: linear-gradient(90deg, #042c4b, var(--blue));
    color: #fff;
    padding: 0.85rem 1.25rem;
}

.app-header .container-fluid {
    gap: 1.5rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: .75rem;
    color: #fff;
    text-decoration: none;
}

.brand small {
    display: block;
    opacity: .8;
    font-size: .75rem;
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: #fff;
    color: var(--blue);
    display: grid;
    place-items: center;
    font-weight: 800;
}

.module-tabs {
    display: flex;
    gap: .35rem;
}

.module-tabs a {
    color: #d7ecfa;
    text-decoration: none;
    padding: .45rem .9rem;
    border-radius: 999px;
}

.module-tabs a.active,
.module-tabs a:hover {
    background: rgba(255,255,255,.16);
    color: #fff;
}

.user-box {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: .92rem;
}

.notif-link {
    color: #fff;
    text-decoration: none;
}

.app-shell {
    flex: 1 0 auto;
}

.app-shell.with-sidebar {
    display: grid;
    grid-template-columns: 250px 1fr;
}

.app-sidebar {
    background: #fff;
    border-right: 1px solid var(--line);
    padding: 1.25rem 1rem;
}

.app-sidebar h2 {
    font-size: .85rem;
    text-transform: uppercase;
    color: var(--blue);
    margin-bottom: .5rem;
}

.app-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem;
}

.app-sidebar li {
    padding: .4rem 0;
    border-bottom: 1px solid #eef3f7;
}

.app-sidebar a {
    color: var(--blue);
    text-decoration: none;
    font-weight: 600;
}

.app-sidebar small,
.app-sidebar .empty {
    display: block;
    color: var(--muted);
    font-size: .8rem;
}

.app-content {
    padding: 1.5rem;
}

.page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.page-head h1 {
    font-size: 1.6rem;
    margin: 0;
}

.page-head p {
    margin: .2rem 0 0;
    color: var(--muted);
}

.search-box {
    display: flex;
    gap: .5rem;
    min-width: 320px;
}

.panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 1rem 1.1rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 8px 24px rgba(6, 58, 99, .04);
}

.panel h2 {
    font-size: 1rem;
    color: var(--navy);
    margin-bottom: 1rem;
}

.req-table thead th {
    background: var(--navy);
    color: #fff;
    font-size: .82rem;
}

.group-row td {
    background: #e9eef2;
    font-weight: 700;
}

.closed {
    text-decoration: line-through;
    color: #7a8791;
}

.status-pill {
    display: inline-block;
    color: #fff;
    border-radius: 999px;
    padding: .15rem .6rem;
    font-size: .78rem;
}

.status-pill.lg {
    font-size: 1rem;
    padding: .4rem .9rem;
}

.prio {
    font-weight: 700;
}

.prio-baja { color: #198754; }
.prio-media { color: #0d6efd; }
.prio-alta { color: #fd7e14; }
.prio-critica { color: #dc3545; }

.empty-panel {
    text-align: center;
    padding: 2rem;
    color: var(--muted);
}

.form-card,
.form-actions {
    margin-top: 1rem;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: .75rem;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 1rem;
}

.meta-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .85rem;
    margin-bottom: 1rem;
}

.meta-grid dt {
    font-size: .75rem;
    color: var(--muted);
    text-transform: uppercase;
}

.description {
    white-space: pre-wrap;
}

.action-bar {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: 1rem;
}

.task-list, .comment-list, .file-list, .notif-list, .simple-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.task-list li, .comment-list li, .file-list li, .notif-list li {
    border-bottom: 1px solid #eef3f7;
    padding: .75rem 0;
}

.task-list li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.task-list li.done {
    opacity: .65;
    text-decoration: line-through;
}

.admin-tabs {
    display: flex;
    gap: .5rem;
    margin-bottom: 1rem;
}

.admin-tabs a {
    padding: .4rem .8rem;
    border-radius: 8px;
    background: #fff;
    border: 1px solid var(--line);
    text-decoration: none;
    color: var(--navy);
}

.admin-tabs a.active {
    background: var(--blue);
    color: #fff;
    border-color: var(--blue);
}

.app-footer {
    flex-shrink: 0;
    padding: 1rem 1.25rem;
    color: var(--muted);
    background: #fff;
    border-top: 1px solid var(--line);
}

.login-wrap {
    min-height: 100%;
    display: grid;
    place-items: center;
}

.login-card {
    width: min(420px, 92vw);
    background: #fff;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 20px 50px rgba(4, 44, 75, .16);
}

.login-brand {
    display: flex;
    gap: .8rem;
    align-items: center;
    margin-bottom: 1.2rem;
}

.login-hint {
    margin-top: 1.2rem;
    background: var(--sky);
    padding: .9rem;
    border-radius: 10px;
    font-size: .9rem;
}

.group-label {
    background: #e9eef2;
    font-weight: 700;
    padding: .4rem .6rem !important;
}

@media (max-width: 992px) {
    .app-shell.with-sidebar,
    .detail-grid,
    .meta-grid {
        grid-template-columns: 1fr;
    }

    .search-box {
        min-width: 0;
        width: 100%;
    }
}

.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}

.config-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 1.2rem;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: .4rem;
}

.config-card i {
    font-size: 1.6rem;
    color: var(--blue);
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.kpi {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 1rem;
}

.kpi strong {
    display: block;
    font-size: 1.8rem;
    color: var(--navy);
}

.kpi.warn strong {
    color: #dc3545;
}

.bar-row {
    display: grid;
    grid-template-columns: 140px 1fr 40px;
    gap: .6rem;
    align-items: center;
    margin-bottom: .6rem;
}

.bar {
    background: #e9eef2;
    height: 10px;
    border-radius: 99px;
}

.bar i {
    display: block;
    height: 10px;
    border-radius: 99px;
    background: var(--blue);
}
