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

body {
    font-family: "Courier New", Courier, monospace;
    background: #1a1a1a;
    color: #e0e0e0;
    min-height: 100vh;
}

.layout {
    display: flex;
    min-height: 100vh;
}

/* ── Left sidebar ── */
.sidebar {
    width: 200px;
    background: #111;
    border-right: 2px solid #444;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 16px 12px;
    font-size: 18px;
    font-weight: bold;
    color: #4a4;
    border-bottom: 2px solid #444;
    letter-spacing: 2px;
}

.nav-list {
    list-style: none;
    flex: 1;
}

.nav-list li a {
    display: block;
    padding: 10px 12px;
    color: #ccc;
    text-decoration: none;
    border-bottom: 1px solid #333;
}

.nav-list li a:hover {
    background: #222;
    color: #fff;
}

.nav-list li a.active {
    background: #252;
    color: #4a4;
    border-left: 3px solid #4a4;
}

.sidebar-footer {
    padding: 12px;
    font-size: 11px;
    color: #555;
    border-top: 1px solid #333;
}

/* ── Main content ── */
.content {
    flex: 1;
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.ascii-art {
    color: #4a4;
    font-size: 11px;
    line-height: 1.15;
    text-align: center;
    margin-bottom: 30px;
    white-space: pre;
}

.ascii-frog {
    color: #6b6;
    font-size: 8px;
    line-height: 1.1;
    white-space: pre;
    text-align: center;
    letter-spacing: 0.5px;
}

/* ── Sidebar auth ── */
.sidebar-auth {
    padding: 10px 12px;
    border-bottom: 2px solid #444;
}

.sidebar-auth label {
    display: block;
    color: #888;
    font-size: 10px;
    margin-bottom: 2px;
    letter-spacing: 1px;
}

.sidebar-auth input {
    display: block;
    width: 100%;
    padding: 5px 6px;
    margin-bottom: 8px;
    background: #1a1a1a;
    color: #e0e0e0;
    border: 1px solid #444;
    font-family: "Courier New", Courier, monospace;
    font-size: 12px;
    outline: none;
}

.sidebar-auth input:focus {
    border-color: #4a4;
}

.sidebar-auth button {
    display: block;
    width: 100%;
    padding: 5px;
    background: #252;
    color: #4a4;
    border: 1px solid #4a4;
    font-family: "Courier New", Courier, monospace;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 2px;
    cursor: pointer;
}

.sidebar-auth button:hover {
    background: #4a4;
    color: #111;
}

.sidebar-userbar {
    display: block;
    color: #4a4;
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 6px;
    text-decoration: none;
}

.sidebar-userbar:hover {
    color: #6d6;
    text-decoration: underline;
}

.login-msg {
    color: #a44;
    font-size: 10px;
    margin-top: 6px;
}

.logout-btn {
    display: block;
    width: 100%;
    padding: 4px;
    background: none;
    color: #888;
    border: 1px solid #444;
    font-family: "Courier New", Courier, monospace;
    font-size: 10px;
    letter-spacing: 1px;
    cursor: pointer;
}

.logout-btn:hover {
    background: #322;
    color: #a44;
    border-color: #a44;
}

/* ── Content alignment ── */
.content-top-left {
    align-items: flex-start;
    justify-content: flex-start;
}

/* ── Panels ── */
.panel {
    border: 2px solid #444;
    background: #111;
    margin-bottom: 20px;
    width: 400px;
}

.panel-header {
    padding: 8px 12px;
    font-size: 12px;
    font-weight: bold;
    color: #4a4;
    border-bottom: 2px solid #444;
    letter-spacing: 2px;
}

.panel-body {
    padding: 14px 12px;
}

/* ── Forms ── */
.form-field {
    margin-bottom: 12px;
}

.form-field label {
    display: block;
    color: #888;
    font-size: 10px;
    margin-bottom: 3px;
    letter-spacing: 1px;
}

.form-field input {
    display: block;
    width: 100%;
    padding: 6px 8px;
    background: #1a1a1a;
    color: #e0e0e0;
    border: 1px solid #444;
    font-family: "Courier New", Courier, monospace;
    font-size: 13px;
    outline: none;
}

.form-field input:focus {
    border-color: #4a4;
}

.form-field input.input-readonly {
    color: #666;
    border-color: #333;
    cursor: not-allowed;
}

.form-btn {
    display: block;
    width: 100%;
    padding: 6px;
    margin-top: 4px;
    background: #252;
    color: #4a4;
    border: 1px solid #4a4;
    font-family: "Courier New", Courier, monospace;
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 2px;
    cursor: pointer;
}

.form-btn:hover {
    background: #4a4;
    color: #111;
}

.form-msg {
    color: #a44;
    font-size: 11px;
    margin-top: 8px;
}

.form-msg-ok {
    color: #4a4;
}

/* ── Account info ── */
.info-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px solid #222;
}

.info-label {
    color: #888;
    font-size: 10px;
    letter-spacing: 1px;
}

.info-value {
    color: #ccc;
    font-size: 12px;
}

