@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
    --primary-color: #5F7D8E;
    --primary-light: #F0F4F6;
    --text-main: #334155;
    --text-muted: #64748b;
    --bg-app: #F8FAFC;
    --bg-sidebar: #FFFFFF;
    --card-bg: #FFFFFF;
    --border-soft: #E2E8F0;
}

html, body {
    font-family: 'Manrope', sans-serif;
    background-color: var(--bg-app);
    color: var(--text-main);
    overflow-x: hidden;
}

a, .btn-link {
    color: var(--primary-color);
}

.btn-primary {
    background-color: var(--primary-color);
    border: none;
    border-radius: 0.75rem;
    padding: 0.6rem 1.25rem;
    font-weight: 600;
}

.btn-light {
    background-color: var(--primary-light);
    color: var(--primary-color);
    border: none;
    border-radius: 0.75rem;
}

.page {
    position: relative;
    display: flex;
    flex-direction: row;
}

/* Sidebar Styling */
.sidebar {
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-soft);
    width: 280px;
    height: 100vh;
    position: sticky;
    top: 0;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.sidebar .navbar-brand {
    font-weight: 800;
    color: var(--text-main);
    font-size: 1.25rem;
    padding-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar .nav-item {
    margin-bottom: 0.25rem;
}

.sidebar .nav-link {
    color: var(--text-muted);
    font-weight: 500;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar .nav-link:hover {
    background-color: var(--primary-light);
    color: var(--primary-color);
}

.sidebar .nav-link.active {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
}

/* Main Content Area */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.top-row {
    height: 4rem;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 2rem;
    background-color: transparent;
}

.content {
    padding: 1rem 2rem 3rem 2rem;
}

/* Card & Component Styles */
.card-stat {
    background: var(--card-bg);
    border: 1px solid var(--border-soft);
    border-radius: 1rem;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    transition: transform 0.2s;
}

.card-action {
    background: var(--card-bg);
    border: 1px solid var(--border-soft);
    border-radius: 1.25rem;
    padding: 2rem;
    cursor: pointer;
    height: 100%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.card-action:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -10px rgba(0,0,0,0.08);
    border-color: var(--primary-color);
}

/* Notes card — decorative top-right accent circle */
.card-action-highlight {
    overflow: hidden;
    position: relative;
}
.card-action-highlight::before {
    content: '';
    position: absolute;
    top: -2.5rem;
    right: -2.5rem;
    width: 8rem;
    height: 8rem;
    border-radius: 50%;
    background: rgba(29, 78, 216, 0.06);
    transition: transform 0.5s ease;
    pointer-events: none;
}
.card-action-highlight:hover::before {
    transform: scale(1.5);
}

/* Card action footer link */
.hub-card-footer {
    display: flex;
    align-items: center;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-top: 1rem;
    transition: transform 0.2s;
}
.card-action:hover .hub-card-footer {
    transform: translateX(3px);
}

/* Utility: max-width cap for content columns */
.max-w-400 { max-width: 400px; }
.max-w-800 { max-width: 800px; }

/* Hub canvas wrapper */
.hub-canvas {
    max-width: 1100px;
    padding: 0.5rem 0 3rem;
}

/* Section label */
.hub-section-label {
    font-size: 0.6875rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

/* Stat tile */
.hub-stat {
    background: var(--card-bg);
    border: 1px solid var(--border-soft);
    border-radius: 1rem;
    padding: 1.125rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    text-align: center;
    transition: box-shadow 0.2s;
    position: relative;
}
.hub-stat:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.hub-stat-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.625rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.25rem;
}
.hub-stat-icon .material-icons { font-size: 1.2rem; }
.hub-stat-value {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1;
}
.hub-stat-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Icon badge used inside content cards */
.hub-card-icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.hub-card-icon .material-icons { font-size: 1.35rem; }

/* Integration tile */
.hub-integration-tile {
    background: var(--bg-app);
    border: 1px solid var(--border-soft);
    border-radius: 0.875rem;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    height: 100%;
}
.hub-integration-icon { font-size: 1.5rem; }
.hub-integration-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

/* Status badges */
.hub-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
}
.hub-badge--on    { background: #DCFCE7; color: #16A34A; }
.hub-badge--off   { background: #FEE2E2; color: #DC2626; }
.hub-badge--paused { background: #F1F5F9; color: #64748B; }
.hub-badge--live  { background: rgba(134,239,172,0.2); color: #86EFAC; font-size: 0.65rem; font-weight: 700; padding: 0.2rem 0.65rem; border-radius: 9999px; }

/* ── Dark Sync Status card ───────────────────────────────────── */
.hub-sync-card {
    background: #0F172A;
    border-radius: 1.25rem;
    padding: 2rem;
    color: white;
}
.hub-sync-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.875rem;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #BAE6FD;
}
.hub-sync-icon .material-icons { font-size: 1.5rem; }
.hub-sync-spin .material-icons {
    animation: hub-spin 1.4s linear infinite;
}
@@keyframes hub-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
.hub-sync-desc {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.55);
    margin-bottom: 1.25rem;
}
.hub-sync-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: rgba(255,255,255,0.06);
    border-radius: 0.875rem;
    padding: 1rem 1.25rem;
    flex-wrap: wrap;
}
.hub-sync-meta-label {
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.35);
    margin-bottom: 0.15rem;
}
.hub-sync-meta-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
    margin: 0;
}
.hub-sync-btn {
    background: white;
    color: #0F172A;
    font-size: 0.8125rem;
    font-weight: 700;
    padding: 0.45rem 1.25rem;
    border-radius: 0.5rem;
    border: none;
    transition: background 0.15s;
}
.hub-sync-btn:hover:not(:disabled) { background: #BAE6FD; }
.hub-sync-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.hub-sync-btn-outline {
    background: transparent;
    color: rgba(255,255,255,0.75);
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0.45rem 1.25rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(255,255,255,0.2);
    transition: border-color 0.15s, color 0.15s;
}
.hub-sync-btn-outline:hover { border-color: rgba(255,255,255,0.5); color: white; }

/* Bootstrap doesn't have border-end-lg — add it */
@@media (min-width: 992px) {
    .border-end-lg {
        border-right: 1px solid var(--border-soft) !important;
    }
}

.section-header {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    margin-top: 2.5rem;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Responsive adjustments */
@media (max-width: 767.98px) {
    .page {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
}


.content {
    padding-top: 1.1rem;
}

.navbar-toggler {
    background-color: rgba(255, 255, 255, 0.1);
}

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

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    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;
    }

@media (max-width: 767.98px) {
    .main .top-row:not(.auth) {
        display: none;
    }

    .main .top-row.auth {
        justify-content: space-between;
    }

    .main .top-row a, .main .top-row .btn-link {
        margin-left: 0;
    }
}

@media (min-width: 768px) {
    .page {
        flex-direction: row;
    }

    .sidebar {
        width: 250px;
        height: 100vh;
        position: sticky;
        top: 0;
    }

    .main .top-row {
        position: sticky;
        top: 0;
    }

    .main > div {
        padding-left: 2rem !important;
        padding-right: 1.5rem !important;
    }

    .navbar-toggler {
        display: none;
    }

    .sidebar .collapse {
        /* Never collapse the sidebar for wide screens */
        display: block;
    }
}

h1:focus {
    outline: none;
}

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

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

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

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

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* 
   Serene Workspace - Border Left Accent Styling
   Apply this class to your card containers to add a 
   clean, modern color highlight on the left edge.
*/

.border-left-accent {
    border-left: 4px solid var(--primary-color, #5F7D8E);
    border-top-left-radius: 1rem;
    border-bottom-left-radius: 1rem;
    /* Ensure the border doesn't overlap the card's main border */
    margin-left: -1px; 
}

/* Color Variants for different metric types */

/* Primary / Documents */
.border-left-accent-primary {
    border-left-color: #5F7D8E;
}

/* Success / Active / Processed */
.border-left-accent-success {
    border-left-color: #10B981;
}

/* Warning / Awaiting / Pending */
.border-left-accent-warning {
    border-left-color: #F59E0B;
}

/* Info / Prompts / Notes */
.border-left-accent-info {
    border-left-color: #3B82F6;
}

/* Subtle / Muted / History */
.border-left-accent-muted {
    border-left-color: #94A3B8;
}

/* Border Left Accent Usage Example
   <div class="card-stat border-left-accent border-left-accent-primary">
       <div class="h4">124</div>
       <div class="text-muted">Documents</div>
   </div>
*/

/* Radzen Dialog Theme Customization */
:root {
    --rz-dialog-border-radius: 1.25rem;
    --rz-dialog-titlebar-background-color: #FFFFFF;
    --rz-dialog-titlebar-color: var(--text-main);
    --rz-dialog-background-color: #FFFFFF;
    --rz-dialog-box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --rz-primary: var(--primary-color) !important;
    --rz-primary-dark: #4a6371 !important; /* slightly darker shade of primary color */
    --rz-form-field-focus-color: var(--primary-color) !important;
}

.rz-dialog-titlebar {
    border-bottom: 1px solid var(--border-soft) !important;
    padding: 1.5rem 1.5rem 1rem 1.5rem !important;
}

.rz-dialog-title {
    font-weight: 700 !important;
    font-size: 1.25rem !important;
    font-family: 'Manrope', sans-serif !important;
}

.rz-dialog-content {
    padding: 1rem 1.5rem 1.5rem 1.5rem !important;
}

.rz-dialog-titlebar-close {
    background: var(--primary-light) !important;
    color: var(--primary-color) !important;
    border-radius: 50% !important;
    width: 32px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
}

.rz-dialog-titlebar-close:hover {
    background: var(--primary-color) !important;
    color: white !important;
}

/* ── Admin Dashboard ──────────────────────────────────────────────────────── */

.admin-stat-card {
    background: #ffffff;
    border-radius: 1rem;
    padding: 1.5rem;
    border-left: 4px solid #5F7D8E;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
}

.admin-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

.admin-stat-card.accent-primary   { border-left-color: #5F7D8E; }
.admin-stat-card.accent-success   { border-left-color: #10B981; }
.admin-stat-card.accent-warning   { border-left-color: #F59E0B; }
.admin-stat-card.accent-info      { border-left-color: #3B82F6; }
.admin-stat-card.accent-muted     { border-left-color: #94A3B8; }

.admin-stat-label {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.admin-stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.1;
}

.admin-stat-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    opacity: 0.4;
}

.admin-card {
    background: #ffffff;
    border: 1px solid var(--border-soft);
    border-radius: 1rem;
    padding: 2rem;
    height: 100%;
}

.section-header {
    font-size: 0.6875rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.admin-canvas {
    max-width: 1200px;
    padding: 0.5rem 0 3rem;
}
