* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    min-height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--color-body);
    background: var(--color-background);
    font-family: var(--font-family);
    line-height: 1.5;
    transition: color .18s ease, background-color .18s ease;
}

.page-loader {
    position: fixed;
    z-index: 2000;
    inset: 0;
    display: grid;
    place-items: center;
    background: var(--color-background);
    opacity: 1;
    visibility: visible;
    transition: opacity .2s ease, visibility .2s ease;
}

.page-loader.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.page-loader-spinner {
    width: 38px;
    height: 38px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: loader-spin .7s linear infinite;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    padding: 0;
    margin: -1px;
    border: 0;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

@keyframes loader-spin {
    to {
        transform: rotate(360deg);
    }
}

body.drawer-open {
    overflow: hidden;
}

button,
input,
select,
textarea {
    font: inherit;
}

a {
    color: var(--color-primary);
    text-decoration: none;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1,
h2,
h3 {
    color: var(--color-text);
}

p {
    color: var(--color-text-muted);
}

.topbar {
    position: sticky;
    z-index: 40;
    top: 0;
    height: 64px;
    background: color-mix(in srgb, var(--color-surface) 95%, transparent);
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(10px);
}

.topbar-inner {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 16px;
}

.topbar-brand,
.header-brand,
.user-menu-trigger {
    display: flex;
    align-items: center;
}

.topbar-brand {
    gap: 12px;
}

.header-brand {
    gap: 9px;
    color: var(--color-text);
    font-size: 1.1rem;
    font-weight: 750;
    letter-spacing: -.02em;
}

.brand-mark {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--color-primary);
    border-radius: var(--radius-md);
    font-size: .78rem;
    font-weight: 800;
}

.brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: inherit;
}

.icon-button {
    width: 40px;
    height: 40px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    color: var(--color-text);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
}

.icon-button:hover {
    background: var(--color-surface-muted);
}

.user-menu-wrap {
    position: relative;
}

.user-menu-trigger {
    gap: 9px;
    padding: 5px 7px;
    color: var(--color-text);
    background: transparent;
    border: 0;
    border-radius: var(--radius-md);
    cursor: pointer;
}

.user-menu-trigger:hover {
    background: var(--color-surface-muted);
}

.avatar {
    position: relative;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--color-primary);
    border-radius: 50%;
    font-size: .78rem;
    font-weight: 700;
}

.avatar i {
    position: absolute;
    top: 0;
    right: 0;
    width: 10px;
    height: 10px;
    background: var(--color-success);
    border: 2px solid var(--color-surface);
    border-radius: 50%;
}

.user-menu-copy {
    min-width: 0;
    text-align: left;
}

.user-menu-copy strong,
.user-menu-copy small {
    display: block;
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu-copy strong {
    font-size: .75rem;
}

.user-menu-copy small {
    color: var(--color-text-muted);
    font-size: .68rem;
}

.chevron {
    color: var(--color-text-muted);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 256px;
    display: none;
    overflow: hidden;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 18px 40px rgb(15 23 42 / 18%);
}

.user-dropdown.is-open {
    display: block;
}

.user-dropdown-heading {
    padding: 13px 16px;
    border-bottom: 1px solid var(--color-border);
}

.user-dropdown-heading strong,
.user-dropdown-heading small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-dropdown-heading strong {
    color: var(--color-text);
    font-size: .875rem;
}

.user-dropdown-heading small {
    color: var(--color-text-muted);
    font-size: .75rem;
}

.user-dropdown-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    font-size: .875rem;
    border-bottom: 1px solid var(--color-border);
}

.logout-form {
    margin: 0;
    padding: 6px;
}

.dropdown-action {
    width: 100%;
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    background: transparent;
    border: 0;
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--color-body);
    font-size: .875rem;
    font-weight: 550;
    text-align: left;
}

.dropdown-action:hover {
    color: var(--color-text);
    background: var(--color-surface-muted);
}

.user-dropdown-links {
    display: grid;
    padding-block: 6px;
    border-bottom: 1px solid var(--color-border);
}

.danger-text {
    color: var(--color-danger);
}

.profile-layout {
    display: grid;
    grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
    gap: 20px;
    align-items: start;
}

.profile-summary {
    display: flex;
    align-items: center;
    gap: 16px;
}

.profile-summary h2,
.profile-summary p {
    margin: 0;
}

