*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body.nebula-body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #050710;
    color: #e5e7eb;
}

a {
    color: inherit;
    text-decoration: none;
}

.nebula-layout {
    display: flex;
    min-height: 100vh;
}

.nebula-sidebar {
    width: 260px;
    background: radial-gradient(circle at top left, #1f2937 0, #020617 55%);
    border-right: 1px solid rgba(148, 163, 184, 0.16);
    padding: 20px 18px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.nebula-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nebula-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.nebula-brand-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nebula-app-name {
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    font-size: 13px;
    color: #e5e7eb;
}

.nebula-app-version {
    font-size: 11px;
    color: #9ca3af;
    margin-left: 8px;
}

.nebula-project-name {
    font-size: 13px;
    color: #cbd5f5;
}

.nebula-admin-name {
    font-size: 12px;
    color: #9ca3af;
}

.nebula-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nebula-nav-item {
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 13px;
    color: #e5e7eb;
    display: block;
    transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.nebula-nav-item:hover {
    background: rgba(148, 163, 184, 0.18);
    transform: translateX(2px);
}

.nebula-nav-danger {
    color: #fecaca;
}

.nebula-main {
    flex: 1;
    padding: 20px 26px;
}

.nebula-main-inner {
    max-width: 1120px;
    margin: 0 auto;
}

.nebula-card {
    background: radial-gradient(circle at top left, rgba(55, 65, 81, 0.9) 0, rgba(15, 23, 42, 0.96) 52%);
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 16px;
    padding: 18px 20px;
    margin-bottom: 18px;
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.9);
}

.nebula-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.nebula-card-title {
    font-size: 16px;
    font-weight: 600;
}

.nebula-card-subtitle {
    font-size: 13px;
    color: #9ca3af;
}

.nebula-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    background: rgba(37, 99, 235, 0.15);
    color: #bfdbfe;
    border: 1px solid rgba(59, 130, 246, 0.45);
}

.nebula-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.nebula-stat {
    padding: 10px 11px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.25);
}

.nebula-stat-label {
    font-size: 11px;
    color: #9ca3af;
    margin-bottom: 3px;
}

.nebula-stat-value {
    font-size: 15px;
    font-weight: 600;
}

.nebula-stat-sub {
    font-size: 11px;
    color: #6b7280;
}

/* Forms */

.nebula-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.nebula-form-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.nebula-field {
    flex: 1;
    min-width: 180px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nebula-label {
    font-size: 12px;
    color: #e5e7eb;
}

.nebula-input,
.nebula-select,
.nebula-textarea {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(55, 65, 81, 0.9);
    border-radius: 10px;
    padding: 8px 10px;
    color: #e5e7eb;
    font-size: 13px;
    outline: none;
    width: 100%;
}

.nebula-input:focus,
.nebula-select:focus,
.nebula-textarea:focus {
    border-color: rgba(59, 130, 246, 0.9);
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.5);
}

.nebula-textarea {
    min-height: 90px;
    resize: vertical;
}

.nebula-checkbox-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #e5e7eb;
}

.nebula-btn-row {
    margin-top: 6px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.nebula-btn {
    border-radius: 999px;
    padding: 7px 14px;
    font-size: 13px;
    border: none;
    cursor: pointer;
    background: linear-gradient(135deg, #7c3aed, #5b21b6);
    color: #e5e7eb;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: transform 0.1s ease, box-shadow 0.1s ease, opacity 0.1s ease;
}

.nebula-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.5);
}

.nebula-btn-secondary {
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.55);
    color: #e5e7eb;
}

.nebula-btn-danger {
    background: linear-gradient(135deg, #7c3aed, #5b21b6);
}

.nebula-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-top: 8px;
}

.nebula-table th,
.nebula-table td {
    padding: 8px 6px;
    border-bottom: 1px solid rgba(55, 65, 81, 0.9);
}

.nebula-table th {
    text-align: left;
    font-weight: 500;
    color: #9ca3af;
}

.nebula-table tr:hover td {
    background: rgba(31, 41, 55, 0.9);
}

.nebula-pill {
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    display: inline-flex;
    align-items: center;
}

.nebula-pill-green {
    background: rgba(22, 163, 74, 0.15);
    color: #bbf7d0;
    border: 1px solid rgba(34, 197, 94, 0.6);
}

.nebula-pill-red {
    background: rgba(220, 38, 38, 0.15);
    color: #fecaca;
    border: 1px solid rgba(248, 113, 113, 0.7);
}

.nebula-pill-yellow {
    background: rgba(234, 179, 8, 0.15);
    color: #facc15;
    border: 1px solid rgba(250, 204, 21, 0.7);
}

.nebula-alert {
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 10px;
}

.nebula-alert-error {
    background: rgba(127, 29, 29, 0.95);
    border: 1px solid rgba(248, 113, 113, 0.8);
    color: #fee2e2;
}

.nebula-alert-success {
    background: rgba(22, 101, 52, 0.95);
    border: 1px solid rgba(34, 197, 94, 0.8);
    color: #bbf7d0;
}

.nebula-small {
    font-size: 11px;
    color: #9ca3af;
}

/* Login layout (admin + user) */

.nebula-auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top, #1f2937 0, #020617 55%);
}

.nebula-auth-card {
    background: radial-gradient(circle at top left, rgba(55, 65, 81, 0.96) 0, rgba(15, 23, 42, 0.98) 55%);
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    padding: 22px 24px;
    width: 360px;
    box-shadow: 0 22px 40px rgba(15, 23, 42, 0.9);
}

.nebula-auth-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.nebula-auth-title {
    font-size: 18px;
    font-weight: 600;
}

.nebula-auth-subtitle {
    font-size: 12px;
    color: #9ca3af;
}

.nebula-auth-footer {
    margin-top: 12px;
    font-size: 11px;
    color: #6b7280;
    text-align: center;
}
