.fto-page,
.fto-page *{box-sizing:border-box}

.fto-page{
  display:flex;
  flex-direction:column;
  gap:18px;
  color:rgba(255,255,255,.94);
  min-height:100%;
  padding:4px;
}

.fto-header{
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap:18px;
  flex-wrap:wrap;
}

.fto-header-copy{min-width:320px;flex:1 1 500px}
.fto-header h1{margin:0;font-size:30px;font-weight:800}
.fto-header p{margin:6px 0 0;opacity:.72}
.fto-header-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}

.fto-stats{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:14px;
}

.fto-stat-card{
  border-radius:18px;
  padding:16px;
  background:linear-gradient(180deg,rgba(255,255,255,.05),rgba(255,255,255,.03));
  border:1px solid rgba(255,255,255,.08);
  box-shadow:0 18px 40px rgba(0,0,0,.22);
}

.fto-stat-label{font-size:12px;text-transform:uppercase;letter-spacing:.08em;opacity:.65}
.fto-stat-value{margin-top:8px;font-size:30px;font-weight:800;line-height:1}
.fto-stat-sub{margin-top:6px;font-size:12px;opacity:.68}

.fto-toolbar-card,.fto-table-card{
  background:linear-gradient(180deg,rgba(255,255,255,.04),rgba(255,255,255,.025));
  border:1px solid rgba(255,255,255,.08);
  border-radius:18px;
  padding:16px;
}

.fto-toolbar{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.fto-toolbar .input,#ftoStatusFilter,#ftoPhaseFilter{height:42px}
#ftoSearch{flex:1 1 360px}

.fto-page .input,
.fto-page textarea,
.fto-page select,
.fto-modal .input,
.fto-modal textarea,
.fto-modal select{
  width:100%;
  border:1px solid rgba(76,132,255,.24);
  background:linear-gradient(180deg,rgba(32,44,74,.94),rgba(21,30,53,.94));
  color:#f4f7ff;
  border-radius:14px;
  outline:none;
  padding:0 14px;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.04),0 0 0 1px rgba(59,130,246,.08);
}

.fto-page textarea,
.fto-modal textarea{height:auto;padding:12px 14px;resize:vertical;min-height:90px}

.fto-page .input:focus,
.fto-page textarea:focus,
.fto-page select:focus,
.fto-modal .input:focus,
.fto-modal textarea:focus,
.fto-modal select:focus{
  border-color:rgba(59,130,246,.95);
  box-shadow:0 0 0 1px rgba(59,130,246,.45),0 0 0 4px rgba(59,130,246,.12);
}

.fto-page select,
.fto-modal select{
  appearance:none;-webkit-appearance:none;-moz-appearance:none;
  padding-right:38px;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M4 6L8 10L12 6' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat;background-position:right 12px center;background-size:14px;
}
.fto-page select option,.fto-modal select option{background:#0f172a;color:#f4f7ff}

.table-wrap{overflow:auto}
.fto-table{width:100%;border-collapse:collapse}
.fto-table th,.fto-table td{padding:14px 12px;text-align:left;border-bottom:1px solid rgba(255,255,255,.07);vertical-align:top}
.fto-table th{font-size:12px;text-transform:uppercase;letter-spacing:.08em;opacity:.72;font-weight:700}
.fto-empty-cell{text-align:center;opacity:.7;padding:28px 12px !important}

.fto-case-number{
  display:inline-flex;align-items:center;justify-content:center;
  padding:7px 11px;border-radius:999px;background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.08);
  font-size:12px;font-weight:800;
}

.fto-person{display:flex;gap:12px;align-items:flex-start}
.fto-person-avatar{width:42px;height:42px;border-radius:14px;background:rgba(255,255,255,.06);background-size:cover;background-position:center;border:1px solid rgba(255,255,255,.08);flex:0 0 42px}
.fto-person-name{font-weight:700}
.fto-person-sub{margin-top:4px;font-size:12px;opacity:.66}
.fto-person-stack{display:flex;flex-direction:column;gap:8px}

