/* Container */
#agent-schedule.as-container {
  max-width: 820px;
  margin: 24px auto 64px;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: #0f172a;
  width: 100%;
  box-sizing: border-box;
  padding-left: 10px;
  padding-right: 10px;
}

.as-header { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:16px; }
.as-header h2 { font-size:22px; margin:0; }

/* Buttons */
.as-btn { border:1px solid #cbd5e1; background:#fff; padding:8px 12px; border-radius:10px; cursor:pointer; font-size:14px; }
.as-btn:hover { background:#f8fafc; }
.as-primary { background:#2563eb; border-color:#2563eb; color:#fff; }
.as-primary:hover { background:#1d4ed8; }
.as-danger { background:#ef4444; border-color:#ef4444; color:#fff; }
.as-danger:hover { background:#dc2626; }

/* + New Plan: samme look som kortene, med tynn mørkere kant */
#as-add {
  background: #0b13241a;           /* samme som .as-card bakgrunn */
  border: 1px solid #9aa2a8;       /* tynn mørkere kant */
  color: #0f172a;
  box-shadow: none;
}
#as-add:hover { filter: brightness(0.98); }

/* List */
.as-list { display:grid; gap:14px; }
.as-empty, .as-error { padding:14px; border:1px dashed #cbd5e1; border-radius:12px; background:#f8fafc; color:#334155; }

/* Card – 2 rader: 
   Rad 1 = tittel + dager, Rad 2 = tid + toggle */
.as-card {
  display: grid;
  grid-template-rows: auto auto;
  gap: 10px;
  background:#0b13241a;
  border:1px solid #e2e8f0;
  border-radius:16px;
  padding:14px 16px;
  box-shadow: 0 1px 0 rgba(15,23,42,.04);
  cursor: pointer;
}
.as-card:hover { filter: brightness(1.02); }

.as-row1,
.as-row2 {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

/* Left bits */
.as-card-title { font-size:16px; font-weight:700; }
.as-card-time  { font-size:22px; font-weight:700; letter-spacing:.02em; }

/* Days (badges) */
.as-days-mini {
  display:flex;
  gap:6px;
  user-select:none;
  flex-wrap: nowrap;           /* hold på én linje */
}
.as-days-mini .day {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:22px; height:22px;
  border-radius:999px;
  border:1px solid rgba(0,0,0,.15);
  opacity:.45;
  font-weight:600;
  font-size:12px;
  background:#fff;
}
.as-days-mini .day.on {
  opacity:1;
  border-color: rgba(0,0,0,.35);
  box-shadow: 0 1px 1px rgba(0,0,0,.05);
}

/* Switch */
.as-switch { position:relative; display:inline-block; width:50px; height:28px; }
.as-switch input { opacity:0; width:0; height:0; }
.as-switch .as-slider { position:absolute; inset:0; background:#e2e8f0; border-radius:999px; transition:.2s; }
.as-switch .as-slider:before {
  content:""; position:absolute; width:22px; height:22px; left:3px; top:3px; background:#fff;
  border-radius:999px; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition:.2s;
}
.as-switch input:checked + .as-slider { background:#6366f1; }
.as-switch input:checked + .as-slider:before { transform: translateX(22px); }

/* Modal */
.as-modal.hidden { display:none; }
.as-modal { position:fixed; inset:0; background:rgba(15,23,42,.45); display:grid; place-items:center; z-index:9999; }
.as-dialog { width:min(560px,92vw); background:#fff; border-radius:16px; border:1px solid #e2e8f0; box-shadow:0 20px 60px rgba(2,6,23,.18); overflow:hidden; }
.as-dialog-header { padding:14px 18px; border-bottom:1px solid #e2e8f0; }
.as-dialog-header h3 { margin:0; }
.as-dialog-body { padding:16px 18px; display:grid; gap:14px; }
.as-dialog-footer { display:flex; gap:8px; justify-content:flex-end; padding:12px 18px; border-top:1px solid #e2e8f0; }
.as-field { display:grid; gap:6px; }
.as-field.two { grid-template-columns:1fr 1fr; gap:12px; }
.as-field span { font-size:13px; color:#475569; }
.as-field input[type="text"], .as-field input[type="time"] {
  height:42px; border:1px solid #cbd5e1; border-radius:10px; padding:0 10px; font-size:14px;
}

/* Day chips in modal */
.as-daychips { display:flex; gap:8px; flex-wrap:nowrap; }
.as-daychips .chip {
  display:inline-flex; width:34px; height:34px; border-radius:999px; border:1px solid #cbd5e1;
  align-items:center; justify-content:center; user-select:none; cursor:pointer; background:#fff; color:#475569; font-weight:600;
}
.as-daychips .chip.on { border-color:#2563eb; background:#dbeafe; color:#1e3a8a; }

/* Mobile tweaks so nothing overlaps */
@media (max-width:560px){
  .as-card-time{font-size:20px;}
}
@media (max-width:420px){
  .as-daychips{gap:6px;}
  .as-daychips .chip{width:32px; height:32px;}
  .as-days-mini{gap:5px;}
  .as-days-mini .day{width:20px; height:20px; font-size:11px;}
}
@media (max-width:360px){
  .as-daychips{gap:5px;}
  .as-daychips .chip{width:30px; height:30px;}
  .as-days-mini{gap:4px;}
  .as-days-mini .day{width:19px; height:19px; font-size:10px;}
}

/* Utilities */
.hidden { display:none !important; }