:root {
    --ink: #16323f;
    --ink-soft: #5b6f78;
    --line: #dde1e6;
    --accent: #1f7a68;
    --accent-dark: #16594c;
    --accent-soft: #e3f0ec;
    --error: #b3261e;
    --bg: #f7f5f1;
    --card: #ffffff;
    --radius: 12px;
    --shadow-sm: 0 1px 2px rgba(22,50,63,0.04), 0 4px 10px rgba(22,50,63,0.05);
}

a {
    color: var(--accent);
}

a:hover {
    color: var(--accent-dark);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.5;
}

.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--card);
    border-bottom: 1px solid var(--line);
}

.brand {
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
    letter-spacing: 0.01em;
}

.site-nav a {
    margin-left: 1.25rem;
    color: var(--ink-soft);
    text-decoration: none;
    font-size: 0.95rem;
    padding-bottom: 0.3rem;
    border-bottom: 2px solid transparent;
}

.site-nav a:hover { color: var(--accent); }
.site-nav a.active { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }

a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

@media (max-width: 480px) {
    .site-main { padding: 0 1rem; margin: 1.5rem auto; }
    .admin-toolbar { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
    .site-nav a { margin-left: 0; margin-right: 1rem; }
}

.site-main {
    max-width: 1100px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

.site-footer {
    text-align: center;
    color: var(--ink-soft);
    font-size: 0.85rem;
    padding: 2rem 0;
}

.footer-logo {
    height: 32px;
    width: auto;
    display: block;
    margin: 0 auto 0.5rem;
    opacity: 0.85;
}

.auth-card, .report-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.auth-card { max-width: 360px; margin: 3rem auto; text-align: center; }

.auth-logo {
    height: 42px;
    width: auto;
    margin: 0 auto 1.25rem;
    display: block;
}

.auth-card form { text-align: left; }

form label {
    display: block;
    font-size: 0.9rem;
    color: var(--ink-soft);
    margin-top: 1rem;
    margin-bottom: 0.3rem;
}

form input, form textarea, form select {
    width: 100%;
    padding: 0.6rem 0.7rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
}

button {
    margin-top: 1.5rem;
    width: 100%;
    padding: 0.7rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 999px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

button:hover { background: var(--accent-dark); }

.alert {
    padding: 0.6rem 0.8rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
}

.alert-error {
    background: #fbeae9;
    color: var(--error);
}

.alert-success {
    background: var(--accent-soft);
    color: var(--accent-dark);
}

.report-grid {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.35rem 1rem;
    margin: 1rem 0;
}

.report-grid dt { color: var(--ink-soft); }
.report-grid dd { margin: 0; }

.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--line);
}

.tab {
    padding: 0.6rem 1rem;
    text-decoration: none;
    color: var(--ink-soft);
    font-size: 0.92rem;
    border-bottom: 2px solid transparent;
}

.tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    font-weight: 600;
}

.ticket-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.9rem 1rem;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin-bottom: 0.6rem;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow-sm);
}

.ticket-row:hover { border-color: var(--accent); }

.thread-msg {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
}

.thread-msg.from-admin {
    background: var(--accent-soft);
    border-color: var(--accent);
}

.thread-msg .thread-meta {
    font-size: 0.8rem;
    color: var(--ink-soft);
    margin-bottom: 0.5rem;
}

.thread-msg .thread-body { font-size: 0.95rem; }
.thread-msg .thread-body p:first-child { margin-top: 0; }
.thread-msg .thread-body p:last-child { margin-bottom: 0; }

.attachment-list {
    list-style: none;
    padding: 0;
    margin: 0.75rem 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.attachment-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.7rem;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 0.82rem;
    text-decoration: none;
    color: var(--ink);
}

.attachment-chip:hover { border-color: var(--accent); }

/* Quill editor sizing to match the rest of the form */
.ql-toolbar { border-radius: var(--radius) var(--radius) 0 0; border-color: var(--line) !important; }
.ql-container { border-radius: 0 0 var(--radius) var(--radius); border-color: var(--line) !important; font-family: inherit; font-size: 1rem; min-height: 140px; }

.admin-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.btn {
    display: inline-block;
    padding: 0.6rem 1.4rem;
    background: var(--accent);
    color: #fff;
    border-radius: 999px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
}

