* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Manrope", "Golos Text", ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
}

html {
    min-height: 100%;
}

body {
    background: #f5f5f5;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    color: #141414;
}

header {
    background: #dc2626;
    padding: 10px;
    font-size: 26px;
    font-weight: bold;
    color: #FFF;
    flex: none;
}

main {
    display: flex;
    height: 100%;
    flex: 1;
}

main > aside {
    flex: none;
    width: 300px;
    background-color: #e4e2e2;
    padding: 10px;
    border-right: 1px solid #d4d7de;
}

section {
    flex: 1;
    padding: 10px;
}

h2 {
    font-size: 20px;
    margin: 5px 0px;
    text-align: center;
}

input[type=text], input[type=date], input[type=password], input[type=time], select, option, textarea {
    width: 100%;
    padding: 10px;
    margin: 5px 0px;
    font-size: 16px;
    outline: none;
    background-color: #fcfcfc;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

main > aside input:focus, main > aside select:focus, main > aside textarea:focus {
    background-color: #fff;
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

main > aside > label {
    display: flex;
    align-items: center;
}

main > aside label span {
    flex: none;
    width: 80px;
    color: #777474;
}

button {
    appearance: none;
    background: #dc2626;
    border: 1px solid #b91c1c;
    border-radius: 12px;
    color: #fff;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    display: block;
    margin: 10px auto;
    cursor: pointer;
    transition: background-color .18s ease, border-color .18s ease, transform .18s ease;
}

button:hover {
    background: #b91c1c;
    border-color: #991b1b;
    transform: translateY(-1px);
}

button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.18);
}

section {
    display: flex;
}

article {
    flex: 1;
    border: 1px solid #CCC;
    border-radius: 0px;
    display: flex;
    flex-direction: column;
}

h3 {
    text-align: left;
    background: transparent;
    border-bottom: 1px solid #eceff3;
    padding: 0 0 10px;
    margin: 0 0 10px;
    color: #111827;
    font-size: 18px;
    font-weight: 700;
}

h3 small {
    font-weight: 500;
    display: block;
    color: #6b7280;
    margin-top: 4px;
}

#scheduleGrid h3 {
    text-align: center;
    background-color: #DDD;
    border-bottom: none;
    padding: 0;
    margin: 0;
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
}

#scheduleGrid h3 small {
    font-weight: normal;
    color: inherit;
    margin-top: 0;
}

h4 {
    font-size: 14px;
    padding: 5px 5px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: center;
    position: relative;
    border-bottom: 1px solid #CCC;
    height: 20px;
    min-height: 20px;
}

section > :first-child  h4 {
    background-color: #EEE;
}

.otherDays input[type=checkbox] {
    display: none;
}

.otherDays label {
    padding: 5px;
    margin: 3px;
    display: inline-block;
    border: 1px solid #966;
    width: 120px;
    border-radius: 5px;
    cursor: pointer;
}

.otherDays input[type=checkbox]:checked + label {
    background-color: #9D9;
    border: 1px solid #696;
}

.method {
    display: inline-block;
    margin: 5px;
    padding: 15px 10px;
    text-align: center;
    width: fit-content;
    border: 1px solid #C70012;
    border-radius: 10px;
    color: #C70012;
    text-decoration: none;
}

.active {
    background-color: #C70012;
    color: #FFF;
    text-decoration: none;
    font-weight: bold;
}

.crm-users {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 12px;
}

.crm-card {
    background: #fff;
    border: 1px solid #d8dce5;
    border-radius: 16px;
    padding: 14px;
}

.crm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}

.crm-table th, .crm-table td {
    border-bottom: 1px solid #e7e9ef;
    text-align: left;
    padding: 8px;
}

.crm-table thead th {
    background: #f3f6fb;
    font-weight: 700;
}

.crm-table tbody tr:hover {
    background: #f8fbff;
}

.crm-table button {
    margin: 0 6px 0 0;
    font-size: 13px;
    padding: 7px 10px;
    border-radius: 10px;
}

.crm-form {
    display: grid;
    gap: 6px;
}

.event-create-form {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    margin-bottom: 0;
}

.event-create-form h2 {
    text-align: left;
    margin: 0 0 10px;
}

.event-create-form label {
    display: block;
}

.role-badge {
    display: inline-block;
    font-size: 12px;
    border-radius: 999px;
    padding: 3px 8px;
    font-weight: 700;
}

