:root{
  --bg:#0b1220;
  --card:#101a2d;
  --border:#24314f;
  --text:#e7eefc;
  --muted:#b7c4e1;
  --link:#7dd3fc;

  --primary:#3b82f6;
  --success:#22c55e;
  --warn:#f59e0b;
  --danger:#ef4444;
}

*{box-sizing:border-box}
body{
  margin:0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
}

a{color:var(--link); text-decoration:none}
h2{margin:0 0 10px 0}

.container{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:18px;
}

.page{
  padding:18px;
  max-width:1200px;
  margin:0 auto;
}

.grid{
  display:grid;
  grid-template-columns: 360px 1fr;
  gap:16px;
}

.card{
  background: var(--card);
  border:1px solid var(--border);
  border-radius:16px;
  padding:16px;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
}

.brand{
  font-size:22px;
  font-weight:800;
  letter-spacing:.3px;
}

.brand-small{
  font-size:16px;
  font-weight:800;
}

.subtitle{margin-top:6px; color:var(--muted)}

.topbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:14px 18px;
  border-bottom:1px solid var(--border);
  background: rgba(16,26,45,.7);
  backdrop-filter: blur(8px);
}

.top-left{display:flex; gap:12px; align-items:center}
.top-right{display:flex; gap:12px; align-items:center}

.pill{
  border:1px solid var(--border);
  background: rgba(11,18,32,.7);
  padding:6px 10px;
  border-radius:999px;
  color:var(--muted);
  font-size:12px;
}

.form{
  display:flex;
  flex-direction:column;
  gap:8px;
  margin-top:12px;
}

label{font-size:13px; color:var(--muted)}
input{
  width:100%;
  padding:10px;
  border-radius:12px;
  border:1px solid var(--border);
  background:#0d162a;
  color: var(--text);
  outline:none;
}

.select{
  width:100%;
  padding:10px;
  border-radius:12px;
  border:1px solid var(--border);
  background:#0d162a;
  color: var(--text);
  outline:none;
}

.textarea{
  width:100%;
  min-height:110px;
  padding:10px;
  border-radius:12px;
  border:1px solid var(--border);
  background:#0d162a;
  color: var(--text);
  outline:none;
  resize: vertical;
  line-height:1.35;
}

.check{
  display:flex;
  gap:8px;
  align-items:center;
  user-select:none;
  margin-top:6px;
}

.btn{
  border:none;
  border-radius:12px;
  padding:10px 12px;
  cursor:pointer;
  font-weight:800;
  background:#172442;
  color: var(--text);
  border:1px solid var(--border);
}

