
/* =========================
   Colors
========================= */

:root {
    --bg-main: #171717;
    --bg-secondary: #202020;
    --bg-card: #292929;
    --bg-input: #303030;

    --accent: #52796F;
    --accent-hover: #3F6259;

    --text-main: #F5F5F5;
    --text-secondary: #A3A3A3;

    --border: #404040;

    --success: #6B9B78;
    --error: #CF6679;
}


/* ========================================
   GLOBAL DEFAULTS
======================================== */

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    margin: 0;

    background-color: var(--bg-main);
    color: var(--text-main);

    font-family: Arial, sans-serif;
}


/* ========================================
   GLOBAL PAGE LAYOUT
======================================== */

.app-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
    background: var(--bg-main);
}


/* ========================================
   SIDEBAR
======================================== */

.sidebar {
    width: 260px;
    min-width: 260px;
    min-height: 100vh;

    display: flex;
    flex-direction: column;

    background: var(--bg-secondary);
    color: var(--text-main);

    border-right: 1px solid var(--border);

    transition: transform 0.25s ease;

    z-index: 1000;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 24px 20px;

    border-bottom: 1px solid var(--border);
}

.sidebar-header h2 {
    margin: 0;

    font-size: 21px;
    color: var(--text-main);
}

.close-sidebar {
    display: none;

    background: none;
    border: none;

    color: var(--text-main);
    font-size: 28px;

    cursor: pointer;
}


/* ========================================
   SIDEBAR NAVIGATION
======================================== */

.sidebar-nav {
    flex: 1;
    padding: 20px 12px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 13px;

    padding: 13px 14px;
    margin-bottom: 5px;

    border-radius: 7px;

    color: var(--text-secondary);
    text-decoration: none;

    transition:
        background 0.2s ease,
        color 0.2s ease;
}

.nav-link:hover {
    background: var(--bg-card);
    color: var(--text-main);
}

.nav-link.active {
    background: var(--accent);
    color: var(--text-main);
}

.nav-icon {
    width: 22px;
    flex-shrink: 0;

    text-align: center;
    font-size: 19px;
}

.nav-divider {
    height: 1px;

    background: var(--border);

    margin: 18px 5px;
}

.nav-heading {
    padding: 0 14px;

    color: var(--text-secondary);

    font-size: 11px;
    font-weight: bold;

    text-transform: uppercase;
    letter-spacing: 1px;
}


/* ========================================
   SIDEBAR FOOTER
======================================== */

.sidebar-footer {
    padding: 18px;

    border-top: 1px solid var(--border);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;

    min-width: 0;
    margin-bottom: 15px;
}

.user-avatar {
    width: 38px;
    height: 38px;

    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: var(--accent);
    color: var(--text-main);

    font-weight: bold;
}

.user-details {
    display: flex;
    flex-direction: column;

    min-width: 0;
}

.user-details strong {
    overflow: hidden;

    color: var(--text-main);

    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-details small {
    margin-top: 3px;

    color: var(--text-secondary);
}

.logout-link {
    display: block;

    padding: 8px 0;

    color: var(--error);
    text-decoration: none;
}

.logout-link:hover {
    color: var(--text-main);
}


/* ========================================
   MAIN CONTENT
======================================== */

.main-content {
    flex: 1;
    min-width: 0;

    background: var(--bg-main);
}

.topbar {
    height: 68px;

    display: flex;
    align-items: center;
    gap: 18px;

    padding: 0 25px;

    background: var(--bg-secondary);

    border-bottom: 1px solid var(--border);
}

.topbar-title {
    color: var(--text-main);

    font-size: 17px;
    font-weight: 600;
}

.topbar-account {
    margin-left: auto;

    color: var(--text-secondary);
    font-size: 14px;
}

.page-content {
    width: 100%;
    max-width: 1400px;

    margin: 0 auto;
    padding: 35px;
}


/* ========================================
   MOBILE MENU BUTTON
======================================== */

.menu-button {
    display: none;

    width: 38px;
    height: 38px;

    padding: 8px;

    flex-direction: column;
    justify-content: center;
    gap: 5px;

    border: none;
    background: transparent;

    cursor: pointer;
}

.menu-button span {
    display: block;

    width: 22px;
    height: 2px;

    border-radius: 2px;

    background: var(--text-main);
}


/* ========================================
   MOBILE OVERLAY
======================================== */

.sidebar-overlay {
    display: none;
}


/* ========================================
   RESPONSIVE LAYOUT
======================================== */

@media (max-width: 800px) {

    .sidebar {
        position: fixed;

        top: 0;
        bottom: 0;
        left: 0;

        width: 270px;
        min-width: 270px;

        height: 100%;
        min-height: 100%;

        overflow-y: auto;

        transform: translateX(-100%);
    }

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

    .close-sidebar {
        display: block;
    }

    .menu-button {
        display: flex;
    }

    .sidebar-overlay.visible {
        display: block;

        position: fixed;
        inset: 0;

        background: rgba(0, 0, 0, 0.65);

        z-index: 999;
    }

    body.sidebar-open {
        overflow: hidden;
    }

    .page-content {
        padding: 25px 18px;
    }

}


@media (max-width: 450px) {

    .topbar {
        padding: 0 15px;
    }

    .topbar-account {
        font-size: 12px;
    }

}

/* ========================================
   FORM INPUTS & BROWSER AUTOFILL
======================================== */

/* Default form field styling */
input,
textarea,
select {
    background-color: var(--bg-input) !important;
    color: var(--text-main) !important;
    border: 1px solid var(--border);
}

/* Placeholder styling */
input::placeholder,
textarea::placeholder {
    color: var(--text-secondary);
    opacity: 1;
}

/* Chromium browsers: Chrome, Edge, Opera */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus,
select:-webkit-autofill {
    -webkit-text-fill-color: var(--text-main) !important;
    caret-color: var(--text-main) !important;

    -webkit-box-shadow: 0 0 0 1000px #303030 inset !important;
    box-shadow: 0 0 0 1000px #303030 inset !important;

    background-color: #303030 !important;

    transition: background-color 5000s ease-in-out 0s !important;
}

/* Standard autofill styling */
input:autofill,
textarea:autofill,
select:autofill {
    background-color: #303030 !important;
    color: #F5F5F5 !important;
}

/* Keep focused inputs consistent */
input:focus,
textarea:focus,
select:focus {
    background-color: var(--bg-input) !important;
    color: var(--text-main) !important;
    outline: none;
}
