/*
 * Roast N' Brew dashboard - modern theme.
 * Keeps the class names the dashboard pages and scripts already use, so behaviour is untouched.
 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --brand: #7C2D18;
    --brand-600: #66240f;
    --brand-100: #f4e3dd;
    --brand-50: #fbf3f0;
    --bg: #f5f6f8;
    --card: #ffffff;
    --text: #1f2937;
    --muted: #6b7280;
    --border: #e5e7eb;
    --danger: #dc2626;
    --danger-50: #fef2f2;
    --success: #16a34a;
    --success-50: #ecfdf3;
    --warn: #d97706;
    --radius: 14px;
    --shadow: 0 1px 2px rgb(16 24 40 / 0.05), 0 1px 3px rgb(16 24 40 / 0.06);
    --shadow-lg: 0 24px 48px -12px rgb(16 24 40 / 0.28);
    --green-color: var(--brand);
    --light-green-color: var(--brand-50);
}

* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
}

html,
body {
    height: 100%;
    background-color: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
}

/* ---------- Layout ---------- */
.wrapper {
    display: flex;
    height: 100%;
}

.overlay {
    position: fixed;
    inset: 0;
    background-color: rgb(17 24 39 / 0.45);
    z-index: 1000;
    pointer-events: none;
    visibility: hidden;
    opacity: 0;
    transition: .3s ease;
}

.overlay.active {
    visibility: visible;
    opacity: 1;
    pointer-events: all;
}

main {
    flex: 1;
    min-width: 0;
    height: 100%;
}

.main-section {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 4px 28px 32px;
}

/* ---------- Sidebar ---------- */
aside {
    width: 268px;
    flex: none;
    height: 100%;
    background-color: var(--card);
    border-right: 1px solid var(--border);
    padding: 20px 16px;
    overflow-y: auto;
    overflow-x: hidden;
    transition: width .3s ease, padding .3s ease;
    display: flex;
    flex-direction: column;
}

aside.hide {
    width: 0;
    padding: 0;
    border-right: none;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 10px 20px;
    margin-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

.logo-image {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.logo-container h1 {
    font-size: 16px;
    line-height: 1.2;
    color: var(--text);
    font-weight: 700;
    white-space: nowrap;
}

.logo-container h1 small {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
}

.navigation-block {
    margin-top: 18px;
}

.mini-title {
    font-weight: 600;
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #9ca3af;
    padding: 0 12px;
    margin-bottom: 6px;
}

.main-navigation {
    display: flex;
    flex-direction: column;
    gap: 2px;
    list-style: none;
}

.main-navigation li {
    position: relative;
    border-radius: 10px;
    padding: 0;
    transition: background-color .15s;
}

.main-navigation li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: #4b5563;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    width: 100%;
    white-space: nowrap;
}

.main-navigation li a svg {
    width: 18px;
    height: 18px;
    flex: none;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.main-navigation li:hover {
    background-color: #f3f4f6;
}

.main-navigation li.active {
    background-color: var(--brand-50);
}

.main-navigation li.active a {
    color: var(--brand);
    font-weight: 600;
}

.nav-footer {
    margin-top: auto;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.nav-footer a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    padding: 10px 12px;
    border-radius: 10px;
}

.nav-footer a:hover {
    background-color: #f3f4f6;
    color: var(--text);
}

.nav-footer svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ---------- Top bar ---------- */
.main-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 28px;
    margin: 0;
    background: transparent;
    flex-wrap: wrap;
}

.main-header .no-decoration {
    margin-right: auto;
    min-width: 0;
}

.main-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -.01em;
}

.no-decoration {
    text-decoration: none;
}

