/* ── Reset & Variables ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:           #f9fafb;
  --sidebar-bg:   #ffffff;
  --sidebar-w:    300px;
  --blue:         #059669;
  --blue-dark:    #047857;
  --green:        #10b981;
  --green-dark:   #059669;
  --purple:       #10b981;
  --purple-dark:  #059669;
  --yellow:       #f59e0b;
  --pink:         #ec4899;
  --text:         #111827;
  --text-light:   #6b7280;
  --border:       #e5e7eb;
  --white:        #ffffff;
  --radius:       12px;
}

body {
  font-family: 'Google Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── Login overlay ─────────────────────────────────────────────────────────── */
.login-overlay {
  position: fixed; inset: 0;
  background: linear-gradient(135deg, #047857 0%, #059669 100%);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
}

.login-card {
  background: var(--white);
  border-radius: 20px;
  padding: 48px 40px;
  width: 360px;
  text-align: center;
}

.login-logo { margin-bottom: 32px; }
.login-logo h2 { font-size: 1.6rem; font-weight: 700; color: var(--text); }
.login-logo p  { color: var(--text-light); margin-top: 4px; font-size: .9rem; }

.login-card input {
  width: 100%; padding: 12px 16px; margin-bottom: 12px;
  border: 1.5px solid var(--border); border-radius: 10px;
  font-size: .95rem; outline: none; transition: border-color .2s;
}
.login-card input:focus { border-color: var(--blue); }

.login-card .btn-primary {
  width: 100%; padding: 13px; background: var(--blue);
  color: #fff; border: none; border-radius: 10px;
  font-size: 1rem; font-weight: 600; cursor: pointer;
  transition: background .2s;
}
.login-card .btn-primary:hover { background: var(--blue-dark); }

.error-msg { color: #dc2626; font-size: .85rem; margin-top: 8px; }

/* ── App layout ────────────────────────────────────────────────────────────── */
#app {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ───────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex; flex-direction: column;
  flex-shrink: 0;
  transition: width .25s;
  overflow: hidden;
  position: relative;
  z-index: 100;
}

.sidebar.collapsed { width: 60px; }

.sidebar-header {
  padding: 20px 16px 8px;
  display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid var(--border);
  min-height: 68px;
}

.sidebar-brand {
  font-weight: 700; font-size: 1.05rem; white-space: nowrap;
  color: var(--text); overflow: hidden;
}

.hamburger {
  background: none; border: none; cursor: pointer;
  font-size: 1.3rem; padding: 6px; color: var(--text);
  border-radius: 8px; flex-shrink: 0;
  transition: background .15s;
}
.hamburger:hover { background: var(--border); }

/* ── Sidebar nav ────────────────────────────────────────────────────────────── */
.sidebar-nav {
  flex: 1; overflow-y: auto; padding: 12px 0;
  border-right: solid 1px var(--border);
}

.sidebar-nav ul { list-style: none; }

.sidebar-nav > ul > li > a,
.sidebar-nav > ul > li > span.nav-group {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 20px;
  color: var(--text); text-decoration: none;
  font-size: .92rem; border-radius: 0;
  cursor: pointer; white-space: nowrap;
  transition: background .15s, color .15s;
  user-select: none;
}

.sidebar-nav > ul > li > a:hover,
.sidebar-nav > ul > li > span.nav-group:hover { background: #f0fdf4; color: var(--blue); }

.sidebar-nav > ul > li > a.active { background: #f0fdf4; color: var(--blue); font-weight: 600; }

.nav-icon { font-size: 1.1rem; flex-shrink: 0; width: 22px; text-align: center; }
.nav-icon .material-icons-outlined { font-size: 20px; line-height: 1; }
.nav-label { flex: 1; }
.nav-chevron { font-size: .7rem; transition: transform .2s; }
.nav-group.open .nav-chevron { transform: rotate(90deg); }

/* submenu */
.submenu {
  list-style: none; overflow: hidden;
  max-height: 0; transition: max-height .25s ease;
}
.submenu.open { max-height: 400px; }

.submenu li a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 20px 9px 54px;
  color: var(--text-light); text-decoration: none;
  font-size: .88rem; white-space: nowrap;
  transition: background .15s, color .15s;
}
.submenu li a:hover { background: #f0fdf4; color: var(--blue); }
.submenu li a.active { color: var(--blue); font-weight: 600; }

/* collapsed sidebar hides labels */
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-chevron,
.sidebar.collapsed .sidebar-brand,
.sidebar.collapsed .submenu { display: none; }

/* ── Sidebar footer ────────────────────────────────────────────────────────── */
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  font-size: .85rem;
  border-right: solid 1px var(--border);
}

.sidebar-user { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.sidebar-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--blue); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .9rem; flex-shrink: 0;
}
.sidebar-user-info { overflow: hidden; }
.sidebar-user-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { color: var(--text-light); font-size: .78rem; white-space: nowrap; }

.btn-logout {
  padding: 8px; background: #fef2f2;
  color: #dc2626; border: 1px solid #fecaca;
  border-radius: 8px; cursor: pointer; font-size: .85rem;
  transition: background .15s;
}
.btn-logout:hover { background: #fee2e2; }

.sidebar.collapsed .sidebar-footer { padding: 12px 8px; }
.sidebar.collapsed .sidebar-user-info,
.sidebar.collapsed .btn-logout { display: none; }

/* ── Content area ──────────────────────────────────────────────────────────── */
.content-area {
  flex: 1; display: flex; flex-direction: column; min-width: 0;
}

.content-header {
  background: var(--white);
  padding: 0 28px;
  height: 68px;
  display: flex; align-items: center; justify-content: flex-end;
  flex-shrink: 0;
  border-bottom: solid 1px var(--border);
}

.content-header h1 {
  font-size: 1rem; font-weight: 700;
  letter-spacing: .04em; color: var(--text);
}

.page-body { flex: 1; padding: 28px; overflow-y: auto; }

/* ── Dashboard cards ───────────────────────────────────────────────────────── */
.dash-toggle { display: flex; gap: 12px; margin-bottom: 24px; }

.dash-toggle button {
  padding: 10px 28px; border-radius: 100px; font-size: .9rem; font-weight: 600;
  cursor: pointer; border: 2px solid var(--text); background: var(--white); color: var(--text);
  transition: all .2s;
}
.dash-toggle button.active { background: var(--text); color: var(--white); }

.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 2fr 2fr 2fr;
  gap: 16px;
  align-items: start;
}

.dash-col { display: flex; flex-direction: column; gap: 16px; }
.dash-col-pair { flex-direction: row; }
.dash-col-pair .stat-card { flex: 1; min-width: 0; }

.stat-card {
  border-radius: var(--radius);
  padding: 20px 20px 16px;
  color: #111827;
  min-height: 160px;
  display: flex; flex-direction: column; justify-content: space-between;
  position: relative;
  border: 1px solid rgba(0,0,0,.08);
}
.stat-card.blue   { background: #dbeafe; border-color: #93c5fd; }
.stat-card.green  { background: #dcfce7; border-color: #86efac; }
.stat-card.purple { background: #f3e8ff; border-color: #e9d5ff; }
.stat-card.red    { background: #fee2e2; border-color: #fecaca; }
.stat-card.yellow { background: #fef3c7; border-color: #fde047; }

.stat-card-title    { font-size: 1.2rem; font-weight: 700; margin-bottom: 5px; }
.stat-card-subtitle { font-size: .9rem; font-weight: 700; }

.stat-card-numbers {
  display: flex; align-items: baseline; gap: 16px; margin: 12px 0 4px;
}

.stat-card .icon-shape {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    vertical-align: middle;
    width: 44px; height: 44px;
    border-radius: 8px;
    font-size: 0.8rem;
    color: #fff;
    padding: 19px;
    margin-bottom: 7px;
}

.stat-card.blue .icon-shape { background-color: #00B8DB; }
.stat-card.green .icon-shape { background-color: #00C951; }
.stat-card.purple .icon-shape { background-color: purple; }
.stat-card.red .icon-shape { background-color: red; }
.stat-card.yellow .icon-shape { background-color:#F0B100; }

.stat-card .double {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  align-content: stretch;
  gap: 16px;
}

.stat-card .double > DIV {
  width: 100%;
}
.stat-card-main { font-size: 2.8rem; font-weight: 800; line-height: 1; }
.stat-card-unit { font-size: 1rem; font-weight: 600; }
.stat-card-desc { font-size: .9rem; opacity: 1; }

.stat-card.blue .stat-card-desc { color: #00B8DB; }
.stat-card.green .stat-card-desc { color: #00C951; }
.stat-card.purple .stat-card-desc { color: purple; }
.stat-card.red .stat-card-desc { color: red; }
.stat-card.yellow .stat-card-desc { color:#F0B100; }

.single-line {
  white-space: nowrap;
}

.progress-bar-wrap {
  background: rgba(0,0,0,.1);
  border-radius: 100px; height: 8px; margin-top: 14px;
}
.progress-bar-fill { height: 8px; border-radius: 100px; background: var(--yellow); }

.stat-card.red .progress-bar-fill { background: #ef4444; }
.stat-card.green .progress-bar-fill { background: #22c55e; }
.stat-card.blue .progress-bar-fill { background: #3b82f6; }
.stat-card.yellow .progress-bar-fill { background: #eab308; }
.stat-card.purple .progress-bar-fill { background: #a855f7; }

.stat-timing-card {
  background: var(--white); border-radius: var(--radius);
  padding: 14px 20px;
  display: flex; align-items: center; gap: 14px;
}
.timing-gauge { font-size: 2rem; }
.timing-info { font-size: .78rem; color: var(--text-light); line-height: 1.6; }

/* ── Data tables ───────────────────────────────────────────────────────────── */
.page-card {
  background: var(--white); border-radius: var(--radius);
  overflow: hidden;
  border: solid 1px var(--border);
}

.page-card-header {
  padding: 20px 24px; display: flex;
  align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.page-card-header h2 { font-size: 1.1rem; font-weight: 700; }

.btn-add {
  background: var(--blue); color: #fff; border: none;
  padding: 9px 20px; border-radius: 8px; cursor: pointer;
  font-size: .88rem; font-weight: 600; transition: background .15s;
}
.btn-add:hover { background: var(--blue-dark); }

.search-bar {
  padding: 14px 24px; border-bottom: 1px solid var(--border);
}
.search-bar input {
  padding: 8px 14px; border: 1.5px solid var(--border);
  border-radius: 8px; font-size: .88rem; width: 280px; outline: none;
}
.search-bar input:focus { border-color: var(--blue); }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 24px; text-align: left; font-size: .975rem; }
th { font-weight: 600; color: var(--text-light); font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; background: #f9fafb; }
tbody tr { border-top: 1px solid var(--border); }
tbody tr:hover { background: #f9fafb; }

.badge {
  display: inline-block; padding: 3px 10px; border-radius: 100px;
  font-size: .9rem; font-weight: 400;
}
.badge-green  { background: #d1fae5; color: #065f46; }
.badge-yellow { background: #fef9c3; color: #92400e; }
.badge-gray   { background: #f3f4f6; color: #4b5563; }
.badge-blue   { background: #d1fae5; color: #047857; }
.badge-purple { background: #ede9fe; color: #7c3aed; }
.badge-red    { background: #fee2e2; color: #dc2626; }

.btn-sm {
  padding: 5px 12px; border-radius: 6px; font-size: .85rem;
  font-weight: 600; cursor: pointer; border: none; transition: opacity .15s;
}
.btn-sm:hover { opacity: .85; }
.btn-edit   { background: #eff6ff; color: var(--blue); }
.btn-delete { background: #fee2e2; color: #dc2626; }

/* ── Export buttons ──────────────────────────────────────────────────────── */
.btn-export {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 8px; font-size: .85rem; font-weight: 600;
  cursor: pointer; background: var(--white); border: 1.5px solid var(--border);
  color: var(--text); transition: background .15s;
}
.btn-export:hover { background: #f3f4f6; }
.btn-export .material-icons-outlined { font-size: 16px; }
.btn-export-excel .material-icons-outlined { color: #217346; }
.btn-export-pdf   .material-icons-outlined { color: #dc2626; }

/* ── Icon action buttons ─────────────────────────────────────────────────── */
.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; padding: 0;
  border-radius: 6px; border: none; cursor: pointer;
  background: transparent; transition: background .15s;
}
.btn-icon .material-icons-outlined { font-size: 18px; }
.btn-icon-edit   { color: var(--blue); }
.btn-icon-edit:hover   { background: #eff6ff; }
.btn-icon-delete { color: #dc2626; }
.btn-icon-delete:hover { background: #fee2e2; }
.btn-icon-nav    { color: var(--blue); }
.btn-icon-nav:hover    { background: #eff6ff; }

/* ── View toggle (table / card) ─────────────────────────────────────────────── */
.view-toggle {
  display: flex;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.view-toggle-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  border: none; background: transparent; cursor: pointer;
  color: var(--text-light); transition: background .15s, color .15s;
}
.view-toggle-btn + .view-toggle-btn { border-left: 1.5px solid var(--border); }
.view-toggle-btn.active { background: var(--blue); color: var(--white); }
.view-toggle-btn:hover:not(.active) { background: #f3f4f6; }
.view-toggle-btn .material-icons-outlined { font-size: 18px; }

/* ── Alokasi card grid ──────────────────────────────────────────────────────── */
.alokasi-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 16px;
  padding: 16px 20px 20px;
}
.alokasi-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.alokasi-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1.5px solid var(--border);
}
.alokasi-card-kode {
  font-size: 1rem; font-weight: 700; letter-spacing: .2px;
}
.alokasi-card-meta {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  border-bottom: 1.5px solid var(--border);
  font-size: .84rem;
}
.alokasi-card-table { padding: 0 14px 10px; }
.alokasi-card-thead {
  display: grid;
  grid-template-columns: 1fr 1fr 36px;
  padding: 7px 0 4px;
  font-size: .67rem; font-weight: 700;
  letter-spacing: .5px; text-transform: uppercase;
  color: var(--text-light);
  border-bottom: 1px solid var(--border);
}
.alokasi-card-thead span:last-child { text-align: center; }
.alokasi-card-row {
  display: grid;
  grid-template-columns: 1fr 1fr 36px;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid #f3f4f6;
  font-size: .82rem;
}
.alokasi-card-row:last-child { border-bottom: none; }
.alokasi-card-name { font-weight: 600; font-size: .84rem; }
.alokasi-card-kode-pk { font-size: .71rem; color: var(--text-light); }
.alokasi-card-atasnama { color: var(--text); }
.alokasi-card-paid { display: flex; align-items: center; justify-content: center; }

/* ── Modal ─────────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center; z-index: 500;
}
.modal-box {
  background: var(--white); border-radius: 16px;
  width: 480px; max-width: 95vw; max-height: 90vh;
  display: flex; flex-direction: column;
}
.modal-header {
  padding: 20px 24px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header h3 { font-size: 1rem; font-weight: 700; }
.modal-close {
  background: none; border: none; font-size: 1.3rem;
  cursor: pointer; color: var(--text-light); padding: 4px;
  border-radius: 6px;
}
.modal-close:hover { background: var(--border); }
.modal-body { padding: 24px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 16px 24px; border-top: 1px solid var(--border);
  display: flex; gap: 10px; justify-content: flex-end;
}

/* ── Form elements ─────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 6px; }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%; padding: 10px 12px;
  border: 1.5px solid var(--border); border-radius: 8px;
  font-size: .9rem; outline: none; transition: border-color .2s;
  font-family: inherit;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--blue); }
.form-group textarea { resize: vertical; min-height: 72px; }

/* ── Camera / photo upload area ─────────────────────────────────────────────── */
.camera-area {
  width: 100%; aspect-ratio: 4/3; max-height: 220px;
  border: 2px dashed var(--border); border-radius: 8px;
  background: #f9fafb; cursor: pointer;
  position: relative; overflow: hidden;
  transition: border-color .2s, background .2s;
}
.camera-area:hover { border-color: var(--blue); background: #f0fdf4; }
.camera-placeholder {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; color: var(--text-light); pointer-events: none;
}
.camera-placeholder .material-icons-outlined { font-size: 40px; color: #9ca3af; }
.camera-placeholder span:last-child { font-size: .82rem; }
.camera-area img { width: 100%; height: 100%; object-fit: cover; display: block; }
.foto-info {
  display: flex; align-items: center; gap: 6px;
  margin-top: 6px; font-size: .8rem; color: var(--text-light);
}
.foto-info .material-icons-outlined { font-size: 15px; color: var(--green); }
.foto-info .btn-text-xs {
  background: none; border: none; color: var(--blue);
  font-size: .8rem; font-weight: 600; cursor: pointer; padding: 0 4px;
  font-family: inherit;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Foto action buttons (kamera / upload) ──────────────────────────────────── */
.foto-actions {
  display: flex; gap: 8px; margin-top: 8px;
}
.foto-action-btn {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 12px; border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--white); color: var(--text);
  font-size: .85rem; font-weight: 600;
  cursor: pointer; transition: background .15s; font-family: inherit;
}
.foto-action-btn:hover { background: #f3f4f6; }
.foto-action-btn .material-icons-outlined { font-size: 16px; }

/* ── Live camera modal ──────────────────────────────────────────────────────── */
.cam-overlay {
  position: fixed; inset: 0; background: #000;
  z-index: 2000; display: flex; flex-direction: column;
}
.cam-overlay video {
  flex: 1; width: 100%; min-height: 0; object-fit: cover; display: block;
}
.cam-controls {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 32px calc(20px + env(safe-area-inset-bottom, 0px));
  background: rgba(0,0,0,.8); flex-shrink: 0;
}
.cam-btn-shutter {
  width: 68px; height: 68px; border-radius: 50%;
  border: 4px solid #fff; background: rgba(255,255,255,.2);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .15s; color: #fff;
}
.cam-btn-shutter:active { background: rgba(255,255,255,.45); }
.cam-btn-shutter .material-icons-outlined { font-size: 32px; }
.cam-btn-round {
  width: 48px; height: 48px; border-radius: 50%;
  border: none; background: rgba(255,255,255,.15);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .15s; color: #fff;
}
.cam-btn-round:hover { background: rgba(255,255,255,.3); }
.cam-btn-round .material-icons-outlined { font-size: 22px; }
.cam-error-msg {
  position: absolute; bottom: 110px; left: 50%; transform: translateX(-50%);
  background: rgba(220,38,38,.9); color: #fff;
  border-radius: 8px; padding: 10px 16px; font-size: .85rem;
  max-width: 80%; text-align: center; white-space: nowrap;
}

.btn-primary-md {
  background: var(--blue); color: #fff; border: none;
  padding: 10px 24px; border-radius: 8px; font-size: .9rem;
  font-weight: 600; cursor: pointer; transition: background .15s;
}
.btn-primary-md:hover { background: var(--blue-dark); }

.btn-secondary-md {
  background: var(--white); color: var(--text); border: 1.5px solid var(--border);
  padding: 10px 24px; border-radius: 8px; font-size: .9rem;
  font-weight: 600; cursor: pointer; transition: background .15s;
}
.btn-secondary-md:hover { background: #f3f4f6; }

/* ── Update-status float bar ────────────────────────────────────────────────── */
.us-float-bar {
  flex-shrink: 0;
  padding: 12px 28px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(6px);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, .08);
}

/* ── Penimbangan ───────────────────────────────────────────────────────────── */
.pb-jenis-row {
  display: flex;
  gap: 8px;
}
.pb-jenis-btn {
  padding: 6px 18px;
  border-radius: 50px;
  border: 2px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.pb-jenis-sapi.active    { border-color: #b45309; background: #b45309; color: #fff; }
.pb-jenis-kambing.active { border-color: #0284c7; background: #0284c7; color: #fff; }
.pb-log-empty {
  padding: 12px 20px;
  font-size: .82rem;
  color: var(--text-muted);
}
.pb-tabs {
  display: flex;
  gap: 10px;
  padding: 14px 20px 0;
}

.pb-tab {
  flex: 1;
  padding: 9px 14px;
  border-radius: 50px;
  font-weight: 600;
  font-size: .88rem;
  cursor: pointer;
  transition: all .15s;
  border: 2px solid transparent;
  background: #fff;
}

.pb-tab-kupon        { border-color: #059669; color: #059669; }
.pb-tab-kupon.active { background: #059669; color: #fff; }

.pb-tab-pekurban        { border-color: #16a34a; color: #16a34a; }
.pb-tab-pekurban.active { background: #16a34a; color: #fff; }

.pb-card {
  margin: 14px 20px;
  border-radius: 16px;
  padding: 18px 20px;
  color: #fff;
}
.pb-card-kupon   { background: linear-gradient(135deg, #047857 0%, #059669 100%); }
.pb-card-pekurban { background: linear-gradient(135deg, #14532d 0%, #16a34a 100%); }

.pb-card-title    { font-size: 1.05rem; font-weight: 700; margin-bottom: 1px; }
.pb-card-subtitle { font-size: .78rem; opacity: .82; margin-bottom: 14px; }

.pb-card-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 3px;
}
.pb-card-count  { font-size: 2.8rem; font-weight: 700; line-height: 1; }
.pb-card-weight { font-size: 1.9rem; font-weight: 600; opacity: .9; }

.pb-card-desc { font-size: .76rem; opacity: .72; margin-bottom: 10px; }

.pb-progress-bar  { height: 7px; background: rgba(255,255,255,.3); border-radius: 4px; overflow: hidden; }
.pb-progress-fill { height: 100%; background: #fff; border-radius: 4px; transition: width .4s ease; }

.pb-log-row {
  display: flex;
  align-items: center;
  padding: 5px 20px;
  font-size: .82rem;
  color: var(--text-light);
  gap: 12px;
}
.pb-log-time   { min-width: 44px; font-weight: 500; color: var(--text); }
.pb-log-action { flex: 1; }
.pb-log-count  { font-weight: 700; color: var(--text); }

.pb-input-area {
  padding: 12px 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}

.pb-input {
  width: 100%;
  padding: 10px 0;
  border: none;
  border-bottom: 1.5px solid #d1d5db;
  font-size: .95rem;
  outline: none;
  color: var(--text);
  background: transparent;
  box-sizing: border-box;
}
.pb-input::placeholder { color: #9ca3af; }
.pb-input:focus { border-bottom-color: var(--blue); }

.pb-btn-tambah {
  width: 100%;
  padding: 13px;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: .04em;
  transition: background .15s;
}
.pb-btn-tambah:hover     { background: #1d4ed8; }
.pb-btn-tambah:disabled  { opacity: .6; cursor: not-allowed; }

/* ── Distribusi Pekurban ───────────────────────────────────────────────────── */
.dp-wrap        { max-width: 560px; margin: 0 auto; padding: 0 0 32px; }
.dp-header.kambing { background: linear-gradient(135deg, #0284c7 0%, #0c4a6e 100%) !important; }
.dp-header      { background: linear-gradient(135deg, #16a34a 0%, #14532d 100%);
                  border-radius: 16px 16px 0 0; padding: 20px; text-align: center;
                  color: #fff; font-size: 1rem; font-weight: 700; letter-spacing: .06em;
                  line-height: 1.4; }
.dp-filters     { display: flex; gap: 10px; padding: 14px 16px;
                  background: #fff; border-bottom: 1px solid var(--border); }
.dp-select      { flex: 0 0 auto; padding: 9px 14px; border: 1.5px solid var(--border);
                  border-radius: 50px; font-size: .85rem; background: #fff;
                  color: var(--text); outline: none; cursor: pointer; }
.dp-search-wrap { flex: 1; position: relative; }
.dp-search-wrap input { width: 100%; padding: 9px 14px 9px 36px; border: 1.5px solid var(--border);
                         border-radius: 50px; font-size: .85rem; outline: none; box-sizing: border-box; }
.dp-search-wrap input:focus { border-color: var(--blue); }
.dp-search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
                  color: var(--text-muted); font-size: .9rem; pointer-events: none; }
.dp-table-head  { display: grid; grid-template-columns: 1.2fr 1fr 1fr auto;
                  padding: 8px 16px; font-size: .78rem; font-weight: 600;
                  color: var(--text-muted); background: var(--bg); }
.dp-row         { display: grid; grid-template-columns: 1.2fr 1fr 1fr auto; align-items: center;
                  padding: 11px 16px; border-top: 1px solid var(--border);
                  cursor: pointer; transition: background .12s; background: #fff; }
.dp-row:hover   { background: var(--bg); }
.dp-row.diambil .dp-col-nama,
.dp-row.diambil .dp-col-alamat,
.dp-row.diambil .dp-col-atasnama { color: var(--text-muted); font-weight: 400; font-size: .85rem; }
.dp-row.belum   .dp-col-nama   { font-weight: 700; }
.dp-col-nama    { font-size: .9rem; line-height: 1.3; }
.dp-col-cluster { font-size: .75rem; color: var(--text-muted); font-weight: 400; }
.dp-col-alamat  { font-size: .85rem; color: var(--text-muted); }
.dp-col-atasnama { font-size: .82rem; color: var(--text-muted); }
.dp-badge-diambil { display: inline-flex; align-items: center; gap: 4px;
                    background: #f0fdf4; color: #16a34a; border: 1.5px solid #86efac;
                    border-radius: 50px; padding: 4px 10px; font-size: .78rem; font-weight: 600;
                    white-space: nowrap; }
.dp-btn-belum   { background: #2563eb; color: #fff; border: none; border-radius: 50px;
                  padding: 5px 12px; font-size: .78rem; font-weight: 600; cursor: pointer;
                  white-space: nowrap; }

/* bulk action bar */
.dk-bulk-bar { display: flex; align-items: center; gap: 12px; padding: 10px 16px;
               background: #f0fdf4; border-bottom: 1px solid #bbf7d0; }
.dk-bulk-bar span { font-size: .85rem; font-weight: 600; color: #047857; }
.dk-bulk-btn { padding: 6px 18px !important; font-size: .82rem !important; }

/* detail */
.dp-detail-card { background: #fff; margin: 0; padding: 40px 20px 14px; position: relative; }
.dp-close       { position: absolute; top: 14px; right: 16px; background: none; border: none;
                  font-size: 1.2rem; cursor: pointer; color: var(--text-muted);
                  line-height: 1; padding: 4px 8px; }
.dp-close:hover { color: var(--text); }
.dp-info-row    { display: flex; justify-content: space-between; padding: 7px 0;
                  border-bottom: 1px solid var(--border); font-size: .88rem; }
.dp-info-row:last-of-type { border-bottom: none; }
.dp-info-label  { color: var(--text-muted); }
.dp-info-val    { font-weight: 700; text-align: right; }
.dp-divider     { height: 1px; background: var(--border); margin: 12px 0; }
.dp-log-row     { display: flex; gap: 16px; font-size: .84rem; padding: 5px 0;
                  color: var(--text-muted); }
.dp-log-time    { min-width: 40px; font-weight: 600; color: var(--text); }
.dp-log-empty   { font-size: .82rem; color: var(--text-muted); padding: 4px 0; }
.dp-input-area  { background: #fff; border-top: 1px solid var(--border);
                  padding: 16px 20px; display: flex; flex-direction: column; gap: 10px; }
.dp-input       { border: none; border-bottom: 1.5px solid var(--border); padding: 8px 2px;
                  font-size: .95rem; outline: none; background: transparent; width: 100%; }
.dp-input:focus { border-bottom-color: #16a34a; }
.dp-btn-ambil   { display: flex; align-items: center; justify-content: center; gap: 8px;
                  background: #16a34a; color: #fff; border: none; border-radius: 12px;
                  padding: 14px; font-size: 1rem; font-weight: 700; cursor: pointer;
                  letter-spacing: .04em; transition: background .15s; }
.dp-btn-ambil:hover    { background: #15803d; }
.dp-btn-ambil:disabled { opacity: .6; cursor: not-allowed; }
.dp-sudah-diambil { display: flex; align-items: center; gap: 8px; justify-content: center;
                    padding: 12px; background: #f0fdf4; border-radius: 12px;
                    color: #16a34a; font-weight: 700; font-size: .95rem; }

.dp-btn-scan      { display: flex; align-items: center; gap: 6px; padding: 9px 14px;
                    background: #7c3aed; color: #fff; border: none; border-radius: 8px;
                    font-size: .85rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.dp-btn-scan:hover { background: #6d28d9; }

/* ── QR Scanner Modal ──────────────────────────────────────────────────────── */
.qr-overlay       { position: fixed; inset: 0; background: rgba(0,0,0,.85);
                    display: flex; flex-direction: column; align-items: center; justify-content: center;
                    z-index: 9000; padding: 20px; }
.qr-box           { position: relative; width: 100%; max-width: 360px; background: #000;
                    border-radius: 12px; overflow: hidden; }
.qr-video         { display: block; width: 100%; aspect-ratio: 1/1; object-fit: cover; }
.qr-canvas-hidden { display: none; }
.qr-frame         { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.qr-corner        { position: absolute; width: 56px; height: 56px; border-color: #a78bfa;
                    border-style: solid; border-width: 0; }
.qr-corner.tl     { top: 18px; left: 18px; border-top-width: 4px; border-left-width: 4px; border-radius: 4px 0 0 0; }
.qr-corner.tr     { top: 18px; right: 18px; border-top-width: 4px; border-right-width: 4px; border-radius: 0 4px 0 0; }
.qr-corner.bl     { bottom: 18px; left: 18px; border-bottom-width: 4px; border-left-width: 4px; border-radius: 0 0 0 4px; }
.qr-corner.br     { bottom: 18px; right: 18px; border-bottom-width: 4px; border-right-width: 4px; border-radius: 0 0 4px 0; }
.qr-scan-line     { position: absolute; left: 18px; right: 18px; height: 2px;
                    background: linear-gradient(90deg, transparent, #a78bfa, transparent);
                    animation: qr-scan 2s linear infinite; }
@keyframes qr-scan { 0% { top: 20px; } 50% { top: calc(100% - 20px); } 100% { top: 20px; } }
.qr-status        { color: #fff; margin-top: 16px; font-size: .9rem; text-align: center; min-height: 1.4em; }
.qr-status.success { color: #86efac; font-weight: 700; }
.qr-status.error   { color: #fca5a5; }
.qr-btn-cancel    { margin-top: 18px; padding: 10px 32px; background: transparent;
                    border: 1.5px solid rgba(255,255,255,.5); color: #fff; border-radius: 8px;
                    cursor: pointer; font-size: .9rem; }
.qr-btn-cancel:hover { background: rgba(255,255,255,.1); }

/* ── Toast ─────────────────────────────────────────────────────────────────── */
#toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }

.toast {
  background: var(--text); color: #fff; padding: 12px 20px;
  border-radius: 10px; font-size: .88rem; font-weight: 500;
  animation: slideIn .2s ease;
  max-width: 320px;
}
.toast.success { background: var(--green); }
.toast.error   { background: #dc2626; }

@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ── Misc ──────────────────────────────────────────────────────────────────── */
.empty-state { padding: 48px; text-align: center; color: var(--text-light); }
.empty-state .icon { font-size: 2.5rem; margin-bottom: 12px; }
.empty-state p { font-size: .95rem; }

.loading { padding: 48px; text-align: center; color: var(--text-light); }

/* scrollbar */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 10px; }
