/* ============================================================
   ANAND STAYS — Admin Theme
   Matches the guest-facing app's heritage haveli palette:
   parchment cream, deep forest green, terracotta accent, gold highlight.
   Include once via header.php — every admin page shares this file.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,500;0,9..144,600;0,9..144,700;1,9..144,500&family=Manrope:wght@400;500;600;700;800&display=swap');

:root{
  --cream: #FAF3E6;
  --cream-deep: #F1E7D4;
  --ink: #241F1A;
  --ink-soft: #8A8175;
  --forest: #1F3B2C;
  --forest-deep: #16291D;
  --terracotta: #C1583A;
  --terracotta-soft: #F3E3DC;
  --gold: #E8B93F;
  --gold-soft: #F6E6B4;
  --sage: #DDE4D2;
  --line: #EAE2D4;
  --white: #FFFFFF;
  --green-soft: #E3F1E6;
  --green: #1F8A4C;
  --red-soft: #FBE7E4;
  --red: #C1583A;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px -14px rgba(36,31,26,0.28);
  --shadow-sm: 0 4px 18px -12px rgba(36,31,26,0.18);
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
  --ease: cubic-bezier(.22,.61,.36,1);
}

*{ box-sizing: border-box; }
html, body{ margin:0; padding:0; }
body{
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
a{ color: inherit; }

/* ================= TOPBAR ================= */
.topbar{
  background: linear-gradient(120deg, var(--forest-deep), var(--forest));
  color: var(--white);
  padding: 16px 28px;
  display:flex;
  align-items:center;
  box-shadow: 0 4px 16px -8px rgba(0,0,0,0.35);
  position: relative;
  z-index: 10;
}
.topbar .brand{
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 19px;
  letter-spacing: -0.01em;
  color: var(--gold-soft);
}

/* ================= LAYOUT ================= */
.layout{ display:flex; min-height: calc(100vh - 60px); }

.sidebar{
  flex: 0 0 200px;
  background: var(--forest-deep);
  padding: 24px 14px;
  display:flex;
  flex-direction: column;
  gap: 4px;
}
.sidebar a,
.sidebar a:visited{
  display:block;
  padding: 11px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255,255,255,0.72);
  text-decoration:none;
  transition: all .15s var(--ease);
}
.sidebar a:hover{
  background: rgba(255,255,255,0.08);
  color: var(--white);
}
.sidebar a.active,
.sidebar a.active:visited{
  background: var(--gold);
  color: var(--forest-deep);
}

.content{
  flex: 1;
  padding: 32px 36px 60px;
  min-width: 0;
}

.admin-footer{
  text-align:center;
  padding: 18px;
  font-size: 12.5px;
  color: var(--ink-soft);
  background: var(--cream-deep);
}

/* ================= PAGE HEADINGS ================= */
h1{
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--terracotta);
  font-size: 24px;
  margin: 0 0 18px;
}
.list-heading{
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--terracotta);
  font-size: 22px;
  margin: 42px 0 14px;
}

/* ================= FORM CARD ================= */
.page-card{
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 34px 38px 28px;
  position: relative;
  overflow: hidden;
}
.page-card::before{
  /* decorative jali dot motif along the top, echoing the guest app */
  content:"";
  position:absolute;
  top:0; left:0; right:0;
  height: 6px;
  background-image: radial-gradient(var(--terracotta-soft) 1.2px, transparent 1.4px);
  background-size: 12px 12px;
  opacity:.7;
}
.page-card-header{ text-align:center; margin-bottom:4px; }
.page-logo-full{ max-width:210px; height:auto; }
.page-card-title{
  text-align:center;
  font-family: var(--font-display);
  color: var(--forest);
  font-size: 21px;
  font-weight: 600;
  margin: 6px 0 28px;
}

.grid-form{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 24px;
}
.grid-field-full{ grid-column: 1 / -1; }
.grid-field label{
  display:block;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 7px;
}
.grid-field .req{ color: var(--terracotta); }
.grid-field input[type="text"],
.grid-field input[type="number"],
.grid-field select{
  width:100%;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  font-family: inherit;
  color: var(--ink);
  background: var(--white);
  transition: border-color .15s var(--ease);
}
.grid-field input:focus,
.grid-field select:focus{ outline:none; border-color: var(--forest); }
.field-hint{
  display:block;
  margin-top: 8px;
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.5;
}

