:root {
    --bg: #f4f6f8;
    --card: #ffffff;
    --ink: #1f2a33;
    --muted: #5b6770;
    --line: #d5dce2;
    --header: #2c3e50;
    --accent: #3498db;
    --accent-dark: #217dbb;
    --danger: #c0392b;
    --ok: #1e7a46;
    --error-bg: #fdecea;
    --ok-bg: #e8f6ee;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: Arial, sans-serif;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.45;
}

.site-header {
    background: var(--header);
    color: #fff;
    padding: 16px;
    text-align: center;
}
.site-header h1 {
    margin: 8px 0 0;
    font-size: 1.25rem;
    font-weight: 700;
}
.logo {
    width: 72px;
    height: auto;
    display: block;
    margin: 0 auto;
}
.header-user {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    font-size: 0.9rem;
}
.header-link, .link-button {
    color: #fff;
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}
.inline-form { display: inline; }

.site-main {
    max-width: 760px;
    margin: 0 auto;
    padding: 16px 16px 96px;
}
.lede, .hint { color: var(--muted); }

.alert {
    padding: 12px 14px;
    border-radius: 6px;
    margin: 12px 0;
}
.alert-error { background: var(--error-bg); color: #7a1f16; }
.alert-success { background: var(--ok-bg); color: var(--ok); }

.btn {
    display: inline-block;
    border: 0;
    border-radius: 6px;
    padding: 12px 16px;
    font-size: 1rem;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    color: #fff;
}
.btn-primary { background: var(--accent); }
.btn-primary:hover { background: var(--accent-dark); }
.btn-secondary { background: var(--header); }
.btn-danger { background: var(--danger); }
.btn-google { background: #4285F4; width: 100%; }
.btn-microsoft { background: #2f2f2f; width: 100%; }
.btn:disabled { opacity: 0.65; cursor: not-allowed; }

.login-main { text-align: center; }
.login-actions {
    display: grid;
    gap: 12px;
    max-width: 320px;
    margin: 24px auto 0;
}

fieldset {
    border: 1px solid var(--line);
    background: var(--card);
    border-radius: 8px;
    padding: 16px;
    margin: 0 0 16px;
}
legend { font-weight: 700; padding: 0 6px; }
label, fieldset p { display: block; margin: 12px 0 6px; font-weight: 600; }
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="time"],
input[type="search"],
input[type="file"],
select,
textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    font: inherit;
    background: #fff;
}
.choice-row { display: flex; flex-wrap: wrap; gap: 12px; }
.choice { font-weight: 500; display: flex; gap: 8px; align-items: center; }
.location-row { display: grid; gap: 8px; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.photo-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin: 8px 0 4px;
}
.photo-btn {
    width: 100%;
    position: relative;
    overflow: hidden;
}
.photo-btn input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    font-size: 16px;
}
.photo-previews {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 8px;
    margin-top: 12px;
}
.photo-preview { position: relative; }
.photo-previews img {
    width: 100%;
    height: 110px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--line);
    display: block;
}
.photo-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 50%;
    background: rgba(31, 42, 51, 0.8);
    color: #fff;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
}
.submit-bar {
    position: sticky;
    bottom: 0;
    background: var(--bg);
    padding: 12px 0;
}
.submit-bar .btn { width: 100%; }

.admin-nav {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}
.admin-nav a { color: var(--accent); }
.admin-nav a[aria-current="page"] { font-weight: 700; color: var(--ink); }
.filter-form, .actions {
    display: grid;
    gap: 8px;
    margin: 16px 0;
}
.table-wrap { overflow-x: auto; }
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card);
}
.data-table th, .data-table td {
    border-bottom: 1px solid var(--line);
    text-align: left;
    padding: 10px 8px;
    white-space: nowrap;
}
.row-actions form { display: inline; margin-right: 8px; }
.row-actions .link-button { color: var(--accent); }
.detail-grid h3 { margin-top: 20px; }
.success-panel {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 20px;
}

@media (min-width: 700px) {
    .location-row { grid-template-columns: 1fr auto; }
    .photo-actions { grid-template-columns: 1fr 1fr; }
    .filter-form { grid-template-columns: 1fr auto auto; align-items: end; }
    .actions { grid-template-columns: auto auto; justify-content: start; }
    .submit-bar .btn { width: auto; min-width: 240px; }
}