.profile-summary p {
    margin-top: 4px;
    color: var(--color-text-muted);
}

.profile-avatar {
    width: 56px;
    height: 56px;
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    color: #fff;
    background: var(--color-primary);
    border-radius: 50%;
    font-size: 1.2rem;
    font-weight: 750;
}

.profile-details {
    display: grid;
    gap: 14px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--color-border);
}

.profile-details div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.profile-details span {
    color: var(--color-text-muted);
}

.permission-list {
    display: grid;
    gap: 10px;
    max-height: 480px;
    overflow-y: auto;
    padding-right: 6px;
    scrollbar-gutter: stable;
}

.access-notice {
    display: grid;
    gap: 3px;
    margin-bottom: 14px;
    padding: 13px 15px;
    color: var(--color-primary);
    background: color-mix(in srgb, var(--color-primary) 10%, var(--color-surface));
    border: 1px solid color-mix(in srgb, var(--color-primary) 28%, var(--color-border));
    border-radius: var(--radius-md);
}

.access-notice span {
    color: var(--color-body);
    font-size: .82rem;
}

.permission-list-item {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 11px 13px;
    background: var(--color-surface-muted);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.permission-list-item strong,
.permission-list-item small {
    display: block;
}

.permission-list-item small {
    margin-top: 3px;
    color: var(--color-text-muted);
}

.empty-state {
    margin: 0;
    padding: 20px;
    color: var(--color-text-muted);
    background: var(--color-surface-muted);
    border-radius: var(--radius-md);
    text-align: center;
}

.theme-icon-dark {
    display: none;
}

[data-theme="dark"] .theme-icon-light {
    display: none;
}

[data-theme="dark"] .theme-icon-dark {
    display: inline;
}

.sidebar-overlay {
    position: fixed;
    z-index: 50;
    inset: 0;
    visibility: hidden;
    opacity: 0;
    background: rgb(2 6 23 / 60%);
    backdrop-filter: blur(2px);
    transition: opacity .24s ease, visibility 0s linear .24s;
}

.sidebar-overlay.is-open {
    visibility: visible;
    opacity: 1;
    transition-delay: 0s;
}

.sidebar {
    width: var(--sidebar-width);
    max-width: 85vw;
    height: 100%;
    overflow-y: auto;
    padding: 20px;
    background: var(--color-surface);
    border-right: 1px solid var(--color-border);
    box-shadow: 0 24px 50px rgb(0 0 0 / 28%);
    overscroll-behavior: contain;
    transform: translate3d(-100%, 0, 0);
    transition: transform .28s cubic-bezier(.22, 1, .36, 1);
    will-change: transform;
    backface-visibility: hidden;
}

.sidebar.is-open {
    transform: translate3d(0, 0, 0);
}

.sidebar-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
}

.sidebar-heading strong,
.sidebar-heading small {
    display: block;
}

.sidebar-heading strong {
    color: var(--color-text);
    font-size: 1.1rem;
}

.sidebar-heading small {
    color: var(--color-text-muted);
    font-size: .75rem;
}

.nav-label {
    margin: 0 12px 12px;
    color: var(--color-text-muted);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.sidebar-nav {
    display: grid;
    gap: 6px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: var(--color-body);
    border-radius: var(--radius-md);
    font-size: .875rem;
    font-weight: 550;
    transition: color .15s ease, background-color .15s ease;
}

.nav-link:hover {
    color: var(--color-text);
    background: var(--color-surface-muted);
}

.nav-link.is-active {
    color: #fff;
    background: var(--color-primary);
    box-shadow: var(--shadow-sm);
}

.nav-group {
    display: grid;
    gap: 4px;
}

.nav-group-toggle {
    min-height: 40px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    color: var(--color-body);
    background: transparent;
    border: 0;
    border-radius: var(--radius-md);
    box-shadow: none;
    font-size: .875rem;
    font-weight: 600;
    text-align: left;
}

.nav-group-toggle:hover {
    color: var(--color-text);
    background: var(--color-surface-muted);
}

.nav-group-toggle.is-active {
    color: #fff;
    background: var(--color-primary);
    box-shadow: var(--shadow-sm);
}

.nav-group-toggle svg {
    flex: 0 0 auto;
    transition: transform .18s ease;
}

.nav-group-toggle[aria-expanded="true"] svg {
    transform: rotate(180deg);
}

.nav-group-items {
    display: none;
    gap: 4px;
    margin-left: 12px;
    padding-left: 10px;
    border-left: 1px solid var(--color-border);
}

.nav-group-items.is-open {
    display: grid;
}

.nav-group-items .nav-link {
    padding-block: 8px;
    font-size: .82rem;
}

.container {
    width: 100%;
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 24px 16px;
}

.page-heading {
    min-height: 80px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--color-border);
}

