/* Town of Coosada — admin portal */

:root {
    --navy: #132a4c;
    --navy-dark: #0d1f3a;
    --blue: #2457a6;
    --gold: #e3a824;
    --cream: #f7f5f0;
    --border: #e4e1da;
    --text: #1b2230;
    --muted: #5f6b7c;
    --red: #b3401f;
    --red-bg: #fbe9e3;
    --green: #1f6b3a;
    --green-bg: #e6f1ea;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'IBM Plex Sans', Helvetica, Arial, sans-serif;
    background: var(--cream);
    color: var(--text);
    font-size: 15px;
    line-height: 1.5;
}

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--navy); }
h1, h2, h3 { font-family: 'Lora', Georgia, serif; color: var(--navy); font-weight: 600; }

/* Login screen */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--navy-dark);
}
.login-card {
    background: #fff;
    border-radius: 14px;
    padding: 36px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 50px rgba(13, 31, 58, .4);
}
.login-card img { height: 64px; display: block; margin: 0 auto 16px; }
.login-card h1 { font-size: 22px; text-align: center; margin: 0 0 4px; }
.login-card .sub { text-align: center; color: var(--muted); font-size: 13px; margin: 0 0 24px; }
.login-card .login-help { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 0 0 18px; }
.login-card .login-links { text-align: center; font-size: 13px; margin: 18px 0 0; }
.login-card .login-links a { color: var(--navy, #1f3a5f); text-decoration: underline; }

/* Layout */
.admin-shell { display: flex; min-height: 100vh; }
.admin-side {
    width: 220px;
    flex: none;
    background: var(--navy-dark);
    color: #c9d3e3;
    display: flex;
    flex-direction: column;
    padding: 20px 12px;
    gap: 4px;
}
.admin-side .as-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-family: 'Lora', Georgia, serif;
    font-weight: 600;
    padding: 4px 10px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, .12);
    margin-bottom: 12px;
}
.admin-side .as-brand img { height: 34px; }
.admin-side a.nav-item {
    color: #c9d3e3;
    padding: 9px 12px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
}
.admin-side a.nav-item:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.admin-side a.nav-item.on { background: rgba(255, 255, 255, .12); color: #fff; }
.admin-side .as-foot { margin-top: auto; padding: 12px 10px 0; font-size: 12px; border-top: 1px solid rgba(255,255,255,.12); }
.admin-side .as-foot a { color: var(--gold); }

.admin-main { flex: 1; min-width: 0; padding: 28px clamp(16px, 3vw, 40px); }
.admin-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}
.admin-head h1 { font-size: 26px; margin: 0; }

/* Panels & tables */
.panel {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}
.panel h2 { font-size: 18px; margin: 0 0 14px; }

table.grid { width: 100%; border-collapse: collapse; font-size: 14px; }
table.grid th {
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
    padding: 8px 10px;
    border-bottom: 2px solid var(--border);
}
table.grid td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.grid tr:hover td { background: var(--cream); }

.badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 999px;
}
.badge--on { background: var(--green-bg); color: var(--green); }
.badge--off { background: var(--border); color: var(--muted); }
.badge--event { background: #fbf3df; color: #9a6b07; }
.badge--court { background: #e8eef8; color: var(--blue); }
.badge--meeting { background: var(--green-bg); color: var(--green); }
.badge--closure { background: var(--red-bg); color: var(--red); }

/* Forms */
.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 16px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-weight: 500; font-size: 13px; color: var(--navy); }
.form .full { grid-column: 1 / -1; }
.form input[type="text"], .form input[type="email"], .form input[type="password"],
.form input[type="date"], .form input[type="time"], .form input[type="datetime-local"],
.form input[type="url"], .form select, .form textarea, .form input[type="file"] {
    padding: 10px 12px;
    border: 1px solid #d5d1c8;
    border-radius: 8px;
    background: #fff;
    font-size: 15px;
}
.form textarea { resize: vertical; font-family: inherit; }
.form .check { flex-direction: row; align-items: center; gap: 8px; font-size: 14px; }

/* Rich-text editor (assets/js/admin-editor.js) */
.rte { border: 1px solid #d5d1c8; border-radius: 8px; background: #fff; overflow: hidden; font-weight: 400; }
.rte:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(36, 87, 166, .12); }
.rte-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 6px; background: var(--cream); border-bottom: 1px solid var(--border); }
.rte-btn {
    border: 1px solid transparent; background: transparent; color: var(--navy);
    font: inherit; font-size: 13px; line-height: 1; padding: 7px 9px; border-radius: 6px; cursor: pointer; min-width: 32px;
}
.rte-btn:hover { background: #fff; border-color: var(--border); }
.rte-btn.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.rte-btn:disabled { opacity: .4; cursor: default; }
.rte-btn.rte-right { margin-left: auto; }
.rte-sep { width: 1px; height: 20px; background: var(--border); margin: 0 4px; }
.rte-area { min-height: 320px; max-height: 70vh; overflow: auto; padding: 16px 18px; outline: none; font-size: 16px; line-height: 1.6; color: var(--text); }
.rte-area:empty::before { content: 'Start writing…'; color: var(--muted); }
.rte-area p, .rte-area blockquote, .rte-area ul, .rte-area ol { margin: 0 0 14px; }
.rte-area h2 { font-size: 22px; margin: 18px 0 8px; }
.rte-area h3 { font-size: 18px; margin: 16px 0 6px; }
.rte-area blockquote { border-left: 4px solid var(--gold); padding: 6px 14px; color: var(--muted); background: var(--cream); border-radius: 0 6px 6px 0; }
.rte-area a { color: var(--blue); text-decoration: underline; }
.rte-area img { max-width: 100%; height: auto; border-radius: 8px; display: block; }
.form .rte textarea.rte-source { border: 0; border-radius: 0; width: 100%; min-height: 320px; font-family: ui-monospace, Consolas, monospace; font-size: 13px; line-height: 1.5; display: block; }
.form .rte textarea.rte-source[hidden], .rte-area[hidden] { display: none; }
.rte-status { font-size: 12px; color: var(--muted); padding: 4px 10px; min-height: 22px; border-top: 1px solid var(--border); }
.rte-status:empty { display: none; }
.rte-status--err { color: var(--red); background: var(--red-bg); }
.form-actions { grid-column: 1 / -1; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    padding: 10px 18px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.3;
}
.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy-dark); color: #fff; }
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-outline { background: #fff; color: var(--navy); border: 1.5px solid #cfd6e0; }
.btn-danger { background: var(--red-bg); color: var(--red); }
.btn-sm { padding: 6px 12px; font-size: 13px; }

.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 18px; font-size: 14px; }
.flash--ok { background: var(--green-bg); color: var(--green); }
.flash--err { background: var(--red-bg); color: var(--red); }

.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 14px; margin-bottom: 22px; }
.stat-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 18px; }
.stat-card .num { font-family: 'Lora', Georgia, serif; font-size: 30px; font-weight: 600; color: var(--navy); display: block; }
.stat-card .lbl { font-size: 13px; color: var(--muted); }

.muted { color: var(--muted); }
.mb-0 { margin-bottom: 0; }

@media (max-width: 760px) {
    .admin-shell { flex-direction: column; }
    .admin-side { width: 100%; flex-direction: row; flex-wrap: wrap; align-items: center; }
    .admin-side .as-brand { border: none; margin: 0; padding: 4px 10px; }
    .admin-side .as-foot { margin: 0; border: none; padding: 4px 10px; }
}

/* ==========================================================================
   Business directory (admin + owner portal)
   ========================================================================== */
.nav-badge {
    display: inline-block;
    min-width: 18px;
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--gold);
    color: var(--navy);
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    margin-left: 6px;
}

.biz-map-caption { font-size: 12px; color: var(--muted); font-weight: 400; }
.biz-map-preview {
    height: 260px;
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-top: 6px;
    overflow: hidden;
}
.biz-suggest {
    position: absolute;
    z-index: 30;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #cfd6e0;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 10px 24px rgba(13, 31, 58, .15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.biz-suggest button {
    text-align: left;
    padding: 10px 14px;
    background: #fff;
    border: none;
    border-bottom: 1px solid #eef1f6;
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    color: var(--text);
}
.biz-suggest button:last-child { border-bottom: none; }
.biz-suggest button:hover { background: var(--cream); }

.biz-hours-grid { display: flex; flex-direction: column; gap: 6px; }
.biz-hours-row { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.biz-hours-row span { width: 92px; font-weight: 500; color: var(--navy); flex: none; }
.biz-hours-row em { font-style: normal; color: var(--muted); font-size: 13px; }
.biz-hours-row input[type="time"] {
    padding: 6px 8px;
    border: 1px solid #d5d1c8;
    border-radius: 8px;
    background: #fff;
    font-size: 14px;
}
