:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --success: #16a34a;
  --warning: #ca8a04;
  --danger: #dc2626;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-600: #4b5563;
  --gray-800: #1f2937;
  --shadow: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.6;
}
.login-body {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-box {
  background: white;
  padding: 40px;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 420px;
}
.login-box h1 {
  text-align: center;
  margin-bottom: 8px;
  font-size: 24px;
  color: var(--gray-800);
}
.login-box .subtitle {
  text-align: center;
  color: var(--gray-600);
  margin-bottom: 24px;
  font-size: 14px;
}
.role-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  background: var(--gray-100);
  padding: 4px;
  border-radius: 8px;
}
.role-tab {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 6px;
  font-size: 14px;
  color: var(--gray-600);
  transition: all 0.2s;
}
.role-tab.active {
  background: white;
  color: var(--primary);
  font-weight: 600;
  box-shadow: var(--shadow);
}
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 500;
}
.form-group input, .form-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.2s;
}
.form-group input:focus, .form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-primary {
  background: var(--primary);
  color: white;
  width: 100%;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: white; }
.btn-warning { background: var(--warning); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.layout {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  width: 240px;
  background: var(--gray-800);
  color: white;
  display: flex;
  flex-direction: column;
}
.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sidebar-header h2 {
  font-size: 18px;
  font-weight: 600;
}
.sidebar-header .role-tag {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 10px;
  background: var(--primary);
  border-radius: 20px;
  font-size: 12px;
}
.nav-menu {
  flex: 1;
  padding: 12px;
}
.nav-item {
  display: block;
  padding: 12px 16px;
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  border-radius: 8px;
  margin-bottom: 4px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
}
.nav-item:hover, .nav-item.active {
  background: rgba(255,255,255,0.1);
  color: white;
}
.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 13px;
  color: rgba(255,255,255,0.6);
}
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.topbar {
  height: 60px;
  background: white;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}
.content-area {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}
.card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.card-title {
  font-size: 18px;
  font-weight: 600;
}
.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
th, td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
}
th {
  background: var(--gray-50);
  font-weight: 600;
  color: var(--gray-600);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
tr:hover { background: var(--gray-50); }
tr.status-empty { background: #fef9c3 !important; }
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}
.badge-empty { background: #fef9c3; color: #854d0e; }
.badge-pending { background: #dbeafe; color: #1e40af; }
.badge-filled { background: #dcfce7; color: #166534; }
.badge-confirmed { background: #d1fae5; color: #065f46; }
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal {
  background: white;
  border-radius: 16px;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--gray-200);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.close-btn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--gray-600);
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.form-grid .form-group.full-width {
  grid-column: 1 / -1;
}
.filter-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.filter-bar input, .filter-bar select {
  padding: 8px 12px;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
}
.info-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
.info-item dt {
  font-size: 12px;
  color: var(--gray-600);
  margin-bottom: 4px;
}
.info-item dd {
  font-size: 15px;
  font-weight: 500;
}
.status-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.status-step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}
.status-step .dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: white;
}
.status-step.done .dot { background: var(--success); }
.status-step.active .dot { background: var(--primary); }
.status-step.wait .dot { background: var(--gray-300); }
.signature-pad {
  width: 100%;
  height: 160px;
  border: 2px dashed var(--gray-300);
  border-radius: 8px;
  background: white;
}
.print-form {
  border: 1px solid #000;
  padding: 40px;
  background: white;
}
.print-form h2 {
  text-align: center;
  margin-bottom: 24px;
}
.print-row {
  display: flex;
  border-bottom: 1px solid #000;
}
.print-row .label {
  width: 120px;
  padding: 8px 12px;
  border-right: 1px solid #000;
  background: #f5f5f5;
  font-weight: 500;
}
.print-row .value {
  flex: 1;
  padding: 8px 12px;
}
.print-signature {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed #999;
  margin-top: 8px;
}
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 20px;
  border-radius: 8px;
  color: white;
  font-size: 14px;
  z-index: 2000;
  animation: slideIn 0.3s ease;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  .main-content { margin: 0; padding: 0; }
  .print-only { display: block !important; }
  body { background: white; }
}
.print-only { display: none; }
@media (max-width: 768px) {
  .sidebar { width: 200px; }
  .form-grid { grid-template-columns: 1fr; }
}