.page-heading h1 {
    margin-bottom: 5px;
    font-size: clamp(1.5rem, 3vw, 1.875rem);
    line-height: 1.2;
    letter-spacing: -.025em;
}

.page-heading p {
    max-width: 672px;
    margin: 0;
    font-size: .875rem;
    line-height: 1.6;
}

.card {
    padding: 24px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.narrow {
    width: min(672px, 100%);
    margin-inline: auto;
}

.narrow>h1 {
    margin-bottom: 24px;
    font-size: 1.5rem;
}

form:not(.filters):not(.logout-form) {
    display: grid;
    gap: 20px;
}

.filters {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    margin: 16px 0;
}

.filter-group {
    display: flex;
    align-items: end;
    gap: 10px;
}

.filter-search {
    width: min(540px, 100%);
}

.filter-search label {
    flex: 1;
}

.filter-page-size {
    margin-left: auto;
}

.filter-page-size label {
    width: 92px;
}

.department-filter-options label:first-child {
    width: 132px;
}

.designation-filter-options label:first-child {
    width: 210px;
}

.designation-filter-options label:not(:first-child) {
    width: 110px;
}

label {
    display: grid;
    gap: 8px;
    color: var(--color-text);
    font-size: .875rem;
    font-weight: 550;
}

input,
select {
    min-height: 40px;
    width: 100%;
    padding: 9px 12px;
    color: var(--color-text);
    background: var(--color-input);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    outline: none;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-primary) 28%, transparent);
}

textarea {
    min-height: 112px;
    resize: vertical;
}

button,
.button {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    padding: 7px 14px;
    color: #fff;
    background: var(--color-primary);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    font-weight: 600;
    cursor: pointer;
}

button:hover,
.button:hover {
    background: var(--color-primary-hover);
}

.button-secondary {
    color: var(--color-body);
    background: var(--color-surface-muted);
    border-color: var(--color-border);
}

.button-secondary:hover {
    color: var(--color-text);
    background: color-mix(in srgb, var(--color-border) 70%, var(--color-surface));
    border-color: var(--color-border);
}

.icon-button,
.user-menu-trigger,
.dropdown-action {
    min-height: auto;
    box-shadow: none;
}

.icon-button:hover,
.user-menu-trigger:hover,
.dropdown-action:hover {
    color: var(--color-text);
    background: var(--color-surface-muted);
}

.danger {
    background: var(--color-danger);
}

.danger:hover {
    background: var(--color-danger-hover);
}

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

td.actions {
    display: table-cell;
}

td.actions > * + * {
    margin-left: 10px;
}

.actions a:not(.button) {
    padding: 6px 8px;
    border-radius: 6px;
    font-size: .78rem;
    font-weight: 650;
}

.actions a:not(.button):hover {
    background: color-mix(in srgb, var(--color-primary) 10%, transparent);
}

.searchable-select {
    position: relative;
    width: 100%;
}

.searchable-select__native {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    opacity: 0;
    pointer-events: none;
}

.searchable-select__input {
    padding-right: 36px;
    cursor: text;
}

.searchable-select__chevron {
    position: absolute;
    top: 50%;
    right: 12px;
    display: grid;
    place-items: center;
    color: var(--color-text-muted);
    pointer-events: none;
    transform: translateY(-50%);
    transition: transform .15s ease;
}

.searchable-select.is-open .searchable-select__chevron {
    transform: translateY(-50%) rotate(180deg);
}

