:root {
    --pink: #d6336c;
    --pink-dark: #b02457;
    --pink-light: #fdeef3;
    --text: #222;
    --muted: #6b7280;
    --border: #e5e7eb;
    --bg: #f7f7f9;
    --card: #fff;
    --ok: #15803d;
    --warn: #b45309;
    --err: #b91c1c;
    --radius: 10px;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--text);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); line-height: 1.45; padding-bottom: 80px; }
a { color: var(--pink-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; margin: 0 0 1rem; }
h2 { font-size: 1.15rem; margin: 0 0 .75rem; }
h3 { font-size: 1rem; margin: 0 0 .5rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

.topbar {
    display: flex; align-items: center; gap: 1rem;
    background: #fff; border-bottom: 1px solid var(--border);
    padding: .5rem 1rem; position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: .5rem; font-weight: 600; color: var(--pink); }
.brand:hover { text-decoration: none; }
.mainnav { display: flex; gap: .25rem; flex: 1; align-items: center; }
.mainnav > a, .dropdown summary {
    padding: .45rem .75rem; border-radius: 8px; color: var(--text); cursor: pointer; list-style: none;
}
.mainnav > a.active, .dropdown.active summary, .mainnav > a:hover, .dropdown summary:hover {
    background: var(--pink-light); color: var(--pink-dark); text-decoration: none;
}
.dropdown { position: relative; }
.dropdown summary::-webkit-details-marker { display: none; }
.dropdown-menu {
    position: absolute; top: 110%; left: 0; background: #fff; border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,.08); min-width: 220px; padding: .4rem; z-index: 30;
}
.dropdown-menu a, .dropdown-menu .linklike { display: block; padding: .45rem .7rem; border-radius: 6px; color: var(--text); width: 100%; text-align: left; }
.dropdown-menu a:hover, .dropdown-menu .linklike:hover { background: var(--pink-light); text-decoration: none; }
.dropdown-menu hr { border: 0; border-top: 1px solid var(--border); margin: .3rem 0; }
.linklike { background: none; border: 0; font: inherit; cursor: pointer; color: var(--pink-dark); padding: 0; }

.container { max-width: 1200px; margin: 0 auto; padding: 1.25rem 1rem; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.page-head h1 { margin: 0; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 1rem; }
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.stat { font-size: 1.8rem; font-weight: 700; color: var(--pink-dark); }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
    padding: .5rem .9rem; border-radius: 8px; border: 1px solid var(--border);
    background: #fff; color: var(--text); font: inherit; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { text-decoration: none; background: #f3f4f6; }
.btn-primary { background: var(--pink); border-color: var(--pink); color: #fff; }
.btn-primary:hover { background: var(--pink-dark); }
.btn-danger { color: var(--err); border-color: #fecaca; }
.btn-danger:hover { background: #fef2f2; }
.btn-sm { padding: .25rem .55rem; font-size: .85rem; }
.btn-block { width: 100%; }
.inline { display: inline; }

table { width: 100%; border-collapse: collapse; }
th, td { padding: .5rem .6rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }

form .row { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-bottom: .75rem; }
.form-aligned .row > div { display: flex; flex-direction: column; justify-content: flex-end; min-width: 0; }
form .row-checks { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); align-items: center; }
form .row.row-address { grid-template-columns: minmax(90px, 9rem) minmax(0, 1fr); }
form .row.row-full { grid-template-columns: minmax(0, 1fr); }

/* Section titles: same look for every card heading and form section */
.card > h2, .card > h3, .card > .page-head, .form-section {
    font-size: 1.05rem; font-weight: 600; color: var(--pink-dark);
    margin: 0 0 .75rem; padding-bottom: .35rem; border-bottom: 1px solid var(--border);
}
.card > .page-head h2 { font-size: inherit; color: inherit; margin: 0; }
.card > h2:not(:first-of-type), .card > h3:not(:first-of-type) { margin-top: 1.5rem; }
label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: .2rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], input[type=tel], select, textarea {
    width: 100%; padding: .55rem .65rem; border: 1px solid #d1d5db; border-radius: 8px; font: inherit; background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--pink-light); border-color: var(--pink); }
textarea { min-height: 90px; resize: vertical; }
textarea.report { min-height: 320px; font-family: ui-monospace, Consolas, monospace; font-size: .9rem; }
.check { display: flex; align-items: center; gap: .5rem; color: var(--text); font-size: 1rem; }
.check input { width: 1.1rem; height: 1.1rem; }
.suggest-wrap { position: relative; }
.suggest {
    position: absolute; z-index: 20; top: 100%; left: 0; right: 0; margin: .2rem 0 0; padding: .25rem 0; list-style: none;
    background: #fff; border: 1px solid #d1d5db; border-radius: 8px; box-shadow: 0 6px 18px rgba(0, 0, 0, .08);
}
.suggest li { padding: .5rem .65rem; cursor: pointer; }
.suggest li:hover, .suggest li.active { background: var(--pink-light); }
.warn { color: var(--warn); }
.form-actions { display: flex; gap: .5rem; justify-content: flex-end; margin-top: 1rem; flex-wrap: wrap; }
.card + .form-actions { margin-bottom: 1rem; }

.alert { padding: .75rem 1rem; border-radius: 8px; margin-bottom: 1rem; border: 1px solid; }
.alert-success { background: #f0fdf4; border-color: #bbf7d0; color: var(--ok); }
.alert-error { background: #fef2f2; border-color: #fecaca; color: var(--err); }
.alert-warning { background: #fffbeb; border-color: #fde68a; color: var(--warn); }

.badge { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .75rem; background: #eef2ff; color: #3730a3; }
.badge-ok { background: #dcfce7; color: var(--ok); }
.badge-warn { background: #fef3c7; color: var(--warn); }
.badge-pink { background: var(--pink-light); color: var(--pink-dark); }

.services-table input { min-width: 70px; }
.services-table select { min-width: 70px; }

.auth-box { max-width: 380px; margin: 8vh auto; text-align: center; }
.auth-box img { width: 80px; margin-bottom: 1rem; }
.auth-box form { text-align: left; }

.bottomnav { display: none; }
.empty { padding: 1.5rem; text-align: center; color: var(--muted); }

.quick { max-width: 520px; margin: 0 auto; }
.quick .big { font-size: 1.15rem; padding: .8rem; }
.minute-buttons { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .4rem; }
.minute-buttons button { flex: 1; }
.timer { font-size: 2.2rem; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; margin: .5rem 0; }
.offline-banner { background: #fffbeb; color: var(--warn); border: 1px solid #fde68a; padding: .5rem 1rem; border-radius: 8px; margin-bottom: 1rem; display: none; }

@media (max-width: 800px) {
    .mainnav, .btn-quick { display: none; }
    .topbar { justify-content: center; }
    .container { padding: 1rem .75rem; }
    .bottomnav {
        display: flex; position: fixed; bottom: 0; left: 0; right: 0; background: #fff;
        border-top: 1px solid var(--border); justify-content: space-around; align-items: center;
        padding: .3rem 0 calc(.3rem + env(safe-area-inset-bottom)); z-index: 20;
    }
    .bottomnav a { display: flex; flex-direction: column; align-items: center; font-size: .7rem; color: var(--muted); flex: 1; }
    .bottomnav a span { font-size: 1.3rem; line-height: 1.2; }
    .bottomnav a.active { color: var(--pink-dark); }
    .bottomnav a.fab span {
        background: var(--pink); color: #fff; width: 52px; height: 52px; border-radius: 50%;
        display: flex; align-items: center; justify-content: center; font-size: 2rem; margin-top: -24px;
        box-shadow: 0 4px 12px rgba(214,51,108,.4);
    }
    .bottomnav a:hover { text-decoration: none; }
    .hide-mobile { display: none; }
    th, td { padding: .45rem .4rem; }
}
