@font-face {
    font-family: 'Montserrat';
    src: url('../assets/fonts/Montserrat-VariableFont_wght.ttf') format('truetype');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Space Grotesk';
    src: url('../assets/fonts/SpaceGrotesk-VariableFont_wght.ttf') format('truetype');
    font-weight: 300 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --primary: #f0b400;
    --primary-hover: #d49d00;
    --bg-default: #050505;
    --bg-paper: #0f1114;
    --text-main: #f6f7f8;
    --text-secondary: #aeb4bd;
    --border-color: #2b3038;
    --brand-gray: #aeb4bd;
    --brand-black-soft: #111419;
    --sidebar-width: 260px;
    --header-height: 64px;
    --transition-speed: 0.3s;
}

[data-theme="dark"] {
    --primary: #f0b400;
    --primary-hover: #d49d00;
    --bg-default: #030303;
    --bg-paper: #0c0e12;
    --text-main: #ffffff;
    --text-secondary: #aeb4bd;
    --border-color: #242933;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
}

body {
    background:
        radial-gradient(circle at 20% -10%, rgba(240, 180, 0, 0.16), transparent 38%),
        radial-gradient(circle at 100% 0%, rgba(174, 180, 189, 0.14), transparent 32%),
        var(--bg-default);
    color: var(--text-main);
    display: flex;
    height: 100vh;
    overflow: hidden;
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

aside {
    width: var(--sidebar-width);
    background-color: var(--bg-paper);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: width var(--transition-speed);
    z-index: 10;
}

body.sidebar-collapsed aside {
    width: 80px;
}

.sidebar-brand {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 20px;
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #ffffff;
    border-bottom: 1px solid var(--border-color);
    gap: 12px;
    white-space: nowrap;
}

.sidebar-brand img {
    width: 38px;
    height: 38px;
    object-fit: contain;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.brand-text strong {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1rem;
    letter-spacing: 0.14em;
}

.brand-text small {
    margin-top: 4px;
    font-size: 0.62rem;
    color: var(--brand-gray);
    letter-spacing: 0.2em;
}

body.sidebar-collapsed .sidebar-brand span {
    display: none;
}

body.sidebar-collapsed .brand-text {
    display: none;
}

.sidebar-menu {
    list-style: none;
    padding: 15px 10px;
    overflow-y: auto;
    flex: 1;
}

.sidebar-menu li {
    margin-bottom: 5px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    color: var(--text-main);
    text-decoration: none;
    border-radius: 10px;
    font-weight: 500;
    transition: background 0.2s;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: linear-gradient(90deg, rgba(240, 180, 0, 0.2), rgba(240, 180, 0, 0.04));
    color: var(--primary);
}

body.sidebar-collapsed .sidebar-menu a span {
    display: none;
}

.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

header {
    height: var(--header-height);
    background-color: var(--bg-paper);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    backdrop-filter: blur(6px);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.menu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-main);
}

.breadcrumb {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.theme-toggle-btn {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-main);
    background-color: var(--bg-paper);
    transition: background 0.2s;
}

.theme-toggle-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

main {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

.page-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-bottom: 18px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.card,
.table-container,
.section-card {
    background: linear-gradient(180deg, rgba(16, 18, 22, 0.98), rgba(11, 13, 16, 0.98));
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.card-value {
    font-size: 1.8rem;
    font-weight: 700;
    margin-top: 10px;
    color: var(--text-main);
}

.table-title,
.section-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    margin-bottom: 15px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

th {
    font-weight: 600;
    color: var(--brand-gray);
}

.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    background-color: rgba(240, 180, 0, 0.18);
    color: #ffd45f;
}

.info-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
}

.info-item {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 14px;
    background-color: var(--bg-paper);
}

.info-item h3 {
    font-size: 0.92rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.info-item p {
    font-size: 1.1rem;
    font-weight: 600;
}

.projects-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.projects-kpis {
    margin-bottom: 20px;
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-chip {
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-main);
    border-radius: 999px;
    padding: 10px 14px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s, background 0.2s;
}

.filter-chip strong {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(240, 180, 0, 0.16);
    color: var(--primary);
    font-size: 0.82rem;
}

.filter-chip:hover {
    transform: translateY(-1px);
    border-color: rgba(240, 180, 0, 0.4);
}

.filter-chip.active {
    background: linear-gradient(90deg, rgba(240, 180, 0, 0.18), rgba(240, 180, 0, 0.06));
    border-color: rgba(240, 180, 0, 0.45);
    color: var(--primary);
}

.form-grid {
    display: grid;
    gap: 12px;
    margin-bottom: 16px;
}

.form-grid label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.86rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.form-grid input,
.form-grid select {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    height: 40px;
    padding: 0 12px;
    background-color: var(--bg-paper);
    color: var(--text-main);
}

.btn-primary {
    border: none;
    background: var(--primary);
    color: #fff;
    border-radius: 8px;
    height: 40px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.table-wrapper {
    overflow-x: auto;
}

.action-cell {
    width: 120px;
}

.btn-inline {
    border: none;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
}

.btn-danger {
    background: rgba(174, 180, 189, 0.2);
    color: #dfe3e8;
}

.empty-state {
    text-align: center;
    color: var(--text-secondary);
    padding: 18px;
}

.form-hours {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    align-items: end;
}

.form-employees {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    align-items: end;
}

.form-employees button {
    grid-column: 1 / -1;
}

.badge[style*='rgba(46, 125, 50, 0.2)'] {
    border: 1px solid rgba(46, 125, 50, 0.35);
}

.badge[style*='rgba(255, 152, 0, 0.2)'] {
    border: 1px solid rgba(255, 152, 0, 0.35);
}

.badge[style*='rgba(239, 68, 68, 0.2)'] {
    border: 1px solid rgba(239, 68, 68, 0.35);
}

@media (max-width: 900px) {
    body {
        overflow: auto;
    }

    aside {
        position: fixed;
        height: 100%;
        left: 0;
        top: 0;
        transform: translateX(0);
    }

    body.sidebar-collapsed aside {
        transform: translateX(-100%);
        width: var(--sidebar-width);
    }

    .main-wrapper {
        width: 100%;
    }

    header,
    main {
        padding-left: 20px;
        padding-right: 20px;
    }

    .projects-layout {
        grid-template-columns: 1fr;
    }
}
