:root{--ink:#26170f;--brown:#4a230f;--green:#0c7a62;--cream:#fffaf2;--border:#eadfce}*{box-sizing:border-box}body{margin:0;font-family:Arial,Helvetica,sans-serif;color:var(--ink);background:linear-gradient(135deg,#fffaf2,#f4ebde);min-height:100vh}.delivery-page{padding:28px 16px}.delivery-login{width:min(430px,100%);margin:8vh auto 0;padding:30px;background:#fff;border:1px solid var(--border);border-radius:24px;box-shadow:0 18px 50px rgba(49,29,18,.12)}.delivery-login img{width:220px;max-width:100%;height:auto;object-fit:contain;display:block;margin:0 auto 16px;background-color:#fff;padding:6px 10px;border-radius:14px;box-shadow:0 5px 14px rgba(0,0,0,.22), 0 0 12px rgba(200,155,84,.28);filter:drop-shadow(0 0 8px rgba(255,228,174,.38));box-sizing:border-box}.delivery-login h1,.delivery-header h1{font-family:Georgia,serif;color:var(--brown);margin:0 0 8px;font-size:38px}.eyebrow{font-size:11px;letter-spacing:2px;color:var(--green);font-weight:900;margin:0 0 8px}.delivery-login form{display:grid;gap:15px;margin-top:24px}.delivery-login label{display:grid;gap:6px;font-size:12px;font-weight:800;color:#6d5a4f}.delivery-login input{padding:12px;border:1px solid var(--border);border-radius:10px;font:inherit}.delivery-button{border:0;border-radius:999px;padding:12px 18px;background:var(--brown);color:#fff;font-weight:800;cursor:pointer}.delivery-button.secondary{background:#fff;color:var(--brown);border:1px solid var(--border)}.message{font-size:12px;color:#9b4c46;min-height:18px}.delivery-login>a{display:block;margin-top:18px;color:var(--green);font-size:13px;font-weight:800;text-align:center}.delivery-main{width:min(1050px,100%);margin:0 auto}.delivery-header{display:flex;justify-content:space-between;align-items:flex-start;gap:20px;margin-bottom:30px}.delivery-orders{display:grid;gap:16px}.delivery-order{background:#fff;border:1px solid var(--border);border-radius:20px;padding:22px;box-shadow:0 12px 30px rgba(49,29,18,.08)}.delivery-order h2{font-family:Georgia,serif;color:var(--brown);font-size:24px;margin:0}.delivery-order-head{display:flex;justify-content:space-between;gap:18px;border-bottom:1px solid #eee2d1;padding-bottom:14px;margin-bottom:16px}.delivery-order-head p{font-size:12px;color:#75675e;margin:4px 0}.delivery-order-total{font-weight:900;color:var(--green);font-size:20px}.delivery-details{display:grid;grid-template-columns:repeat(2,1fr);gap:10px 20px;font-size:13px;color:#5f5148}.delivery-items{grid-column:1/-1;display:grid;gap:6px;padding-top:10px;border-top:1px dashed #ded0c0}.delivery-action{margin-top:18px;display:flex;gap:9px;flex-wrap:wrap}.delivery-action button{border:0;border-radius:999px;padding:10px 16px;background:var(--green);color:#fff;font-weight:800;cursor:pointer}.delivery-action button:disabled{background:#d8cfc5;color:#88796e;cursor:not-allowed}.empty-delivery{background:#fff;border:1px dashed #d8c7b4;border-radius:20px;padding:28px;text-align:center;color:#75675e}@media(max-width:620px){.delivery-header,.delivery-order-head{flex-direction:column}.delivery-details{grid-template-columns:1fr}.delivery-login h1,.delivery-header h1{font-size:32px}}
.active-delivery-label{display:inline-block;margin-bottom:10px;font-size:11px;letter-spacing:1px;color:var(--green)}.assigned-delivery{border-color:#d7c4a8}.modal{display:none;position:fixed;z-index:1000;left:0;top:0;width:100%;height:100%;background-color:rgba(38,23,15,0.6);backdrop-filter:blur(2px);overflow-y:auto;padding:24px 12px;box-sizing:border-box}.modal-content{background-color:#fff;margin:15% auto;padding:30px;border-radius:24px;width:min(400px,90%);box-shadow:0 18px 50px rgba(49,29,18,.12)}.modal-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:20px}.modal-header h2{margin:0;font-family:Georgia,serif;color:var(--brown);font-size:24px}.close-modal{font-size:28px;font-weight:bold;color:#aaa;cursor:pointer;border:none;background:none}.close-modal:hover{color:#000}.modal form{display:grid;gap:15px}.modal label{display:grid;gap:6px;font-size:12px;font-weight:800;color:#6d5a4f}.modal input{padding:12px;border:1px solid var(--border);border-radius:10px;font:inherit}
.delivery-tabs{display:flex;gap:10px;margin-bottom:24px}.delivery-tab{padding:10px 20px;border:1px solid var(--border);border-radius:999px;background:#fff;color:var(--brown);font-weight:800;cursor:pointer}.delivery-tab.active{background:var(--brown);color:#fff;border-color:var(--brown)}.delivery-tab-content{display:none}.delivery-tab-content.active{display:block}.performance-section{display:grid;gap:20px}.member-info-card,.filter-section,.count-section,.history-section{background:#fff;border:1px solid var(--border);border-radius:20px;padding:20px}.member-info-card h3,.filter-section h3,.count-section h3,.history-section h3{font-family:Georgia,serif;color:var(--brown);font-size:20px;margin:0 0 16px}.member-info-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:12px}.member-info-grid>div{font-size:13px}.member-info-grid strong{display:block;font-size:11px;color:#6d5a4f;margin-bottom:4px}.filter-controls{display:flex;flex-wrap:wrap;gap:12px;align-items:flex-end}.filter-controls label{display:flex;flex-direction:column;gap:4px}.filter-controls label span{font-size:11px;font-weight:700;color:#6d5a4f}.filter-controls select,.filter-controls input{padding:8px;border:1px solid var(--border);border-radius:8px;font:inherit;min-width:140px}.filtered-count-display{font-size:24px;font-weight:800;color:var(--green)}.history-table-shell table{width:100%;border-collapse:collapse}.history-table-shell th,.history-table-shell td{padding:10px;text-align:left;border-bottom:1px solid var(--border)}.history-table-shell th{font-size:11px;font-weight:700;color:#6d5a4f;background:var(--cream)}.history-table-shell td{font-size:12px}.pagination-controls{display:flex;justify-content:center;align-items:center;gap:12px;margin-top:16px}.pagination-controls span{font-size:12px;color:#6d5a4f}.pagination-controls button:disabled{opacity:.5;cursor:not-allowed}@media(max-width:768px){.member-info-grid{grid-template-columns:1fr}.filter-controls{flex-direction:column;align-items:stretch}.filter-controls label{width:100%}.filter-controls select,.filter-controls input{width:100%}.delivery-header{flex-direction:column}.delivery-header h1{font-size:28px}}

/* =====================================================================
   Edit Profile Modal & Form Styling
   ===================================================================== */
.profile-modal-content {
  width: min(560px, 100%);
  max-width: 560px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  margin: auto;
  padding: 30px 28px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(49, 29, 18, 0.16);
  box-sizing: border-box;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f0e6d9;
}

.modal-header h2 {
  margin: 0;
  font-family: Georgia, serif;
  color: var(--brown);
  font-size: 24px;
  line-height: 1.2;
}

.modal-subtitle {
  margin: 4px 0 0;
  font-size: 13px;
  color: #75675e;
  line-height: 1.4;
}

.close-modal {
  font-size: 26px;
  line-height: 1;
  font-weight: 700;
  color: #a89a8f;
  cursor: pointer;
  border: none;
  background: none;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}

.close-modal:hover,
.close-modal:focus-visible {
  color: var(--ink);
  background: #f7efe6;
  outline: none;
}

/* Sections */
fieldset.profile-section {
  border: 1px solid #ebd9c8;
  border-radius: 16px;
  padding: 16px 18px 18px;
  margin: 0 0 16px;
  background: #fdfbf7;
  box-sizing: border-box;
}

.profile-section-heading {
  font-family: Georgia, serif;
  color: var(--brown);
  font-size: 15px;
  font-weight: 700;
  padding: 0 6px;
}

.section-legend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.optional-pill {
  font-family: Arial, sans-serif;
  font-size: 11px;
  font-weight: 800;
  color: #7c6556;
  background: #f0e4d6;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.field-hint {
  font-size: 12px;
  color: #827267;
  margin: 2px 0 12px;
  line-height: 1.4;
}

/* Form Grid */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-group label {
  font-size: 12px;
  font-weight: 800;
  color: #503d33;
  letter-spacing: 0.2px;
}

.form-group .required {
  color: #b91c1c;
  font-weight: 800;
  margin-left: 2px;
}

.form-group input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 13px;
  border: 1px solid #dccfbf;
  border-radius: 10px;
  font: inherit;
  font-size: 13.5px;
  color: var(--ink);
  background: #ffffff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-group input::placeholder {
  color: #aa9c91;
  font-size: 12.5px;
}

.form-group input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(12, 122, 98, 0.18);
}

/* Actions */
.profile-modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 18px;
}