.searchable-select__dropdown {
    position: absolute;
    z-index: 35;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    max-height: 240px;
    display: none;
    overflow-y: auto;
    padding: 6px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

.searchable-select.is-open .searchable-select__dropdown {
    display: grid;
}

.searchable-select__option {
    min-height: 36px;
    width: 100%;
    justify-content: flex-start;
    padding: 8px 10px;
    color: var(--color-body);
    background: transparent;
    border: 0;
    box-shadow: none;
    font-size: .875rem;
    text-align: left;
}

.searchable-select__option:hover,
.searchable-select__option[aria-selected="true"] {
    color: var(--color-text);
    background: var(--color-surface-muted);
}

.searchable-select__option[aria-selected="true"] {
    color: var(--color-primary);
}

.searchable-select__empty {
    margin: 0;
    padding: 10px;
    font-size: .8rem;
    text-align: center;
}

[data-theme="dark"] button:not(.icon-button):not(.user-menu-trigger):not(.dropdown-action):not(.searchable-select__option):not(.nav-group-toggle),
[data-theme="dark"] .button {
    color: #ffffff;
}

[data-theme="dark"] .button-secondary {
    color: var(--color-body);
    background: var(--color-surface-muted);
}

[data-theme="dark"] .searchable-select__dropdown,
[data-theme="dark"] .user-dropdown {
    box-shadow: 0 20px 45px rgb(0 0 0 / 45%);
}

.table-wrap {
    position: relative;
    overflow-x: auto;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

table {
    width: 100%;
    min-width: 672px;
    border-collapse: collapse;
    text-align: left;
    font-size: .875rem;
}

thead {
    color: var(--color-text-muted);
    background: var(--color-surface-muted);
    border-bottom: 1px solid var(--color-border);
}

th {
    padding: 13px 20px;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    white-space: nowrap;
}

td {
    padding: 15px 20px;
    color: var(--color-body);
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
    white-space: nowrap;
}

tbody tr:last-child td {
    border-bottom: 0;
}

tbody tr:hover td {
    background: var(--color-surface-soft);
}

.table-empty {
    padding: 32px 20px;
    color: var(--color-text-muted);
    text-align: center;
}

.table-wrap+.pagination-bar {
    margin-top: 0;
    padding: 16px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-top: 0;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.pagination-bar p {
    margin: 0;
    font-size: .875rem;
}

.pagination {
    display: flex;
    gap: 0;
    overflow-x: auto;
}

.pagination a {
    min-width: 36px;
    display: grid;
    place-items: center;
    padding: 7px 11px;
    color: var(--color-body);
    background: var(--color-surface-muted);
    border: 1px solid var(--color-border);
    margin-left: -1px;
    font-size: .82rem;
    font-weight: 600;
}

.pagination a:first-child {
    margin-left: 0;
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.pagination a:last-child {
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.pagination a:hover {
    color: var(--color-text);
    background: color-mix(in srgb, var(--color-border) 65%, var(--color-surface));
}

.pagination .active {
    position: relative;
    z-index: 1;
    color: var(--color-primary);
    background: var(--color-primary-soft);
    border-color: var(--color-primary);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.module-card {
    display: block;
    transition: transform .15s ease, box-shadow .15s ease;
}

.module-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.module-card h2 {
    margin: 14px 0 5px;
    font-size: 1rem;
}

.module-card p {
    margin: 0;
    font-size: .78rem;
}

.module-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    color: var(--color-primary);
    background: var(--color-primary-soft);
    border-radius: var(--radius-lg);
}

.dashboard-hero {
    background: var(--color-surface);
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
}

.checkbox-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px;
    background: var(--color-surface-soft);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.checkbox-option input {
    min-height: auto;
    width: auto;
    margin-top: 4px;
    accent-color: var(--color-primary);
}

.checkbox-option span {
    display: grid;
    gap: 3px;
}

.checkbox-option small {
    color: var(--color-text-muted);
    font-weight: 400;
}

.file-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--color-text-muted);
    font-size: .8rem;
}

.file-preview img {
    width: 96px;
    height: 64px;
    object-fit: contain;
    background: var(--color-surface-soft);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.file-preview-small img {
    width: 40px;
    height: 40px;
}

.settings-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr);
    gap: 20px;
}

.communication-service-picker {
    max-width: 520px;
    margin-bottom: 20px;
}

.communication-settings-grid {
    align-items: start;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.communication-card-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.communication-card-heading h2,
.communication-card-heading p {
    margin-top: 0;
}

.compact-checkbox {
    flex: 0 0 auto;
    min-width: 112px;
}

.communication-inline-fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 120px;
    gap: 14px;
}

.communication-save-actions {
    margin-top: 20px;
}

.settings-grid h2,
.subheading h2 {
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.config-list {
    display: grid;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.config-list>div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--color-border);
}

.config-list>div:last-child {
    border-bottom: 0;
}

.config-list span {
    color: var(--color-text-muted);
    font-size: .82rem;
}

.config-list strong {
    color: var(--color-text);
    font-size: .85rem;
}

.config-note {
    margin: 14px 0 0;
    font-size: .8rem;
}

.backup-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.backup-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.backup-card h2 {
    margin-bottom: 8px;
    font-size: 1.05rem;
}

.backup-card p {
    flex: 1;
    margin-bottom: 20px;
    font-size: .85rem;
}

.backup-note {
    margin-top: 20px;
}

.backup-note p {
    margin: 6px 0;
}

.backup-note code,
.config-note code {
    color: var(--color-primary);
    overflow-wrap: anywhere;
}

.drive-settings-card {
    margin-top: 20px;
}

.drive-settings-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--color-border);
}