.btn.primary{background: var(--primary); border-color: rgba(0,0,0,0); color:#fff}
.btn.success{background: var(--success); border-color: rgba(0,0,0,0); color:#052012}
.btn.warn{background: var(--warn); border-color: rgba(0,0,0,0); color:#2b1600}
.btn.danger{background: var(--danger); border-color: rgba(0,0,0,0); color:#2b0000}

.messages{margin-top:10px; display:flex; flex-direction:column; gap:8px}
.msg{padding:10px 12px; border-radius:12px; border:1px solid var(--border); background:#0d162a; font-size:13px}
.msg.error{border-color: rgba(239,68,68,.35)}
.msg.success{border-color: rgba(34,197,94,.35)}

.hint{margin-top:12px; color:var(--muted); font-size:12px}

.table-wrap{overflow:auto; border-radius:12px; border:1px solid var(--border)}
table{width:100%; border-collapse:collapse; min-width:860px}
th,td{padding:10px; border-bottom:1px solid var(--border); text-align:left; font-size:13px}
th{color:var(--muted); background: rgba(13,22,42,.65)}

.actions{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  align-items:center;
}

.reset-form{
  display:flex;
  gap:8px;
  align-items:center;
}

input.mini{
  width:140px;
  padding:8px 10px;
  border-radius:10px;
}

/* RO detail extras */
.detail-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:16px;
}

.kv{
  display:flex;
  justify-content:space-between;
  gap:12px;
  padding:8px 0;
  border-bottom:1px solid rgba(36,49,79,.6);
}
.kv span{color:var(--muted); font-size:13px}
.kv b{font-size:13px}

.note-box{
  white-space: pre-wrap;
  border:1px solid var(--border);
  background:#0d162a;
  border-radius:12px;
  padding:12px;
  line-height:1.35;
}

.comment-list{
  margin-top:14px;
  display:flex;
  flex-direction:column;
  gap:10px;
}

.comment{
  border:1px solid var(--border);
  background:#0d162a;
  border-radius:12px;
  padding:12px;
}

.comment-head{
  display:flex;
  justify-content:space-between;
  color:var(--muted);
  font-size:12px;
  margin-bottom:8px;
}

.comment-body{
  white-space: pre-wrap;
  line-height:1.35;
  font-size:13px;
}

.two-col{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
}

.section-title{
  margin:14px 0 0 0;
  font-size:14px;
  color: var(--muted);
  font-weight:800;
  letter-spacing:.2px;
}

.time-box{
  margin-top:12px;
  border:1px solid var(--border);
  background:#0d162a;
  border-radius:12px;
  padding:12px;
}

.time-row{
  display:flex;
  justify-content:space-between;
  gap:12px;
  padding:6px 0;
  border-bottom:1px solid rgba(36,49,79,.6);
}

.time-row:last-child{border-bottom:none}

.time-row span{color:var(--muted); font-size:13px}
.time-row b{font-size:13px}

.time-actions{
  margin-top:10px;
  display:flex;
  flex-direction:column;
  gap:8px;
}

.labor-lines{margin-top:14px; display:flex; flex-direction:column; gap:12px;}
.labor-line{
  border:1px solid var(--border);
  background:#0d162a;
  border-radius:12px;
  padding:12px;
}
.labor-line-head{
  display:flex;
  justify-content:space-between;
  color:var(--muted);
  font-size:12px;
  margin-bottom:10px;
}
.form.compact{gap:8px; margin-top:0}
.row-actions{
  display:flex;
  gap:10px;
  align-items:center;
  margin-top:10px;
  flex-wrap:wrap;
}


/* =========================
   PRINT RO SHEET
   - prints RO # + labor CCC + requested + SOLD write-in
========================= */

/* Hide print sheet on screen */
.print-ro{display:none}

@media print{
  body{background:#fff !important; color:#000 !important}

  /* Hide everything by default */
  body *{visibility:hidden}

  /* Show only the print sheet */
  .print-ro, .print-ro *{visibility:visible}
  .print-ro{
    display:block;
    position:absolute;
    left:0;
    top:0;
    width:100%;
    padding:24px;
  }

  /* Avoid printing dark UI backgrounds */
  .topbar, .page, .card{display:none !important}
}

.print-ro{
  font-family: Arial, Helvetica, sans-serif;
  color:#000;
}

.print-header{
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap:12px;
}

.print-title{
  font-size:22px;
  font-weight:900;
}

.print-meta{
  text-align:right;
  font-size:12px;
  line-height:1.4;
}

.print-divider{
  border-top:2px solid #000;
  margin:12px 0;
}

.print-vehicle{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:6px 16px;
  font-size:12px;
}

.print-vehicle div{white-space:nowrap; overflow:hidden; text-overflow:ellipsis}

.print-table{
  width:100%;
  border-collapse:collapse;
  font-size:12px;
}

.print-table th,
.print-table td{
  border:1px solid #000;
  padding:10px;
  vertical-align:top;
}

.print-table th{
  background:#f0f0f0;
  text-align:center;
  font-weight:900;
}

.print-ccc{width:70%}
.print-req{width:15%}
.print-sold{width:15%}

.ccc-block{margin-bottom:10px}
.ccc-label{font-size:11px; font-weight:900; text-transform:uppercase; margin-bottom:3px}
.ccc-text{white-space:pre-wrap; line-height:1.25}

.print-req, .print-sold{text-align:center; white-space:nowrap; font-weight:900}

.print-sold .sold-writein{height:42px; border-bottom:2px solid #000; margin-top:8px}

.print-footer{display:flex; justify-content:space-between; margin-top:16px; font-size:12px}