.profile-modal-actions .delivery-button {
  flex: 1;
  padding: 12px 20px;
  font-size: 13.5px;
  font-weight: 800;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
  text-align: center;
}

.profile-modal-actions .delivery-button.primary {
  background: var(--green);
  color: #ffffff;
  border: 1px solid var(--green);
}

.profile-modal-actions .delivery-button.primary:hover:not(:disabled) {
  background: #095f4c;
  border-color: #095f4c;
}

.profile-modal-actions .delivery-button.primary:disabled {
  background: #a0c5bc;
  border-color: #a0c5bc;
  cursor: not-allowed;
  opacity: 0.8;
}

.profile-modal-actions .delivery-button.secondary {
  background: #ffffff;
  color: var(--brown);
  border: 1px solid var(--border);
}

.profile-modal-actions .delivery-button.secondary:hover {
  background: #f7f1e7;
  border-color: #d8c7b5;
}

/* Messages */
#editProfileMessage.message {
  display: none;
  margin-top: 14px;
  font-size: 12.5px;
  font-weight: 700;
  text-align: center;
  border-radius: 10px;
  padding: 9px 14px;
  line-height: 1.4;
}

#editProfileMessage.message.error {
  display: block;
  color: #991b1b;
  background: #fee2e2;
  border: 1px solid #fca5a5;
}

