:root{
      --bg:#0f172a;
      --panel:#111827;
      --panel-2:#1f2937;
      --line:#334155;
      --text:#f8fafc;
      --muted:#94a3b8;
      --primary:#38bdf8;
      --primary-2:#0ea5e9;
      --success:#22c55e;
      --warning:#f59e0b;
      --danger:#ef4444;
      --shadow:0 14px 35px rgba(0,0,0,.28);
      --radius:18px;
    }

    *{box-sizing:border-box}
    html{scroll-behavior:smooth}
    body{
      margin:0;
      font-family:Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      background:
        radial-gradient(circle at top left, rgba(56,189,248,.15), transparent 28%),
        linear-gradient(180deg,#0b1220 0%,var(--bg) 100%);
      color:var(--text);
      min-height:100vh;
    }

    button,input,select,textarea{font:inherit}

    .app{
      width:min(1280px, calc(100% - 32px));
      margin:0 auto;
      padding:32px 0 56px;
    }

    .hero{
      display:flex;
      justify-content:space-between;
      gap:24px;
      align-items:flex-start;
      margin-bottom:24px;
    }

    .eyebrow{
      text-transform:uppercase;
      letter-spacing:.14em;
      color:var(--primary);
      font-size:.78rem;
      font-weight:800;
      margin-bottom:8px;
    }

    h1{
      margin:0;
      font-size:clamp(2rem,4vw,3.5rem);
      line-height:1;
    }

    .subtitle{
      margin:14px 0 0;
      color:var(--muted);
      max-width:760px;
      line-height:1.6;
    }

    .hero-actions{
      display:flex;
      flex-wrap:wrap;
      gap:10px;
      justify-content:flex-end;
    }

    .btn{
      border:1px solid transparent;
      border-radius:12px;
      padding:11px 16px;
      cursor:pointer;
      transition:.2s ease;
      font-weight:750;
    }

    .btn:hover{transform:translateY(-1px)}
    .btn-primary{
      background:var(--primary);
      color:#082f49;
    }
    .btn-primary:hover{background:#7dd3fc}
    .btn-secondary{
      background:rgba(255,255,255,.05);
      color:var(--text);
      border-color:var(--line);
    }
    .btn-danger{
      background:rgba(239,68,68,.12);
      color:#fecaca;
      border-color:rgba(239,68,68,.35);
    }

    .dashboard{
      display:grid;
      grid-template-columns:repeat(4,1fr);
      gap:14px;
      margin-bottom:22px;
    }

    .stat{
      background:rgba(17,24,39,.78);
      border:1px solid rgba(148,163,184,.14);
      border-radius:var(--radius);
      padding:18px;
      box-shadow:var(--shadow);
      backdrop-filter: blur(10px);
    }

    .stat-label{
      color:var(--muted);
      font-size:.83rem;
      margin-bottom:8px;
    }

    .stat-value{
      font-size:1.65rem;
      font-weight:850;
    }

    .progress-card{
      grid-column:span 2;
    }

    .progress-track{
      height:12px;
      background:#0b1220;
      border-radius:999px;
      overflow:hidden;
      margin-top:12px;
      border:1px solid rgba(148,163,184,.12);
    }

    .progress-bar{
      height:100%;
      width:0%;
      background:linear-gradient(90deg,var(--primary),var(--success));
      border-radius:inherit;
      transition:width .3s ease;
    }

    .project-overview{
      display:grid;
      grid-template-columns:220px 1fr;
      gap:18px;
      align-items:stretch;
      background:rgba(17,24,39,.82);
      border:1px solid rgba(148,163,184,.14);
      border-radius:var(--radius);
      padding:20px;
      margin-bottom:22px;
      box-shadow:var(--shadow);
    }

    .overall-progress{
      display:grid;
      place-items:center;
      text-align:center;
      padding:8px;
    }

    .progress-ring{
      --progress:0;
      width:150px;
      height:150px;
      border-radius:50%;
      display:grid;
      place-items:center;
      background:conic-gradient(var(--primary) calc(var(--progress) * 1%), #0b1220 0);
      position:relative;
      box-shadow:inset 0 0 0 1px rgba(148,163,184,.14);
    }

    .progress-ring::before{
      content:"";
      position:absolute;
      width:116px;
      height:116px;
      border-radius:50%;
      background:var(--panel);
      border:1px solid rgba(148,163,184,.12);
    }

    .progress-ring-content{
      position:relative;
      z-index:1;
    }

    .progress-ring-value{
      font-size:2rem;
      font-weight:900;
      line-height:1;
    }

    .progress-ring-label{
      color:var(--muted);
      font-size:.75rem;
      margin-top:6px;
    }

    .overview-content{
      display:grid;
      gap:16px;
    }

    .overview-head{
      display:flex;
      justify-content:space-between;
      align-items:flex-start;
      gap:16px;
    }

    .overview-head h2{
      margin:0;
      font-size:1.2rem;
    }

    .overview-head p{
      margin:6px 0 0;
      color:var(--muted);
      font-size:.88rem;
    }

    .overview-kpis{
      display:grid;
      grid-template-columns:repeat(3,1fr);
      gap:10px;
    }

    .overview-kpi{
      background:rgba(15,23,42,.65);
      border:1px solid rgba(148,163,184,.12);
      border-radius:14px;
      padding:13px;
    }

    .overview-kpi span{
      display:block;
      color:var(--muted);
      font-size:.76rem;
      margin-bottom:5px;
    }

    .overview-kpi strong{
      font-size:1.05rem;
    }

    .phase-progress-list{
      display:grid;
      grid-template-columns:repeat(2,1fr);
      gap:10px 14px;
    }

    .phase-progress-item{
      display:grid;
      gap:6px;
    }

    .phase-progress-top{
      display:flex;
      justify-content:space-between;
      gap:10px;
      font-size:.78rem;
    }

    .phase-progress-name{
      color:#dbeafe;
      white-space:nowrap;
      overflow:hidden;
      text-overflow:ellipsis;
    }

    .phase-progress-percent{
      color:var(--muted);
      font-weight:800;
    }

    .mini-progress-track{
      height:7px;
      border-radius:999px;
      background:#0b1220;
      overflow:hidden;
      border:1px solid rgba(148,163,184,.1);
    }

    .mini-progress-bar{
      height:100%;
      border-radius:inherit;
      background:linear-gradient(90deg,var(--primary-2),var(--success));
      width:0;
      transition:width .3s ease;
    }

    .report-panel{
      background:rgba(17,24,39,.82);
      border:1px solid rgba(148,163,184,.14);
      border-radius:var(--radius);
      padding:20px;
      margin-bottom:22px;
      box-shadow:var(--shadow);
    }

    .report-panel-head{
      display:flex;
      justify-content:space-between;
      align-items:flex-start;
      gap:18px;
      margin-bottom:16px;
    }

    .report-panel h2{
      margin:0;
      font-size:1.2rem;
    }

    .report-panel p{
      margin:7px 0 0;
      color:var(--muted);
      font-size:.88rem;
      line-height:1.5;
    }

    .report-options{
      display:grid;
      grid-template-columns:repeat(3,1fr);
      gap:10px;
      margin-bottom:14px;
    }

    .report-option{
      display:flex;
      align-items:center;
      gap:9px;
      padding:12px;
      border:1px solid rgba(148,163,184,.14);
      border-radius:12px;
      background:rgba(15,23,42,.62);
      color:#dbeafe;
      font-size:.86rem;
      cursor:pointer;
    }

    .report-option input{
      accent-color:var(--primary);
    }

    .report-actions{
      display:flex;
      justify-content:flex-end;
      gap:10px;
      flex-wrap:wrap;
    }

    .report-document{
      display:none;
      background:#fff;
      color:#111827;
      padding:36px;
      border-radius:18px;
      margin-bottom:22px;
    }

    .report-document.visible{
      display:block;
    }

    .report-doc-header{
      display:flex;
      justify-content:space-between;
      gap:20px;
      align-items:flex-start;
      border-bottom:2px solid #d1d5db;
      padding-bottom:18px;
      margin-bottom:22px;
    }

    .report-doc-header h1{
      color:#111827;
      font-size:2rem;
      line-height:1.1;
      margin:0;
    }

    .report-meta{
      text-align:right;
      font-size:.84rem;
      color:#4b5563;
      line-height:1.5;
    }

    .report-summary-grid{
      display:grid;
      grid-template-columns:repeat(4,1fr);
      gap:12px;
      margin-bottom:22px;
    }

    .report-summary-card{
      border:1px solid #d1d5db;
      border-radius:12px;
      padding:14px;
      background:#f9fafb;
    }

    .report-summary-card span{
      display:block;
      color:#6b7280;
      font-size:.76rem;
      margin-bottom:5px;
    }

    .report-summary-card strong{
      font-size:1.05rem;
      color:#111827;
    }

    .report-section{
      margin-top:24px;
    }

    .report-section h2{
      color:#111827;
      font-size:1.2rem;
      margin:0 0 12px;
      border-bottom:1px solid #d1d5db;
      padding-bottom:8px;
    }

    .report-phase{
      border:1px solid #d1d5db;
      border-radius:12px;
      padding:16px;
      margin-bottom:14px;
      break-inside:avoid;
    }

    .report-phase-title{
      display:flex;
      justify-content:space-between;
      gap:16px;
      align-items:flex-start;
      margin-bottom:10px;
    }

    .report-phase-title h3{
      margin:0;
      color:#111827;
      font-size:1rem;
    }

    .report-phase-title span{
      font-size:.78rem;
      font-weight:800;
      color:#374151;
    }

    .report-phase p{
      color:#4b5563;
      font-size:.84rem;
      margin:0 0 10px;
    }

    .report-task-list{
      margin:0;
      padding-left:20px;
      color:#1f2937;
    }

    .report-task-list li{
      margin-bottom:8px;
      line-height:1.45;
    }

    .report-task-meta{
      display:block;
      color:#6b7280;
      font-size:.78rem;
      margin-top:2px;
    }

    @media print{
      body{
        background:#fff !important;
      }

      body *{
        visibility:hidden !important;
      }

      #reportDocument,
      #reportDocument *{
        visibility:visible !important;
      }

      #reportDocument{
        display:block !important;
        position:absolute;
        inset:0;
        width:100%;
        margin:0;
        padding:22mm 18mm;
        border-radius:0;
        background:#fff;
      }

      .no-print{
        display:none !important;
      }

      @page{
        size:A4;
        margin:0;
      }
    }

    .toolbar{
      background:rgba(17,24,39,.82);
      border:1px solid rgba(148,163,184,.14);
      padding:14px;
      border-radius:var(--radius);
      display:grid;
      grid-template-columns:2fr 1fr 1fr auto;
      gap:10px;
      margin-bottom:22px;
      box-shadow:var(--shadow);
    }

    .field{
      width:100%;
      background:#0b1220;
      border:1px solid var(--line);
      color:var(--text);
      border-radius:12px;
      padding:11px 12px;
      outline:none;
    }

    .field:focus{
      border-color:var(--primary);
      box-shadow:0 0 0 3px rgba(56,189,248,.12);
    }

    .roadmap{
      display:grid;
      gap:18px;
    }

    .phase{
      background:rgba(17,24,39,.82);
      border:1px solid rgba(148,163,184,.15);
      border-radius:var(--radius);
      overflow:hidden;
      box-shadow:var(--shadow);
    }

    .phase-header{
      display:grid;
      grid-template-columns:auto 1fr auto auto;
      gap:14px;
      align-items:center;
      padding:18px;
      cursor:pointer;
      user-select:none;
    }

    .phase-number{
      width:42px;
      height:42px;
      border-radius:13px;
      display:grid;
      place-items:center;
      background:rgba(56,189,248,.13);
      color:var(--primary);
      font-weight:900;
      border:1px solid rgba(56,189,248,.25);
    }

    .phase-title{
      margin:0;
      font-size:1.08rem;
    }

    .phase-description{
      color:var(--muted);
      font-size:.88rem;
      margin-top:4px;
    }

    .badge{
      padding:7px 10px;
      border-radius:999px;
      font-size:.78rem;
      font-weight:800;
      white-space:nowrap;
    }

    .badge-progress{
      background:rgba(245,158,11,.12);
      color:#fcd34d;
      border:1px solid rgba(245,158,11,.25);
    }

    .badge-done{
      background:rgba(34,197,94,.12);
      color:#86efac;
      border:1px solid rgba(34,197,94,.25);
    }

    .phase-toggle{
      color:var(--muted);
      font-size:1.2rem;
      transition:transform .2s ease;
    }

    .phase.collapsed .phase-toggle{transform:rotate(-90deg)}
    .phase.collapsed .phase-body{display:none}

    .phase-body{
      border-top:1px solid rgba(148,163,184,.12);
      padding:16px 18px 18px;
    }

    .task-list{
      display:grid;
      gap:10px;
    }

    .task{
      display:grid;
      grid-template-columns:auto 1fr 140px 130px auto;
      gap:12px;
      align-items:center;
      padding:13px;
      background:rgba(15,23,42,.64);
      border:1px solid rgba(148,163,184,.12);
      border-radius:14px;
    }

    .task.done{
      opacity:.72;
    }

    .task.done .task-name{
      text-decoration:line-through;
      color:var(--muted);
    }

    .task-check{
      width:20px;
      height:20px;
      accent-color:var(--success);
      cursor:pointer;
    }

    .task-name{
      font-weight:720;
    }

    .task-note{
      color:var(--muted);
      font-size:.8rem;
      margin-top:3px;
    }

    .pill{
      display:inline-flex;
      justify-content:center;
      padding:7px 9px;
      border-radius:999px;
      font-size:.75rem;
      font-weight:800;
      border:1px solid;
    }

    .status-pendente{
      color:#cbd5e1;
      border-color:#475569;
      background:rgba(71,85,105,.13);
    }

    .status-andamento{
      color:#fcd34d;
      border-color:rgba(245,158,11,.35);
      background:rgba(245,158,11,.1);
    }

    .status-revisao{
      color:#c4b5fd;
      border-color:rgba(139,92,246,.35);
      background:rgba(139,92,246,.1);
    }

    .status-concluido{
      color:#86efac;
      border-color:rgba(34,197,94,.35);
      background:rgba(34,197,94,.1);
    }

    .task-owner{
      color:var(--muted);
      font-size:.85rem;
      text-align:center;
    }

    .icon-btn{
      width:36px;
      height:36px;
      border-radius:10px;
      border:1px solid var(--line);
      background:rgba(255,255,255,.04);
      color:var(--text);
      cursor:pointer;
    }

    .phase-footer{
      display:flex;
      justify-content:flex-end;
      margin-top:14px;
    }

    .empty{
      text-align:center;
      padding:34px;
      color:var(--muted);
      border:1px dashed var(--line);
      border-radius:14px;
    }

    dialog{
      border:none;
      border-radius:20px;
      background:var(--panel);
      color:var(--text);
      width:min(560px,calc(100% - 28px));
      padding:0;
      box-shadow:0 30px 80px rgba(0,0,0,.5);
    }

    dialog::backdrop{
      background:rgba(2,6,23,.72);
      backdrop-filter:blur(3px);
    }

    .modal-head{
      padding:20px 22px;
      border-bottom:1px solid var(--line);
      display:flex;
      justify-content:space-between;
      align-items:center;
    }

    .modal-head h2{margin:0;font-size:1.15rem}
    .modal-body{
      padding:20px 22px;
      display:grid;
      gap:14px;
    }

    .modal-actions{
      display:flex;
      justify-content:flex-end;
      gap:10px;
      padding:0 22px 22px;
    }

    label{
      display:grid;
      gap:7px;
      color:#dbeafe;
      font-size:.88rem;
      font-weight:700;
    }

    textarea.field{
      min-height:90px;
      resize:vertical;
    }

    .footer-note{
      margin-top:24px;
      color:var(--muted);
      font-size:.82rem;
      text-align:center;
    }

    .sync-status{
      display:inline-flex;
      align-items:center;
      gap:8px;
      padding:9px 12px;
      border-radius:999px;
      border:1px solid var(--line);
      background:rgba(255,255,255,.04);
      color:var(--muted);
      font-size:.8rem;
      font-weight:800;
      white-space:nowrap;
    }

    .sync-dot{
      width:8px;
      height:8px;
      border-radius:50%;
      background:var(--warning);
      box-shadow:0 0 0 3px rgba(245,158,11,.12);
    }

    .sync-status.online .sync-dot{
      background:var(--success);
      box-shadow:0 0 0 3px rgba(34,197,94,.12);
    }

    .sync-status.error .sync-dot{
      background:var(--danger);
      box-shadow:0 0 0 3px rgba(239,68,68,.12);
    }

    @media (max-width: 900px){
      .hero{flex-direction:column}
      .hero-actions{justify-content:flex-start}
      .dashboard{grid-template-columns:repeat(2,1fr)}
      .progress-card{grid-column:span 2}
      .project-overview{grid-template-columns:1fr}
      .overall-progress{padding-bottom:0}
      .overview-kpis{grid-template-columns:repeat(3,1fr)}
      .report-options{grid-template-columns:1fr 1fr}
      .report-summary-grid{grid-template-columns:1fr 1fr}
      .toolbar{grid-template-columns:1fr 1fr}
      .toolbar .search{grid-column:span 2}
      .task{
        grid-template-columns:auto 1fr auto;
      }
      .task-owner,.task-status{
        grid-column:2;
        text-align:left;
      }
      .task-actions{
        grid-row:1 / span 3;
        grid-column:3;
      }
    }

    @media (max-width: 600px){
      .app{width:min(100% - 20px,1280px);padding-top:20px}
      .dashboard{grid-template-columns:1fr}
      .progress-card{grid-column:auto}
      .overview-kpis{grid-template-columns:1fr}
      .phase-progress-list{grid-template-columns:1fr}
      .report-panel-head{flex-direction:column}
      .report-options{grid-template-columns:1fr}
      .report-summary-grid{grid-template-columns:1fr}
      .report-doc-header{flex-direction:column}
      .report-meta{text-align:left}
      .overview-head{flex-direction:column}
      .toolbar{grid-template-columns:1fr}
      .toolbar .search{grid-column:auto}
      .phase-header{
        grid-template-columns:auto 1fr auto;
      }
      .phase-header .badge{grid-column:2}
      .phase-toggle{grid-row:1 / span 2;grid-column:3}
      .task{
        grid-template-columns:auto 1fr auto;
      }
    }
