.admin-portal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 18px;
}

.admin-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(38, 33, 27, .6);
  backdrop-filter: blur(5px);
}

.admin-dialog {
  position: relative;
  z-index: 1;
  width: min(1100px, 100%);
  height: min(760px, calc(100dvh - 40px));
  overflow: hidden;
  border: 1px solid #e9e2d4;
  border-radius: 26px;
  background: #fbf5e7;
  box-shadow: 0 25px 80px rgba(32, 27, 20, .26);
  color: #3e3629;
}

.admin-dialog.is-login { width: min(420px, 100%); height: auto; max-height: calc(100dvh - 36px); padding: 36px 28px 22px; overflow-y: auto; }
.admin-dialog.is-login .admin-close { top: 12px; right: 12px; width: 32px; height: 32px; font-size: 22px !important; }

.admin-dialog button { font: inherit; }
.admin-dialog button:disabled { cursor: not-allowed; opacity: .55; }
.admin-close {
  position: absolute;
  top: 24px;
  right: 24px;
  z-index: 4;
  width: 42px;
  height: 42px;
  border: 1px solid #e9d9b9;
  border-radius: 50%;
  background: #fffdf8;
  color: #594d3d;
  font-size: 27px !important;
  line-height: 1;
}

.admin-login {
  width: 100%;
  height: auto;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.admin-login .admin-icon { width: 48px; height: 48px; margin-bottom: 16px; border-radius: 14px; font-size: 28px; }
.admin-login .eyebrow,
.admin-dashboard-head .eyebrow { color: #956f2c; }
.admin-login h2 { margin: 8px 0; font-family: "Playfair Display", serif; font-size: 30px; }
.admin-login > p { margin: 0 0 20px; color: #7a6f5c; font-size: 14px; line-height: 1.5; }
.admin-login form { display: grid; gap: 9px; }
.admin-login label { font-size: 13px; font-weight: 800; }
.admin-login input,
.fulfill-modal input {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid #ded5c6;
  border-radius: 12px;
  background: #fffdf9;
  color: #3e3629;
}
.admin-login-button {
  min-height: 48px;
  margin-top: 10px;
  border: 0;
  border-radius: 13px;
  background: #a5782e;
  color: white;
  font-weight: 800 !important;
}
.admin-login-error,
.fulfill-error { min-height: 20px; margin: 4px 0; color: #a33a31; font-size: 12px; }

.admin-dashboard {
  height: 100%;
  overflow: auto;
  padding: 22px 20px 24px;
}
.admin-dashboard-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  padding-right: 54px;
}
.admin-dashboard-head h2 { margin: 2px 0 0; font-size: 26px; letter-spacing: -.03em; }
.admin-head-actions { display: flex; gap: 10px; }
.admin-reload,
.admin-signout {
  min-height: 43px;
  padding: 9px 16px;
  border: 0;
  border-radius: 24px;
  background: #efe2c8;
  color: #443a2a;
  font-weight: 800 !important;
  white-space: nowrap;
}
.admin-signout { border: 1px solid #e8d9b9; background: #fffdf8; }

.admin-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .95fr); gap: 22px; align-items: start; }
.calendar-card,
.activity-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid #e9e2d4;
  border-radius: 21px;
  background: #fffaf0;
}
.calendar-card h3,
.activity-card h3 { margin: 0 0 16px; font-size: 18px; }
.calendar-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.calendar-section-heading h3 { margin: 0; }
.calendar-section-heading button { min-height: 32px; padding: 5px 12px; font-size: 12px; }
.admin-calendar-note { margin: 8px 0 16px; color: #7a6f5c; font-size: 11px; line-height: 1.5; }
#requests-load-more { width: 100%; margin-top: 12px; }
.calendar-inner {
  padding: 18px;
  border: 1px solid #eae3d5;
  border-radius: 19px;
  background: #fffdf8;
}
.calendar-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 16px; }
.calendar-toolbar strong { font-size: 18px; }
.calendar-toolbar button {
  width: 40px;
  height: 40px;
  border: 1px solid #eee0c8;
  border-radius: 50%;
  background: #fffaf1;
  color: #463b2d;
  font-size: 29px;
  line-height: 1;
}
.calendar-weekdays,
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.calendar-weekdays { margin-bottom: 8px; text-align: center; text-transform: uppercase; color: #8f8066; font-size: 11px; font-weight: 800; }
.calendar-day,
.calendar-spacer { min-width: 0; min-height: 63px; }
.calendar-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 4px;
  border: 1px solid #ece5d8;
  border-radius: 14px;
  background: #fffaf1;
  color: #3c3429;
}
.calendar-day strong { font-size: 15px; }
.calendar-day small { color: #9b7229; font-size: 10px; font-weight: 800; }
.calendar-day.is-today { outline: 2px solid #edd9aa; outline-offset: -4px; }
.calendar-day.is-selected { border-color: #a67a2e; background: #a67a2e; color: white; }
.calendar-day.is-selected small { color: #fff5d9; }
.calendar-day.has-orders:not(.is-selected) { border-color: #d9be87; background: #fffdf8; }
.selected-day-panel { margin-top: 16px; padding: 15px; border: 1px solid #eae3d5; border-radius: 17px; background: #fffaf1; }
.selected-day-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 12px; }
.selected-day-head div { display: flex; flex-direction: column; gap: 2px; }
.selected-day-head small,
.calendar-totals small,
.activity-stats small,
.payment-fields small { color: #8f8066; text-transform: uppercase; font-size: 10px; font-weight: 800; }
.selected-day-head strong { font-size: 14px; }
.orders-list { display: grid; gap: 10px; }
.empty-orders { padding: 16px; border: 1px dashed #e7decc; border-radius: 12px; color: #8d806d; text-align: center; font-size: 12px; }
.payment-card { padding: 13px; border: 1px solid #ece5d8; border-radius: 15px; background: #fffdf8; }
.payment-card-head { display: flex; justify-content: space-between; gap: 10px; }
.payment-card-head div { display: flex; flex-direction: column; gap: 3px; }
.payment-card-head small { color: #8f8066; font-size: 11px; }
.payment-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
.payment-fields div { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 9px; border-radius: 10px; background: #f4f0e9; }
.payment-fields span { overflow-wrap: anywhere; font-size: 11px; font-weight: 700; }
.payment-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.payment-actions button { min-height: 38px; padding: 8px 12px; border: 0; border-radius: 20px; background: #f0e7d6; color: #534637; font-size: 11px; font-weight: 800 !important; }
.payment-actions button[data-action="fulfill"] { background: #816b49; color: white; }
.payment-actions .delete-order-button { background: #fbe9e7; color: #a52c26; }
.calendar-totals { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 13px; }
.calendar-totals div,
.activity-stats div { display: flex; flex-direction: column; gap: 4px; padding: 14px; border: 1px solid #edddc3; border-radius: 15px; background: #fffaf1; }
.calendar-totals strong { font-size: 22px; }
.calendar-totals span,
.activity-stats span { color: #8f8066; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.activity-card > p { margin: -10px 0 17px; color: #81745e; font-size: 12px; }
.activity-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.activity-stats strong { font-size: 27px; line-height: 1; }
.activity-card h4 { margin: 23px 0 8px; font-size: 14px; }
.activity-list,
.request-list { display: grid; gap: 8px; }
.activity-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 12px; border: 1px solid #ece5d8; border-radius: 12px; background: #fffdf8; color: #3e3629; text-align: left; }
.activity-item span { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.activity-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.activity-item small { color: #8f8066; font-size: 10px; }
.activity-item b { white-space: nowrap; font-size: 13px; }
.admin-status { min-height: 18px; margin: 15px 0 0 !important; color: #8f8066; font-size: 11px !important; }
.admin-status.is-error { color: #a33a31; }
.request-section { margin-top: 18px; padding-top: 2px; border-top: 1px solid #e9e1d1; }
.request-section > p { margin: 0 0 10px; color: #8f8066; font-size: 11px; }
.request-card { padding: 12px; border: 1px solid #ece5d8; border-radius: 12px; background: #fffdf8; }
.request-card div { display: flex; justify-content: space-between; gap: 10px; font-size: 11px; }
.request-card div span { color: #8f8066; }
.request-card > small { display: block; margin-top: 4px; color: #8f8066; font-size: 10px; }
.request-card p { margin: 8px 0 0; overflow-wrap: anywhere; color: #554d40; font-size: 11px; }
.request-card-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; color: #8f8066; font-size: 10px; }
.request-card-actions button { border: 0; border-radius: 99px; padding: 7px 10px; background: #8a704d; color: #fff; font-weight: 700; cursor: pointer; }
.request-card-actions button:disabled { background: #eee9df; color: #6e665c; cursor: default; }

.fulfill-modal { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; padding: 20px; background: rgba(36, 30, 21, .58); }
.fulfill-modal-card { width: min(420px, 100%); padding: 28px; border-radius: 19px; background: #fffaf1; box-shadow: 0 20px 60px rgba(0,0,0,.24); }
.fulfill-modal h2 { margin: 0 0 6px; font-family: "Playfair Display", serif; font-size: 25px; }
.fulfill-modal p { color: #7d705c; font-size: 12px; }
.fulfill-modal form { display: grid; gap: 8px; }
.fulfill-modal label { font-size: 12px; font-weight: 800; }
.fulfill-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 8px; }
.fulfill-actions button { min-height: 42px; padding: 8px 14px; border: 0; border-radius: 10px; background: #eee4d4; color: #3e3629; font-weight: 800 !important; }
.fulfill-actions button[type="submit"] { background: #816b49; color: white; }

@media (max-width: 1000px) {
  .admin-layout { grid-template-columns: 1fr; }
  .activity-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .admin-portal { padding: 10px; }
  .admin-dialog { width: 100%; height: calc(100dvh - 20px); border-radius: 20px; }
  .admin-dialog.is-login { height: auto; max-height: calc(100dvh - 20px); padding: 32px 22px 20px; }
  .admin-dashboard { padding: 19px 12px 28px; }
  .admin-dashboard-head { align-items: flex-start; flex-direction: column; gap: 12px; padding-right: 42px; }
  .admin-dashboard-head h2 { font-size: 26px; }
  .admin-close { top: 15px; right: 12px; }
  .admin-head-actions { flex-wrap: wrap; }
  .admin-reload, .admin-signout { min-height: 38px; padding: 7px 11px; font-size: 12px !important; }
  .calendar-card, .activity-card { padding: 12px; }
  .calendar-inner { padding: 9px; }
  .calendar-weekdays, .calendar-grid { gap: 3px; }
  .calendar-day, .calendar-spacer { min-height: 52px; }
  .calendar-day strong { font-size: 12px; }
  .calendar-day small { font-size: 8px; }
  .activity-stats { grid-template-columns: 1fr 1fr; }
  .payment-fields { grid-template-columns: 1fr; }
}
