* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f7fb;
  color: #1a1d26;
  height: 100vh;
  overflow: hidden;
}
#app { display: flex; flex-direction: column; height: 100vh; }

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
  background: #fff;
  border-bottom: 1px solid #e5e8ef;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo .icon { font-size: 1.6rem; }
header h1 { font-size: 1.35rem; font-weight: 650; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.business-name { font-weight: 500; color: #555; font-size: 0.95rem; }

.tabs {
  display: flex;
  gap: 4px;
  padding: 8px 24px 0;
  background: #fff;
  border-bottom: 1px solid #e5e8ef;
}
.tab {
  background: none;
  border: none;
  padding: 10px 16px;
  font-size: 0.9rem;
  color: #666;
  cursor: pointer;
  border-radius: 8px 8px 0 0;
  position: relative;
}
.tab.active {
  color: #2563eb;
  font-weight: 600;
  background: #f5f7fb;
}
.tab.active::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0; right: 0;
  height: 2px;
  background: #2563eb;
}

main { flex: 1; overflow: auto; padding: 20px 24px; }

button {
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s;
}
button.primary { background: #2563eb; color: white; }
button.primary:hover { background: #1d4ed8; }
button.secondary { background: #eef2ff; color: #3730a3; }
button.secondary:hover { background: #e0e7ff; }
button.danger { background: #ef4444; color: white; }
button.danger:hover { background: #dc2626; }
button.icon-btn { background: none; font-size: 1.4rem; padding: 4px 10px; color: #666; }

.card {
  background: white;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  margin-bottom: 16px;
}
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.calendar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.day-header { text-align: center; font-size: 0.75rem; font-weight: 600; color: #888; padding: 8px 0; }
.day-cell {
  min-height: 90px;
  background: white;
  border-radius: 8px;
  padding: 6px;
  border: 1px solid #eee;
  cursor: pointer;
  position: relative;
}
.day-cell:hover { border-color: #2563eb; }
.day-cell.other-month { opacity: 0.4; }
.day-cell.today { border-color: #2563eb; background: #eff6ff; }
.day-num { font-size: 0.8rem; font-weight: 600; }
.appointment-pill {
  font-size: 0.7rem;
  background: #dbeafe;
  color: #1e40af;
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.appointment-pill.late { background: #fee2e2; color: #991b1b; }
.appointment-pill.missed { background: #fecaca; color: #7f1d1d; }

table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid #eee; }
th { background: #f8fafc; font-weight: 600; color: #444; }
tr:hover td { background: #f8fafc; }

.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}
.status-scheduled { background: #dbeafe; color: #1e40af; }
.status-confirmed { background: #dcfce7; color: #166534; }
.status-late { background: #ffedd5; color: #9a3412; }
.status-missed { background: #fee2e2; color: #991b1b; }
.status-completed { background: #f3e8ff; color: #6b21a8; }
.status-cancelled { background: #f1f5f9; color: #475569; }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: white;
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #eee;
}
.modal-body { padding: 20px; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 500; margin-bottom: 4px; color: #444; }
input, select, textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 0.9rem;
  background: white;
}
textarea { min-height: 70px; resize: vertical; }
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }

.alert-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: white;
  border-radius: 10px;
  margin-bottom: 8px;
  border-left: 4px solid #ef4444;
}
.alert-item.late { border-left-color: #f97316; }
.stats { display: flex; gap: 16px; margin-bottom: 20px; }
.stat-card {
  flex: 1;
  background: white;
  padding: 16px;
  border-radius: 12px;
  text-align: center;
}
.stat-card .num { font-size: 1.8rem; font-weight: 700; color: #2563eb; }
.stat-card .label { font-size: 0.8rem; color: #666; margin-top: 4px; }

.empty { text-align: center; color: #888; padding: 40px; }
/* ===== Utilumen Book redesign ===== */
:root{--bk-ac:#7c3aed;--bk-ac2:#db2777;--bk-g:linear-gradient(135deg,#7c3aed,#db2777);--bk-ln:#ebe8f5;--bk-mu:#6b6488;--bk-bg:#f7f5fd}
body{background:linear-gradient(180deg,#faf8ff,#f3f0fb)!important;font-family:Inter,system-ui,sans-serif!important;padding-bottom:110px}
#app{max-width:1180px;margin:0 auto;padding:14px}
#app header{background:#fff;border:1px solid var(--bk-ln);border-radius:20px;padding:14px 18px;box-shadow:0 6px 24px rgba(60,40,120,.06);flex-wrap:wrap;gap:10px}
#app header h1{background:var(--bk-g);-webkit-background-clip:text;background-clip:text;color:transparent;font-size:1.35rem}
#app .logo .icon{display:grid;place-items:center;width:40px;height:40px;border-radius:12px;background:var(--bk-g);font-size:20px}
.business-name{background:#f3f0ff;color:#4c3a9e;padding:6px 12px;border-radius:999px;font-weight:600;font-size:13px}
#app .tabs{display:flex;gap:6px;overflow-x:auto;padding:10px 2px;margin:8px 0;border:0;background:none;scrollbar-width:none}
#app .tab{display:flex;align-items:center;gap:6px;white-space:nowrap;border:1px solid var(--bk-ln)!important;background:#fff!important;color:#4a4366!important;border-radius:999px!important;padding:9px 16px!important;font-weight:600}
#app .tab span{font-size:15px}#app .tab.active{background:var(--bk-g)!important;color:#fff!important;border-color:transparent!important;box-shadow:0 6px 16px rgba(124,58,237,.3)}#app .tab.active::after{display:none}
#app main{padding:0}
#app button,.modal button{border-radius:12px;font-weight:600}
#app button.primary,.modal button.primary{background:var(--bk-g)!important;border:0!important;color:#fff!important;box-shadow:0 6px 16px rgba(124,58,237,.25)}
#app button.secondary{background:#fff!important;border:1px solid var(--bk-ln)!important;color:#3b2f73!important}
#app button.danger,.modal button.danger{background:#fff1f2!important;color:#be123c!important;border:1px solid #fecdd3!important}
.card{background:#fff!important;border:1px solid var(--bk-ln)!important;border-radius:18px!important;box-shadow:0 4px 18px rgba(60,40,120,.05)!important;padding:16px!important}
.calendar-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}.calendar-header h2,.calendar-header h3{font-size:1.15rem}
.calendar-grid{gap:6px!important;background:none!important;border:0!important}
.day-header{background:none!important;color:var(--bk-mu)!important;font-size:12px;font-weight:700;text-transform:uppercase;letter-spacing:.05em;text-align:center;padding:4px 0!important}
.day-cell{background:#fff!important;border:1px solid var(--bk-ln)!important;border-radius:12px!important;min-height:92px;padding:6px!important;transition:.15s}
.day-cell:hover{border-color:#c4b5fd!important;box-shadow:0 4px 14px rgba(124,58,237,.12)}
.day-cell.other-month{background:#faf9fd!important;opacity:.55}
.day-cell.today{border:2px solid var(--bk-ac)!important;background:#f6f2ff!important}
.day-cell.today .day-num{background:var(--bk-g);color:#fff!important;border-radius:999px;display:inline-grid;place-items:center;width:24px;height:24px}
.day-num{font-weight:700;font-size:13px;color:#2d2650}
.appointment-pill{display:block;background:#ede9fe!important;color:#5b21b6!important;border-left:3px solid #7c3aed;border-radius:6px!important;padding:2px 6px!important;font-size:11px!important;font-weight:600;margin-top:3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.appointment-pill.late{background:#fef3c7!important;color:#92400e!important;border-left-color:#f59e0b}
.appointment-pill.missed{background:#ffe4e6!important;color:#9f1239!important;border-left-color:#e11d48}
#app table{width:100%;border-collapse:separate;border-spacing:0 6px}#app th{color:var(--bk-mu)!important;font-size:12px;text-transform:uppercase;letter-spacing:.04em;background:none!important;border:0!important}
#app td{background:#fff;border-top:1px solid var(--bk-ln);border-bottom:1px solid var(--bk-ln)}#app td:first-child{border-left:1px solid var(--bk-ln);border-radius:12px 0 0 12px}#app td:last-child{border-right:1px solid var(--bk-ln);border-radius:0 12px 12px 0}
.status-badge{border-radius:999px!important;padding:3px 10px!important;font-size:11px!important;font-weight:700}
.stats{gap:12px!important}.stat-card{background:#fff!important;border:1px solid var(--bk-ln)!important;border-radius:16px!important;box-shadow:0 4px 14px rgba(60,40,120,.05)}.stat-card .num{background:var(--bk-g);-webkit-background-clip:text;background-clip:text;color:transparent!important;font-size:2rem!important;font-weight:800}
.alert-item{background:#fff!important;border:1px solid var(--bk-ln)!important;border-left:4px solid #e11d48!important;border-radius:14px!important;padding:12px 14px!important;margin-bottom:8px}.alert-item.late{border-left-color:#f59e0b!important;background:#fffbeb!important}
.modal-overlay{background:rgba(20,14,45,.45)!important;backdrop-filter:blur(6px)}.modal{border-radius:20px!important;box-shadow:0 30px 80px rgba(20,14,45,.35)!important;max-height:calc(100vh - 120px);overflow:auto}
.modal input,.modal select,.modal textarea,#app input,#app select,#app textarea{background:#fbfaff!important;border:1px solid #dcd7ee!important;border-radius:12px!important;padding:10px 12px!important;color:#22223a!important}
.modal input:focus,.modal select:focus,.modal textarea:focus{outline:2px solid #a78bfa;border-color:transparent!important}
.form-group label{color:var(--bk-mu)!important;font-weight:600;font-size:12px}
.empty{color:var(--bk-mu);text-align:center;padding:24px}
@media(max-width:700px){#app{padding:8px}#app header{padding:12px}.header-actions{width:100%;display:flex;gap:8px;flex-wrap:wrap}.header-actions button{flex:1}.business-name{width:100%;text-align:center}
.calendar-grid{gap:3px!important}.day-cell{min-height:58px;padding:3px!important;border-radius:8px!important}.appointment-pill{font-size:0!important;padding:0!important;height:6px;border-left:0;background:var(--bk-ac)!important}.appointment-pill.late{background:#f59e0b!important}.appointment-pill.missed{background:#e11d48!important}
.grid-3,.grid-2,.grid-4{grid-template-columns:1fr!important}.form-row{flex-direction:column}.stats{grid-template-columns:1fr 1fr!important}
#app table,#app tbody,#app tr,#app td{display:block;width:100%}#app thead{display:none}#app tr{margin-bottom:8px;background:#fff;border:1px solid var(--bk-ln);border-radius:12px;padding:6px}#app td{border:0!important;border-radius:0!important;padding:3px 8px!important}
.modal{width:calc(100vw - 20px)!important;max-height:calc(100vh - 140px)}}
#bkGate{padding:14px 14px 110px}#bkGate .logo{display:flex;align-items:center;gap:10px}#bkGate .icon{display:grid;place-items:center;width:40px;height:40px;border-radius:12px;background:var(--bk-g);font-size:20px}#bkGate h1{margin:0;font-size:1.4rem;background:var(--bk-g);-webkit-background-clip:text;background-clip:text;color:transparent}#bkGate button{border-radius:12px;font-weight:600;padding:11px 20px;cursor:pointer}#bkGate .primary{background:var(--bk-g);color:#fff;border:0}#bkGate .secondary{background:#fff;border:1px solid var(--bk-ln);color:#3b2f73}
