html, body {
    height: 100%;
}

body.layout-body {
    margin: 0;
    font-family: 'Segoe UI', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #f5f7fb;
    color: #1f2937;
    transition: background-color 0.2s ease, color 0.2s ease;
}

html.dark body.layout-body {
    background-color: #0f172a;
    color: #e2e8f0;
}

.layout {
    display: flex;
    min-height: 100vh;
    background-color: inherit;
    color: inherit;
}

.layout .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    background-color: #ffffff;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    border-right: 1px solid rgba(15, 23, 42, 0.08);
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease;
    z-index: 40;
}

html.dark .layout .sidebar {
    background-color: #1e293b;
    border-right-color: rgba(148, 163, 184, 0.2);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.35);
}

.layout .sidebar--open {
    width: 260px;
}

.layout .sidebar--collapsed {
    width: 76px;
}

.layout .sidebar__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 18px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

html.dark .layout .sidebar__header {
    border-bottom-color: rgba(148, 163, 184, 0.2);
}

.layout .sidebar__brand {
    font-size: 22px;
    font-weight: 700;
    color: #2563eb;
}

html.dark .layout .sidebar__brand {
    color: #60a5fa;
}

.layout .sidebar__toggle {
    border: none;
    background: transparent;
    padding: 8px;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    color: inherit;
}

.layout .sidebar__toggle:hover {
    background-color: rgba(37, 99, 235, 0.08);
}

html.dark .layout .sidebar__toggle:hover {
    background-color: rgba(148, 163, 184, 0.15);
}

.layout .sidebar__toggle-icon {
    width: 24px;
    height: 24px;
}

.layout .sidebar__nav {
    padding: 16px 8px;
    flex: 1 1 auto;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.layout .sidebar__link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    margin: 4px 8px;
    border-radius: 12px;
    text-decoration: none;
    color: #334155;
    transition: background-color 0.2s ease, color 0.2s ease;
    font-weight: 500;
}

.layout .sidebar__link:hover {
    background-color: rgba(37, 99, 235, 0.08);
    color: #1d4ed8;
}

.layout .sidebar__link--active {
    background-color: rgba(37, 99, 235, 0.12);
    color: #1d4ed8;
    box-shadow: inset 3px 0 0 #2563eb;
}

html.dark .layout .sidebar__link {
    color: #cbd5f5;
}

html.dark .layout .sidebar__link:hover {
    background-color: rgba(96, 165, 250, 0.12);
    color: #93c5fd;
}

html.dark .layout .sidebar__link--active {
    background-color: rgba(96, 165, 250, 0.18);
    color: #bfdbfe;
    box-shadow: inset 3px 0 0 #3b82f6;
}

.layout .sidebar--collapsed .sidebar__brand,
.layout .sidebar--collapsed .sidebar__link-text,
.layout .sidebar--collapsed .sidebar__button-text {
    display: none;
}

.layout .sidebar--collapsed .sidebar__nav {
    align-items: center;
}

.layout .sidebar--collapsed .sidebar__link {
    justify-content: center;
    gap: 0;
}

.layout .sidebar--collapsed .sidebar__button-icon--spaced {
    margin-right: 0;
}

.layout .sidebar__link-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.layout .sidebar__link-text {
    white-space: nowrap;
}

.layout .sidebar__footer {
    padding: 16px;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

html.dark .layout .sidebar__footer {
    border-top-color: rgba(148, 163, 184, 0.2);
}

.layout .sidebar__button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
    font-weight: 500;
    font-size: 14px;
}

.layout .sidebar__button--secondary {
    background-color: #edf2f8;
    color: #334155;
}

.layout .sidebar__button--secondary:hover {
    background-color: #dbe3ee;
}

.layout .sidebar__button--danger {
    background-color: #ef4444;
    color: #ffffff;
}

.layout .sidebar__button--danger:hover {
    background-color: #dc2626;
}

html.dark .layout .sidebar__button--secondary {
    background-color: #273449;
    color: #e2e8f0;
}

html.dark .layout .sidebar__button--secondary:hover {
    background-color: #33445f;
}

.layout .sidebar__button-icon {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.layout .sidebar__button-icon--spaced {
    margin-right: 6px;
}

.sidebar__button-icon--theme-dark {
    display: none;
}

.dark .sidebar__button-icon--theme-light {
    display: none;
}

.dark .sidebar__button-icon--theme-dark {
    display: inline-flex;
}

.layout .layout-content {
    flex: 1 1 auto;
    margin-left: 260px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s ease;
    background-color: inherit;
    color: inherit;
}

.layout .layout-content--sidebar-collapsed {
    margin-left: 76px;
}

.layout .layout-content__header {
    background-color: #ffffff;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    padding: 24px 32px;
}

html.dark .layout .layout-content__header {
    background-color: #1e293b;
    border-bottom-color: rgba(148, 163, 184, 0.2);
}

.layout .layout-content__title {
    margin: 0;
    font-size: 26px;
    font-weight: 600;
}

.layout .layout-content__body {
    padding: 32px;
    background-color: inherit;
    flex: 1 1 auto;
}

.ui-card {
    background-color: #ffffff;
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 15px 35px rgba(15, 23, 42, 0.06);
    border: 1px solid rgba(15, 23, 42, 0.05);
    display: flex;
    flex-direction: column;
    gap: 18px;
}

html.dark .ui-card {
    background-color: #1e293b;
    border-color: rgba(148, 163, 184, 0.15);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.4);
}

.ui-card--info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(59, 130, 246, 0.04));
}

.ui-card--alert {
    background: linear-gradient(135deg, rgba(248, 113, 113, 0.12), rgba(248, 113, 113, 0.04));
}

.ui-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.ui-card__title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.ui-card__content {
    font-size: 15px;
    line-height: 1.5;
}

.ui-card__toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.ui-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ui-field__label {
    font-size: 14px;
    font-weight: 600;
    color: rgba(15, 23, 42, 0.7);
}
