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

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

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

.navbar {
    background: #1a1a2e;
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    color: white;
    text-decoration: none;
    font-size: 1.4rem;
    font-weight: 700;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-link {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.nav-link:hover {
    color: white;
    background: rgba(255,255,255,0.1);
}

.nav-user {
    color: rgba(255,255,255,0.6);
    font-size: 0.9rem;
}

.nav-form {
    display: inline;
}

.btn-logout {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.9rem;
}

.btn-logout:hover {
    background: #c0392b;
}

main {
    flex: 1;
    padding: 2rem 0;
}

.hero {
    text-align: center;
    padding: 4rem 0;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #1a1a2e;
}

.hero p {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 2rem;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
}

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    text-align: center;
}

.feature-card h3 {
    margin-bottom: 0.5rem;
    color: #1a1a2e;
}

.auth-container {
    max-width: 420px;
    margin: 2rem auto;
    background: white;
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
}

.auth-container h2 {
    margin-bottom: 1.5rem;
    text-align: center;
    color: #1a1a2e;
}

.auth-form .form-group {
    margin-bottom: 1.2rem;
}

.auth-form label {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 500;
    color: #555;
}

.auth-form input {
    width: 100%;
    padding: 0.7rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.auth-form input:focus {
    outline: none;
    border-color: #4a90d9;
}

.auth-link {
    text-align: center;
    margin-top: 1.5rem;
    color: #666;
}

.auth-link a {
    color: #4a90d9;
    text-decoration: none;
}

.dashboard h2 {
    margin-bottom: 1.5rem;
    color: #1a1a2e;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.card h3 {
    margin-bottom: 1rem;
    color: #1a1a2e;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 0.5rem;
}

.instance-status {
    margin-bottom: 1rem;
}

.instance-port {
    margin-top: 0.5rem;
    color: #666;
}

.instance-url {
    margin-top: 0.5rem;
    color: #666;
    word-break: break-all;
}

.status-info p {
    margin: 0.4rem 0;
}

.status-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-active, .status-running {
    background: #d4edda;
    color: #155724;
}

.status-inactive, .status-stopped {
    background: #f8d7da;
    color: #721c24;
}

.status-starting, .status-stopping {
    background: #fff3cd;
    color: #856404;
}

.status-error {
    background: #f8d7da;
    color: #721c24;
}

.role-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    background: #e8eaf6;
    color: #3949ab;
    border-radius: 4px;
    font-size: 0.85rem;
}

.card-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.card-actions.vertical {
    flex-direction: column;
}

.btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s;
}

.btn-primary {
    background: #4a90d9;
    color: white;
}

.btn-primary:hover {
    background: #357abd;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

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

.btn-success {
    background: #27ae60;
    color: white;
}

.btn-success:hover {
    background: #219a52;
}

.btn-warning {
    background: #f39c12;
    color: white;
}

.btn-warning:hover {
    background: #e67e22;
}

.btn-full {
    width: 100%;
}

.btn-large {
    padding: 0.8rem 2rem;
    font-size: 1.1rem;
}

.btn-small {
    padding: 0.3rem 0.7rem;
    font-size: 0.85rem;
}

.alert {
    padding: 0.8rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-error ul {
    margin: 0.3rem 0 0 1.2rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.data-table {
    width: 100%;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border-collapse: collapse;
}

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

.data-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
}

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

.data-table .actions {
    display: flex;
    gap: 0.5rem;
}

.inline-form {
    display: inline;
}

.admin-actions {
    margin-bottom: 1.5rem;
}

.footer {
    background: #1a1a2e;
    color: rgba(255,255,255,0.6);
    padding: 1.5rem 0;
    text-align: center;
    margin-top: auto;
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 1.8rem;
    }

    .hero-actions {
        flex-direction: column;
        align-items: center;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .data-table {
        font-size: 0.9rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.5rem;
    }
}