.menu-btn,
.circle,
.logout {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background-color: var(--card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: background-color .15s, border-color .15s, transform .15s;
    margin-left: 0;
    aspect-ratio: auto;
    flex: none;
}

.menu-btn:hover,
.circle:hover,
.logout:hover {
    background-color: var(--brand-50);
    border-color: var(--brand-100);
}

.menu-btn img,
.circle img,
.logout img {
    width: 20px;
    height: 20px;
    opacity: .75;
    object-fit: contain;
}

aside .menu-btn {
    position: fixed;
    right: 20px;
    bottom: 20px;
    display: none;
    z-index: 100000;
}

/* ---------- Cards / blocks ---------- */
.block {
    display: flex;
    flex-direction: column;
    gap: 20px;
    border-radius: var(--radius);
    background-color: var(--card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 24px;
    overflow-x: auto;
}

.block + .block {
    margin-top: 20px;
}

h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

.block .row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0;
}

.block > .row {
    gap: 16px;
}

.block > .row > * {
    padding: 0;
    width: auto;
    max-width: none;
}

.block .row .circle {
    cursor: pointer;
}

.sub-title {
    font-weight: 600;
    font-size: 18px;
}

.green-col {
    color: var(--brand);
}

.title {
    font-size: 14px;
    color: var(--text);
    font-weight: 500;
}

.column {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.column .title {
    color: var(--text);
}

.column .date {
    font-size: 12px;
    font-weight: 500;
}

.scrollable {
    overflow: auto;
}

.disabled-body {
    pointer-events: none;
    opacity: .55;
}

/* ---------- Tables ---------- */
table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    text-align: left;
    font-size: 14px;
}

th {
    font-weight: 600;
    font-size: 12px;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 12px 14px;
    background-color: #f9fafb;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

th:first-child {
    border-top-left-radius: 10px;
    border-bottom-left-radius: 10px;
    border-left: 1px solid var(--border);
}

th:last-child {
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
    border-right: 1px solid var(--border);
}

td {
    padding: 12px 14px;
    border-bottom: 1px solid #f1f2f4;
    color: #374151;
    vertical-align: middle;
}

tbody tr {
    transition: background-color .12s;
}

tbody tr:hover {
    background-color: #fafafb;
}

tbody tr:last-child td {
    border-bottom: none;
}

thead th:last-child,
tbody td:last-child {
    text-align: right;
}

td .image-container img {
    object-fit: cover;
}

.table-product {
    display: flex;
    align-items: center;
    gap: 14px;
}

.table-product .image-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    flex: none;
    border-radius: 12px;
    background: #f3f4f6;
    overflow: hidden;
}

.table-product .image-container img {
    width: 52px;
    height: 52px;
    border-radius: 12px;
}

table .flex {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.gap10 {
    gap: 8px;
}

.image-button {
    flex: none;
    max-width: none;
    cursor: pointer;
    width: 34px;
    height: 34px;
    padding: 7px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--card);
    object-fit: contain;
    transition: background-color .15s, border-color .15s;
}

.image-button:hover {
    background-color: var(--brand-50);
    border-color: var(--brand-100);
}

.image-button.delete:hover {
    background-color: var(--danger-50);
    border-color: #fecaca;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
}

.badge.bg-success {
    background-color: var(--success-50) !important;
    color: var(--success);
}

.badge.bg-danger {
    background-color: var(--danger-50) !important;
    color: var(--danger);
}

/* ---------- Forms ---------- */
fieldset {
    border: none;
}

label {
    color: #374151;
    font-size: 13px;
    font-weight: 500;
}

.fieldset-input {
    display: flex;
    align-items: center;
}

.fieldset-input label {
    width: 100px;
    text-align: right;
    margin-right: 16px;
}

.fieldset-input div {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    flex-wrap: wrap;
}

.fieldset-input input,
.fieldset-input select,
.fieldset-input textarea,
textarea,
select,
input[type="text"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
input[type="password"],
input[type="email"] {
    height: 40px;
    border-radius: 10px;
    border: 1px solid #d1d5db;
    background: #fff;
    color: var(--text);
    font-size: 14px;
    padding: 0 12px;
    transition: border-color .15s, box-shadow .15s;
}

.fieldset-input input,
.fieldset-input select {
    flex: 1;
}

textarea,
.fieldset-input textarea {
    height: auto;
    padding: 10px 12px;
    font-size: 14px;
}

select {
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 34px;
}

.fieldset-input input:focus,
.fieldset-input select:focus,
.fieldset-input textarea:focus,
textarea:focus,
select:focus,
input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgb(124 45 24 / 0.14);
}

input[type="file"] {
    border: 1px dashed #d1d5db;
    padding: 8px;
    height: auto;
    background: #fafafa;
    font-size: 13px;
}

input[type="file"]::file-selector-button {
    border: none;
    background: var(--brand-50);
    color: var(--brand);
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 8px;
    margin-right: 10px;
    cursor: pointer;
}

button.primary,
button.secondary {
    color: #fff;
    background-color: var(--brand);
    padding: 11px 20px;
    border: 1px solid var(--brand);
    font-size: 14px;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color .15s, box-shadow .15s;
}

button.primary:hover {
    background-color: var(--brand-600);
}

button.secondary {
    background-color: transparent;
    color: var(--brand);
    border: 1px solid var(--brand-100);
}

button.secondary:hover {
    background-color: var(--brand-50);
}

.primary.red {
    background-color: var(--danger);
    border-color: var(--danger);
}

.primary.red:hover {
    background-color: #b91c1c;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.col-span-2,
.col-2 {
    grid-column: span 2;
}

.col-2 button {
    width: 100% !important;
    margin-left: 0 !important;
}

#notes-textarea {
    width: 100%;
    resize: vertical;
    height: 90px;
    margin: 6px 0 14px;
}

/* ---------- Modals ---------- */
.popup {
    position: fixed;
    inset: 0;
    z-index: 10;
    width: 100%;
    height: 100%;
    background-color: rgb(17 24 39 / 0.55);
    backdrop-filter: blur(3px);
    display: grid;
    place-items: center;
    overflow: auto;
    padding: 20px;
    pointer-events: none;
    visibility: hidden;
    opacity: 0;
    transition: opacity .25s ease, visibility .25s;
}

.popup.active {
    pointer-events: all;
    visibility: visible;
    opacity: 1;
}

.popup .inner {
    width: 440px;
    max-width: 100%;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    background-color: var(--card);
    border-radius: 18px;
    box-shadow: var(--shadow-lg);
    position: relative;
    top: 16px;
    transition: top .3s ease;
}

.popup.active .inner {
    top: 0;
}

.popup header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    background: none;
    padding: 24px 56px 16px 24px;
    text-align: left;
    position: relative;
    border-bottom: 1px solid var(--border);
}

