/********** Template CSS **********/
:root {
    --primary: #EB1616;
    --secondary: #191C24;
    --light: #6C7293;
    --dark: #000000;
}

.back-to-top {
    position: fixed;
    display: none;
    right: 45px;
    bottom: 45px;
    z-index: 99;
}


/*** Spinner ***/
#spinner {
    opacity: 0;
    visibility: hidden;
    transition: opacity .5s ease-out, visibility 0s linear .5s;
    z-index: 99999;
}

#spinner.show {
    transition: opacity .5s ease-out, visibility 0s linear 0s;
    visibility: visible;
    opacity: 1;
}


/*** Button ***/
.btn {
    transition: .5s;
}

.btn-square {
    width: 38px;
    height: 38px;
}

.btn-sm-square {
    width: 32px;
    height: 32px;
}

.btn-lg-square {
    width: 48px;
    height: 48px;
}

.btn-square,
.btn-sm-square,
.btn-lg-square {
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: normal;
    border-radius: 50px;
}


/*** Layout ***/
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 250px;
    height: 100vh;
    overflow-y: auto;
    background: var(--secondary);
    transition: 0.5s;
    z-index: 999;
}

.content {
    margin-left: 250px;
    min-height: 100vh;
    background: var(--dark);
    transition: 0.5s;
    min-width: 0;
    box-sizing: border-box;
}

.content1 {
    margin-left: 150px;
    min-height: 100vh;
    background: var(--dark);
    transition: 0.5s;
    min-width: 0;
    box-sizing: border-box;
}

@media (min-width: 992px) {
    .sidebar {
        margin-left: 0;
    }

    .sidebar.open {
        margin-left: -250px;
    }

    .content {
        width: calc(100% - 250px);
    }

    .content.open {
        width: 100%;
        margin-left: 0;
    }

    .content1 {
        width: calc(100% - 250px);
    }

        .content1.open {
            width: 100%;
            margin-left: 0;
        }
}

@media (max-width: 991.98px) {
    .sidebar {
        margin-left: -250px;
    }

    .sidebar.open {
        margin-left: 0;
    }

    .content {
        width: 100%;
        margin-left: 0;
    }

    /* Календар та інші сторінки з обгорткою .content1 */
    .content1 {
        width: 100%;
        margin-left: 0;
    }

    /* Подвійна кнопка меню: глобальна панель у MainLayout замість Navbar на Home */
    .navbar.navbar-expand.bg-secondary .sidebar-toggler {
        display: none !important;
    }
}