.drive-settings-heading h2 {
    margin: 3px 0 5px;
    font-size: 1.15rem;
}

.drive-settings-heading p,
.drive-viewer-message {
    margin: 0;
    color: var(--color-text-muted);
    font-size: .86rem;
}

.drive-eyebrow {
    color: var(--color-primary);
    font-size: .7rem;
    font-weight: 750;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.drive-settings-layout {
    display: grid;
    grid-template-columns: minmax(250px, .75fr) minmax(0, 1.25fr);
    gap: 24px;
    padding-top: 22px;
}

.drive-setup-guide {
    padding: 18px;
    background: var(--color-surface-soft);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
}

.drive-setup-guide h3 {
    margin: 0 0 12px;
    font-size: .95rem;
}

.drive-setup-guide ol {
    margin: 0;
    padding-left: 20px;
    color: var(--color-body);
    font-size: .82rem;
}

.drive-setup-guide li + li {
    margin-top: 9px;
}

.drive-setup-guide a {
    color: var(--color-primary);
    font-weight: 650;
}

.drive-guide-note {
    margin: 16px 0 0;
    padding-top: 14px;
    color: var(--color-text-muted);
    border-top: 1px solid var(--color-border);
    font-size: .78rem;
}

.drive-settings-form {
    display: grid;
    gap: 16px;
}

.drive-settings-form label {
    margin: 0;
}

.drive-settings-form small code {
    color: var(--color-primary);
}

.drive-redirect-uri {
    display: grid;
    gap: 6px;
    padding: 14px;
    background: var(--color-surface-muted);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.drive-redirect-uri span {
    color: var(--color-text);
    font-size: .8rem;
    font-weight: 700;
}

.drive-redirect-uri code {
    color: var(--color-primary);
    overflow-wrap: anywhere;
}

.drive-settings-actions {
    flex-wrap: wrap;
}

.drive-disconnect {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--color-border);
}

.drive-viewer-message {
    padding-top: 18px;
}

.subheading {
    margin: 28px 0 14px;
}

.subheading p {
    margin-bottom: 0;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 700;
}

.employee-table-photo {
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    object-fit: cover;
    border-radius: 50%;
    background: var(--color-surface-muted);
    border: 1px solid var(--color-border);
}

.employee-photo-placeholder {
    color: var(--color-primary);
    font-weight: 700;
}

.employee-photo-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--color-text-muted);
    font-size: .875rem;
}

.employee-photo-preview img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 50%;
    border: 1px solid var(--color-border);
}

