html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5I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I2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto 0 auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: #c02d76;
}

/* Login Layout */
.login-layout {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f5f5f5;
}

.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 1rem;
}

.login-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 400px;
}

.login-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.logo-icon {
    background: #111;
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.logo-name {
    font-weight: 700;
    font-size: 1rem;
    color: #111;
}

.logo-subtitle {
    font-size: 0.65rem;
    color: #888;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.login-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111;
    margin-bottom: 0.25rem;
}

.login-subtitle {
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 1.75rem;
}

.login-card .form-group {
    margin-bottom: 1.25rem;
}

.login-card .form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #111;
    margin-bottom: 0.4rem;
}

.login-card .form-control {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.login-card .form-control:focus {
    border-color: #111;
    box-shadow: none;
    outline: none;
}

.password-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.forgot-link {
    font-size: 0.8rem;
    color: #111;
    text-decoration: underline;
}

.forgot-link:hover {
    color: #333;
}

.btn-login {
    width: 100%;
    padding: 0.7rem;
    background: #111;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    margin-top: 0.5rem;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-login:hover {
    background: #333;
}

.btn-login:disabled {
    background: #666;
    cursor: not-allowed;
}

/* Tenants Page */
.tenants-page {
    width: 100%;
}

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

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111;
    margin: 0;
}

.btn-create {
    background: #111;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0.55rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-create:hover:not(:disabled) {
    background: #333;
}

.btn-create:disabled {
    background: #666;
    cursor: not-allowed;
}

.filters-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.filters-row .filters-box {
    display: flex;
    min-width: 50%;
}

.filters-row .filters-box div {
    padding: 0 10px;
}

.search-box {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-box .search-icon {
    position: absolute;
    left: 5%;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
}

.search-box input {
    width: 100%;
    padding: 0.55rem 0.75rem 0.55rem 2.25rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.875rem;
    background: #fff;
    box-sizing: border-box;
}

.search-box input:focus {
    outline: none;
    border-color: #111;
}

.tenant-count {
    font-size: 0.85rem;
    color: #6b7280;
    white-space: nowrap;
}

.table-container {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
}

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

.tenants-table thead th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.tenants-table tbody td {
    padding: 0.85rem 1rem;
    font-size: 0.875rem;
    color: #374151;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

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

.tenants-table tbody tr:hover {
    background-color: #f9fafb;
}

.tenant-name {
    font-weight: 600;
    color: #111;
}

.tenant-subdomain {
    font-size: 0.75rem;
    color: #9ca3af;
}

.domain-link {
    color: #818cf8;
    text-decoration: none;
    transition: color 0.2s;
}

.domain-link:hover {
    color: #a5b4fc;
    text-decoration: underline;
}

.loading-cell {
    text-align: center;
    padding: 2rem 1rem !important;
    color: #9ca3af;
}

/* Plan Badges */
.badge-plan {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
}

.plan-basic {
    background: #f3f4f6;
    color: #374151;
}

.plan-pro {
    background: #f3f4f6;
    color: #374151;
}

.plan-enterprise {
    background: #f3f4f6;
    color: #374151;
}

/* Status */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.4rem;
}

.status-active {
    background-color: #22c55e;
}

.status-inactive {
    background-color: #9ca3af;
}

.status-blocked {
    background-color: #ef4444;
}

/* Pagination */
.pagination-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.pagination-info {
    font-size: 0.85rem;
    color: #6b7280;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.page-btn {
    padding: 0.4rem 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #fff;
    color: #374151;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s;
}

.page-btn:hover:not(:disabled):not(.active) {
    background: #f3f4f6;
}

.page-btn.active {
    background: #111;
    color: #fff;
    border-color: #111;
}

.page-btn:disabled {
    color: #d1d5db;
    cursor: not-allowed;
}

/* Settings Page */
.settings-page {
    width: 100%;
}

.settings-page h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111;
    margin: 0 0 2rem;
}

.coming-soon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    text-align: center;
}

.coming-soon-icon {
    color: #9ca3af;
    margin-bottom: 1.5rem;
}

.coming-soon h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111;
    margin: 0 0 0.5rem;
}

.coming-soon-text {
    font-size: 0.9rem;
    color: #6b7280;
    margin: 0 0 1.5rem;
    line-height: 1.5;
}

.coming-soon-label {
    display: inline-block;
    padding: 0.3rem 1rem;
    background: #f3f4f6;
    border-radius: 20px;
    font-size: 0.8rem;
    color: #6b7280;
    font-weight: 500;
}

/* Sidebar Panel */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 900;
}

.sidebar-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 420px;
    max-width: 90vw;
    height: 100vh;
    background: #fff;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
    z-index: 901;
    display: flex;
    flex-direction: column;
    animation: slide-in-right 0.25s ease;
}

@keyframes slide-in-right {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.sidebar-header h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #111;
    margin: 0;
}

.sidebar-close {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    transition: background 0.15s;
}

.sidebar-close:hover {
    background: #f3f4f6;
    color: #111;
}

.sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.sidebar-body .form-group {
    margin-bottom: 1.15rem;
}

.sidebar-body .form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.35rem;
}

.sidebar-body .form-control {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.875rem;
    background: #fff;
    box-sizing: border-box;
    transition: border-color 0.15s;
}

.sidebar-body .form-control:focus {
    outline: none;
    border-color: #111;
}

.sidebar-body select.form-control {
    appearance: auto;
}

.create-error {
    padding: 0.6rem 0.85rem;
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.sidebar-footer {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    padding: 1rem 1.5rem;
    border-top: 1px solid #e5e7eb;
}

/* Status Filter */
.filter-status select {
    padding: 0.55rem 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.875rem;
    background: #fff;
    box-sizing: border-box;
    min-width: 160px;
    cursor: pointer;
}

.filter-status select:focus {
    outline: none;
    border-color: #111;
}

/* Sortable Headers */
.sortable-header {
    cursor: pointer;
    user-select: none;
    transition: color 0.15s;
}

.sortable-header:hover {
    color: #111;
}

.sort-icon {
    font-size: 0.6rem;
    margin-left: 0.3rem;
    color: #111;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.35rem;
    align-items: center;
}

.btn-action {
    background: none;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 0.35rem 0.5rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.btn-edit {
    color: #6b7280;
}

.btn-edit:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
    color: #111;
}

.btn-deactivate {
    color: #ef4444;
}

.btn-deactivate:hover:not(:disabled) {
    background: #fef2f2;
    border-color: #ef4444;
}

.btn-deactivate:disabled {
    color: #d1d5db;
    cursor: not-allowed;
}

.text-muted {
    color: #d1d5db;
    font-size: 0.85rem;
}

/* Toast */
.toast-message {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 1rem;
    animation: toast-in 0.3s ease;
}

.toast-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.toast-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Confirmation Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
    z-index: 1050;
    background: rgba(0, 0, 0, 0.4);
}

.modal-dialog {
    background: #fff;
    border-radius: 12px;
    padding: 2rem;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    pointer-events: auto;
}

.modal-dialog h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #111;
    margin: 0 0 0.75rem;
}

.modal-dialog p {
    font-size: 0.9rem;
    color: #6b7280;
    margin: 0 0 1.5rem;
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

.btn-modal {
    padding: 0.55rem 1.25rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
}

.btn-modal:active {
    transform: scale(0.97);
}

.btn-cancel {
    background: #f3f4f6;
    color: #374151;
}

.btn-cancel:hover {
    background: #d1d5db;
    color: #111827;
}

.btn-confirm {
    background: #ef4444;
    color: #fff;
}

.btn-confirm:hover {
    background: #dc2626;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.35);
}