.diet-toggle-group{ display:flex; gap:14px; align-items:center; margin-top:2px; }
.veg-toggle{
  display:inline-flex;
  align-items:center;
  gap:8px;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 15px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  cursor:pointer;
  transition: all .15s var(--ease);
}
.veg-toggle:has(input:checked){
  border-color: var(--forest);
  background: var(--green-soft);
}
.veg-toggle input{ accent-color: var(--forest); width:16px; height:16px; }

.upload-box, .upload-box-compact{
  display:flex;
  align-items:center;
  justify-content:center;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius-sm);
  padding: 22px;
  cursor:pointer;
  background: var(--cream);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  transition: all .15s var(--ease);
}
.upload-box:hover, .upload-box.dragging{ border-color: var(--forest); background: var(--white); }
.upload-box input[type="file"]{ display:none; }

/* ================= BUTTONS ================= */
.btn{
  display:inline-flex;
  align-items:center;
  gap:8px;
  border:none;
  border-radius: 999px;
  padding: 12px 24px;
  font-weight: 700;
  font-size: 14px;
  cursor:pointer;
  font-family: inherit;
  text-decoration:none;
  transition: transform .1s var(--ease), background .15s var(--ease), opacity .15s var(--ease);
}
.btn:active{ transform: scale(0.97); }
.btn-green{ background: var(--forest); color:#fff; box-shadow: 0 8px 18px -10px rgba(31,59,44,.6); }
.btn-green:hover{ background: var(--forest-deep); }
.btn-outline{ background: var(--white); color: var(--forest); border: 1.5px solid var(--forest); }
.btn-outline:hover{ background: var(--cream); }
.btn-sm{ padding: 7px 14px; font-size: 12.5px; }

/* ================= TABLE SHELL (toolbar + table as one card) ================= */
.items-shell{
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.items-toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding: 16px 20px;
  background: var(--cream-deep);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.items-search-wrap{ position:relative; flex: 1 1 260px; max-width:320px; }
.items-search-wrap svg{ position:absolute; left:12px; top:50%; transform:translateY(-50%); color: var(--ink-soft); pointer-events:none; }
.items-search{
  width:100%;
  padding: 9px 14px 9px 36px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  font-size:14px;
  background: var(--white);
  font-family: inherit;
  box-sizing:border-box;
}
.items-search:focus{ outline:none; border-color: var(--forest); }
.items-count-pill{
  background: var(--forest);
  color:#fff;
  font-size: 12.5px;
  font-weight:700;
  padding: 7px 16px;
  border-radius:999px;
  white-space:nowrap;
}

.table-wrap table{ width:100%; border-collapse:collapse; }
.table-wrap thead th{
  background: var(--white);
  color: var(--ink-soft);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 800;
  text-align:left;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
}
.table-wrap tbody tr{ border-bottom: 1px solid var(--line); transition: background .12s var(--ease); }
.table-wrap tbody tr:last-child{ border-bottom:none; }
.table-wrap tbody tr:hover{ background: #FCFAF5; }
.table-wrap td{ padding: 13px 18px; font-size: 14px; color: var(--ink); vertical-align: middle; }
.table-wrap td .empty{ color: var(--ink-soft); }

.thumb-wrap{
  width:52px; height:52px;
  border-radius: 10px;
  overflow:hidden;
  background: var(--cream);
  display:flex; align-items:center; justify-content:center;
}
.thumb{ width:100%; height:100%; object-fit:cover; }
.thumb-fallback{ font-size:20px; }

.type-pill{
  display:inline-block;
  background: var(--cream);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size:12px;
  font-weight:600;
  padding: 4px 10px;
  border-radius: 999px;
  white-space:nowrap;
}
.sort-pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:26px;
  height:22px;
  padding: 0 8px;
  background: var(--cream);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size:12px;
  font-weight:700;
  border-radius:999px;
}

.diet-pill{
  display:inline-flex; align-items:center; gap:5px;
  font-size:12px; font-weight:700;
  padding:4px 10px; border-radius:999px;
  white-space:nowrap;
}
.diet-pill.veg{ background: var(--green-soft); color: var(--green); }
.diet-pill.nonveg{ background: var(--red-soft); color: var(--red); }
.diet-pill.both{ background:#FDF1DA; color:#96721A; }

.status-active, .status-inactive{
  display:inline-flex; align-items:center; gap:5px;
  font-size:12px; font-weight:700;
  padding:4px 10px; border-radius:999px;
}
.status-active{ background: var(--green-soft); color: var(--green); }
.status-inactive{ background:#F1EDE6; color: var(--ink-soft); }
.status-active::before, .status-inactive::before{ content:"●"; font-size:8px; }

.row-actions{ display:flex; gap:6px; flex-wrap:wrap; }

.alert-warning{
  background: var(--gold-soft);
  border: 1px solid var(--gold);
  color: #7A5D14;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 14.5px;
}
.alert-warning a{ color: var(--terracotta); font-weight:700; }

.no-orders{
  text-align:center; color: var(--ink-soft);
  padding: 56px 24px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  font-size: 14.5px;
}

/* Villa pill + guest avatar (Guest Orders page) */
.villa-pill{
  display:inline-block;
  background: var(--cream);
  border:1px solid var(--line);
  color: var(--ink);
  font-size:12.5px;
  font-weight:600;
  padding:4px 10px;
  border-radius:999px;
  white-space:nowrap;
}
.guests-count{ display:inline-flex; align-items:center; gap:5px; font-weight:700; }
.guests-count::before{ content:"👥"; font-size:12px; }

/* Menu-details popover on the Guest Orders page */
.menu-details summary{ cursor:pointer; color: var(--terracotta); font-weight:700; font-size:13px; list-style:none; }
.menu-details summary::-webkit-details-marker{ display:none; }
.menu-details[open] summary{ margin-bottom:6px; }
.meal-group{ margin:4px 0 8px; }
.meal-group b{ display:block; font-size:11px; color: var(--terracotta); text-transform:uppercase; letter-spacing:.04em; margin-bottom:2px; }
.meal-group ul{ margin:0; padding-left:16px; font-size:13px; color: var(--ink); }

@media (max-width: 900px){
  .content{ padding: 22px 18px 48px; }
  .layout{ flex-direction: column; }

  .topbar{ padding: 14px 18px; }
  .topbar .brand{ font-size: 16px; }

    .sidebar{
    flex: 0 0 auto;   /* stop the desktop 200px flex-basis from becoming a height */
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
    padding: 12px 16px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .sidebar::-webkit-scrollbar{ display:none; }
  .sidebar a{
    flex: 0 0 auto;
    align-self: center;
    padding: 9px 16px;
    font-size: 13.5px;
    white-space: nowrap;
    line-height: 1.2;
  }
}

@media (max-width: 680px){
  .grid-form{ grid-template-columns: 1fr; }
  .page-card{ padding: 22px 18px; }
    .items-toolbar{ flex-direction:column; align-items:stretch; }
  .items-search-wrap{
    flex: 0 0 auto;   /* stop the 260px flex-basis from becoming a height */
    width: 100%;
    max-width: none;
  }
  .items-count-pill{
    align-self: flex-start;
    margin-top: 4px;
  }

  .table-wrap table,
  .table-wrap thead,
  .table-wrap tbody,
  .table-wrap th,
  .table-wrap td,
  .table-wrap tr{ display:block; width:100%; }
  .table-wrap thead{
    position:absolute; width:1px; height:1px;
    overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap;
  }
  .table-wrap tbody{ padding: 12px; display:block; }
  .table-wrap tbody tr{
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    padding: 10px 14px;
    background: var(--white);
  }
  .table-wrap tbody tr:last-child{ margin-bottom:0; }
  .table-wrap td{
    display:flex; align-items:flex-start; justify-content:space-between;
    gap:12px; padding: 9px 2px;
    border-bottom: 1px dashed var(--line);
    text-align:right;
  }
  .table-wrap td:last-child{ border-bottom:none; }
  .table-wrap td::before{
    content: attr(data-label);
    font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.04em;
    color: var(--ink-soft); text-align:left; flex:0 0 auto; padding-top:2px;
  }
  .table-wrap td[data-label="Image"]{ justify-content:flex-start; }
  .table-wrap td[data-label="Image"]::before{ display:none; }
  .table-wrap td[data-label="Name"],
  .table-wrap td[data-label="Guest"]{ text-align:left; font-weight:700; font-size:15px; }
  .table-wrap td[data-label="Name"]::before,
  .table-wrap td[data-label="Guest"]::before{ display:none; }
   .table-wrap td[data-label="Action"]{ display:block; text-align:left; padding-top:10px; }
  .table-wrap td[data-label="Action"]::before{ display:none; }
  .table-wrap td[data-label="Action"] .row-actions{
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
  }
  .table-wrap td[data-label="Action"] .btn-sm{
    display:inline-block;
    flex: 0 0 auto;
    padding: 6px 11px;
    font-size: 11.5px;
  }
  .table-wrap td[data-label="Menu"]{ display:block; text-align:left; padding-top:10px; }
  .table-wrap td[data-label="Menu"]::before{ display:block; margin-bottom:4px; }
}