:root {
    --primary-color: #1b6ec2;
    --primary-dark: #1861ac;
    --primary-light: #258cfb;
    --error-color: #e50000;
    --success-color: #26b050;
    --text-color: #212529;
    --link-color: #006bb7;
    --sidebar-width: 300px;
    --sidebar-collapsed: 78px;
    --transition-speed: 0.3s;
}

html, body {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    height: 100%;
    margin: 0;
}

a, .btn-link {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.2s;
}

.btn-primary {
    color: #fff;
    background-color: var(--primary-color);
    border-color: var(--primary-dark);
    transition: background-color 0.2s, border-color 0.2s;
}

:is(.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 var(--primary-light);
}

.content {
    padding-top: 56px;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--success-color);
}

.invalid {
    outline: 1px solid var(--error-color);
}

.validation-message {
    color: var(--error-color);
}

/* Error boundary */
.blazor-error-boundary {
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='235 51 56 49'%3E%3Cpath fill='%23FFE500' fill-rule='evenodd' d='M263.506 51a2 2 0 0 1 1.1.27l.45.53.53.83L290.185 92l.36.61.11.2c.22.51.34 1.08.34 1.68 0 2.38-2 4.32-4.38 4.32h-46.22c-2.42 0-4.38-1.94-4.38-4.32 0-.3.03-.6.09-.88l.25-.8.7-1.12 22.62-38.5.51-.83.45-.53a2 2 0 0 1 2.9 0Zm-.08 15.02c-2.85 0-4.27 1.11-4.27 3.32 0 .28.02.53.06.75l2.42 13.93 3.59 0 2.44-14.26c.04-.18.05-.34.05-.49 0-2.2-1.43-3.31-4.29-3.31Zm-.01 20.03c-2.53 0-3.79 1.25-3.79 3.74 0 2.49 1.26 3.74 3.79 3.74 2.54 0 3.81-1.25 3.81-3.74 0-2.49-1.27-3.74-3.81-3.74Z'/%3E%3C/svg%3E") no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred.";
    }

/* Checkbox */
.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

/* Modal styles */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: grid;
    place-items: center;
    z-index: 1050;
}

.modal-content {
    --modal-padding: 20px;
    background-color: white;
    padding: var(--modal-padding);
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    max-inline-size: min(80%, 1200px);
    max-block-size: min(80vh, 900px);
    overflow: auto;
}

/* Table styles */
table {
    table-layout: fixed;
    inline-size: 100%;
}

.table td:hover {
    background-color: #f5f5f5;
}

/* Popup styles */
.popup-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0);
    z-index: 19999;
}

.popup-card {
    --popup-padding: 20px;
    background: white;
    border-radius: 8px;
    padding: var(--popup-padding);
    box-shadow: 4px 8px 15px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    overflow-y: auto;
}

/* Animations */
.popup-slide-in {
    animation: slide-in-bottom 0.1s ease-out;
}

.popup-slide-in-top {
    animation: slide-in-top 0.1s ease-out;
}

@keyframes slide-in-bottom {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slide-in-top {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 1.125rem;
    cursor: pointer;
}

/* Layout */
.page {
    display: flex;
    flex-direction: column;
    min-block-size: 100vh;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-inline-start: var(--sidebar-width);
    transition: margin-inline-start var(--transition-speed) ease;
}

/* Sidebar */
.sidebar {
    inline-size: var(--sidebar-width);
    block-size: 100vh;
    position: fixed;
    inset-inline-start: 0;
    inset-block-start: 0;
    background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%);
    z-index: 1000;
    transition: inline-size var(--transition-speed) ease;
    overflow-x: hidden;
}

    .sidebar.collapsed {
        inline-size: var(--sidebar-collapsed);
    }

        .sidebar.collapsed .nav-text,
        .sidebar.collapsed .navbar-brand {
            display: none;
        }

        .sidebar.collapsed + main {
            margin-inline-start: var(--sidebar-collapsed);
        }

/* Nav items */
.nav-item {
    white-space: nowrap;
}

/* Top row */
.top-row {
    block-size: 3.5rem;
    display: flex;
    align-items: center;
}

/* Nav pills */
.nav-pills .nav-link {
    color: #0f328a;
    background-color: transparent;
    transition: background-color 0.2s, color 0.2s;
}

    .nav-pills .nav-link.active {
        background-color: #0f328a;
        color: white;
    }

