:root{
  --bg: #f4f5f7;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --pill: #f3f4f6;
  --btn: #111827;
  --btnHover: #000000;
  --danger: #ef4444;
  --success: #16a34a;
  --warning: #f97316;
}

*{ box-sizing:border-box; }

body{
  margin:0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #f9fafb 0, #f3f4f6 45%, #e5e7eb 100%);
  color:var(--text);
}

a{ color:var(--text); }

.header{
  padding: 0.6rem 1.25rem;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:0.8rem;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(6px);
  border-bottom:1px solid var(--border);
  position:sticky;
  top:0;
  z-index:20;
}

.header-left{
  display:flex;
  align-items:center;
  gap:0.9rem;
}
.header-logo{
  width:60px;
  height:60px;
  border-radius:999px;
  overflow:hidden;
  background:#fff;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
  display:flex;
  align-items:center;
  justify-content:center;
}
.header-logo img{
  max-width:60px;
  max-height:60px;
  display:block;
}
.header-text{
  display:flex;
  flex-direction:column;
  gap:0.1rem;
}
.header-title{
  font-size:1.05rem;
  font-weight:600;
  letter-spacing:0.01em;
}
.header-subtitle{
  font-size:0.8rem;
  color:var(--muted);
}

.header-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:0.35rem;
  flex-wrap:wrap;
  font-size:0.85rem;
}
.badge{
  padding:0.15rem 0.6rem;
  border-radius:999px;
  background:var(--pill);
  border:1px solid var(--border);
  font-size:0.8rem;
}
.navlink{
  text-decoration:none;
  font-size:0.8rem;
  padding:0.25rem 0.6rem;
  border-radius:999px;
  border:1px solid transparent;
}
.navlink:hover{
  background:#f3f4f6;
  border-color:var(--border);
}

.main{
  padding: 1.3rem 1rem;
  max-width: 1200px;
  margin: 0 auto;
}

.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:16px;
  box-shadow: 0 14px 40px rgba(15,23,42,0.08);
  padding:1rem;
}

.tabs{
  display:flex;
  border-bottom:1px solid var(--border);
  margin-bottom:1rem;
  gap:0.5rem;
  flex-wrap:wrap;
}
.tab{
  padding:0.4rem 0.9rem;
  border-radius:999px 999px 0 0;
  background:var(--pill);
  cursor:pointer;
  font-size:0.9rem;
  color:#4b5563;
}
.tab.active{
  background:var(--card);
  border:1px solid var(--border);
  border-bottom:none;
  color:var(--text);
  font-weight:500;
}

.filters{
  display:flex;
  flex-wrap:wrap;
  gap:0.6rem;
  margin-bottom:0.8rem;
  font-size:0.85rem;
  align-items:flex-end;
}
.filters label{
  display:flex;
  flex-direction:column;
  gap:0.15rem;
}
.filters label span{
  color:#4b5563;
}
.filters input, .filters select{
  padding:0.3rem 0.55rem;
  border-radius:999px;
  border:1px solid var(--border);
  font-size:0.85rem;
  background:#f9fafb;
  outline:none;
}
.btn{
  border:none;
  padding:0.45rem 1.1rem;
  border-radius:999px;
  font-size:0.85rem;
  background:var(--btn);
  color:#fff;
  cursor:pointer;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  gap:0.35rem;
}
.btn:hover{ background:var(--btnHover); }
.btn-secondary{
  border:1px solid var(--border);
  background:#fff;
  color:var(--text);
}
.btn-secondary:hover{ background:#f3f4f6; }

.table{
  width:100%;
  border-collapse:collapse;
  font-size:0.85rem;
  background:#fff;
  border-radius:12px;
  overflow:hidden;
}
.table th, .table td{
  border:1px solid var(--border);
  padding:0.35rem 0.45rem;
  text-align:left;
}
.table th{
  background:#f3f4f6;
  font-weight:500;
  color:#374151;
}
tr.executed{ background:#ecfdf3; }
tr.cancelled{ background:#fef2f2; color:#b91c1c; }

.actions button{
  border:none;
  padding:0.25rem 0.6rem;
  border-radius:999px;
  font-size:0.75rem;
  cursor:pointer;
  margin-right:0.2rem;
  color:#fff;
}
.btn-danger{ background:var(--danger); }
.btn-success{ background:var(--success); }
.btn-warning{ background:var(--warning); }

.form-wrap{
  max-width: 440px;
  margin: 2.8rem auto;
  padding: 0 0.8rem;
}
.form-card{
  background: var(--card);
  border:1px solid var(--border);
  border-radius: 16px;
  padding: 1.4rem;
  box-shadow: 0 14px 40px rgba(15,23,42,0.08);
}
.form-title{
  margin:0 0 0.3rem;
  font-size:1.1rem;
  font-weight:600;
}
.form-subtitle{
  margin:0 0 1rem;
  font-size:0.9rem;
  color:var(--muted);
}
.field{
  margin-bottom:0.8rem;
}
.field label{
  display:block;
  font-size:0.9rem;
  margin-bottom:0.25rem;
  color:#374151;
}
.field input, .field select{
  width:100%;
  padding:0.45rem 0.65rem;
  border-radius:999px;
  border:1px solid var(--border);
  background:#f9fafb;
  font-size:0.92rem;
}
.alert{
  border-radius: 10px;
  padding: 0.65rem 0.8rem;
  font-size:0.85rem;
  margin-bottom:0.8rem;
}
.alert-error{
  background:#fef2f2;
  color:#b91c1c;
  border:1px solid #fecaca;
}
.alert-ok{
  background:#ecfdf3;
  color:#166534;
  border:1px solid #bbf7d0;
}

.message{
  padding:0.6rem 0.85rem;
  border-radius:10px;
  border:1px solid var(--border);
  background:#f9fafb;
  font-size:0.85rem;
}
.message.success{
  border-color: rgba(22,163,74,0.3);
  background: rgba(22,163,74,0.08);
  color: #166534;
}
.message.error{
  border-color: rgba(239,68,68,0.3);
  background: rgba(239,68,68,0.08);
  color: #991b1b;
}

.modal-overlay{
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 1rem;
}
.modal{
  background: #fff;
  border-radius: 16px;
  padding: 1rem 1.2rem;
  width: min(520px, 95vw);
  box-shadow: 0 24px 60px rgba(15,23,42,0.25);
}
.modal-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:0.8rem;
}
.modal-header h3{
  margin:0;
  font-size:1rem;
}
.modal-close{
  border:none;
  background:transparent;
  font-size:1.4rem;
  cursor:pointer;
  color:var(--muted);
}
.modal-body{
  display:flex;
  flex-direction:column;
  gap:0.5rem;
  font-size:0.9rem;
}
.detail-row .label{
  color:var(--muted);
  margin-right:0.35rem;
}

@media (max-width:768px){
  .header{ flex-wrap:wrap; }
  .header-left, .header-actions{ width:100%; justify-content:flex-start; }
  .main{ padding: 1rem 0.6rem; }
  .table{ font-size:0.8rem; }
  .table th, .table td{ padding:0.25rem 0.3rem; }
}

@media print{
  .header, .tabs, .filters, .actions, .no-print{ display:none !important; }
  body{ background:#fff; }
  .card{ box-shadow:none; border:none; }
}
