/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

:root {
    --sidebar-width: 260px;
    --header-height: 70px;

    /* override colors */
    --pico-secondary: #fff;
    --pico-secondary-background: #fff;
}

body {
    display: flex;
    flex-direction: column;
    height: 100vh;
    margin: 0;
    background-color: var(--pico-background-color);
}

.title {
    text-decoration: none;
    color: var(--pico-contrast);
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--pico-primary-background);
    color: var(--pico-secondary-inverse);
    padding: 0.75rem;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.sidebar-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.sidebar-footer {
    text-align: center;
}

.sidebar-title {
    margin: 0;
    text-align: center;
}

.sidebar-title .title {
    color: var(--pico-secondary-inverse);
    font-size: 2rem;
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav li {
    margin: 5px 0;
}

.sidebar-nav a {
    color: var(--pico-secondary-inverse);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-radius: var(--pico-border-radius);
    transition: background-color 0.2s ease, color 0.2s ease;
}

.sidebar-nav a:hover {
    background-color: var(--pico-color-jade-450);
}

.menu-item-selected a {
    font-weight: bold;
    background-color: var(--pico-color-jade-450);
    border-right: 5px solid var(--pico-color-jade-300);
}

.sidebar-nav .icon {
    width: 24px;
    height: 24px;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-left: var(--sidebar-width);
    height: 100vh;
}

.header {
    height: var(--header-height);
    /* background-color: var(--pico-secondary-background); */
    color: var(--pico-primary-inverse);
    padding: 0 2rem;
    display: flex;
    /* flex-direction: column; */
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--pico-card-border-color);
    flex-shrink: 0; /* Prevent header from shrinking */
    display: none;
}

.title {
    margin: 1rem 0;
}

.header-right {
    display: inline;
}

.footer {
    /* background: var(--pico-primary-background); */
    color: var(--pico-primary-inverse);
    padding: 1rem 2rem;
    text-align: center;
    border-top: 1px solid var(--pico-card-border-color);
    flex-shrink: 0; /* Prevent footer from shrinking */
}

.footer p {
    margin: 0;
}

.search-result li:hover {
  font-weight: bold;
}

.form-footer {
    margin-top: 20px;
}

.table-container {
    max-height: 1200px; /* Set the maximum height for the tbody */
    overflow-y: auto; /* Enable vertical scrolling */
}

table {
    width: 100%; /* Make the table take full width */
    border-collapse: collapse; /* Collapse borders */
}

thead th {
    position: sticky; /* Make the header sticky */
    top: 0; /* Position it at the top */
    z-index: 10; /* Ensure the header is above the tbody */
    background-color: var(--pico-card-background-color); /* Give header a background */
}

.max-discount td {
    color: #f94358;
}

.max-discount input {
    color: #f94358;
}

.phone-title {
    display: none;
}

.phone-menu {
    display: inline-block !important;
}

.phone-menu-items {
    display: none;
}

.items-table input, select {
    min-width: 100px;
}

.show-actions {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.show-in-print {
    display: none;
}

/* Minimal styles for collapsed sidebar */
body.sidebar-collapsed .sidebar {
    width: 64px !important; /* narrow width showing icons only */
}

body.sidebar-collapsed .sidebar .sidebar-title .title {
    display: none; /* hide the textual title */
}

body.sidebar-collapsed .sidebar .sidebar-nav ul li span {
    display: none; /* hide nav labels */
}

body.sidebar-collapsed .sidebar .sidebar-nav .icon {
    transform: scale(1.5);
}

body.sidebar-collapsed .sidebar .sidebar-nav .menu-item-selected a {
    border: 0 !important;
}

body.sidebar-collapsed .main-content {
    margin-left: 80px;
}

/* Ensure top area aligns icons */
.sidebar .sidebar-top {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    /*padding: 0.5rem 1rem;*/
}

.sidebar-toggle {
    background: none;
    border: none;
    padding: 0.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.sidebar-toggle:focus { outline: 2px solid #6ee7b7; }

@media only screen and (max-width: 930px) {
    :root {
        --sidebar-width: 0px;
    }
    .sidebar {
        display: none;
    }
    .main-content {
        margin-left: 0;
    }
    .phone-title {
        display: block;
    }
    .phone-menu {
        display: contents !important;
    }
    .phone-menu-items {
        display: contents;
    }

    .items-table input, select {
        min-width: 140px;
    }

    .header {
        display: inherit;
    }

    body.sidebar-collapsed .sidebar {
        display: none;
        width: 0 !important;
    }

    body.sidebar-collapsed .main-content {
        margin-left: 1rem !important;
    }
}

@media (min-width: 1090px) {
    .order-resume {
        grid-template-columns: 2fr 1fr !important;
    }
}
