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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f5f5;
    color: #333;
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 240px;
    background: #1a1a2e;
    color: #fff;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
}

.nav-links {
    list-style: none;
    padding: 0.5rem 0;
    flex: 1;
}

.nav-links li a {
    display: block;
    padding: 0.75rem 1.5rem;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: all 0.2s;
}

.nav-links li a:hover {
    color: #fff;
    background: rgba(255,255,255,0.05);
}

.nav-links li a.active {
    color: #fff;
    background: rgba(255,255,255,0.1);
    border-left: 3px solid #4a9eff;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.85rem;
}

.user-info {
    display: block;
    margin-bottom: 0.3rem;
    color: rgba(255,255,255,0.8);
}

.logout-link {
    color: rgba(255,255,255,0.5);
    text-decoration: none;
    font-size: 0.8rem;
}

.logout-link:hover {
    color: #fff;
}

main {
    flex: 1;
    min-height: 100vh;
}

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

.content {
    padding: 2rem;
    max-width: 1000px;
}

.content h1 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.card {
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.card h2 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.card h3 {
    font-size: 0.95rem;
    margin-top: 1.2rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.card ol {
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
}

.card ol li {
    margin-bottom: 0.4rem;
    line-height: 1.5;
}

.card p {
    line-height: 1.6;
}

/* Forms */
.form-group {
    margin-bottom: 0.75rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: #555;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #4a9eff;
    box-shadow: 0 0 0 2px rgba(74,158,255,0.15);
}

.form-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
}

.form-inline .form-group {
    margin-bottom: 0;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: background 0.2s;
}

.btn-primary {
    background: #4a9eff;
    color: #fff;
}

.btn-primary:hover {
    background: #3a8eef;
}

.btn-secondary {
    background: #e8e8e8;
    color: #333;
}

.btn-secondary:hover {
    background: #ddd;
}

.btn-danger {
    background: #ff4a4a;
    color: #fff;
}

.btn-danger:hover {
    background: #e63c3c;
}

.btn-small {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
}

.btn-block {
    display: block;
    width: 100%;
}

/* Table */
table {
    width: 100%;
    border-collapse: collapse;
}

table th,
table td {
    padding: 0.6rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

table th {
    font-size: 0.8rem;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-table th {
    text-transform: none;
    letter-spacing: normal;
    color: #555;
    font-size: 0.9rem;
    width: 180px;
}

.input-inline {
    padding: 0.3rem 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.85rem;
    width: 150px;
}

.select-inline {
    padding: 0.3rem 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.85rem;
}

.inline-form {
    display: inline;
}

.actions {
    white-space: nowrap;
}

.actions .btn {
    margin-right: 0.3rem;
}

code {
    background: #f0f0f0;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-size: 0.85em;
}

.badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    font-size: 0.8rem;
    font-weight: 500;
}

.badge-guest {
    background: #e8f5e9;
    color: #2e7d32;
}

.muted {
    color: #888;
    font-size: 0.9rem;
}

/* Alerts */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-error {
    background: #fff0f0;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

.alert-success {
    background: #f0fff0;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

/* Login */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    width: 100%;
}

.login-box {
    background: #fff;
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-align: center;
    width: 360px;
}

.login-box h1 {
    margin-bottom: 0.5rem;
}

.login-box p {
    color: #888;
    margin-bottom: 1.5rem;
}

/* Secret toggle */
.secret-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.secret-wrapper .secret-value {
    display: none;
}

.secret-wrapper.visible .secret-mask {
    display: none;
}

.secret-wrapper.visible .secret-value {
    display: inline;
}

.btn-toggle {
    background: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0.15rem 0.4rem;
    cursor: pointer;
    color: #666;
    font-size: 0.8rem;
    line-height: 1;
    vertical-align: middle;
}

.btn-toggle:hover {
    background: #f0f0f0;
    border-color: #bbb;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        position: relative;
        height: auto;
    }

    main.with-sidebar {
        margin-left: 0;
    }

    .nav-links {
        display: flex;
        overflow-x: auto;
    }

    .nav-links li a {
        white-space: nowrap;
        padding: 0.5rem 1rem;
    }

    .nav-links li a.active {
        border-left: none;
        border-bottom: 3px solid #4a9eff;
    }

    body {
        flex-direction: column;
    }

    .form-inline {
        flex-direction: column;
    }

    .form-group input,
    .form-group select {
        width: 100%;
    }

    table {
        font-size: 0.85rem;
    }
}
