:root {
    --primary: #1f4f8a;
    --primary-dark: #163a64;
    --ink: #0f172a;
    --muted: #5b6472;
    --bg: #eef2f7;
    --card: #ffffff;
    --line: #d7e1ef;
    --accent: #2563eb;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: "IBM Plex Sans", "Segoe UI", Tahoma, Verdana, sans-serif;
    color: var(--ink);
    background: linear-gradient(180deg, #f7f9fc 0%, #eef2f7 100%);
}
a { color: inherit; }
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 32px;
    background: linear-gradient(90deg, #ffffff 0%, #f5f8fc 100%);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 5;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}
.brand { font-weight: 700; letter-spacing: 0.4px; font-size: 18px; }
.nav { display: flex; flex-wrap: wrap; gap: 10px; }
.nav a {
    padding: 6px 12px;
    border-radius: 8px;
    text-decoration: none;
    border: 1px solid transparent;
    color: var(--muted);
    transition: all 0.2s ease;
}
.nav a:hover { border-color: var(--line); background: #eef3fb; color: var(--ink); }
.container { padding: 28px 32px 60px; }
h2 { font-size: 26px; margin: 0 0 16px; }
h3 { margin: 0 0 12px; font-weight: 600; }
.card {
    background: #ffffff;
    border-radius: 12px;
    padding: 22px;
    margin-bottom: 20px;
    border: 1px solid var(--line);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}
.grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); gap: 16px; }
.card.link { text-align: center; font-weight: 600; text-decoration: none; color: var(--ink); }
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, #ffffff 0%, #f2f6fb 100%);
    cursor: pointer;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    color: var(--ink);
    transition: all 0.2s ease;
}
.btn.primary { background: var(--primary); color: #fff; border: 1px solid var(--primary); }
.btn.primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 12px rgba(15, 23, 42, 0.12); }
.grid-form { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); }
label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
input, select, textarea {
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid var(--line);
    background: #ffffff;
    color: var(--ink);
}
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; font-size: 14px; }
.auth {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}
.auth-card { width: 420px; }
.subtitle { color: var(--muted); }
.alert { background: #1c2432; padding: 10px; border-radius: 10px; margin-bottom: 10px; border: 1px solid #3b4a61; }
.alert.error { background: #2a1820; border-color: #5a2a35; }
.drawio-container { height: 560px; position: relative; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.drawio-container iframe { width: 100%; height: 100%; }
.diagram-overlay {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255,255,255,0.9);
    padding: 8px 12px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    font-size: 12px;
}
.diagram-overlay .bar {
    height: 6px;
    background: #e7edf7;
    border-radius: 6px;
    overflow: hidden;
    margin-top: 6px;
}
.diagram-overlay .bar span {
    display: block;
    height: 100%;
    background: var(--primary);
}
.inline-form { display: inline-flex; gap: 8px; align-items: center; }
.list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.gantt { display: grid; gap: 8px; }
.gantt-wrap { background: white; }
.gantt-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.gantt-controls { display: flex; gap: 8px; flex-wrap: wrap; }
.table-container { overflow-x: auto; }
.task-table { width: 100%; border-collapse: collapse; background: #ffffff; border: 1px solid var(--line); }
.task-table thead { background: linear-gradient(135deg, #1f4f8a 0%, #163a64 100%); color: #ffffff; }
.task-table th, .task-table td { padding: 10px 12px; border: 1px solid var(--line); font-size: 14px; }
.task-table tbody tr:nth-child(even) { background: #f6f8fc; }
.task-table tbody tr:nth-child(odd) { background: #ffffff; }
.task-table tbody tr:hover { background: #eef3fb; }
.table-edit-row td { background: #f6f8fc; }
.table-edit-form { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); align-items: end; }
.table-edit-actions { display: flex; gap: 8px; align-items: center; }
.table-total { background: #0f2340; color: #ffffff; font-weight: 700; }
.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.summary-item { background: #141c27; border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; gap: 4px; }
.summary-item strong { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.summary-item span { font-size: 16px; font-weight: 700; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.legend-item { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.legend-color { width: 18px; height: 12px; border-radius: 4px; border: 1px solid var(--line); }
.assignee-equipo { background: #151c26; }
.assignee-- { background: #151c26; }
.assignee-lider-proyecto { background: #1f2a3a; }
.assignee-lider { background: #1f2a3a; }
.assignee-analista { background: #172436; }
.assignee-developer { background: #182b27; }
.assignee-disenador { background: #241f36; }
.assignee-tester { background: #2b1a22; }
.phase-row { background: #1b2431; font-weight: 700; }
.phase-row td { font-weight: 700; }
.gantt .bar-wrapper.phase .bar { fill: #4f8ccf; }
.gantt .bar-wrapper.phase .bar-label { fill: #fff; }
@media print {
    body { background: #fff; }
    .topbar, .nav, .gantt-wrap { display: none !important; }
    main.container > :not(#print-section) { display: none !important; }
    #print-section { display: block !important; box-shadow: none; border: none; }
    #print-section .actions, #print-section .btn { display: none !important; }
    #print-section .task-table { font-size: 11px; }
    #print-section .task-table thead {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    #print-section .task-table,
    #print-section .task-table th,
    #print-section .task-table td,
    #print-section .table-total,
    #print-section .phase-row {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    body.print-gantt .topbar,
    body.print-gantt .nav,
    body.print-gantt main.container > :not(#gantt-print-section) {
        display: none !important;
    }
    body.print-gantt #gantt-print-section {
        display: block !important;
        box-shadow: none;
        border: none;
    }
    body.print-gantt #gantt-print-section .btn {
        display: none !important;
    }
    body.print-gantt #gantt-print-section,
    body.print-gantt #gantt-print-section * {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
.gantt-row { display: grid; grid-template-columns: 180px 1fr; align-items: center; gap: 12px; }
.gantt-bar {
    height: 16px;
    background: #1a2431;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}
.gantt-bar > span {
    position: absolute;
    height: 100%;
    background: var(--primary);
    border-radius: 10px;
    opacity: 0.9;
}
.user-info { display: flex; align-items: center; gap: 12px; color: var(--muted); }