/* Оболонка Blazor — без горизонтального скролу через flex-дочірні блоки */
.page {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

main.main-content {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.container-fluid.position-relative.d-flex.p-0 {
    max-width: 100%;
}

.layout-mobile-toolbar {
    z-index: 998;
    background: var(--secondary);
    padding: 0.5rem 0.75rem;
}

.layout-mobile-toolbar__toggle {
    color: #fff;
    font-size: 1.25rem;
    text-decoration: none;
    padding: 0.35rem 0.65rem;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 0.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

    .layout-mobile-toolbar__toggle:hover {
        color: var(--primary);
        border-color: rgba(235, 22, 22, 0.45);
    }


/*** Navbar ***/
.sidebar .navbar .navbar-nav .nav-link {
    padding: 7px 20px;
    color: var(--light);
    font-weight: 500;
    border-left: 3px solid var(--secondary);
    border-radius: 0 30px 30px 0;
    outline: none;
}

.sidebar .navbar .navbar-nav .nav-link:hover,
.sidebar .navbar .navbar-nav .nav-link.active {
    color: var(--primary);
    background: var(--dark);
    border-color: var(--primary);
}

.sidebar .navbar .navbar-nav .nav-link i {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--dark);
    border-radius: 40px;
}

.sidebar .navbar .navbar-nav .nav-link:hover i,
.sidebar .navbar .navbar-nav .nav-link.active i {
    background: var(--secondary);
}

.sidebar .navbar .dropdown-toggle::after {
    position: absolute;
    top: 15px;
    right: 15px;
    border: none;
    content: "\f107";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    transition: .5s;
}

.sidebar .navbar .dropdown-toggle[aria-expanded=true]::after {
    transform: rotate(-180deg);
}

.sidebar .navbar .dropdown-item {
    padding-left: 25px;
    border-radius: 0 30px 30px 0;
    color: var(--light);
}

.sidebar .navbar .dropdown-item:hover,
.sidebar .navbar .dropdown-item.active {
    background: var(--dark);
}

.content .navbar .navbar-nav .nav-link {
    margin-left: 25px;
    padding: 12px 0;
    color: var(--light);
    outline: none;
}

.content .navbar .navbar-nav .nav-link:hover,
.content .navbar .navbar-nav .nav-link.active {
    color: var(--primary);
}

.content .navbar .sidebar-toggler,
.content .navbar .navbar-nav .nav-link i {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--dark);
    border-radius: 40px;
}

.content .navbar .dropdown-item {
    color: var(--light);
}

.content .navbar .dropdown-item:hover,
.content .navbar .dropdown-item.active {
    background: var(--dark);
}

.content .navbar .dropdown-toggle::after {
    margin-left: 6px;
    vertical-align: middle;
    border: none;
    content: "\f107";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    transition: .5s;
}

.content .navbar .dropdown-toggle[aria-expanded=true]::after {
    transform: rotate(-180deg);
}

@media (max-width: 575.98px) {
    .content .navbar .navbar-nav .nav-link {
        margin-left: 15px;
    }
}


/*** Date Picker ***/
.bootstrap-datetimepicker-widget.bottom {
    top: auto !important;
}

.bootstrap-datetimepicker-widget .table * {
    border-bottom-width: 0px;
}

.bootstrap-datetimepicker-widget .table th {
    font-weight: 500;
}

.bootstrap-datetimepicker-widget.dropdown-menu {
    padding: 10px;
    border-radius: 2px;
}

.bootstrap-datetimepicker-widget table td.active,
.bootstrap-datetimepicker-widget table td.active:hover {
    background: var(--primary);
}

.bootstrap-datetimepicker-widget table td.today::before {
    border-bottom-color: var(--primary);
}


/*** Testimonial ***/
.progress .progress-bar {
    width: 0px;
    transition: 2s;
}


/*** Testimonial ***/
.testimonial-carousel .owl-dots {
    margin-top: 24px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.testimonial-carousel .owl-dot {
    position: relative;
    display: inline-block;
    margin: 0 5px;
    width: 15px;
    height: 15px;
    border: 5px solid var(--primary);
    border-radius: 15px;
    transition: .5s;
}

.testimonial-carousel .owl-dot.active {
    background: var(--dark);
    border-color: var(--primary);
}

.ec-btn {
    background: linear-gradient(135deg, #0b3c5d, #1e5f8a);
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(11, 60, 93, 0.3);
}

/*page home button event*/
.ec-btn {
    background: linear-gradient(135deg, #0b3c5d, #1e5f8a);
    color: #ff4d4d; /* 🔴 червоний текст */
    border: none;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

    .ec-btn:hover {
        color: #ff0000;
    }

/*page home popup*/
.current-task-title {
    color: #d90429;
    font-weight: 700;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.ec-btn-add {
    background: linear-gradient(135deg, #0b3c5d, #145a86);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 30px;
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 6px 18px rgba(11, 60, 93, 0.35);
}

    .ec-btn-add:hover {
        transform: translateY(-1px);
        box-shadow: 0 10px 24px rgba(11, 60, 93, 0.45);
        background: linear-gradient(135deg, #145a86, #0b3c5d);
    }

    .ec-btn-add:active {
        transform: scale(0.98);
    }

.task-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 99999;
}

.task-modal-window {
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    background: #0f1722;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalIn 0.22s ease;
}

.task-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0));
    flex-shrink: 0;
}

.task-modal-title {
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
}

.task-modal-close {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    color: #c7d0d9;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

    .task-modal-close:hover {
        background: rgba(217, 4, 41, 0.18);
        color: #ff4d6d;
    }

.task-modal-body {
    padding: 16px 18px;
    overflow-y: auto;
    flex: 1;
}

.task-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.task-label {
    display: block;
    margin-bottom: 6px;
    color: #c7d0d9;
    font-size: 13px;
    font-weight: 600;
}

.task-input {
    width: 100%;
    box-sizing: border-box;
    background: #0b1118;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 10px 12px;
    outline: none;
    transition: all 0.2s ease;
    font-size: 14px;
}

    .task-input::placeholder {
        color: #6c7a89;
    }

    .task-input:focus {
        border-color: #145a86;
        box-shadow: 0 0 0 3px rgba(20, 90, 134, 0.18);
    }

.task-textarea {
    min-height: 80px;
    resize: vertical;
}

.task-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 18px 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    background: #0f1722;
    flex-shrink: 0;
}

.task-btn-cancel {
    background: #212b36;
    color: #d7dde4;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    padding: 9px 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .task-btn-cancel:hover {
        background: #2a3642;
    }

.task-btn-save {
    background: linear-gradient(135deg, #0b3c5d, #145a86);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    padding: 9px 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 8px 18px rgba(11, 60, 93, 0.35);
}

    .task-btn-save:hover {
        transform: translateY(-1px);
        box-shadow: 0 10px 24px rgba(11, 60, 93, 0.45);
    }

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* планшет */
@media (max-width: 768px) {
    .task-modal-backdrop {
        padding: 10px;
        align-items: center;
        justify-content: center;
    }

    .task-modal-window {
        max-width: 100%;
        max-height: 92vh;
        border-radius: 14px;
    }

    .task-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .task-modal-header {
        padding: 12px 14px;
    }

    .task-modal-body {
        padding: 12px 14px;
    }

    .task-modal-footer {
        padding: 12px 14px 14px;
        flex-direction: column;
    }

    .task-btn-cancel,
    .task-btn-save {
        width: 100%;
    }

    .task-modal-title {
        font-size: 15px;
    }

    .task-input {
        font-size: 13px;
        padding: 9px 10px;
    }

    .task-label {
        font-size: 12px;
    }

    .task-textarea {
        min-height: 70px;
    }
}

/* дуже маленький екран */
@media (max-width: 480px) {
    .task-modal-backdrop {
        padding: 0;
        align-items: flex-end;
    }

    .task-modal-window {
        max-width: 100%;
        width: 100%;
        max-height: 95vh;
        border-radius: 16px 16px 0 0;
    }

    .task-modal-header {
        padding: 12px;
    }

    .task-modal-body {
        padding: 12px;
    }

    .task-modal-footer {
        padding: 12px;
        position: sticky;
        bottom: 0;
    }

    .task-modal-title {
        font-size: 14px;
    }

    .task-modal-close {
        width: 30px;
        height: 30px;
    }
}

.action-btn {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: linear-gradient(145deg, #0b0f14, #111820);
    color: #9aa4ad;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s ease;
    font-size: 14px;
    position: relative;
}

    /* базовий hover */
    .action-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(0,0,0,0.6);
    }

    /* EDIT — стриманий червоний акцент */
    .action-btn.edit:hover {
        color: #ff4d4d;
        border-color: rgba(255, 77, 77, 0.4);
        box-shadow: 0 0 12px rgba(255, 77, 77, 0.4);
    }

    /* DELETE — більш агресивний червоний */
    .action-btn.delete {
        color: #ff6b6b;
    }

        .action-btn.delete:hover {
            background: linear-gradient(145deg, #1a0000, #220000);
            color: #ff2e2e;
            border-color: rgba(255, 0, 0, 0.5);
            box-shadow: 0 0 18px rgba(255, 0, 0, 0.6);
        }

    /* активний клік */
    .action-btn:active {
        transform: scale(0.95);
    }


.custom-table {
    border-collapse: separate;
    border-spacing: 0;
}

    .custom-table thead th {
        background-color: #111827;
        color: #fff;
        font-weight: 600;
        font-size: 14px;
        border-bottom: 1px solid rgba(255,255,255,0.08);
        padding: 14px 12px;
        white-space: nowrap;
    }

    .custom-table tbody td {
        padding: 14px 12px;
        vertical-align: middle;
        border-bottom: 1px solid rgba(255,255,255,0.05);
        font-size: 14px;
    }

    .custom-table tbody tr:hover {
        background-color: rgba(255,255,255,0.04);
        transition: 0.2s ease-in-out;
    }

.bg-secondary.rounded {
    border-radius: 16px !important;
}

.badge {
    font-size: 12px;
    font-weight: 600;
    min-width: 65px;
}

@media (max-width: 768px) {
    .custom-table thead th,
    .custom-table tbody td {
        font-size: 13px;
        padding: 10px 8px;
    }

    h4 {
        font-size: 18px;
    }
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 250px;
    height: 100vh;
    background: #191c24;
    z-index: 1000;
    overflow-y: auto;
}

.sidebar-nav {
    width: 100%;
    padding: 18px 0;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    padding: 0 24px 24px;
    color: #ff1f1f;
    font-size: 28px;
    font-weight: 800;
    text-decoration: none;
}

    .sidebar-brand:hover {
        color: #ff1f1f;
    }

.sidebar-profile {
    display: flex;
    align-items: center;
    padding: 0 24px 28px;
}

.profile-img-wrap {
    position: relative;
    flex-shrink: 0;
}

.profile-img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
}

.profile-status {
    position: absolute;
    right: 0;
    bottom: 1px;
    width: 12px;
    height: 12px;
    background: #00d25b;
    border: 2px solid #ffffff;
    border-radius: 50%;
}

.profile-info {
    margin-left: 14px;
}

    .profile-info h6 {
        margin: 0;
        color: #ffffff;
        font-size: 15px;
        font-weight: 700;
    }

    .profile-info span {
        color: #8f9bb3;
        font-size: 14px;
    }

.sidebar-menu {
    width: 100%;
}

.sidebar-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 6px 16px;
    padding: 14px 18px;
    color: #8f9bb3;
    font-size: 16px;
    text-decoration: none;
    border-radius: 0 30px 30px 0;
    transition: 0.2s ease;
}

    .sidebar-link i {
        width: 22px;
        min-width: 22px;
        height: 22px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        color: #ffffff;
    }

    .sidebar-link:hover {
        color: #ffffff;
        background: #000000;
    }

    .sidebar-link.active {
        color: #ffffff;
        background: #000000;
    }

        .sidebar-link.active::before {
            content: "";
            position: absolute;
            left: -16px;
            top: 0;
            width: 6px;
            height: 100%;
            background: #ff1f1f;
        }