.btn:hover { background: var(--accent-dark); color: #fff; }

.btn-outline {
    display: inline-block;
    padding: 0.6rem 1.4rem;
    background: transparent;
    color: var(--accent);
    border: 1.5px solid var(--accent);
    border-radius: 999px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
}

.btn-outline:hover { background: var(--accent-soft); color: var(--accent-dark); }

.badge {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid transparent;
}

.badge-open { background: #fff1f2; color: #be123c; border-color: #fecdd3; }
.badge-in_progress { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.badge-closed { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.badge-warning { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.badge-info { background: #f0f9ff; color: #0369a1; border-color: #bae6fd; }

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}

.admin-table th, .admin-table td {
    text-align: left;
    padding: 0.7rem 0.9rem;
    border-bottom: 1px solid var(--line);
    font-size: 0.92rem;
}

.admin-table th {
    background: var(--accent-soft);
    color: var(--ink-soft);
    font-weight: 600;
}

.admin-table tr:last-child td { border-bottom: none; }

.credential-box {
    background: var(--accent-soft);
    border: 1px dashed var(--accent);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin: 1rem 0;
    font-family: monospace;
    font-size: 0.95rem;
}

.report-bubble {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin-bottom: 1.25rem;
    overflow: hidden;
}

.report-bubble-header {
    padding: 0.6rem 1.1rem;
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
}

.report-bubble-body { padding: 1.1rem 1.25rem; }

.bubble-uptime  { background: #2f8a5d; }
.bubble-security { background: #b3261e; }
.bubble-plugins { background: #2f5d8a; }
.bubble-wp      { background: #6b4fa0; }
.bubble-backup  { background: #b06a1e; }

.report-meta {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    color: var(--ink-soft);
    font-size: 0.88rem;
    margin: 0.25rem 0 1.5rem;
}

.status-banner {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    border: 1px solid;
}
.status-banner.healthy { background: var(--accent-soft); border-color: #a9d9c8; }
.status-banner.attention { background: #fdeeea; border-color: #f2b8b0; }

.report-card.card-healthy { border-color: #a9d9c8; }
.report-card.card-attention { border-color: #f2b8b0; }

.status-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
}
.status-icon.healthy { background: var(--accent); }
.status-icon.attention { background: var(--error); }

.status-banner h2 {
    margin: 0.15rem 0 0.25rem;
    font-size: 1.4rem;
}
.status-banner .status-label {
    font-size: 0.8rem;
    color: var(--ink-soft);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.status-banner p { margin: 0; color: var(--ink-soft); font-size: 0.92rem; }

.stat-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}
@media (max-width: 700px) {
    .stat-row { grid-template-columns: repeat(2, 1fr); }
}

.stat-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: var(--shadow-sm);
}
.stat-card-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    margin-bottom: 0.6rem;
}
.stat-card-label { font-size: 0.82rem; color: var(--ink-soft); margin-bottom: 0.3rem; }
.stat-card-value { font-size: 1.5rem; font-weight: 700; color: var(--ink); }
.stat-card-sub { font-size: 0.78rem; color: var(--ink-soft); margin-bottom: 0.5rem; }

.stat-card-link {
    display: block;
    margin-top: 0.6rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
}
.stat-card-link:hover { color: var(--accent-dark); }

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
}
@media (max-width: 850px) {
    .detail-grid { grid-template-columns: 1fr; }
}

.extra-plugin-row { display: none; }
#plugins-table.show-all .extra-plugin-row { display: table-row; }

.summary-row {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--line);
}
.summary-row:last-child { border-bottom: none; }
.summary-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
}
.summary-row h4 { margin: 0 0 0.15rem; font-size: 0.95rem; }
.summary-row p { margin: 0; color: var(--ink-soft); font-size: 0.85rem; }
.summary-row a { font-size: 0.85rem; white-space: nowrap; margin-left: auto; }

.detail-section { margin-bottom: 1.25rem; }
.detail-header {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 0.75rem;
}
.detail-header .stat-card-icon { margin-bottom: 0; width: 32px; height: 32px; }
.detail-header h3 { margin: 0; font-size: 1.05rem; }

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--ink-soft);
    text-decoration: none;
    font-size: 0.88rem;
    margin-bottom: 1.25rem;
}
.back-link:hover { color: var(--accent); }

/* Sidebar shell - used on client-facing pages instead of the top nav.
   Sidebar is fixed so it doesn't stretch to match content length on
   short pages; app-content offsets by its width instead of using flex. */
.app-shell {
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 240px;
    overflow-y: auto;
    background: var(--card);
    border-right: 1px solid var(--line);
    padding: 1.5rem 1.25rem;
    display: flex;
    flex-direction: column;
    z-index: 10;
}

.app-content.with-sidebar {
    margin-left: 240px;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 2rem;
    font-size: 1.02rem;
}
.sidebar-logo { height: 26px; width: auto; }

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.65rem 0.9rem;
    border-radius: 8px;
    color: var(--ink-soft);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.92rem;
}
.sidebar-nav a:hover { background: var(--bg); }
.sidebar-nav a.active { background: var(--accent-soft); color: var(--accent); }

.sidebar-footer { margin-top: auto; padding-top: 1.5rem; }
.sidebar-footer a {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.65rem 0.9rem;
    color: var(--ink-soft);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.92rem;
}
.sidebar-footer a:hover { color: var(--error); }

.app-main {
    flex: 1;
    padding: 2.5rem 3rem;
    max-width: 90%;
    margin: 0 auto;
}

.kicker {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 0.4rem;
}

@media (max-width: 768px) {
    .sidebar {
        position: static;
        width: 100%;
        flex-direction: row;
        align-items: center;
        border-right: none;
        border-bottom: 1px solid var(--line);
        padding: 0.9rem 1rem;
    }
    .app-content.with-sidebar { margin-left: 0; }
    .sidebar-brand { margin-bottom: 0; margin-right: 1.25rem; }
    .sidebar-nav { flex-direction: row; gap: 0.25rem; overflow-x: auto; }
    .sidebar-nav a { padding: 0.5rem 0.7rem; font-size: 0.85rem; white-space: nowrap; }
    .sidebar-footer { margin-top: 0; margin-left: auto; padding-top: 0; }
    .app-main { padding: 1.5rem 1.25rem; }
}

.report-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--ink);
}
.report-sub { color: var(--ink-soft); font-size: 0.85rem; }
