﻿:root {
    --primary-color: #007bff;
    --primary-hover-color: #0056b3;
    --secondary-color: #6c757d;
    --background-color: #f8f9fa;
    --card-background-color: #ffffff;
    --text-color: #343a40;
    --light-text-color: #6c757d;
    --border-color: #dee2e6;
    --shadow-light: rgba(0, 0, 0, 0.05);
    --nav-bg-color: #343a40;
    --nav-link-color: #adb5bd;
    --nav-link-hover-color: #ffffff;
    --nav-link-active-bg: #0056b3;
    --nav-link-active-color: #ffffff;
}

body,
html,
.page {
    height: 100%;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow: hidden;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

    a:hover {
        color: var(--primary-hover-color);
        text-decoration: underline;
    }

.sidebar,
.main {
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

    .sidebar::-webkit-scrollbar,
    .main::-webkit-scrollbar {
        width: 6px;
    }

    .sidebar::-webkit-scrollbar-thumb,
    .main::-webkit-scrollbar-thumb {
        background-color: var(--border-color);
        border-radius: 3px;
    }

.btn,
.btn-primary {
    display: inline-block;
    font-weight: 400;
    color: #fff;
    text-align: center;
    vertical-align: middle;
    user-select: none;
    background-color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 0.25rem;
    transition: all 0.15s ease-in-out;
    cursor: pointer;
}

    .btn:hover,
    .btn-primary:hover {
        background-color: var(--primary-hover-color);
        border-color: var(--primary-hover-color);
        color: #fff;
        text-decoration: none;
    }

.page {
    display: flex;
    flex-direction: column;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 220px;
    color: var(--nav-link-color);
    flex-shrink: 0;
    box-shadow: 2px 0 5px var(--shadow-light);
    display: flex;
    flex-direction: column;
    max-height: auto;
    overflow-y: auto;
    background-color: var(--nav-bg-color);
    z-index: 1000;
}

.sidebar-scroll {
    flex: 1;
    overflow-y: auto;
}

.main {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    margin-left: 0;
    padding-top: 50px;
}

main {
    overflow-y: auto;
}

.top-row {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--card-background-color);
    border-bottom: 1px solid var(--border-color);
    padding: 10px 20px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    box-shadow: 0 2px 4px var(--shadow-light);
    margin-bottom: 20px;
    z-index: 1001;
}

    .top-row a {
        color: var(--secondary-color);
        margin-left: 15px;
        font-size: 0.9em;
    }

        .top-row a:hover {
            color: var(--text-color);
            text-decoration: none;
        }

.content {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding-bottom: 10px;
}

.nav {
    display: flex;
    flex-wrap: wrap;
    padding-left: 0;
    margin-bottom: 0;
    list-style: none;
    white-space: nowrap;
    overflow: hidden;
    flex-direction: column;
}

.navbar-brand {
    font-size: 1.5em;
    font-weight: bold;
    color: var(--nav-link-hover-color);
    text-align: center;
    padding: 15px 0;
    display: block;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 10px;
}

.nav-item {
    font-size: 0.95em;
    /*padding: 0 10px;*/
}

    .nav-item a.nav-link {
        color: var(--nav-link-color);
        padding: 12px 15px;
        display: flex;
        align-items: center;
        border-radius: 5px;
        margin-bottom: 5px;
        line-height: 1.5rem !important;
        transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
    }

        .nav-item a.nav-link:hover {
            background-color: rgba(255, 255, 255, 0.1);
            color: var(--nav-link-hover-color);
            text-decoration: none;
        }

    .nav-item a.active {
        background-color: var(--nav-link-active-bg);
        color: var(--nav-link-active-color);
        font-weight: 600;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    }

    .nav-item a .oi {
        margin-right: 15px;
        width: 20px;
        text-align: center;
    }

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-color);
    margin-top: 20px;
    margin-bottom: 15px;
}

p {
    margin-bottom: 10px;
}

.alert {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 0.25rem;
}

.alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

.table-scroll-wrapper {
    max-height: 550px;
    overflow: auto;
    width: 100%;
    box-sizing: border-box;
}

.table-scroll-inner {
    width: 100%;
}

table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--card-background-color);
    box-shadow: 0 2px 8px var(--shadow-light);
}

.row-selected {
    background-color: #d1ecf1 !important;
}

tr:hover {
    background-color: #f1f1f1;
    cursor: pointer;
}

th,
td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

th {
    background-color: var(--primary-color) !important;
    color: white;
    font-weight: 600;
    font-size: 0.9em;
    text-transform: uppercase;
}