.popup h2,
.popup header h2 {
    color: var(--text);
    font-size: 18px;
    font-weight: 700;
}

.popup header p {
    color: var(--muted);
    font-size: 13px;
    margin-top: 4px;
}

.popup img.main {
    display: none;
}

.popup img.close {
    position: absolute;
    right: 16px;
    top: 16px;
    width: 32px;
    height: 32px;
    padding: 7px;
    border-radius: 10px;
    cursor: pointer;
    opacity: .7;
    transition: background-color .15s, opacity .15s;
}

.popup img.close:hover {
    background-color: #f3f4f6;
    opacity: 1;
}

.popup fieldset {
    margin: 0;
    padding: 20px 24px 24px;
}

.popup .block {
    border: none;
    box-shadow: none;
    padding: 0 !important;
    gap: 0;
    overflow: visible;
}

.popup .block fieldset {
    padding: 20px 24px 24px;
}

.popup form > fieldset > div,
.popup fieldset > div {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.popup fieldset > div.grid-2 {
    display: grid;
}

.fieldset-input.col {
    display: block;
}

.fieldset-input.col label {
    width: 100%;
    margin: 0 0 6px;
    text-align: left;
    display: block;
}

.fieldset-input.col input,
.fieldset-input.col select,
.fieldset-input.col textarea {
    width: 100%;
    margin: 0;
    display: block;
}

.popup .secondary-container {
    width: 100%;
    margin: 0;
    display: block;
}

.popup .primary {
    width: 100%;
    margin: 0;
    display: block;
}

.popup .fieldset-input div[style] {
    width: 100% !important;
    margin: 0 !important;
}

.popup.order .inner {
    width: 860px;
}

.popup.order .row {
    display: flex;
    align-items: stretch;
}

.popup.order form {
    flex: 1;
}

.popup.order .grid-2 {
    gap: 14px;
    padding: 0;
}

.popup.order .grid-2 label,
.popup.order .grid-2 input {
    margin: 0;
}

.popup.order table {
    width: 100%;
}

.popup.order table td img {
    border-radius: 50%;
    width: 40px !important;
    height: 40px !important;
    object-fit: cover;
}

.popup.order .details {
    flex: 1;
    overflow-y: auto;
    max-height: 420px;
    padding: 20px 24px;
    border-left: 1px solid var(--border);
}

.popup.wide .inner {
    width: 860px;
}

.popup.wide .inner .block table {
    width: 100%;
}

.popup.wide .block {
    padding: 16px !important;
}

/* ---------- Tags input / category dropdown ---------- */
.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px !important;
    border: 1px solid #d1d5db;
    padding: 6px;
    border-radius: 10px;
    width: 100%;
    min-height: 40px;
}