.shift-rule-grid,
.shift-segment-fields {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.shift-segment-heading {
    align-items: center;
}

.shift-segment-list {
    display: grid;
    gap: 16px;
}

.shift-segment-card {
    padding: 16px;
    background: var(--color-surface-muted);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.shift-segment-card > .button-secondary {
    margin-top: 14px;
}

.status-success {
    color: #047857;
    background: rgb(16 185 129 / 14%);
}

.status-warning {
    color: #b45309;
    background: rgb(245 158 11 / 16%);
}

.status-danger {
    color: var(--color-danger);
    background: rgb(239 68 68 / 14%);
}

.inline-form {
    display: inline-flex !important;
    gap: 0 !important;
}

.inline-form button {
    min-height: 34px;
    padding: 6px 10px;
    font-size: .75rem;
}

.login-page {
    position: relative;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 48px 16px;
}

.login-container {
    width: min(448px, 100%);
}

.login-container .card {
    padding: 32px;
    box-shadow: 0 20px 44px rgb(15 23 42 / 14%);
}

.login-brand {
    min-height: 56px;
    display: grid;
    place-items: center;
    margin-bottom: 16px;
}

.login-brand img {
    display: block;
    width: min(140px, 100%);
    max-height: 72px;
    margin-inline: auto;
    object-fit: contain;
}

.login-brand span {
    color: var(--color-primary);
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: .04em;
}

.login-container h1 {
    text-align: center;
}

.toast-container {
    position: fixed;
    z-index: 1000;
    top: 20px;
    left: 50%;
    width: min(420px, calc(100vw - 32px));
    display: grid;
    gap: 10px;
    pointer-events: none;
    transform: translateX(-50%);
}

.toast {
    --toast-accent: var(--color-success);
    width: fit-content;
    max-width: 100%;
    margin-inline: auto;
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 11px 15px 11px 11px;
    color: var(--color-text);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    pointer-events: auto;
    animation: toast-in .32s ease both;
}

.toast--error {
    --toast-accent: var(--color-danger);
}

.toast__icon {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    display: inline-grid;
    place-items: center;
    color: var(--toast-accent);
    border: 2px solid currentColor;
    border-radius: 50%;
}

.toast__icon svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.toast__message {
    font-size: .875rem;
    font-weight: 500;
}

.toast.is-leaving {
    animation: toast-out .2s ease both;
}

.error-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.error-card {
    width: min(560px, 100%);
    text-align: center;
}

.error-code {
    margin: 0;
    color: var(--color-primary);
    font-size: 4rem;
    font-weight: 800;
    line-height: 1;
}

.error-card .button {
    margin-top: 12px;
}

.health-page {
    width: min(820px, 100%);
}

.health-container {
    width: min(900px, 100%);
}

.health-heading,
.health-panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.health-heading {
    margin-bottom: 22px;
}

.health-heading h1,
.health-heading p,
.health-panel-heading h2 {
    margin: 0;
}

.health-heading > div > p:last-child {
    margin-top: 6px;
    color: var(--color-text-muted);
}

.health-eyebrow {
    margin-bottom: 5px !important;
    color: var(--color-primary);
    font-size: .72rem;
    font-weight: 750;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.health-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.health-panel {
    padding: 22px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.health-panel-heading {
    align-items: center;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--color-border);
}

.health-details {
    display: grid;
    gap: 0;
    margin: 8px 0 0;
}

.health-details div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px solid var(--color-border);
}

.health-details div:last-child {
    border-bottom: 0;
}

.health-details dt {
    color: var(--color-text-muted);
}

.health-details dd {
    margin: 0;
    color: var(--color-text);
    font-weight: 650;
    text-align: right;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(-12px) scale(.97);
    }
}

@keyframes toast-out {
    to {
        opacity: 0;
        transform: translateY(-8px) scale(.97);
    }
}

.roster-pattern-details {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.roster-day-heading {
    margin-top: 24px;
}

.roster-day-list {
    display: grid;
    gap: 12px;
    margin-bottom: 20px;
}

.roster-day-row {
    display: grid;
    grid-template-columns: minmax(80px, 120px) minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: var(--color-surface-muted);
}

.roster-day-row label {
    margin: 0;
}

.roster-assignment-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.table-secondary {
    display: block;
    margin-top: 3px;
    color: var(--color-text-muted);
}

.holiday-form-grid,
.holiday-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.holiday-filter-options {
    flex-wrap: wrap;
}

.holiday-schedule-item {
    display: block;
}

.leave-type-grid,
.leave-request-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.leave-type-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.review-details {
    display: grid;
    gap: 0;
    margin: 16px 0 24px;
}

.review-details div {
    display: grid;
    grid-template-columns: minmax(130px, 180px) 1fr;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--color-border);
}

.review-details dt {
    color: var(--color-text-muted);
}

.review-details dd {
    margin: 0;
}

@media (min-width: 640px) {
    .topbar-inner {
        padding-inline: 24px;
    }

    .container {
        padding: 24px;
    }
}

@media (min-width: 1024px) {
    .container {
        padding: 32px;
    }
}

@media (max-width: 700px) {

    .header-brand>span:last-child,
    .user-menu-copy,
    .chevron {
        display: none;
    }

    .page-heading,
    .pagination-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filters {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group {
        width: 100%;
        align-items: end;
    }

    .filter-search label {
        min-width: 0;
    }

    .filter-page-size {
        margin-left: 0;
    }

    .filter-page-size label {
        flex: 1;
        width: auto;
    }

    .department-filter-options label:first-child {
        width: auto;
    }

    .designation-filter-options {
        flex-wrap: wrap;
    }

    .designation-filter-options label:first-child,
    .designation-filter-options label:not(:first-child) {
        flex: 1;
        width: auto;
        min-width: 120px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .shift-rule-grid,
    .shift-segment-fields,
    .roster-pattern-details,
    .roster-assignment-grid,
    .holiday-form-grid,
    .holiday-options,
    .leave-type-grid,
    .leave-request-grid,
    .leave-type-options {
        grid-template-columns: 1fr;
    }

    .review-details div {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .roster-day-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .settings-grid {
        grid-template-columns: 1fr;
    }

    .communication-inline-fields {
        grid-template-columns: 1fr;
    }

    .backup-grid {
        grid-template-columns: 1fr;
    }

    .drive-settings-heading {
        flex-direction: column;
    }

    .drive-settings-layout {
        grid-template-columns: 1fr;
    }

    .profile-layout {
        grid-template-columns: 1fr;
    }

    .health-grid {
        grid-template-columns: 1fr;
    }

    .health-heading {
        flex-direction: column;
    }

    .card {
        padding: 20px;
    }

    .login-container .card {
        padding: 28px 22px;
    }
}

.location-coordinates {
    white-space: nowrap;
}

.location-map-trigger {
    display: inline-grid;
    width: 34px;
    height: 34px;
    margin-left: 6px;
    padding: 0;
    color: var(--color-primary);
    background: transparent;
    border-color: transparent;
    place-items: center;
    vertical-align: middle;
}

.location-map-trigger:hover,
.location-map-trigger:focus-visible {
    color: var(--color-primary-hover);
    background: var(--color-primary-soft);
}

.location-map-dialog {
    width: min(900px, calc(100% - 32px));
    padding: 0;
    color: var(--color-text);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
}

.location-map-dialog::backdrop {
    background: rgb(15 23 42 / 68%);
}

.location-map-heading,
.location-map-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
}

.location-map-heading h2,
.location-map-heading p {
    margin: 0;
}

.location-map-heading p {
    margin-top: 4px;
    color: var(--color-text-muted);
}

.location-map-canvas {
    position: relative;
    display: block;
    width: 100%;
    height: min(60vh, 520px);
    border-block: 1px solid var(--color-border);
}

.location-map-canvas iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.location-map-radius {
    position: absolute;
    z-index: 2;
    top: 50%;
    left: 50%;
    width: 25%;
    aspect-ratio: 1;
    border: 2px solid var(--color-primary);
    border-radius: 50%;
    background: rgb(37 99 235 / 18%);
    pointer-events: none;
    transform: translate(-50%, -50%);
}

.location-map-loader {
    position: absolute;
    z-index: 1000;
    inset: 78px 0 57px;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 10px;
    background: var(--color-surface);
    transition: opacity .15s ease, visibility .15s ease;
}

.location-map-loader.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.location-map-spinner {
    width: 34px;
    height: 34px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: loader-spin .7s linear infinite;
}

.policy-section {
    margin-bottom: 18px;
}

.policy-section h2 {
    margin-top: 0;
}

.attendance-policy-grid,
.policy-option-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.policy-rule-card {
    padding: 16px;
    margin-bottom: 14px;
    background: var(--color-surface-soft);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.policy-rule-card:last-child {
    margin-bottom: 0;
}

.slab-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.slab-heading h3 {
    margin: 0;
}

.deduction-slab-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(120px, 1fr)) auto;
    align-items: end;
    gap: 12px;
    padding: 12px 0;
    border-top: 1px solid var(--color-border);
}

.policy-details-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.policy-details-list {
    margin: 0;
}

.policy-details-list div {
    display: grid;
    grid-template-columns: minmax(140px, 1fr) 2fr;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px solid var(--color-border);
}

.policy-details-list div:last-child {
    border-bottom: 0;
}

.policy-details-list dt {
    color: var(--color-text-muted);
}

.policy-details-list dd {
    margin: 0;
    color: var(--color-text);
}

@media (max-width: 700px) {
    .attendance-policy-grid,
    .policy-option-grid {
        grid-template-columns: 1fr;
    }

    .policy-details-grid {
        grid-template-columns: 1fr;
    }

    .policy-details-list div {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .deduction-slab-row {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
    }

    .page-loader-spinner {
        animation: none;
    }
}
