:root {
    --color-primary: #333333;
    --color-primary-hover: #1f1f1f;

    --color-background: #f7f7f5;
    --color-surface: #ffffff;

    --color-text: #333333;
    --color-text-secondary: #777777;

    --color-border: #d8d8d8;
    --color-border-dark: #333333;

    --color-success-bg: #edf5ed;
    --color-success-text: #3f6842;

    --color-error-bg: #f7eaea;
    --color-error-text: #9f4242;

    --border-radius: 10px;

    --transition: 0.2s ease;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    font-family: 'Inter', sans-serif;
    background: var(--color-background);
    color: #1a1a1a;
}

body {
    min-height: 100vh;
}

.app {
    display: flex;
    min-height: 100vh;
}

/* SIDEBAR */

.sidebar {
    width: 250px;
    height: 100vh;
    padding: 10px 10px 10px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: sticky;
    top: 0;
    flex-shrink: 0;
    background: var(--color-primary);
    color: var(--color-surface);
    transition: width 0.25s ease;
}

.sidebar-top {
    width: 100%;
}

.sidebar-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: -7px;
    margin-bottom: 20px;
}

.sidebar-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sidebar-logo img {
    display: block;
    width: 230px;
    max-width: 100%;
    height: auto;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sidebar-link {
    min-height: 40px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: var(--border-radius);
    background: #2a2a2a;
    color: var(--color-surface);
    font-size: 14px;
    font-weight: 400;
    text-decoration: none;
    transition:
        background-color var(--transition),
        color var(--transition);
}

.sidebar-icon {
    width: 18px;
    flex-shrink: 0;
    text-align: center;
    font-size: 18px;
}

.sidebar-link.active {
    background: var(--color-surface);
    color: var(--color-text);
}

.sidebar-link:not(.active):hover {
    background: var(--color-surface) !important;
    color: var(--color-text) !important;
}

.sidebar-link-label {
    white-space: nowrap;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
}

.sidebar-bottom {
    padding: 0 14px;
    transition: padding 0.25s ease;
}

.sidebar-user {
    padding-bottom: 18px;
    margin-bottom: 18px;
    border-bottom: 1px solid #292929;
}

.sidebar-user-link {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    color: var(--color-surface);
    text-decoration: none;
    border: 1px solid #1d1d1d;
    border-radius: var(--border-radius);
    padding: 10px;
}

.sidebar-user-link i {
    font-size: 28px;
    width: 28px;
}

.sidebar-user-image {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 50%;
    object-fit: cover;
    object-position: center;
}

.sidebar-user-name {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

.btn-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 90px;
    height: 40px;
    background-color: indianred;
    color: var(--color-surface);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    border-radius: var(--border-radius);
    gap: 10px;
    cursor: pointer;
    transition: background-color var(--transition)
}

.btn-logout:hover {
    background-color: red;
    color: var(--color-surface);
}

.sidebar-version {
    display: block;
    color: var(--color-surface);
    font-size: 10px;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.sidebar-toggle {
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 0;
    border-radius: 8px;
    background: #1d1d1d;
    color: var(--color-surface);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition:
        background-color var(--transition),
        transform 0.25s ease;
}

.sidebar-toggle:hover {
    background: #2a2a2a;
}

.sidebar.collapsed {
    width: 60px;
}

.sidebar.collapsed .sidebar-logo {
    width: 0;
    padding: 0;
    opacity: 0;
}

.sidebar.collapsed .sidebar-link {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

.sidebar.collapsed .sidebar-link-label {
    display: none;
}

.sidebar-toggle i {
    transition: transform 0.25s ease;
}

.sidebar.collapsed .sidebar-toggle i {
    transform: rotate(180deg);
}

.sidebar.collapsed .sidebar-bottom {
    padding: 0;
}

.sidebar.collapsed .sidebar-user {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-bottom: 0;
    margin-bottom: 0;
    border-bottom: 0;
}

.sidebar.collapsed .sidebar-user-link {
    width: 40px;
    height: 40px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    border-radius: var(--border-radius);
}

.sidebar.collapsed .sidebar-user-name {
    display: none;
}

.sidebar.collapsed .btn-logout {
    width: 40px;
    height: 40px;
    padding: 0;
    gap: 0;
}

.sidebar.collapsed .btn-logout-label {
    display: none;
}

.sidebar.collapsed .sidebar-version {
    display: none;
}

/* SIDEBAR NOTIFICATIONS */

.notifications-sidebar {
    position: fixed;
    top: 60px;
    right: 0;
    width: 400px;
    height: calc(100vh - 60px);
    display: flex;
    flex-direction: column;
    background: var(--color-background);
    border-left: 1px solid var(--color-border);
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.08);
    transform: translateX(100%);
    transition: transform 0.25s ease;
    z-index: 500;
}

.notifications-sidebar.open {
    transform: translateX(0);
}

.notifications-sidebar-header {
    height: 60px;
    padding: 0 10px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--color-border);
    font-size: 20px;
}

.notifications-sidebar-content {
    flex: 1;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
}

.notifications-sidebar-content .message.success {
    margin-bottom: 3px;
}

.notification-item {
    position: relative;
    width: 100%;
    display: flex;
    align-items: stretch;
    background: var(--color-surface);
    border: 1px solid var(--color-border-dark);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.notification-main {
    min-width: 0;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.notification-main:hover {
    background: var(--color-background);
}

.notification-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.notification-title {
    min-width: 0;
    font-size: 16px;
    color: var(--color-text);
}

.notification-date {
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 400;
    color: var(--color-text-secondary);
}

.notification-text {
    width: 100%;
    display: block;
    font-size: 13px;
    color: var(--color-text-secondary);
}

.notification-read-button {
    width: 30px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-right: 1px solid var(--color-border-dark);
    background: transparent;
    color: var(--color-text);
    cursor: pointer;
    transition: var(--transition);
}

.notification-read-button:hover {
    background: var(--color-background);
}

/* MAIN */

.main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* NAVBAR */

.navbar {
    height: 60px;
    padding: 0 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--color-surface);
    border-bottom: 1px solid #e6e6e6;
}

.navbar-left {
    display: flex;
    min-width: 0;
    gap: 50px;
}

.navbar-title {
    color: var(--color-text);
    font-size: 25px;
    font-weight: 600;
    white-space: nowrap;
}

.navbar-submenu {
    display: flex;
    gap: 25px;
}

.navbar-sublink {
    width: max-content;
    padding: 7px 10px;
    gap: 10px;
    display: flex;
    align-items: center;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    color: inherit;
    font-size: 13px;
    text-decoration: none;
    background: var(--color-surface);
    cursor: pointer;
}

.navbar-sublink:hover,
.navbar-notifications:hover {
    background: var(--color-background);
}

.navbar-sublink.active,
.navbar-notifications.active {
    background: var(--color-primary);
    color: var(--color-surface);
    border-color: var(--color-border-dark);
}

.navbar-notifications {
    position: relative;
    padding: 7px 13px;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    color: inherit;
    font-size: 13px;
    text-decoration: none;
    background: var(--color-surface);
    cursor: pointer;
}

.notifications-count {
    position: absolute;
    top: 1px;
    right: 1px;
    width: 13px;
    height: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--color-primary);
    color: var(--color-surface);
    font-size: 9px;
    font-weight: 100;
}

.navbar-notifications.active .notifications-count {
    background: var(--color-surface);
    color: var(--color-primary);
}

.notification-alert {
    animation: notification-alert 3s infinite;
}

.notification-alert .notifications-count {
    animation: notification-count-alert 3s infinite;
}

@keyframes notification-alert {
    0%, 100% {
        background-color: var(--color-surface);
        color: indianred;
    }

    50% {
        background-color: indianred;
        color: var(--color-surface);
    }
}

@keyframes notification-count-alert {
    0%, 100% {
        background-color: indianred;
        color: var(--color-surface);
    }

    50% {
        background-color: var(--color-surface);
        color: indianred;
    }
}

/* CONTENT */

.content {
    flex: 1;
    padding: 25px;
    overflow-y: auto;
}

.content h1 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 30px;
    font-weight: 500;
    letter-spacing: -0.5px;
}

.content p {
    margin-top: 0;
    color: var(--color-text-secondary);
    font-size: 14px;
}

/* LOADER */

.global-loader {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.global-loader.active {
    opacity: 1;
    visibility: visible;
}

.global-loader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #d9d9d9;
    border-top-color: #000;
    border-radius: 50%;
    animation: loader-spin 0.8s linear infinite;
}

@keyframes loader-spin {
    to {
        transform: rotate(360deg);
    }
}