.table-bordered > :not(caption) > * {
    border-width: 0px 1px !important;
    border-style: solid;
}

tr:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

td.limit-wrap {
    min-width: 200px;
    max-width: 200px;
    white-space: normal;
    overflow-wrap: break-word;
}

.card {
    background-color: var(--card-background-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--shadow-light);
    padding: 0px;
    margin-bottom: 15px;
    margin: 7px !important;
    border: 1px solid var(--border-color);
}

.card-title {
    font-size: 1.5em;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.form-group {
    margin-bottom: 1rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-color);
}



.form-control {
    display: block;
    width: 100%;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text-color);
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

    .form-control:focus {
        color: var(--text-color);
        background-color: #fff;
        border-color: #80bdff;
        outline: 0;
        box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    }

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

    .loading-overlay.show {
        display: flex;
        opacity: 1;
        visibility: visible;
    }

.loading-content {
    background-color: #fff;
    color: var(--text-color);
    padding: 25px 40px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

    .loading-content .spinner-border {
        width: 3rem;
        height: 3rem;
        color: var(--primary-color);
    }

    .loading-content p {
        font-size: 1.2em;
        font-weight: 600;
        margin: 0;
    }

.table-container {
    padding: 20px;
}

.table-responsive {
    overflow-x: auto;
}

.toasts {
    right: 24px;
    bottom: 24px;
    z-index: 1060;
    width: 345px;
}

@media (max-width: 425px) {
    .toasts {
        right: 0;
        width: 100%;
    }
}

.toast {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: nowrap;
    margin-bottom: 12px;
    padding: 16px;
    font-weight: 600;
    color: #ffffff;
    border-radius: 4px;
    background-color: rgba(236, 53, 53, 0.75);
}

.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding-top: 16px;
    padding-right: 5px;
    padding-bottom: 16px;
    padding-left: 15px;
    border-radius: 8px;
    color: white;
    font-size: 16px;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    animation: fadein 0.4s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-width: 300px;
}

.toast__content {
    flex: 1 1 auto;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
}

.toast.success {
    background-color: rgba(76, 175, 80, 0.85);
}

.toast.error {
    background-color: rgba(244, 67, 54, 0.85);
}

.toast.warning {
    background-color: rgba(255, 152, 0, 0.85);
}

.toast.info {
    background-color: rgba(33, 150, 243, 0.85);
}


.toast .btn-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 18px;
    margin-left: 16px;
    cursor: pointer;
}

@keyframes fadein {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.toast__dismiss {
    background: transparent;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    flex-shrink: 0;
    line-height: 1;
}

    .toast__dismiss:hover,
    .toast__dismiss:focus {
        outline: none;
    }


@media (max-width: 767.98px) {
    .sidebar {
        display: none !important;
    }
}

@media (min-width: 768px) {
    .sidebar {
        display: flex !important;
        position: fixed;
        height: 100vh;
        width: 220px;
    }

    .page {
        flex-direction: row;
    }
}

.mobile-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1001;
    padding: 1rem;
    transform: translateX(0);
}

.mobile-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
}

.logout {
    padding: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.logout-button {
    color: red;
    font-weight: 600;
    display: block;
    padding: 12px 15px;
    border-radius: 5px;
    transition: background-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

    .logout-button:hover {
        color: #ff4d4f;
        background-color: rgba(255, 255, 255, 0.1);
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
        text-decoration: none;
    }

.form-select {
    border: none;
    border-bottom: 1px solid #ccc;
    border-radius: 0;
    background-color: transparent;
    box-shadow: none;
    font-size: 1em;
}

    .form-select:focus {
        border-bottom: 1px solid #007bff;
        outline: none;
        box-shadow: none;
    }

.nav-group {
    margin-bottom: 5px;
}

.nav-group-toggle {
    width: 100%;
    background: none;
    border: none;
    color: var(--nav-link-color);
    font-weight: 600;
    text-align: left;
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
}

    .nav-group-toggle:hover {
        background-color: rgba(255, 255, 255, 0.1);
        color: var(--nav-link-hover-color);
    }

.nav-group.open .nav-group-toggle {
    background-color: var(--nav-link-active-bg);
    color: var(--nav-link-active-color);
}

.nav-group-toggle .arrow {
    transition: transform 0.3s ease;
}

.nav-group.open .arrow {
    transform: rotate(180deg);
}

.nav-submenu {
    display: none;
    flex-direction: column;
    margin-left: 10px;
}

.nav-group.open .nav-submenu {
    display: flex;
}

.input-wrapper {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    user-select: none;
}