.tag {
    display: flex;
    align-items: center;
    background-color: var(--brand-50);
    border-radius: 8px;
    padding: 3px 8px;
    font-size: 13px;
    color: var(--brand);
    flex: initial !important;
}

.tag span {
    margin-right: 4px;
}

.tag .remove-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--brand);
    font-size: 16px;
    line-height: 1;
}

.fieldset-input .column {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}

.custom-dropdown {
    position: relative;
    width: 100%;
    margin: 6px 0;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    background-color: #fff;
}

.dropdown-header {
    padding: 10px 12px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #374151;
}

.dropdown-list {
    display: none;
    position: absolute;
    width: 100%;
    top: calc(100% + 4px);
    left: 0;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    background-color: #fff;
    max-height: 220px;
    overflow-y: auto;
    z-index: 5;
}

.dropdown-list div {
    padding: 10px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
}

.dropdown-list div img {
    width: 28px;
    height: 28px;
    padding: 6px;
    border-radius: 8px;
}

.dropdown-list div:hover {
    background-color: #f9fafb;
}

/* ---------- Menu admin pages ---------- */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.toolbar .search {
    flex: 1;
    min-width: 200px;
    max-width: 360px;
}

.toolbar .search input {
    width: 100%;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip {
    border: 1px solid var(--border);
    background: var(--card);
    color: #4b5563;
    font-size: 13px;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 999px;
    cursor: pointer;
    transition: all .15s;
}

.chip:hover {
    border-color: var(--brand-100);
    background: var(--brand-50);
}

.chip.active {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--brand);
    background: var(--brand);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    padding: 9px 16px;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color .15s;
}

.btn:hover {
    background: var(--brand-600);
}

.btn.ghost {
    background: var(--card);
    color: var(--brand);
    border-color: var(--brand-100);
}

.btn.ghost:hover {
    background: var(--brand-50);
}

.btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.hint {
    font-size: 13px;
    color: var(--muted);
}

.hint.warn {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
    padding: 10px 14px;
    border-radius: 10px;
}

.empty {
    text-align: center;
    color: var(--muted);
    padding: 36px 0;
    font-size: 14px;
}