/* Responsive */
@media (width <= 768px) {
    .sidebar {
        inline-size: var(--sidebar-collapsed);
    }

        .sidebar:not(.collapsed) {
            inline-size: var(--sidebar-width);
        }

    main {
        margin-inline-start: var(--sidebar-collapsed);
    }

    .sidebar:not(.collapsed) + main {
        margin-inline-start: var(--sidebar-width);
    }
}

.activity-table-wrapper {
    width: 100%;
    overflow-x: auto;
    position: relative;
    max-width: 100%;
    scrollbar-width: thin;
}

.grid-container {
    display: grid;
    flex-direction: column;
    width: 100%;
}

.activity-grid {
    display: grid;
    grid-template-columns: 545px 100px 180px 85px 130px 150px 150px 150px 120px 150px;
    align-items: center;
    border-bottom: 1px solid #d6d5d5;
    background: white;
    position: relative;
    height: 42px;
    max-height: 42px;
    box-sizing: border-box;
    min-width: 0;
}


.activity-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: white;
}

.cell.sticky {
    position: sticky;
    left: 0;
    background-color: white;
    z-index: 20;
    min-width: 0;
}

    .cell.sticky:hover {
        background-color: #f5f5f5;
    }

.cell {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
    .cell:hover {
        background-color: #f5f5f5;
    }

</style >
/* DROP ZONE BASE STYLE */
.drop-zone {
    position: absolute;
    top: 100%; /* just below the top-row */
    left: 0;
    width: 100%;
    background: rgba(255, 230, 150, 0.9);
    text-align: center;
    padding: 6px 0;
    z-index: 1100;
    pointer-events: none; /* won't block mouse unless active */
    opacity: 0;
    border: 2px dashed transparent;
    background-color: transparent;
    transition: opacity 0.2s ease;
}

.drop-zone.active {
    pointer-events: auto; /* now it can accept drops */
    opacity: 1;
    height: 100px;
    background-color: #e6f7ff;
    border-color: #1890ff;
    pointer-events: auto;
}

/* VISIBLE STATE WHEN DRAGGING */
.drop-zone.expanded {
    pointer-events: auto; /* now it can accept drops */
    opacity: 1;
    height: 100px;
    background-color: #e6f7ff;
    border-color: #1890ff;
    pointer-events: auto;
}

/* CONTENT (HIDDEN BY DEFAULT) */
.drop-zone-content {
    opacity: 0;
    transition: opacity 0.3s ease;
    font-size: 1.3rem;
    color: #1890ff;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 12px;
}

/* FADE IN TEXT & ICON */
.drop-zone.expanded .drop-zone-content {
    opacity: 1;
}

.ghost-activity {
    background-color: rgba(0, 0, 0, 0.05);
    border: 1px dashed #aaa;
    padding: 10px;
    text-align: center;
    font-style: italic;
    color: #555;
}

.sortable-ghost {
    opacity: 0.4;
}

.sortable-chosen {
    background-color: #e0f7fa !important;
}


.depart-droppable {
    /*transition: background 0.2s ease, border-color 0.2s ease;*/
}

    .depart-droppable.expanded {
        background: rgba(0, 128, 255, 0.06);
        border: 2px dashed #007bff;
    }

.pcr-app {
    display: block !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    transform: none !important;
    visibility: visible !important;
}

.pcr-button {
    display: none !important;
}

/* only the hamburger shows grab */
.drag-handle {
    cursor: grab;
}

    .drag-handle:active {
        cursor: grabbing;
    }

/* rows/table shouldn't appear draggable */
.activity-grid, .sortable-group, .sortable-item {
    cursor: default !important;
}

/* while dragging, suppress text selection */
.is-dragging .activity-grid,
.is-dragging .activity-grid *:not(input):not(textarea):not(select):not([contenteditable="true"]) {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* prevent native image/icon dragging */
.drag-handle, .drag-handle * {
    -webkit-user-drag: none;
    user-drag: none;
}
/* Make sure the modal overlays everything */
.modal-backdrop {
    z-index: 2050 !important;
}

.modal {
    z-index: 2060 !important;
}

.modal-dialog {
    position: relative;
    z-index: 2070;
}
