:root {
    --gray-1: hsl(210, 17%, 98%);
    --gray-2: hsl(210, 17%, 87%);
    --blue-1: hsl(209, 100%, 38%);
    --blue-3: hsl(209, 100%, 50%);
    --blue-7: hsl(209, 100%, 90%);
    --red-1: hsl(358, 75%, 59%);
    --red-9: hsl(358, 75%, 97%);
    --green-9: #2b8a3e;
    --yellow-9: #e67700;
    --size-1: 0.25rem;
    --size-2: 0.5rem;
    --size-3: 0.75rem;
    --size-4: 1rem;
    --size-6: 1.5rem;
    --size-8: 2rem;
    --font-size-01: 0.6875rem;
    --font-size-1: 1rem;
    --font-size-2: 1.25rem;
    --font-size-3: 1.5rem;
    --radius-3: 1rem;
    --layer-important: 1000;
    --left-nav-width: 250px;
    --left-nav-collapsed-width: 64px;
    --left-nav-background: linear-gradient(180deg, rgb(0, 0, 0, .85) 60%, #3B7238 100%);
    --header-height: 64px;
    --nav-link-color: #efefef;
}

html, body {
    margin: 0;
    padding: 0;
}

h1, h2, h3, h4, h5, h6 {
    margin: var(--size-1) 0;
}

.layout {
    display: grid;
    grid-template-columns: var(--left-nav-width) 2fr;
    grid-template-areas: 
        "header header"
        "aside main"
        "footer footer";
    margin: 0;
    padding: 0;
    transition: grid-template-columns 0.3s ease;
}

.layout:has(.nav-container.collapsed) {
    grid-template-columns: var(--left-nav-collapsed-width) 2fr;
}

main {
    flex: 1;
    grid-area: main;
    overflow: auto;
    max-height: calc(100vh - var(--header-height));
    padding: var(--size-1) var(--size-4);
}

header {
    grid-area: header;
    max-height: var(--header-height);
    box-sizing: border-box;
}

aside {
    grid-area: aside;
}

/* iPhone 16 Pro Max media query */
@media screen and (max-width: 430px) {
    .layout {
        grid-template-columns: 1fr;
        grid-template-areas: 
            "header"
            "aside"
            "main"
            "footer";
        column-gap: 0;
    }

    /* Override collapsed state for mobile */
    .layout:has(.nav-container.collapsed) {
        grid-template-columns: 1fr;
    }
}

.panel {
    box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.2), 
                0 0 2px 0 rgba(0, 0, 0, 0.19);
    padding: var(--size-2);
    position: relative;
}

.panel .heading {
    margin: 0 0 var(--size-2) 0;
    font-size: var(--font-size-2);
    font-weight: 500;
}

.item > * {
    position: relative;
}

.item .validation-message {
    position: absolute;
    top: 105%;
    color: var(--red-1);
    border: 1px solid var(--red-1);
    border-radius: 2px;
    background-color: var(--red-9);
    padding: var(--size-1);
    z-index: 1;
    font-size: var(--font-size-01);
}

.invalid {
    border: 1px solid var(--red-1);
}

a[role="button"] {
    color: var(--blue-1);
    text-decoration: none;
    cursor: pointer;
}

dialog {
    --border-color: #ccc;
    border: 1px solid var(--border-color); 
    border-radius: 4px;
    padding: 18px;
    box-shadow: 2px 2px 2px var(--border-color);
}

dialog header {
    border-bottom: 1px solid var(--border-color);
    margin: 0 -18px;
    padding: 0 18px;
} 

dialog .dialog-content {
    margin: 12px 0;
}

dialog .actions {
    border-top: 1px solid var(--border-color);
    margin: 0 -18px;
    padding: 0 18px;
    padding-top: 18px;
    display: flex;
    justify-content: end;
    gap: 12px;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

button {
    display: inline-block;
    color: #fff;
    font-size: 14px;
    font-weight: normal;
    border-radius: 4px;
    border: 1px solid #aaa;
    box-shadow: none;
    padding: 4px 8px;
    min-width: 64px;
}

button:hover {
    filter: brightness(0.9);
}

button:focus {
    outline: 1px solid #009;
}

button.primary {
    background: rgb(11.05, 93.5, 215.05);
    border-color: rgb(10.4, 88, 202.4);
}

button.secondary {
    color: black;
    background: #eee;
    border-color: #ddd;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

button:disabled:hover {
    filter: none;
}

input,
select{
    width: 100%;
    padding: 4px 8px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
    background-color: white;
    height: 32px;
}

input:focus,
select:focus {
    outline: none;
    border-color: #0078d4;
}

.form-field {
    display: flex;
    flex-direction: column;
}

.form-field label {
    font-size: 12px;
    color: #333;
    font-weight: 500;
    margin-bottom: 4px;
}