#editProfileMessage.message.success {
  display: block;
  color: #065f46;
  background: #dff5ea;
  border: 1px solid #b5e7d5;
}

/* Mobile responsive adjustments */
@media (max-width: 600px) {
  .profile-modal-content {
    width: 100%;
    padding: 22px 16px;
    margin: 10px auto;
    border-radius: 18px;
    max-height: calc(100vh - 20px);
  }
  .form-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .form-group.full-width {
    grid-column: auto;
  }
  fieldset.profile-section {
    padding: 14px 12px 16px;
    margin-bottom: 12px;
  }
  .profile-modal-actions {
    flex-direction: column;
    gap: 8px;
  }
  .modal-header h2 {
    font-size: 21px;
  }
}


/* Notify Button & Badge */
.delivery-action .notify-button {
  background: #25D366;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  transition: background 0.15s ease, transform 0.1s ease;
}

.delivery-action .notify-button:hover:not(:disabled) {
  background: #20ba59;
}

.delivery-action .notify-button:disabled {
  background: #d8cfc5;
  color: #88796e;
  cursor: not-allowed;
}

.notified-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  color: #0c7a62;
  background: #e4f7ed;
  border: 1px solid #b7ecd0;
  padding: 4px 10px;
  border-radius: 999px;
  margin-left: 6px;
  align-self: center;
}


/* Delivery Customer Info & Order ID Hierarchy */
.delivery-customer-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.delivery-customer-name {
  font-family: Georgia, serif;
  color: var(--brown);
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 2px;
  line-height: 1.25;
}

.delivery-customer-phone {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
  line-height: 1.4;
}

.delivery-customer-email {
  font-size: 13px;
  color: #5f5148;
  margin: 0;
  line-height: 1.4;
}

.delivery-customer-email a {
  color: var(--green);
  text-decoration: none;
}

.delivery-customer-email a:hover {
  text-decoration: underline;
}

.delivery-order-id {
  font-size: 12px;
  font-weight: 600;
  color: #75675e;
  margin-top: 4px;
}
