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

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

body.auth {
    background-color: #21232a;
    display: grid;
    place-items: center;
    width: 100vw;
    padding: 1rem;
}

body.dashboard {
    background-color: #21232a;
}

.card {
    background-color: #353944;
    border: 1px solid #323641;
    border-radius: 12px;
    padding: 0;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

body.auth .card {
    padding: 2.5rem;
    margin: 0;
}

.card h1 {
    color: #eef0f3;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.card h2 {
    color: #eef0f3;
    font-size: 1.1rem;
    margin: 0;
    padding: 1.25rem 1.5rem 0.8rem;
    border-bottom: 1px solid #323641;
}

.card p {
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.panel-body {
    padding: 1.25rem 1.5rem;
}

.panel-body table {
    width: 100%;
    border-collapse: collapse;
}

.panel-body th,
.panel-body td {
    text-align: left;
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(120, 136, 164, 0.25);
    color: #dfe3ea;
    font-size: 0.9rem;
}

.panel-body th {
    color: #b8bcc4;
    font-weight: 500;
    width: 40%;
}

.panel-body tr:last-child th,
.panel-body tr:last-child td {
    border-bottom: none;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group>label {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 0.35rem;
    color: #878c9a;
}

.form-group input:not([type="radio"]):not([type="checkbox"]),
.form-group textarea,
.form-group select {
    width: 100%;
    height: 2.4rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid #454a5b;
    border-radius: 4px;
    background-color: #252830;
    color: #d8dbdf;
    font-size: 0.95rem;
    font-family: inherit;
    line-height: normal;
    box-sizing: border-box;
}

.form-group textarea {
    height: auto;
    min-height: 5rem;
    font-family: monospace;
    font-size: 0.85rem;
    resize: vertical;
}

.form-group input:-webkit-autofill,
.form-group input:-webkit-autofill:hover,
.form-group input:-webkit-autofill:focus,
.form-group textarea:-webkit-autofill,
.form-group select:-webkit-autofill {
    -webkit-text-fill-color: #d8dbdf !important;
    -webkit-box-shadow: 0 0 0px 1000px #252830 inset !important;
    box-shadow: 0 0 0px 1000px #252830 inset !important;
    transition: background-color 5000s ease-in-out 0s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #03a9f4;
    color: #eef0f3;
}

.form-group input:disabled,
.form-group textarea:disabled,
.form-group select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.form-group-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-hint {
    color: #878c9a;
    font-size: 0.8rem;
    display: block;
    margin-top: 0.35rem;
}

.form-actions {
    margin-top: 1.5rem;
    text-align: right;
}

.form-actions .btn {
    width: auto;
    padding: 0.75rem 2rem;
    font-weight: 600;
}

.btn {
    display: inline-block;
    width: 100%;
    padding: 0.65rem;
    border: none;
    border-radius: 4px;
    background-color: #03a9f4;
    color: #fff;
    font-size: 0.95rem;
    cursor: pointer;
    margin-top: 0.5rem;
    text-align: center;
    text-decoration: none;
    line-height: normal;
    box-sizing: border-box;
}

.btn:hover {
    background-color: #0288d1;
}

a.btn {
    width: auto;
    padding: 0.65rem 1.5rem;
}

.btn-inline {
    width: auto;
    padding: 0.6rem 1.25rem;
    font-size: 0.85rem;
    margin-top: 0;
    white-space: nowrap;
}

.btn-lg {
    padding: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
}

.btn-success {
    background-color: #4caf50;
}

.btn-success:hover {
    background-color: #43a047;
}

.btn-danger {
    background-color: #f33628;
}

.btn-danger:hover {
    background-color: #d32f2f;
}

.btn-secondary {
    background-color: #454a5b;
}

.btn-secondary:hover {
    background-color: #575e73;
}

.btn-table-action {
    width: auto;
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    margin-top: 0;
}

.page-container {
    max-width: 960px;
    margin: 0 auto;
}

.page-container-narrow {
    width: 40vw;
    margin: 0;
}

.page-container-compact {
    width: min(30rem, 100%);
    max-width: 480px;
    margin: 0;
    padding: 2rem;
}

@media (max-width: 1000px) {
    .page-container-narrow {
        width: 100%;
    }

    .page-container-compact {
        width: 100%;
    }
}

@media (max-width: 500px) {
    .page-container-compact {
        padding: 1.5rem;
    }
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.page-title {
    color: #eef0f3;
    font-size: 1.5rem;
    margin: 0 0 1.5rem 0;
}

.page-header .page-title {
    margin: 0;
}

.dashboard-support {
    margin-top: 1.5rem;
    color: #878c9a;
    font-size: 0.85rem;
}

.page-subtitle {
    color: #878c9a;
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.card-subtitle {
    text-align: center;
    color: #878c9a;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.info-box {
    background-color: #252830;
    border: 1px solid #454a5b;
    border-radius: 6px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.info-box-title {
    color: #eef0f3;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.info-grid {
    font-size: 0.85rem;
    color: #b8bcc4;
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 0.4rem;
}

.system-info-grid {
    grid-template-columns: 200px 1fr;
    row-gap: 0.75rem;
    font-size: 0.9rem;
    align-items: center;
}

.info-grid .highlight {
    color: #03a9f4;
}

.license-preview-box {
    background-color: #252830;
    border: 1px solid rgba(120, 136, 164, 0.25);
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1.25rem;
}

.license-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    font-size: 0.9rem;
}

.license-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    margin-bottom: 0.25rem;
    color: #878c9a;
}

.license-value-highlight {
    color: #4fd1c5;
    font-size: 1.1rem;
}

.license-value-bold {
    color: #eef0f3;
    font-weight: 600;
}

.license-value {
    color: #eef0f3;
}

.setup-section {
    margin-bottom: 1.5rem;
}

.setup-section-last {
    margin-bottom: 2rem;
}

.setup-section-title {
    color: #eef0f3;
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

label.radio-card {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 0.75rem !important;
    color: #eef0f3 !important;
    cursor: pointer;
    background-color: #252830;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    border: 1px solid #454a5b;
    margin-bottom: 0 !important;
    font-size: 0.95rem;
    transition: border-color 0.15s ease;
}

label.radio-card:hover,
label.checkbox-card:hover {
    border-color: #03a9f4;
}

label.checkbox-card {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 0.75rem !important;
    color: #eef0f3 !important;
    cursor: pointer;
    background-color: #252830;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    border: 1px solid #454a5b;
    margin-bottom: 0 !important;
    font-size: 0.95rem;
    transition: border-color 0.15s ease;
}

.radio-card input[type="radio"],
.checkbox-card input[type="checkbox"] {
    accent-color: #03a9f4;
    width: 1.15rem !important;
    min-width: 1.15rem !important;
    max-width: 1.15rem !important;
    height: 1.15rem !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    cursor: pointer;
    flex: 0 0 auto !important;
}

.radio-title {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
}

.radio-desc {
    color: #878c9a;
    font-size: 0.8rem;
    line-height: 1.3;
}

.input-copy-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.25rem;
    width: 100%;
}

.input-copy-group input {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    padding: 0.6rem 0.75rem;
    font-family: monospace;
    font-size: 0.85rem;
    background-color: #1c1e24;
    color: #4fd1c5;
    cursor: default;
    border: 1px solid #454a5b;
    border-radius: 4px;
}

.input-copy-group .btn,
.input-copy-group .btn-inline {
    flex: 0 0 auto;
    width: auto !important;
    margin-top: 0 !important;
    padding: 0.6rem 1.25rem;
    font-size: 0.85rem;
    white-space: nowrap;
}

.banner-success {
    background-color: rgba(76, 175, 80, 0.15);
    border: 1px solid #4caf50;
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.banner-success-title {
    color: #4caf50;
    font-size: 1rem;
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.banner-success-title .email {
    color: #ffffff;
}

.banner-success-desc {
    color: #d8dbdf;
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.banner-warning {
    background-color: rgba(243, 54, 40, 0.15);
    border: 1px solid #f33628;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    color: #f33628;
    font-size: 0.85rem;
}

.invite-form {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

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

.invite-form .email-field {
    flex: 1;
    min-width: 250px;
}

.invite-form .role-field {
    width: 140px;
}

.invite-form .btn {
    width: auto;
    height: 2.4rem;
    padding: 0 1.5rem;
    margin-top: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

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

.table-form-inline {
    margin: 0;
    display: inline;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    font-size: 0.75rem;
    line-height: 1.2;
    background-color: #03a9f4;
    color: #fff;
    vertical-align: middle;
    box-sizing: border-box;
}

.badge-owner {
    background-color: #03a9f4;
    color: #fff;
}

.badge-user {
    background-color: #454a5b;
    color: #fff;
}

.badge-muted {
    background-color: #878c9a;
    color: #fff;
}

.badge-active {
    background-color: rgba(76, 175, 80, 0.15);
    border: 1px solid #4caf50;
    color: #4caf50;
}

.badge-disabled {
    background-color: rgba(243, 54, 40, 0.15);
    border: 1px solid #f33628;
    color: #f33628;
}

code,
.code-inline {
    color: #4fd1c5;
    background-color: #1c1e24;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-family: monospace;
    font-size: 0.85rem;
}

.font-mono {
    font-family: monospace;
    font-size: 0.85rem;
}

.text-muted {
    color: #878c9a;
}

.text-center {
    text-align: center;
}

.mt-md {
    margin-top: 1.25rem;
}

.mt-lg {
    margin-top: 1.5rem;
}

.mb-md {
    margin-bottom: 1rem;
}

.mb-lg {
    margin-bottom: 1.5rem;
}

.hidden {
    display: none;
}

.link {
    display: block;
    text-align: center;
    margin-top: 1rem;
    color: #03a9f4;
    text-decoration: none;
    font-size: 0.85rem;
}

.link:hover {
    text-decoration: underline;
}

.error {
    background-color: rgba(243, 54, 40, 0.15);
    border: 1px solid #f33628;
    color: #f33628;
    padding: 0.6rem 0.75rem;
    border-radius: 4px;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.success {
    background-color: rgba(76, 175, 80, 0.15);
    border: 1px solid #4caf50;
    color: #4caf50;
    padding: 0.6rem 0.75rem;
    border-radius: 4px;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

nav.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #252830;
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid #323641;
}

.nav-left {
    display: flex;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.brand img {
    height: 28px;
    width: 28px;
}

.brand span {
    color: #eef0f3;
    font-weight: 600;
    font-size: 1.05rem;
}

.nav-links {
    display: flex;
    gap: 1.25rem;
    margin-left: 2rem;
}

.nav-links a {
    color: #b8bcc4;
    text-decoration: none;
    font-size: 0.9rem;
}

.nav-links a:hover {
    color: #03a9f4;
}

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

.nav-btn {
    margin-top: 0;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.user-menu {
    position: relative;
}

.user-menu summary {
    cursor: pointer;
    list-style: none;
    color: #eef0f3;
    font-weight: 500;
    font-size: 0.85rem;
}

.user-menu summary::-webkit-details-marker {
    display: none;
}

.user-menu[open] summary {
    color: #03a9f4;
}

.caret {
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
    vertical-align: middle;
    transition: transform 0.15s ease;
}

.user-menu[open] .caret {
    transform: rotate(180deg);
}

.user-menu-dropdown {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 0.5rem;
    background-color: #323641;
    border: 1px solid #454a5b;
    border-radius: 4px;
    padding: 0.4rem;
    display: flex;
    flex-direction: column;
    min-width: 140px;
    z-index: 10;
}

.user-menu-dropdown a {
    display: block;
    padding: 0.4rem 0.6rem;
    border-radius: 4px;
    color: #b8bcc4;
    text-decoration: none;
    font-size: 0.85rem;
}

.user-menu-dropdown a:hover {
    background-color: #252830;
    color: #03a9f4;
}

main {
    padding: 2rem;
    max-width: 1280px;
    margin: 0 auto;
}

code.value {
    display: inline-block;
    background-color: #252830;
    color: #4fd1c5;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    text-align: left;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #454a5b;
    font-size: 0.9rem;
}

th {
    color: #878c9a;
    font-weight: 500;
}

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

.dashboard-grid .card {
    margin-bottom: 0;
    min-width: 0;
    width: 100%;
}

.overview-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
}

.overview-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.overview-item+.overview-item {
    border-left: 1px solid #323641;
    padding-left: 1.5rem;
}

.label {
    color: #b8bcc4;
    font-size: 0.95rem;
    font-weight: 500;
}

.metric-row {
    display: flex;
    align-items: baseline;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.metric-value {
    color: #eef0f3;
    font-size: 2.2rem;
    line-height: 1;
    font-weight: 700;
}

.metric-meta {
    color: #b8bcc4;
    font-size: 0.85rem;
}

.full-card {
    grid-column: 2;
}

@media (max-width: 700px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

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

    .overview-item+.overview-item {
        border-left: none;
        border-top: 1px solid #323641;
        padding-left: 0;
        padding-top: 1rem;
    }

    .full-card {
        grid-column: 1;
    }
}

.license-expiry {
    margin-top: 1rem;
    color: #878c9a;
}

.inline-link {
    color: #03a9f4;
    text-decoration: none;
}

.inline-link:hover {
    text-decoration: underline;
}

.status-muted {
    color: #878c9a;
}

@media (max-width: 700px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

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