@import url("./variables.css");

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-family);
    font-size: var(--font-size-md);
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
}

img {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

h1,
h2,
h3,
h4,
h5,
h6,
p {
    margin-top: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    line-height: 1.2;
}

.page-container {
    width: min(
        calc(100% - 40px),
        var(--content-max-width)
    );
    margin: 0 auto;
}

.card {
    padding: var(--space-6);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
}

.card-title {
    margin-bottom: var(--space-2);
    font-size: var(--font-size-xl);
}

.card-text {
    margin-bottom: 0;
    color: var(--color-text-soft);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: 44px;
    padding: 10px 18px;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    font-weight: 700;
    transition:
        background-color var(--transition-fast),
        border-color var(--transition-fast),
        transform var(--transition-fast),
        box-shadow var(--transition-fast);
}

.button:hover {
    transform: translateY(-1px);
}

.button-primary {
    color: #ffffff;
    background: var(--color-primary);
    box-shadow: 0 8px 20px rgba(184, 138, 59, 0.24);
}

.button-primary:hover {
    background: var(--color-primary-dark);
}

.button-secondary {
    color: var(--color-text);
    border-color: var(--color-border-dark);
    background: var(--color-surface);
}

.button-secondary:hover {
    background: var(--color-surface-soft);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: var(--radius-pill);
    font-size: var(--font-size-xs);
    font-weight: 700;
}

.badge-success {
    color: var(--color-success);
    background: rgba(47, 143, 82, 0.12);
}

.text-muted {
    color: var(--color-text-soft);
}

.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: var(--space-4);
}

.mt-6 {
    margin-top: var(--space-6);
}

.mb-0 {
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .page-container {
        width: min(
            calc(100% - 24px),
            var(--content-max-width)
        );
    }

    .card {
        padding: var(--space-5);
    }
}

.sidebar-group {
    width: 100%;
}

.sidebar-group-toggle {
    width: 100%;
    border: 0;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.sidebar-link-label {
    flex: 1;
    min-width: 0;
}

.sidebar-chevron {
    display: inline-flex;
    width: 24px;
    height: 24px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    color: #8a8175;
    font-size: 22px;
    line-height: 1;
    transform: rotate(0deg);
    transition:
        transform 0.22s ease,
        color 0.22s ease;
}

.sidebar-group.is-open .sidebar-chevron {
    color: #a8731d;
    transform: rotate(90deg);
}

.sidebar-submenu {
    position: relative;
    display: grid;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    margin: 0 12px 0 30px;
    padding-left: 18px;
    transition:
        max-height 0.3s ease,
        opacity 0.22s ease,
        margin-top 0.22s ease,
        margin-bottom 0.22s ease,
        visibility 0.22s ease;
}

.sidebar-submenu::before {
    content: "";
    position: absolute;
    top: 6px;
    bottom: 6px;
    left: 3px;
    width: 1px;
    background: #ddd3c4;
}

.sidebar-group.is-open .sidebar-submenu {
    max-height: 320px;
    visibility: visible;
    opacity: 1;
    margin-top: 5px;
    margin-bottom: 10px;
}

.sidebar-sublink {
    position: relative;
    display: flex;
    min-height: 38px;
    align-items: center;
    gap: 9px;
    padding: 8px 12px;
    border-radius: 11px;
    color: #736b60;
    font-size: 13px;
    font-weight: 650;
    line-height: 1.35;
    text-decoration: none;
    transition:
        color 0.18s ease,
        background 0.18s ease,
        transform 0.18s ease;
}

.sidebar-sublink:hover {
    background: #f7f1e7;
    color: #956313;
    transform: translateX(2px);
}

.sidebar-sublink.is-active,
.sidebar-sublink.active {
    background: #f2e5ce;
    color: #8a5c12;
    font-weight: 800;
}

.sidebar-subicon {
    display: inline-flex;
    width: 15px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    color: #bf8b2b;
    font-size: 12px;
}

.sidebar-group-toggle.is-active {
    background: #f3e7d0;
    color: #8c6019;
}