/* Email Tracker — общая тема (все страницы) */
:root {
    --bg: #eef1f6;
    --bg-gradient-end: #e4e9f2;
    --surface: #ffffff;
    --text: #111827;
    --muted: #6b7280;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-muted: rgba(37, 99, 235, 0.12);
    --border: #e5e7eb;
    --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 4px 12px rgba(15, 23, 42, 0.04);
    --radius: 12px;
    --radius-sm: 8px;
    --success: #059669;
    --success-bg: #ecfdf5;
    --danger: #dc2626;
    --danger-bg: #fef2f2;
    --header-h: 3.25rem;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body.app-body {
    margin: 0;
    min-height: 100vh;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.55;
    color: var(--text);
    background: linear-gradient(165deg, var(--bg) 0%, var(--bg-gradient-end) 45%, #dfe6f0 100%);
    background-attachment: fixed;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}

.site-header__inner {
    max-width: 60rem;
    margin: 0 auto;
    padding: 0.65rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.site-brand {
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
    color: var(--text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.site-brand:hover {
    color: var(--accent);
}

.site-brand__dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #7c3aed);
    flex-shrink: 0;
}

.wrap {
    max-width: 60rem;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 3rem;
}

.nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.5rem;
    align-items: center;
    padding: 1rem 0 0.25rem;
    margin-bottom: 1.25rem;
}

.nav a {
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    background: transparent;
    border: 1px solid transparent;
}

.nav a:hover {
    background: var(--accent-muted);
    color: var(--accent);
}

.user-line {
    color: var(--muted);
    font-size: 0.9rem;
    margin: 0 0 1rem;
}

.user-line strong {
    color: var(--text);
}

h1 {
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin: 0 0 0.5rem;
    line-height: 1.2;
}

h2 {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 1.35rem 0 0.65rem;
    letter-spacing: -0.02em;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.35rem 1.4rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow);
}

table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

table.data th,
table.data td {
    border: 1px solid var(--border);
    padding: 0.55rem 0.75rem;
    text-align: left;
}

table.data th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
}

table.data tr:hover td {
    background: #fafbfc;
}

.flash {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.flash.ok {
    background: var(--success-bg);
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.flash.err {
    background: var(--danger-bg);
    color: #991b1b;
    border: 1px solid #fecaca;
}

label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    margin: 0.85rem 0 0.35rem;
    color: #374151;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
    width: 100%;
    max-width: 28rem;
    padding: 0.55rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font: inherit;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-muted);
}

textarea {
    min-height: 6rem;
    max-width: 100%;
}

.btn {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.55rem 1.15rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, transform 0.05s;
}

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

.btn:active {
    transform: scale(0.98);
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn-secondary {
    background: #6b7280;
}

.btn-secondary:hover {
    background: #4b5563;
}

.code {
    background: #f3f4f6;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem;
    overflow-x: auto;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.85rem;
    white-space: pre-wrap;
    word-break: break-all;
}

.logout-form {
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.guest-lead {
    color: var(--muted);
    margin: 0 0 1rem;
    font-size: 0.95rem;
}

.form-hint {
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: 0.5rem;
}

.form-hint a,
.card a {
    color: var(--accent);
    font-weight: 600;
}

.form-hint a:hover,
.card a:hover {
    text-decoration: underline;
}

/* Установщик (install/index.php) */
.install-wrap {
    max-width: 52rem;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 3rem;
}

.install-card h2 {
    margin-top: 0;
}

.steps {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
    margin-bottom: 1.25rem;
    padding: 0.75rem 1rem;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.steps strong {
    font-weight: 700;
}

.ok { color: var(--success); }
.err { color: var(--danger); }
.muted { color: var(--muted); font-size: 0.9rem; }
.info { color: var(--success); }

.card.err {
    border-color: #fecaca;
    background: var(--danger-bg);
}

.toolbar form {
    display: inline-block;
    margin-right: 0.75rem;
    margin-bottom: 0.5rem;
    vertical-align: middle;
}

button:not(.btn):not(.btn-secondary) {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

button:not(.btn):not(.btn-secondary):hover {
    background: #f9fafb;
}

/* Страница «установщик отключен» */
.page-simple {
    max-width: 28rem;
    margin: 4rem auto;
    padding: 2rem;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    text-align: center;
}

.page-simple h1 {
    font-size: 1.35rem;
}

.page-simple a {
    color: var(--accent);
    font-weight: 600;
}
