:root {
    --bg: #090909;
    --bg-elevated: #111111;
    --bg-elevated2: #1c1c1c;
    --border: rgba(255, 255, 255, 0.08);
    --border2: rgba(255, 255, 255, 0.16);
    --text: #f2ede4;
    --text2: #c4bbb0;
    --text-muted: #8c857c;
    --accent: #3dba7a;
    --accent-dim: rgba(61, 186, 122, 0.55);
    --accent-soft: rgba(61, 186, 122, 0.14);
    --radius: 14px;
    --font-heading: 'Cormorant Garamond', Georgia, 'Palatino Linotype', serif;
    --font-body: 'Cormorant Garamond', Georgia, 'Palatino Linotype', serif;
    --font-ui: 'Montserrat', system-ui, sans-serif;
    --font-mono: 'Courier Prime', 'Courier New', monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 18px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

.site-brand {
    font-family: var(--font-heading); font-style: italic; font-weight: 600;
    font-size: 22px; color: var(--accent); letter-spacing: -0.01em; margin-bottom: 20px;
}

.site-header__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.site-header__top .site-brand { margin-bottom: 0; }
.auth-nav { display: flex; align-items: center; gap: 8px; font-family: var(--font-ui); font-size: 13px; }
.auth-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border2);
    color: var(--text2); font-size: 13px; font-weight: 500; white-space: nowrap;
    transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.auth-chip:hover { border-color: var(--accent-dim); color: var(--text); }
.auth-chip--accent { background: var(--accent); color: #06140d; border-color: var(--accent); font-weight: 600; }
.auth-chip--accent:hover { opacity: .88; color: #06140d; }
.auth-icon-btn {
    width: 32px; height: 32px; border-radius: 999px; border: 1px solid var(--border2);
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--text-muted); font-size: 14px; flex-shrink: 0;
    transition: border-color .15s ease, color .15s ease;
}
.auth-icon-btn:hover { border-color: #ff3b30; color: #ff6b60; }
.site-header { padding: 64px 0 40px; border-bottom: 1px solid var(--border); }
.site-header__title { font-family: var(--font-heading); font-style: italic; font-weight: 600; font-size: 42px; letter-spacing: -0.01em; margin: 0 0 12px; }
.site-header__desc { color: var(--text-muted); font-size: 18px; max-width: 560px; margin: 0; }

.site-footer { padding: 48px 0 64px; color: var(--text-muted); font-size: 14px; border-top: 1px solid var(--border); margin-top: 64px; }
.site-footer a { color: var(--text-muted); border-bottom: 1px solid transparent; transition: border-color .15s ease, color .15s ease; }
.site-footer a:hover { color: var(--text); border-color: var(--text-muted); }

.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; padding: 48px 0; }

.tool-card {
    display: flex; flex-direction: column; gap: 10px;
    background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 22px; transition: border-color .15s ease, transform .15s ease, background .15s ease;
}
.tool-card:hover { border-color: var(--accent-dim); transform: translateY(-2px); background: var(--bg-elevated2); }
.tool-card__icon { font-size: 22px; line-height: 1; }
.tool-card__title { font-family: var(--font-heading); font-style: italic; font-weight: 600; font-size: 20px; margin: 0; }
.tool-card__desc { font-family: var(--font-ui); color: var(--text-muted); font-size: 14px; margin: 0; flex-grow: 1; }
.tool-card__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.tag { font-family: var(--font-ui); font-size: 12px; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 3px 10px; }

.empty-state { padding: 64px 0; color: var(--text-muted); text-align: center; }

.admin-header { display: flex; align-items: center; justify-content: space-between; padding: 32px 0; border-bottom: 1px solid var(--border); }
.admin-header h1 { font-family: var(--font-heading); font-style: italic; font-weight: 600; font-size: 26px; margin: 0; }

.btn {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--accent); color: #06140d; border: none; border-radius: 10px;
    padding: 10px 18px; font-family: var(--font-ui); font-size: 14px; font-weight: 600; cursor: pointer; transition: opacity .15s ease;
}
.btn:hover { opacity: 0.88; }
.btn--ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn--danger { background: #ff3b30; color: #fff; }

.admin-table { width: 100%; border-collapse: collapse; margin: 32px 0; }
.admin-table th, .admin-table td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--border); font-family: var(--font-ui); font-size: 14px; }
.admin-table th { color: var(--text-muted); font-weight: 500; text-transform: uppercase; font-size: 12px; letter-spacing: .1em; }
.admin-table__actions { display: flex; gap: 8px; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; }
.badge--on { background: var(--accent-soft); color: var(--accent); }
.badge--off { background: rgba(142, 142, 147, .2); color: var(--text-muted); }

.form { max-width: 560px; margin: 32px 0; display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-family: var(--font-ui); font-size: 13px; color: var(--text-muted); }
.field input[type="text"], .field input[type="url"], .field input[type="number"], .field input[type="password"], .field textarea {
    background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 10px;
    padding: 10px 12px; color: var(--text); font-size: 15px; font-family: var(--font-body);
}
.field textarea { resize: vertical; min-height: 90px; }
.field-checkbox { flex-direction: row; align-items: center; gap: 8px; }
.form-actions { display: flex; gap: 10px; }

.alert { padding: 12px 16px; border-radius: 10px; font-size: 14px; margin: 24px 0 0; }
.alert--error { background: rgba(255, 59, 48, .12); color: #ff6b60; }

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-card { width: 100%; max-width: 360px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; }
.login-card h1 { font-family: var(--font-heading); font-style: italic; font-weight: 600; font-size: 24px; margin: 0 0 24px; }

.bell-btn {
    background: transparent; border: 1px solid var(--border2); border-radius: 999px;
    color: var(--text2); font-size: 16px; line-height: 1; cursor: pointer;
    width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
    padding: 0; transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.bell-btn:hover { border-color: var(--accent-dim); color: var(--text); }
.bell-btn[data-on="1"] { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.bell-btn:disabled { opacity: .5; cursor: default; }
.notify-hint { font-family: var(--font-ui); font-size: 12px; color: var(--text-muted); margin-top: 10px; min-height: 14px; }

@media (max-width: 560px) {
    .site-header { padding: 40px 0 28px; }
    .site-header__top { margin-bottom: 14px; }
    .site-header__title { font-size: 30px; }
    .site-header__desc { font-size: 15px; }
    .auth-nav { gap: 6px; font-size: 12px; }
    .auth-chip { padding: 5px 10px; font-size: 12px; }
    .bell-btn { width: 32px; height: 32px; font-size: 15px; }
}