.pill {
    display: inline-block;
    background: #f3f4f6;
    color: #4b5563;
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.pill.brand {
    background: var(--brand-50);
    color: var(--brand);
}

.macro-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.no-photo {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    font-size: 11px;
    color: #9ca3af;
    text-align: center;
    line-height: 1.2;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.section-head p {
    font-size: 13px;
    color: var(--muted);
    margin-top: 2px;
}

.role-select {
    height: 34px !important;
    font-size: 13px !important;
    min-width: 130px;
}

.pkg-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.pkg-stat {
    background: #f9fafb;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
}

.pkg-stat span {
    display: block;
    font-size: 12px;
    color: var(--muted);
    font-weight: 500;
}

.pkg-stat strong {
    font-size: 22px;
    font-weight: 700;
    color: var(--brand);
}

.form-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.form-2col .full {
    grid-column: 1 / -1;
}

.form-3col {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.field label {
    display: block;
    margin-bottom: 6px;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    display: block;
}

.field small {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-top: 4px;
}

.preview-img {
    width: 72px;
    height: 72px;
    border-radius: 12px;
    object-fit: cover;
    background: #f3f4f6;
    border: 1px solid var(--border);
}

.preview-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.preview-row input[type="file"] {
    flex: 1;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 6px;
}

.modal-actions button {
    flex: 1;
}

/* ---------- Login ---------- */
.popup.update-item.active[style*="f5f5f5"] {
    background: linear-gradient(135deg, #fbf3f0 0%, #f5f6f8 60%);
    backdrop-filter: none;
}

.popup.update-item.active[style*="f5f5f5"] .inner {
    width: 400px;
    border: 1px solid var(--border) !important;
    box-shadow: var(--shadow-lg) !important;
    top: 0;
}

.popup.update-item.active[style*="f5f5f5"] header {
    align-items: center;
    text-align: center;
    padding: 32px 24px 20px;
}

.popup.update-item.active[style*="f5f5f5"] img.main {
    display: block;
    width: 64px;
    margin-bottom: 12px;
}

/* ---------- Responsive ---------- */
@media (max-width: 800px) {
    aside {
        position: fixed;
        z-index: 99999;
        left: -100%;
        top: 0;
        width: 280px;
        transition: left .3s ease;
    }

    aside.hide {
        width: 280px;
        padding: 20px 16px;
    }

    .main-header {
        padding: 14px 16px;
    }

    .main-content {
        padding: 4px 14px 28px;
    }

    .block {
        padding: 16px;
    }

    .popup.order .row {
        display: block;
    }

    .popup.order .details {
        border-left: none;
        border-top: 1px solid var(--border);
        max-height: none;
    }

    .popup.order .inner,
    .popup.wide .inner {
        width: 100%;
    }
}

@media (max-width: 1100px) {
    #products-table thead th:nth-child(2),
    #products-table tbody td:nth-child(2) {
        display: table-cell;
    }
}

@media (max-width: 640px) {
    .grid-2,
    .form-2col,
    .form-3col,
    .popup.order .grid-2 {
        grid-template-columns: 1fr;
    }

    .col-span-2,
    .col-2 {
        grid-column: span 1;
    }

    .fieldset-input {
        display: block;
    }

    .fieldset-input label {
        width: 100%;
        text-align: left;
        margin: 0 0 6px;
    }

    .popup {
        padding: 10px;
    }
}

/* Dynamic modal body used by the menu admin pages */
.modal-body {
    padding: 20px 24px 24px;
}

/* SVG action buttons (menu admin pages) */
.icon-btn {
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--card);
    color: #4b5563;
    cursor: pointer;
    transition: background-color .15s, border-color .15s, color .15s;
}

.icon-btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.icon-btn:hover {
    background: var(--brand-50);
    border-color: var(--brand-100);
    color: var(--brand);
}

.icon-btn.delete:hover {
    background: var(--danger-50);
    border-color: #fecaca;
    color: var(--danger);
}

/* Old colourful PNG header icons -> one calm tone */
.menu-btn img,
.circle img,
.logout img {
    filter: grayscale(1) brightness(.3);
    opacity: .8;
}

/* Statistics: top-align the two ranking cards and give the heading some air */
.browser_users.center {
    align-items: flex-start !important;
}

.main-content > .block[style*="transparent"] {
    gap: 16px;
}

.main-content > .block[style*="transparent"] > .row h3 {
    padding-left: 2px;
}

/* Line icons that replace the old PNG header icons */
.line-icon {
    display: grid;
    place-items: center;
}

.line-icon svg {
    width: 20px;
    height: 20px;
    stroke: #4b5563;
    fill: none;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.menu-btn:hover .line-icon svg,
.circle:hover .line-icon svg,
.logout:hover .line-icon svg {
    stroke: var(--brand);
}

.popup img.close {
    filter: grayscale(1) brightness(.35);
}

/* Login header is wrapped in a link back to the website */
.popup a {
    color: inherit;
    text-decoration: none;
}

/* Order lists */
tr.month-row td {
    background: #f9fafb;
    font-weight: 600;
    font-size: 13px;
    color: var(--text);
    padding: 10px 14px;
    text-align: left !important;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

tr.message-row:hover,
tr.month-row:hover {
    background: transparent;
}

tr.message-row td {
    text-align: center !important;
}

/* Order lists have ten columns: tighter cells so the action buttons stay in view next to the sidebar */
.orders-table th,
.orders-table td {
    padding-left: 9px;
    padding-right: 9px;
}

/* Upcoming / Old orders tabs */
.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    margin: 14px 0 12px;
}

.tab {
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.tab:hover {
    color: var(--text);
}

.tab.active {
    color: var(--brand);
    border-bottom-color: var(--brand);
}

.tab-panel[hidden] {
    display: none;
}

.tab-hint {
    font-size: 13px;
    color: var(--muted);
    margin: 0 0 10px;
}

/* Subscriptions page */
.pill.ok {
    background: var(--success-50);
    color: var(--success);
}

.pill.warn {
    background: #fffbeb;
    color: var(--warn);
}

.pill.bad {
    background: var(--danger-50);
    color: var(--danger);
}

.btn-link {
    background: none;
    border: none;
    padding: 0;
    color: var(--brand);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

.btn-link:hover {
    text-decoration: underline;
}