.fto-badge{
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  padding:7px 11px;border-radius:999px;font-size:12px;font-weight:800;border:1px solid transparent;
}
.fto-badge.status-active,.fto-badge.phase-phase_1{background:rgba(59,130,246,.14);color:#93c5fd;border-color:rgba(59,130,246,.35)}
.fto-badge.status-remedial,.fto-badge.status-critical{background:rgba(245,158,11,.12);color:#fcd34d;border-color:rgba(245,158,11,.32)}
.fto-badge.status-ready_for_solo,.fto-badge.phase-phase_3,.fto-badge.status-completed,.fto-badge.status-excellent{background:rgba(34,197,94,.14);color:#86efac;border-color:rgba(34,197,94,.32)}
.fto-badge.status-failed,.fto-badge.status-unsatisfactory{background:rgba(239,68,68,.14);color:#fca5a5;border-color:rgba(239,68,68,.32)}
.fto-badge.phase-phase_2,.fto-badge.phase-final_eval,.fto-badge.status-satisfactory{background:rgba(168,85,247,.14);color:#d8b4fe;border-color:rgba(168,85,247,.28)}
.fto-badge.status-low{background:rgba(255,255,255,.06);color:#e5e7eb;border-color:rgba(255,255,255,.1)}

.fto-progress{display:flex;flex-direction:column;gap:8px;min-width:160px}
.fto-progress-bar{height:10px;border-radius:999px;background:rgba(255,255,255,.08);overflow:hidden;border:1px solid rgba(255,255,255,.06)}
.fto-progress-fill{height:100%;border-radius:999px;background:linear-gradient(90deg,#2563eb,#60a5fa)}
.fto-progress-meta{display:flex;justify-content:space-between;gap:8px;font-size:12px;opacity:.68}
.fto-actions{display:flex;gap:8px;flex-wrap:wrap}

.modal-overlay{
  position:fixed;inset:0;display:none;align-items:center;justify-content:center;
  background:rgba(2,6,23,.7);backdrop-filter:blur(5px);z-index:99999;padding:22px;
}
.modal-overlay.active{display:flex}
.fto-modal{
  width:min(1450px,96vw);max-height:92vh;display:flex;flex-direction:column;overflow:hidden;
  border-radius:24px;background:linear-gradient(180deg,#0e1a33,#0a1428);border:1px solid rgba(255,255,255,.08);
  box-shadow:0 30px 90px rgba(0,0,0,.56);
}
.modal-header,.modal-footer{padding:18px 22px;border-bottom:1px solid rgba(255,255,255,.08)}
.modal-footer{border-bottom:none;border-top:1px solid rgba(255,255,255,.08);display:flex;justify-content:space-between;gap:12px;align-items:center}
.modal-header h2{margin:0;color:#fff}
.modal-sub{margin-top:6px;font-size:13px;opacity:.7}
.modal-close{width:38px;height:38px;border:none;border-radius:12px;background:rgba(255,255,255,.06);color:#fff;font-size:24px;cursor:pointer}
.fto-modal-body{padding:18px 22px;overflow:auto;display:flex;flex-direction:column;gap:18px}
.fto-modal-body::-webkit-scrollbar,.table-wrap::-webkit-scrollbar,.fto-eval-history-list::-webkit-scrollbar{width:8px;height:8px}
.fto-modal-body::-webkit-scrollbar-thumb,.table-wrap::-webkit-scrollbar-thumb,.fto-eval-history-list::-webkit-scrollbar-thumb{background:rgba(255,255,255,.12);border-radius:999px}
.fto-modal-topbar{display:flex;justify-content:space-between;gap:12px;align-items:center}
.fto-tabs{display:flex;gap:8px;flex-wrap:wrap}
.fto-tab{height:40px;padding:0 14px;border-radius:999px;border:1px solid rgba(255,255,255,.09);background:rgba(255,255,255,.04);color:#fff;font-weight:700;cursor:pointer}
.fto-tab.active{background:linear-gradient(90deg,#2563eb,#3b82f6);border-color:rgba(59,130,246,.55)}
.fto-tab-panel{display:none}
.fto-tab-panel.active{display:block}

.fto-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.fto-form-grid.compact{grid-template-columns:repeat(2,minmax(0,1fr))}
.form-group{display:flex;flex-direction:column;gap:8px}
.form-group label{font-size:12px;font-weight:800;letter-spacing:.06em;text-transform:uppercase;opacity:.76}
.form-group.full{grid-column:1 / -1}

.fto-flags-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:10px}
.fto-flag-item{display:flex;align-items:center;gap:10px;padding:12px 14px;border-radius:14px;background:rgba(255,255,255,.04);border:1px solid rgba(255,255,255,.06)}
.fto-flag-item input{accent-color:#3b82f6}

.card-lite{background:rgba(255,255,255,.03);border:1px solid rgba(255,255,255,.08);border-radius:18px;padding:16px}
.section-title{font-size:13px;font-weight:900;text-transform:uppercase;letter-spacing:.08em;opacity:.78;margin-bottom:14px}
.fto-skills-header h3{margin:0;font-size:20px}
.fto-skills-header p{margin:6px 0 0;opacity:.72}
.fto-skills-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.fto-skill-card{background:rgba(255,255,255,.03);border:1px solid rgba(255,255,255,.08);border-radius:18px;padding:16px;display:flex;flex-direction:column;gap:12px}
.fto-skill-top{display:flex;justify-content:space-between;gap:12px;align-items:flex-start}
.fto-skill-title{font-weight:800}
.fto-skill-meta{font-size:12px;opacity:.66;margin-top:4px}
.fto-skill-card textarea{min-height:88px}
.fto-skill-score-wrap{display:flex;gap:10px;align-items:center}
.fto-skill-score{max-width:130px}

.fto-inline-skills{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:14px}
.fto-inline-skill{padding:12px;border-radius:14px;background:rgba(255,255,255,.03);border:1px solid rgba(255,255,255,.07);display:flex;gap:10px;align-items:center;justify-content:space-between}
.fto-inline-skill label{font-size:12px;font-weight:700;opacity:.86;display:block}
.fto-inline-skill input{max-width:90px;height:40px}

.fto-evals-layout{display:grid;grid-template-columns:1.1fr .9fr;gap:16px}
.fto-eval-actions{display:flex;justify-content:flex-end;margin-top:14px}
.fto-eval-history-list{display:flex;flex-direction:column;gap:12px;max-height:900px;overflow:auto}
.fto-eval-item{padding:14px;border-radius:16px;background:rgba(255,255,255,.035);border:1px solid rgba(255,255,255,.08);display:flex;flex-direction:column;gap:8px}
.fto-eval-item-head{display:flex;justify-content:space-between;gap:12px;align-items:flex-start}
.fto-eval-item-title{font-weight:800}
.fto-eval-item-meta{display:flex;gap:8px;flex-wrap:wrap;font-size:12px;opacity:.72}
.fto-eval-item p{margin:0;font-size:13px;color:rgba(255,255,255,.82);line-height:1.45}
.fto-eval-item-actions{display:flex;justify-content:flex-end}

.fto-timeline{display:flex;flex-direction:column;gap:12px}
.fto-timeline-item{display:grid;grid-template-columns:54px 1fr;gap:14px;align-items:flex-start;padding:14px;border-radius:18px;background:rgba(255,255,255,.035);border:1px solid rgba(255,255,255,.08)}
.fto-timeline-dot{width:44px;height:44px;border-radius:14px;background:rgba(59,130,246,.16);border:1px solid rgba(59,130,246,.32);display:flex;align-items:center;justify-content:center;font-size:18px}
.fto-timeline-title{font-weight:800}
.fto-timeline-meta{font-size:12px;opacity:.66;margin-top:4px}
.fto-timeline-body{margin-top:8px;font-size:13px;color:rgba(255,255,255,.84);line-height:1.5;white-space:pre-wrap}

.fto-modal-footer-right{display:flex;gap:10px;align-items:center}
.btn-primary,.btn-secondary,.btn-ghost,.btn-danger{
  height:42px;border:none;border-radius:14px;padding:0 16px;font-weight:800;cursor:pointer;color:#fff;
}
.btn-primary{background:linear-gradient(90deg,#1d4ed8,#2563eb)}
.btn-secondary{background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.1)}
.btn-ghost{background:transparent;border:1px solid rgba(255,255,255,.12)}
.btn-danger{background:linear-gradient(90deg,#991b1b,#dc2626)}

@media (max-width:1200px){
  .fto-stats,.fto-skills-grid,.fto-inline-skills,.fto-evals-layout{grid-template-columns:1fr}
}
@media (max-width:980px){
  .fto-form-grid,.fto-form-grid.compact{grid-template-columns:1fr}
  .fto-table{min-width:1120px}
}

button,
.btn-primary,
.btn-secondary,
.btn-danger,
.btn-success,
.btn-ghost {

  display: inline-flex;
  align-items: center;
  justify-content: center;

  gap: 6px;

  height: 34px;
  padding: 0 14px;

  line-height: 1;
  font-weight: 600;
}

button span {
  display:flex;
  align-items:center;
}