/* ── Visibility icons ── */
.nav-list li > a,
.nav-children li > a {
    display: flex;
    align-items: center;
}

.nav-link-inner {
    flex: 1;
}

.vis-icon {
    font-size: 12px;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 2px;
    opacity: 0.7;
    transition: opacity 0.15s;
}

.vis-icon:hover {
    opacity: 1;
    background: #222;
}

/* ── Drag handle ── */
.drag-handle {
    display: none;
    color: #555;
    cursor: grab;
    padding: 0 6px 0 0;
    font-size: 11px;
    user-select: none;
}

.reorder-active .drag-handle {
    display: inline;
}

.reorder-active li {
    cursor: grab;
}

.reorder-active li.dragging {
    opacity: 0.3;
}

.reorder-active li.drop-above {
    border-top: 2px solid #4a4;
}

.reorder-active li.drop-below {
    border-bottom: 2px solid #4a4;
}

/* ── Reorder button ── */
.sidebar-footer {
    display: flex;
    align-items: center;
    gap: 8px;
}

.reorder-btn {
    cursor: pointer;
    font-size: 14px;
    color: #555;
    padding: 2px 4px;
    border-radius: 2px;
    user-select: none;
}

.reorder-btn:hover {
    color: #4a4;
    background: #222;
}

.reorder-btn-active {
    color: #4a4;
    background: #252;
}

/* ── Tree navigation ── */
.nav-children {
    list-style: none;
}

.nav-children li a {
    padding: 8px 10px;
    color: #ccc;
    text-decoration: none;
    border-bottom: 1px solid #333;
    display: flex;
    align-items: center;
}

.nav-children li a:hover {
    background: #222;
    color: #fff;
}

.nav-children li a.active {
    background: #252;
    color: #4a4;
    border-left: 3px solid #4a4;
}

.tree-toggle {
    font-size: 8px;
    color: #4a4;
    width: 14px;
    text-align: center;
    cursor: pointer;
    flex-shrink: 0;
    margin-right: 4px;
    user-select: none;
}

.tree-toggle:hover {
    color: #6d6;
}

.tree-leaf {
    color: #444;
    cursor: default;
}

.tree-leaf:hover {
    color: #444;
}

/* ── Role badge ── */
.role-badge {
    display: inline-block;
    padding: 3px 8px;
    margin-bottom: 12px;
    border: 1px solid #444;
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 2px;
}

.role-admin {
    color: #f44;
    border-color: #f44;
    background: #311;
}

.role-moderator {
    color: #fc4;
    border-color: #fc4;
    background: #332;
}

.role-member {
    color: #4af;
    border-color: #4af;
    background: #123;
}

.role-public {
    color: #888;
    border-color: #555;
    background: #1a1a1a;
}

/* ── Register button (sidebar footer) ── */
.register-btn {
    display: inline-block;
    padding: 3px 8px;
    color: #4a4;
    border: 1px solid #4a4;
    font-family: "Courier New", Courier, monospace;
    font-size: 9px;
    font-weight: bold;
    letter-spacing: 1px;
    text-decoration: none;
    cursor: pointer;
}

.register-btn:hover {
    background: #4a4;
    color: #111;
}

/* ── Password strength meter ── */
.strength-bar {
    width: 100%;
    height: 4px;
    background: #333;
    margin-top: -4px;
    margin-bottom: 2px;
}

.strength-fill {
    height: 100%;
    width: 0;
    transition: width 0.3s, background 0.3s;
}

.strength-fill.str-weak   { background: #f44; }
.strength-fill.str-fair   { background: #fa4; }
.strength-fill.str-good   { background: #4a4; }
.strength-fill.str-strong { background: #4f4; }

.strength-label {
    display: block;
    font-size: 9px;
    font-weight: bold;
    letter-spacing: 1px;
    margin-bottom: 10px;
    height: 12px;
}

.strength-label.str-weak   { color: #f44; }
.strength-label.str-fair   { color: #fa4; }
.strength-label.str-good   { color: #4a4; }
.strength-label.str-strong { color: #4f4; }

/* ── Error page ── */
.error-page {
    text-align: center;
}

.error-box {
    border: 2px solid #a44;
    background: #211;
    max-width: 480px;
    margin: 0 auto;
}

.error-title {
    padding: 10px 16px;
    font-size: 13px;
    font-weight: bold;
    color: #f44;
    border-bottom: 2px solid #a44;
    letter-spacing: 2px;
}

.error-body {
    padding: 20px 16px;
    color: #c88;
    font-size: 12px;
    line-height: 1.6;
}

.error-link {
    display: block;
    padding: 10px 16px;
    border-top: 1px solid #a44;
    color: #4a4;
    text-decoration: none;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 1px;
}

.error-link:hover {
    background: #252;
    color: #6d6;
}

.error-debug {
    padding: 8px 16px;
    border-top: 1px solid #332;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    font-size: 9px;
    color: #554;
    letter-spacing: 0.5px;
    font-family: "Courier New", Courier, monospace;
}
