/* Admin portal styles, loaded after account.css */

.admin-main section { margin-bottom: 3rem; }
.admin-main section:has(.table-wrap) { margin-left: -1rem; margin-right: -1rem; padding: 0; }
.admin-main h1 { font-size: 1.4rem; }
.page-title { margin-bottom: 1.25rem; }
.page-actions { margin: 0 0 1.25rem; }

/* ---- Admin nav ---- */
.admin-nav { display: flex; align-items: center; gap: .25rem; flex-wrap: wrap; }
.admin-nav .is-here {
    color: var(--bronze);
    border-bottom: 1px solid var(--bronze);
    border-radius: 0;
}

/* ---- Dashboard tiles ---- */
.dash-group {
    font-family: 'Fraunces', serif;
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--bronze);
    margin: 2rem 0 .75rem;
}
.dash-group:first-of-type { margin-top: 0; }
.tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.25rem;
    margin-top: .5rem;
}
.tile {
    display: block;
    background: #fff;
    border-radius: 6px;
    padding: 1.5rem 1.4rem;
    text-decoration: none;
    color: var(--ink);
    box-shadow: 0 1px 10px rgba(33, 29, 26, .07);
    transition: background .15s ease;
}
.tile h2 {
    font-family: 'Fraunces', serif;
    font-weight: 600;
    font-size: 1.15rem;
    margin: 0 0 .3rem;
}
.tile p { margin: 0; font-size: .88rem; color: #6b6259; }
a.tile:hover { background: #f4eee4; }
a.tile:hover h2 { color: var(--bronze); }
.tile-soon { opacity: .55; }
.tile-soon .soon {
    display: inline-block;
    background: var(--paper-alt);
    border-radius: 999px;
    padding: .1rem .6rem;
    font-size: .75rem;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #9a9088;
}

/* ---- Forms and tables ---- */
.add-album {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    align-items: end;
    max-width: 980px;
}
.add-album label { font-size: .9rem; font-weight: 400; }
.add-album .hint { color: #9a9088; font-weight: 300; }
.add-album input {
    display: block;
    width: 100%;
    margin-top: .3rem;
    padding: .55rem .7rem;
    font: inherit;
    border: 1px solid #d8d2c9;
    border-radius: 4px;
    background: #fff;
}
.add-album input:focus { outline: 2px solid var(--bronze); outline-offset: 1px; }

.table-wrap { margin-bottom: 1.5rem; overflow-x: auto; }
table {
    border-collapse: collapse;
    width: 100%;
    font-size: .9rem;
    background: #fff;
}
th, td {
    text-align: left;
    padding: .55rem .7rem;
    border-bottom: 1px solid #e6e0d7;
    vertical-align: middle;
}
th {
    font-weight: 500;
    background: var(--paper-alt);
    white-space: nowrap;
}
td input[type=text], td input[type=date] {
    font: inherit;
    padding: .35rem .5rem;
    border: 1px solid #d8d2c9;
    border-radius: 4px;
    width: 100%;
    min-width: 110px;
}
td input.narrow { min-width: 90px; max-width: 140px; }
.mono { font-family: ui-monospace, monospace; font-size: .82rem; white-space: nowrap; }

.row-actions { white-space: nowrap; }
.btn-danger {
    background: none;
    border: none;
    color: #b0563a;
    font: inherit;
    font-size: .85rem;
    cursor: pointer;
    padding: .3rem .5rem;
}
.btn-danger:hover { text-decoration: underline; }

.inline-form { display: inline; }
.chip-form { display: inline-block; margin: 0 .25rem .25rem 0; }
.chip {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    background: var(--paper-alt);
    border-radius: 999px;
    padding: .2rem .3rem .2rem .7rem;
    font-size: .82rem;
    white-space: nowrap;
}
.chip button {
    background: none;
    border: none;
    cursor: pointer;
    color: #6b6259;
    font-size: .95rem;
    line-height: 1;
    padding: 0 .3rem;
}
.chip button:hover { color: #b0563a; }

.section-hint { color: #6b6259; font-size: .9rem; margin-top: -.3rem; }

/* ---- Storage page ---- */
.quota-summary { font-size: 1rem; margin-bottom: .5rem; }
.quota-bar {
    background: #e6e0d7;
    border-radius: 999px;
    height: 14px;
    overflow: hidden;
    max-width: 480px;
}
.quota-fill {
    height: 100%;
    background: var(--bronze);
    border-radius: 999px;
}
.quota-fill-warn { background: #c98a3a; }
.quota-fill-danger { background: #b0563a; }
.section-title { font-family: 'Fraunces', serif; font-weight: 600; font-size: 1.15rem; margin: 0 0 .3rem; }
.subsection-title { font-size: .95rem; font-weight: 500; margin: 1.4rem 0 .4rem; }
.subsection-title .hint { font-weight: 300; color: #9a9088; }

.product-tools { margin-top: 1rem; display: grid; gap: .8rem; }
.inline-tool { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-end; }
.inline-tool input[type=text], .inline-tool input[type=number], .inline-tool input[type=date] {
    font: inherit;
    padding: .45rem .6rem;
    border: 1px solid #d8d2c9;
    border-radius: 4px;
    background: #fff;
}
.inline-tool .hint { color: #9a9088; font-size: .82rem; }
.tool-label {
    display: grid;
    gap: .25rem;
    font-size: .8rem;
    color: #6b6259;
}
.order-item { font-size: .85rem; padding: .1rem 0; }
.status {
    display: inline-block;
    padding: .15rem .6rem;
    border-radius: 999px;
    font-size: .8rem;
    text-transform: capitalize;
}
.status-paid { background: #f3e8d9; color: #7a5c33; }
.status-fulfilled { background: #e9efe4; color: #4a6a3a; }

@media (max-width: 700px) {
    .admin-nav { gap: 0; }
    .admin-nav .btn-quiet { padding: .4rem .55rem; font-size: .88rem; }
}

/* ---- Booking admin ---- */
td select, td input[type=time] {
    font: inherit;
    padding: .35rem .5rem;
    border: 1px solid #d8d2c9;
    border-radius: 4px;
    background: #fff;
}
td input.tiny { width: 70px; min-width: 70px; }
.inline-tool input.tiny { width: 90px; }
.inline-tool select {
    font: inherit;
    padding: .45rem .6rem;
    border: 1px solid #d8d2c9;
    border-radius: 4px;
    background: #fff;
}
.status-cancelled { background: #f6e7e2; color: #9c4a30; }
.sub-head { font-size: 1.15rem; margin-bottom: .75rem; }
.hours-table { max-width: 480px; }

/* ---- Term time vs term break hours ---- */
.hours-pair {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    max-width: 1040px;
    margin-bottom: 1.25rem;
}
.breaks-table { max-width: 720px; }
.row-past { opacity: .55; }

/* ---- Diary ---- */
.diary-bar {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
    margin-bottom: .75rem;
}
.cal-nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.1rem;
    height: 2.1rem;
    padding: 0 .6rem;
    background: #fff;
    border: 1px solid #d8d2c9;
    border-radius: 4px;
    text-decoration: none;
    color: var(--ink);
    font-size: 1.05rem;
    line-height: 1;
}
.cal-nav-link:hover { border-color: var(--bronze); color: var(--bronze); }
.diary-today { font-size: .85rem; }
.diary-label {
    font-family: 'Fraunces', serif;
    font-size: 1.1rem;
    min-width: 10rem;
    text-align: center;
}
.diary-toggle { margin-left: auto; display: flex; }
.cal-toggle-link {
    font-size: .82rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: .45rem .85rem;
    background: #fff;
    border: 1px solid #d8d2c9;
    text-decoration: none;
    color: var(--ink);
}
.cal-toggle-link + .cal-toggle-link { border-left: none; }
.cal-toggle-link.is-active { background: var(--bronze); border-color: var(--bronze); color: #fff; }

.diary-legend {
    display: flex;
    align-items: center;
    gap: .45rem 1.25rem;
    flex-wrap: wrap;
    font-size: .82rem;
    color: #6b6259;
    margin-bottom: 1rem;
}
.leg {
    display: inline-block;
    width: .95rem;
    height: .95rem;
    border-radius: 3px;
    border: 1px solid #d8d2c9;
    vertical-align: -2px;
    margin-right: .35rem;
}
.leg-appt { background: #7a5ca8; border-color: #7a5ca8; }
.leg-term { background: #fff; }
.leg-break { background: #f3ead6; }

.diary-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}
.diary-wd {
    font-size: .72rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: #9a9088;
    text-align: center;
    padding: .3rem 0;
}
.diary-day {
    min-height: 6rem;
    background: #fff;
    border: 1px solid #e6e0d7;
    border-radius: 4px;
    padding: .35rem;
    display: flex;
    flex-direction: column;
    gap: 3px;
    overflow: hidden;
}
.diary-day.is-break { background: #f3ead6; }
.diary-day.is-today { outline: 2px solid var(--bronze); outline-offset: -2px; }
.diary-dim { opacity: .5; }
.diary-num { font-size: .82rem; color: #6b6259; }

.ev {
    display: block;
    background: #7a5ca8;
    color: #fff;
    border-radius: 3px;
    padding: .15rem .35rem;
    font-size: .72rem;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ev-allday {
    background: #5d4482;
    font-weight: 500;
}

.diary-week {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}
.diary-col {
    background: #fff;
    border: 1px solid #e6e0d7;
    border-radius: 4px;
    padding: .5rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 8rem;
}
.diary-col.is-break { background: #f3ead6; }
.diary-col.is-today { outline: 2px solid var(--bronze); outline-offset: -2px; }
.diary-col-head {
    font-size: .78rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--ink);
    padding-bottom: .4rem;
    border-bottom: 1px solid #e6e0d7;
    margin-bottom: .3rem;
}
.diary-col .ev { white-space: normal; }
.diary-empty { color: #c9c2b8; font-size: .85rem; margin: 0; }

@media (max-width: 900px) {
    .diary-week { grid-template-columns: 1fr; }
    .diary-day { min-height: 4.2rem; }
    .ev { font-size: .62rem; }
    .diary-label { min-width: 0; flex: 1; }
    .diary-toggle { margin-left: 0; }
}

/* ---- Enquiries CRM ---- */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: center;
    margin-bottom: 1.5rem;
}
.filter-bar input[type=text], .filter-bar select {
    font: inherit;
    padding: .45rem .6rem;
    border: 1px solid #d8d2c9;
    border-radius: 4px;
    background: #fff;
}
.filter-bar input[type=text] { min-width: 220px; }

.avail-yes      { background: #e9efe4; color: #4a6a3a; }
.avail-no       { background: #f6e7e2; color: #9c4a30; }
.avail-blocked  { background: #e8e4de; color: #6b6259; }
.avail-pending  { background: #f3e8d9; color: #7a5c33; }

.enq-new       { background: #e6ecf2; color: #3f5a75; }
.enq-pipeline  { background: #f3e8d9; color: #7a5c33; }
.enq-confirmed { background: #e9efe4; color: #4a6a3a; }
.enq-closed    { background: #e8e4de; color: #6b6259; }

.enq-status-form { display: flex; gap: .35rem; align-items: center; }
.enq-status-form select { max-width: 190px; }

.pager {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-top: 1.25rem;
}

.enq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: .9rem 1.5rem;
    margin-bottom: 1rem;
}
.enq-edit label { display: block; font-size: .9rem; font-weight: 400; }
.enq-edit input[type=text], .enq-edit input[type=email], .enq-edit input[type=date],
.enq-edit select, .enq-edit textarea {
    display: block;
    width: 100%;
    font: inherit;
    padding: .5rem .6rem;
    border: 1px solid #d8d2c9;
    border-radius: 4px;
    background: #fff;
    margin-top: .25rem;
    box-sizing: border-box;
}
.enq-edit textarea { resize: vertical; }
.enq-edit input:focus, .enq-edit select:focus, .enq-edit textarea:focus {
    outline: 2px solid var(--bronze);
    outline-offset: 1px;
}
.enq-check { display: flex; gap: .5rem; align-items: baseline; }
.enq-check input { margin-top: .2rem; }
.enq-check .hint { display: block; font-weight: 300; color: #9a9088; }

/* ---- Enquiries: status colour coding ---- */
/* One hue per status code: bar on the row's left edge + tinted dropdown. */
:root {
    --st-new: #b08d57;  /* bronze - new, no status yet */
    --st-uc:  #c0392b;  /* red - unconfirmed */
    --st-ci:  #7d4f9e;  /* purple - continued interest */
    --st-mp:  #2e6da4;  /* blue - meeting pending */
    --st-cp:  #d4b106;  /* yellow - confirmation pending */
    --st-dp:  #d97a1f;  /* orange - deposit pending */
    --st-cf:  #3e7d3a;  /* green - confirmed */
    --st-lg:  #cfc9c1;  /* light grey - long gone */
    --st-ae:  #9a938b;  /* medium grey - another enquiry */
    --st-cd:  #57514a;  /* dark grey - cancelled */
    --st-dc:  #1c1a18;  /* black - declined */
}
tr[class*="row-st-"] > td:first-child { border-left: 5px solid transparent; }
.row-st-new > td:first-child { border-left-color: var(--st-new); }
.row-st-uc  > td:first-child { border-left-color: var(--st-uc); }
.row-st-ci  > td:first-child { border-left-color: var(--st-ci); }
.row-st-mp  > td:first-child { border-left-color: var(--st-mp); }
.row-st-cp  > td:first-child { border-left-color: var(--st-cp); }
.row-st-dp  > td:first-child { border-left-color: var(--st-dp); }
.row-st-cf  > td:first-child { border-left-color: var(--st-cf); }
.row-st-lg  > td:first-child { border-left-color: var(--st-lg); }
.row-st-ae  > td:first-child { border-left-color: var(--st-ae); }
.row-st-cd  > td:first-child { border-left-color: var(--st-cd); }
.row-st-dc  > td:first-child { border-left-color: var(--st-dc); }

.st-tint { border-left-width: 5px !important; border-left-style: solid !important; }
.st-new { border-left-color: var(--st-new) !important; }
.st-uc  { border-left-color: var(--st-uc) !important; }
.st-ci  { border-left-color: var(--st-ci) !important; }
.st-mp  { border-left-color: var(--st-mp) !important; }
.st-cp  { border-left-color: var(--st-cp) !important; }
.st-dp  { border-left-color: var(--st-dp) !important; }
.st-cf  { border-left-color: var(--st-cf) !important; }
.st-lg  { border-left-color: var(--st-lg) !important; }
.st-ae  { border-left-color: var(--st-ae) !important; }
.st-cd  { border-left-color: var(--st-cd) !important; }
.st-dc  { border-left-color: var(--st-dc) !important; }

/* Open enquiries (still holding their date) get a soft warm wash. */
.row-open > td { background: #fbf6ec; }

/* ---- Enquiries: list extras ---- */
.days-cell { white-space: nowrap; }
.btn-reset {
    border: none;
    background: none;
    cursor: pointer;
    color: #b08d57;
    font-size: 1rem;
    padding: 0 .15rem;
    vertical-align: middle;
}
.btn-reset:hover { color: #7a5c33; }
.emails-cell { max-width: 140px; }
.chip-mail {
    display: inline-block;
    font-size: .68rem;
    letter-spacing: .02em;
    background: #e9efe4;
    color: #4a6a3a;
    border-radius: 3px;
    padding: .1rem .3rem;
    margin: 0 .15rem .15rem 0;
    white-space: nowrap;
}
.chip-fail { background: #f6e7e2; color: #9c4a30; }
.notes-cell {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #6b6259;
    font-size: .85rem;
}

/* ---- Form layout fixes ---- */
.enq-check { display: flex; flex-direction: row; align-items: flex-start; gap: .5rem; }
.enq-check input[type=checkbox] { width: auto; margin: .25rem 0 0; flex: none; }
.form-foot {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid #e5dfd6;
}
.form-foot-danger { margin-top: 1rem; }

/* ---- WYSIWYG template editor ---- */
.wys { margin: .75rem 0; }
.wys-toolbar {
    display: flex;
    gap: .25rem;
    flex-wrap: wrap;
    background: #f3efe8;
    border: 1px solid #d8d2c9;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    padding: .35rem;
}
.wys-toolbar button {
    font: inherit;
    font-size: .82rem;
    padding: .25rem .55rem;
    background: #fff;
    border: 1px solid #d8d2c9;
    border-radius: 3px;
    cursor: pointer;
}
.wys-toolbar button:hover { border-color: #b08d57; }
.wys-toolbar .wys-on { background: #b08d57; color: #fff; border-color: #b08d57; }
.wys-editor {
    border: 1px solid #d8d2c9;
    border-radius: 0 0 4px 4px;
    background: #fff;
    min-height: 220px;
    max-height: 420px;
    overflow-y: auto;
    padding: .9rem 1rem;
    font-size: .92rem;
    line-height: 1.5;
}
.wys-editor:focus { outline: 2px solid #b08d57; outline-offset: 1px; }
.wys-source { border-radius: 0 0 4px 4px !important; }