.role-admin { background: #fee2e2; color: #991b1b; }
.role-manager { background: #dbeafe; color: #1e3a8a; }
.role-viewer { background: #dcfce7; color: #166534; }

.actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

dialog {
    width: 600px;
    padding: 10px;
    border: none;
    border-radius: 5px;
    position: fixed;
    top: 200px;
    left: 50%;
    margin-left: -300px;
}

dialog::backdrop {
    background-color: rgba(0,0,0,0.5);
}

dialog span {
    display: inline-block;
    width: 200px;
}

dialog a {
    display: inline-block;
    padding: 5px;
    text-align: center;
    width: 260px;
    text-decoration: none;
    color: #FFF;
    border-radius: 5px;
    margin: 5px;
}

dialog a.edit {
    background-color: #16a34a;
    border: 1px solid #15803d;
}

dialog a.delete {
    background-color: #dc2626;
    border: 1px solid #b91c1c;
}

dialog a.reset {
    background-color: #2563eb;
    border: 1px solid #1d4ed8;
}
.app-nav {
    --nav-expanded: 300px;
    --nav-collapsed: 76px;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--nav-expanded);
    padding: 18px 14px;
    z-index: 40;
    transition: width .34s cubic-bezier(.2,.65,.2,1);
}

.app-nav__inner {
    height: 100%;
    border-radius: 20px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: hidden;
}

.app-nav__top, .app-nav__footer, .app-nav__menu { padding: 14px; }
.app-nav__top { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #eceff3; }
.app-nav__brand { display: inline-flex; gap: 10px; align-items: center; text-decoration: none; color: #101010; font-weight: 800; letter-spacing: .01em; }
.app-nav__brand-mark { width: 34px; height: 34px; border-radius: 11px; background: #dc2626; color: #fff; display: grid; place-items: center; }
.app-nav__toggle { width: 36px; height: 36px; border-radius: 11px; border: 1px solid #eceff3; background: #fff; color: #737980; cursor: pointer; transition: all .22s ease; }
.app-nav__toggle:hover { color: #dc2626; border-color: #d1d5db; }
.app-nav__toggle svg { width: 18px; height: 18px; margin-top: 2px; }

.app-nav__menu { flex: 1; overflow-y: auto; }
.app-nav__group-title { text-transform: uppercase; font-size: 11px; letter-spacing: .14em; color: #a1a1aa; padding: 2px 12px 10px; }
.app-nav__item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #2f3338;
    border-radius: 16px;
    padding: 11px 12px;
    margin-bottom: 6px;
    border: 1px solid transparent;
    transition: all .22s ease;
}
.app-nav__item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 20%;
    width: 3px;
    height: 60%;
    border-radius: 6px;
    background: transparent;
    transition: all .22s ease;
}
.app-nav__item:hover { background: #f9fafb; transform: translateY(-1px); border-color: #eceff3; }
.app-nav__item:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(220,38,38,.2); }
.app-nav__icon { width: 22px; height: 22px; flex: none; display: inline-flex; align-items: center; justify-content: center; }
.app-nav__icon svg { width: 22px; height: 22px; }
.app-nav__label { white-space: nowrap; font-weight: 600; font-size: 14px; }
.app-nav__chevron { margin-left: auto; width: 18px; height: 18px; color: #a3a8ae; transition: transform .24s ease; }
.app-nav__submenu { padding-left: 10px; max-height: 0; overflow: hidden; transition: max-height .34s ease; }
.app-nav__submenu.is-open { max-height: 200px; }
.app-nav__item.is-open .app-nav__chevron { transform: rotate(90deg); }
.app-nav__item.is-active { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }
.app-nav__item.is-active::before { background: #ef4444; }
.app-nav__item--sub .app-nav__label { font-weight: 560; }
.app-nav__footer { border-top: 1px solid #eceff3; }
.app-nav__item--logout:hover { color: #b91c1c; }

.app-nav-collapsed .app-nav { width: var(--nav-collapsed); }
.app-nav-collapsed .app-nav__brand-text,
.app-nav-collapsed .app-nav__group-title,
.app-nav-collapsed .app-nav__label,
.app-nav-collapsed .app-nav__chevron { display: none; }
.app-nav-collapsed .app-nav__item { justify-content: center; }
.app-nav-collapsed .app-nav__submenu { padding-left: 0; max-height: none; overflow: visible; }
.app-nav-collapsed .app-nav__item--sub { display: none; }
.app-nav-collapsed .app-nav__item[data-tooltip]:hover::after,
.app-nav-collapsed .app-nav__item[data-tooltip]:focus-visible::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    background: #111827;
    color: #fff;
    font-size: 12px;
    padding: 7px 10px;
    border-radius: 9px;
    white-space: nowrap;
    box-shadow: 0 8px 26px rgba(0,0,0,.22);
}
.app-nav-collapsed .app-nav__top { justify-content: center; }
.app-nav-collapsed #scheduleRoot { margin-bottom: 8px; }

body > header,
body > main {
    margin-left: 300px;
    transition: margin-left .34s cubic-bezier(.2,.65,.2,1);
}
body.app-nav-collapsed > header,
body.app-nav-collapsed > main { margin-left: 76px; }

@media (max-width: 980px) {
    .app-nav { width: 76px; }
    body > header,
    body > main { margin-left: 76px; }
    .app-nav__brand-text,
    .app-nav__group-title,
    .app-nav__label,
    .app-nav__chevron { display: none; }
    .app-nav__item { justify-content: center; }
    .app-nav__item--sub { display: none; }
}
