@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800&display=swap');

@font-face {
    font-family: 'SaudiRiyal';
    src: url('../fonts/saudi-riyal/riyal-regular.woff2') format('woff2'),
         url('../fonts/saudi-riyal/riyal-regular.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
    unicode-range: U+20C1;
}

@font-face {
    font-family: 'SaudiRiyal';
    src: url('../fonts/saudi-riyal/riyal-bold.woff2') format('woff2'),
         url('../fonts/saudi-riyal/riyal-bold.woff') format('woff');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
    unicode-range: U+20C1;
}

:root {
    --caly-primary: #3B44FF;
    --caly-accent: #82F7FF;
    --caly-dark: #0B1026;
    --caly-sidebar: #ffffff;
    --caly-sidebar-bg: #f8faff;
    --caly-sidebar-hover: #eef2ff;
    --caly-card: #ffffff;
    --caly-border: #e2e8f0;
    --caly-text: #1e293b;
    --caly-muted: #64748b;
    --caly-success: #10b981;
    --caly-warning: #f59e0b;
    --caly-danger: #ef4444;
    --sidebar-width: 280px;
    --header-height: 72px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Cairo', sans-serif;
    background: #f4f7fb;
    color: var(--caly-text);
    direction: rtl;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--caly-sidebar) 0%, var(--caly-sidebar-bg) 100%);
    color: var(--caly-text);
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 100;
    border-left: 1px solid var(--caly-border);
    box-shadow: -2px 0 16px rgba(59, 68, 255, 0.06);
}

.sidebar-profile {
    padding: 1.5rem 1.25rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.4rem;
    transition: background 0.2s;
}

.sidebar-profile:hover,
.sidebar-profile.is-active {
    background: var(--caly-sidebar-hover);
}

.sidebar-profile__avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--caly-primary), #5b63ff);
    color: #fff;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
    box-shadow: 0 4px 12px rgba(59, 68, 255, 0.2);
    overflow: hidden;
}

.sidebar-profile__avatar.has-image {
    background: #e2e8f0;
}

.sidebar-profile__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.sidebar-profile__name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--caly-dark);
    line-height: 1.35;
}

.sidebar-profile__role {
    font-size: 0.78rem;
    color: var(--caly-primary);
    font-weight: 500;
    line-height: 1.35;
}

.profile-summary {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.profile-avatar-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.profile-avatar-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.profile-summary__avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--caly-primary), #5b63ff);
    color: #fff;
    font-size: 1.75rem;
    font-weight: 700;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.profile-summary__avatar.has-image {
    background: #e2e8f0;
}

.profile-summary__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.profile-summary__avatar--editable {
    cursor: pointer;
}

.profile-summary__avatar-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    background: rgba(11, 16, 38, 0.55);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.2s;
}

.profile-summary__avatar--editable:hover .profile-summary__avatar-overlay,
.profile-summary__avatar--editable:focus-within .profile-summary__avatar-overlay {
    opacity: 1;
}

.profile-avatar-remove {
    white-space: nowrap;
}

.profile-summary__name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--caly-dark);
    margin: 0 0 0.25rem;
}

.profile-summary__role {
    font-size: 0.9rem;
    color: var(--caly-muted);
    margin: 0 0 0.5rem;
}

.profile-summary .role-badge {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
}

.form-control--readonly {
    background: #f8fafc;
    color: var(--caly-text);
    display: flex;
    align-items: center;
    min-height: 42px;
}

.sidebar-backdrop {
    display: none;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.sidebar-nav::-webkit-scrollbar {
    display: none;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: var(--caly-muted);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    border-right: 3px solid transparent;
}

.nav-link:hover {
    background: var(--caly-sidebar-hover);
    color: var(--caly-primary);
}

.nav-link.active {
    background: rgba(59, 68, 255, 0.1);
    color: var(--caly-primary);
    border-right-color: var(--caly-primary);
    font-weight: 600;
}

.nav-link svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.main-content {
    margin-right: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    min-width: 0;
}

.app-header {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 90;
    min-height: var(--header-height);
    background: var(--caly-sidebar);
    padding: 0.75rem 2rem;
    border-bottom: 1px solid var(--caly-border);
    align-items: center;
    gap: 1rem;
}

.app-header__start {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    flex: 1;
}

.app-header__logo {
    display: inline-flex;
    align-items: center;
    line-height: 0;
}

.app-header__logo img {
    height: 36px;
    width: auto;
    max-width: 140px;
    object-fit: contain;
}

.app-header__logout {
    margin-right: auto;
    display: flex;
    align-items: center;
}

.menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--caly-border);
    border-radius: 10px;
    background: #fff;
    color: var(--caly-dark);
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.menu-toggle:hover {
    background: var(--caly-sidebar-hover);
    border-color: #c7d2fe;
    color: var(--caly-primary);
}

.menu-toggle svg {
    width: 22px;
    height: 22px;
}

.header-logout-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--caly-border);
    border-radius: 10px;
    background: #fff;
    color: var(--caly-muted);
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.header-logout-btn:hover {
    color: var(--caly-danger);
    border-color: #fecaca;
    background: #fef2f2;
}

.header-logout-btn svg {
    width: 20px;
    height: 20px;
}

.page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.15rem 1.25rem;
    margin-bottom: 1.25rem;
}

.page-heading__text {
    min-width: 0;
}

.page-heading__actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.page-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--caly-dark);
    line-height: 1.3;
}

.page-subtitle {
    font-size: 0.85rem;
    color: var(--caly-muted);
    margin-top: 0.25rem;
}

body.no-scroll {
    overflow: hidden;
}

.content-area {
    padding: 1.5rem 2rem 2rem;
}

.card {
    background: var(--caly-card);
    border-radius: 12px;
    border: 1px solid var(--caly-border);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--caly-border);
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-body {
    padding: 1.25rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.25rem;
    border: 1px solid var(--caly-border);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    background: var(--caly-primary);
}

.stat-card.accent::before {
    background: var(--caly-accent);
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--caly-primary);
    line-height: 1;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--caly-muted);
    margin-top: 0.35rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1.1rem;
    border-radius: 8px;
    font-family: 'Cairo', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn:disabled,
.btn[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--caly-primary);
    color: #fff;
}

.btn-primary:hover {
    background: #2d35cc;
}

.btn-accent {
    background: var(--caly-accent);
    color: var(--caly-dark);
}

.btn-success {
    background: var(--caly-success);
    color: #fff;
}

.btn-danger {
    background: var(--caly-danger);
    color: #fff;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--caly-border);
    color: var(--caly-text);
}

.btn-outline:hover {
    border-color: var(--caly-primary);
    color: var(--caly-primary);
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
}

.table-wrap {
    overflow-x: auto;
}

table.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

table.data-table th,
table.data-table td {
    padding: 0.75rem 1rem;
    text-align: right;
    border-bottom: 1px solid var(--caly-border);
}

table.data-table th {
    background: #f8fafc;
    font-weight: 700;
    color: var(--caly-dark);
    white-space: nowrap;
}

table.data-table tr:hover td {
    background: #f8fafc;
}

.badge {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-draft { background: #e2e8f0; color: #475569; }
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-approved { background: #d1fae5; color: #065f46; }
.badge-rejected { background: #fee2e2; color: #991b1b; }

.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: var(--caly-text);
}

.form-control {
    width: 100%;
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--caly-border);
    border-radius: 8px;
    font-family: 'Cairo', sans-serif;
    font-size: 0.9rem;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--caly-primary);
    box-shadow: 0 0 0 3px rgba(59, 68, 255, 0.1);
}

.password-field {
    position: relative;
    display: flex;
    align-items: center;
}

.password-field__input {
    padding-left: 2.75rem;
}

.password-field__toggle {
    position: absolute;
    left: 0.45rem;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: var(--caly-muted);
    cursor: pointer;
    border-radius: 8px;
    transition: color 0.2s, background 0.2s;
}

.password-field__toggle:hover {
    color: var(--caly-primary);
    background: var(--caly-sidebar-hover);
}

.password-field__icon {
    width: 18px;
    height: 18px;
    display: block;
}

.password-field__icon[hidden],
.password-field__toggle[aria-pressed="true"] .password-field__icon--show,
.password-field__toggle:not([aria-pressed="true"]) .password-field__icon--hide {
    display: none !important;
}

.password-field__toggle[aria-pressed="true"] .password-field__icon--hide,
.password-field__toggle:not([aria-pressed="true"]) .password-field__icon--show {
    display: block !important;
}

.alert {
    padding: 0.85rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.eval-hero {
    margin-bottom: 1rem;
    overflow: hidden;
}

.eval-hero__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    flex-wrap: wrap;
    padding: 1.15rem 1.35rem;
    background: linear-gradient(135deg, #f8faff 0%, #eef2ff 100%);
    border-right: 4px solid var(--caly-primary);
}

.eval-hero__brand {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    min-width: 0;
}

.eval-hero__logo {
    width: 52px;
    height: 52px;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 12px;
    background: #fff;
    border: 1px solid var(--caly-border);
    padding: 0.35rem;
}

.eval-hero__brand-text {
    min-width: 0;
}

.eval-hero__company {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--caly-muted);
    margin-bottom: 0.15rem;
}

.eval-hero__title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--caly-dark);
    line-height: 1.35;
}

.eval-hero__period {
    margin: 0.25rem 0 0;
    font-size: 0.84rem;
    color: var(--caly-primary);
    font-weight: 600;
}

.eval-hero__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}

.eval-employee-card {
    margin-bottom: 1.5rem;
}

.eval-employee-card .employee-info-grid {
    margin-bottom: 0;
}

.employee-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.info-field label {
    font-size: 0.75rem;
    color: var(--caly-muted);
    font-weight: 600;
}

.info-field .value {
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.55rem 0 0.35rem;
    border-bottom: 2px solid rgba(59, 68, 255, 0.18);
    color: var(--caly-dark);
}

.eval-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.eval-table th,
.eval-table td {
    border: 1px solid var(--caly-primary);
    padding: 0.5rem;
    text-align: center;
}

.eval-table th {
    background: var(--caly-primary);
    color: #fff;
    font-weight: 600;
}

.eval-table .kpi-name {
    text-align: right;
    font-weight: 600;
    min-width: 140px;
}

.eval-table .weight-col {
    font-weight: 700;
    color: var(--caly-primary);
}

/* Weekly evaluation — tabbed card template */
.week-eval {
    background: #fff;
    border: 1px solid var(--caly-border);
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.week-eval__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, #f8faff, #eef2ff);
    border-bottom: 1px solid var(--caly-border);
}

.week-eval__intro h3 {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--caly-dark);
    margin-bottom: 0.2rem;
}

.week-eval__intro p {
    font-size: 0.82rem;
    color: var(--caly-muted);
}

.week-eval__stats {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.week-eval__stat {
    min-width: 90px;
    padding: 0.5rem 0.75rem;
    border-radius: 10px;
    background: #fff;
    border: 1px solid var(--caly-border);
    text-align: center;
}

.week-eval__stat-label {
    display: block;
    font-size: 0.68rem;
    color: var(--caly-muted);
    margin-bottom: 0.15rem;
}

.week-eval__stat strong {
    font-size: 0.95rem;
    color: var(--caly-dark);
}

.week-eval__stat--primary {
    border-color: rgba(59, 68, 255, 0.25);
    background: rgba(59, 68, 255, 0.06);
}

.week-eval__stat--primary strong {
    color: var(--caly-primary);
}

.week-eval__radio {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.week-eval__tabs {
    display: none;
}

.week-eval__tabbar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    padding: 1rem 1.25rem 0;
    background: #fff;
    border-bottom: 1px solid var(--caly-border);
}

.week-eval__tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    padding: 0.75rem 0.5rem;
    border-radius: 10px 10px 0 0;
    border: 1px solid transparent;
    border-bottom: none;
    cursor: pointer;
    transition: all 0.2s;
    background: #f8fafc;
    color: var(--caly-muted);
}

.week-eval__tab-week {
    font-size: 0.78rem;
    font-weight: 700;
}

.week-eval__tab-score {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--caly-dark);
}

.week-eval__tab-progress {
    font-size: 0.65rem;
}

#week-tab-1:checked ~ .week-eval__tabbar label[for="week-tab-1"],
#week-tab-2:checked ~ .week-eval__tabbar label[for="week-tab-2"],
#week-tab-3:checked ~ .week-eval__tabbar label[for="week-tab-3"],
#week-tab-4:checked ~ .week-eval__tabbar label[for="week-tab-4"] {
    background: #fff;
    border-color: var(--caly-border);
    color: var(--caly-primary);
    box-shadow: 0 -2px 0 var(--caly-primary) inset;
}

.week-eval__tab.is-success .week-eval__tab-score { color: #059669; }
.week-eval__tab.is-warning .week-eval__tab-score { color: #d97706; }
.week-eval__tab.is-danger .week-eval__tab-score { color: #dc2626; }

.week-eval__panels {
    padding: 0;
}

.week-eval__panel {
    display: none;
    padding: 1rem 1.25rem 1.25rem;
}

#week-tab-1:checked ~ .week-eval__panels #week-panel-1,
#week-tab-2:checked ~ .week-eval__panels #week-panel-2,
#week-tab-3:checked ~ .week-eval__panels #week-panel-3,
#week-tab-4:checked ~ .week-eval__panels #week-panel-4 {
    display: block;
}

.week-eval__panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    border: 1px solid var(--caly-border);
    background: #f8fafc;
}

.week-eval__panel-head.is-success {
    border-color: #a7f3d0;
    background: #ecfdf5;
}

.week-eval__panel-head.is-warning {
    border-color: #fde68a;
    background: #fffbeb;
}

.week-eval__panel-head.is-danger {
    border-color: #fecaca;
    background: #fef2f2;
}

.week-eval__panel-head h4 {
    font-size: 0.92rem;
    font-weight: 800;
    color: var(--caly-dark);
    margin-bottom: 0.15rem;
}

.week-eval__panel-head p {
    font-size: 0.75rem;
    color: var(--caly-muted);
}

.week-eval__panel-result {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.35rem;
}

.week-eval__panel-score {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--caly-dark);
}

.week-eval__kpi-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.week-kpi-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--caly-border);
    border-radius: 10px;
    background: #fff;
    transition: border-color 0.15s, background 0.15s;
}

.week-kpi-item.is-yes {
    border-color: #a7f3d0;
    background: #f0fdf8;
}

.week-kpi-item.is-no {
    border-color: #fecaca;
    background: #fffafa;
}

.week-kpi-item__info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.week-kpi-item__num {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(59, 68, 255, 0.1);
    color: var(--caly-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 800;
    flex-shrink: 0;
}

.week-kpi-item__info h5 {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--caly-dark);
    margin-bottom: 0.1rem;
}

.week-kpi-item__weight {
    font-size: 0.72rem;
    color: var(--caly-muted);
}

.week-kpi-item__actions {
    display: flex;
    gap: 0.4rem;
    flex-shrink: 0;
}

.kpi-choice {
    position: relative;
    cursor: pointer;
}

.kpi-choice input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.kpi-choice span {
    display: inline-block;
    padding: 0.45rem 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--caly-border);
    background: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--caly-muted);
    transition: all 0.15s;
    white-space: nowrap;
}

.kpi-choice:hover span {
    border-color: var(--caly-primary);
}

.kpi-choice--yes input:checked + span {
    background: var(--caly-success);
    border-color: var(--caly-success);
    color: #fff;
}

.kpi-choice--no input:checked + span {
    background: var(--caly-danger);
    border-color: var(--caly-danger);
    color: #fff;
}

.kpi-status {
    display: inline-block;
    padding: 0.4rem 0.7rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
}

.kpi-status--yes {
    background: #d1fae5;
    color: #065f46;
}

.kpi-status--no {
    background: #fee2e2;
    color: #991b1b;
}

.kpi-status--empty {
    background: #f1f5f9;
    color: #94a3b8;
}

.week-eval__overview {
    padding: 1rem 1.25rem 1.25rem;
    border-top: 1px solid var(--caly-border);
    background: #f8faff;
}

.week-ops-inline {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
    margin-top: 1rem;
    padding: 1rem;
    border: 1px solid var(--caly-border);
    border-radius: 10px;
    background: #f8fafc;
}

.week-eval__actions {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.week-approval-block {
    margin-top: 1.25rem;
    padding: 1rem;
    border: 1px solid var(--caly-border);
    border-radius: 10px;
    background: #fff;
}

.week-approval-block h5 {
    margin-bottom: 0.75rem;
    font-size: 0.92rem;
    font-weight: 800;
}

.week-decision {
    margin-top: 1rem;
    display: grid;
    gap: 0.85rem;
}

.week-decision__reject {
    display: grid;
    gap: 0.65rem;
    padding: 1rem;
    border: 1px solid #fecaca;
    border-radius: 12px;
    background: #fff7f7;
}

.week-decision__reject .form-label {
    margin: 0;
    font-weight: 700;
    color: #991b1b;
}

.week-decision__reject .form-control {
    resize: vertical;
    min-height: 4.5rem;
}

.week-decision__buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: center;
}

.week-decision__buttons .btn {
    min-width: 11rem;
}

@media (max-width: 900px) {
    .week-ops-inline {
        grid-template-columns: 1fr;
    }
}

.week-eval__overview h4 {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--caly-dark);
    margin-bottom: 0.75rem;
}

.week-eval__overview-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.65rem;
}

.week-overview-card {
    text-align: center;
    padding: 0.75rem 0.5rem;
    border-radius: 10px;
    border: 1px solid var(--caly-border);
    background: #fff;
}

.week-overview-card.is-success {
    border-color: #a7f3d0;
    background: #ecfdf5;
}

.week-overview-card.is-warning {
    border-color: #fde68a;
    background: #fffbeb;
}

.week-overview-card.is-danger {
    border-color: #fecaca;
    background: #fef2f2;
}

.week-overview-card__label {
    display: block;
    font-size: 0.72rem;
    color: var(--caly-muted);
    margin-bottom: 0.2rem;
}

.week-overview-card__score {
    display: block;
    font-size: 1rem;
    font-weight: 800;
    color: var(--caly-dark);
    margin-bottom: 0.15rem;
}

.week-overview-card__hint {
    font-size: 0.68rem;
    color: var(--caly-muted);
}

/* Operational follow-up — same shell as weekly eval */
.ops-follow__total .sar-amount {
    font-size: 0.9rem;
}

.ops-follow__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding: 1.25rem 1.5rem;
}

.ops-week-card {
    border: 1px solid var(--caly-border);
    border-radius: 12px;
    background: #fff;
    padding: 1rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    border-top: 3px solid var(--caly-border);
}

.ops-week-card.is-success {
    border-top-color: #10b981;
    background: linear-gradient(180deg, #f0fdf8 0%, #fff 42%);
}

.ops-week-card.is-warning {
    border-top-color: #f59e0b;
    background: linear-gradient(180deg, #fffbeb 0%, #fff 42%);
}

.ops-week-card.is-danger {
    border-top-color: #ef4444;
    background: linear-gradient(180deg, #fef2f2 0%, #fff 42%);
}

.ops-week-card.is-ineligible {
    opacity: 0.92;
}

.ops-week-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.ops-week-card__head h4 {
    margin: 0 0 0.15rem;
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--caly-dark);
}

.ops-week-card__score {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--caly-primary);
}

.ops-week-card__fields {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ops-week-card__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.ops-week-card__field .form-label {
    margin-bottom: 0.3rem;
    font-size: 0.72rem;
}

.ops-week-card__value {
    min-height: 40px;
    display: flex;
    align-items: center;
    padding: 0.55rem 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--caly-border);
    background: #f8fafc;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--caly-dark);
}

.ops-week-card__value--muted {
    color: var(--caly-muted);
    font-weight: 500;
}

.ops-week-card__amount {
    min-height: 40px;
    display: flex;
    align-items: center;
    padding: 0.55rem 0.75rem;
    border-radius: 8px;
    border: 1px solid rgba(59, 68, 255, 0.18);
    background: rgba(59, 68, 255, 0.05);
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--caly-dark);
}

.ops-follow__monthly {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1.1rem 1.5rem;
    border-top: 1px solid var(--caly-border);
    background: linear-gradient(135deg, #f8faff, #eef2ff);
}

.ops-follow__monthly-text h4 {
    margin: 0 0 0.15rem;
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--caly-dark);
}

.ops-follow__monthly-text p {
    margin: 0;
    font-size: 0.78rem;
    color: var(--caly-muted);
}

.ops-follow__monthly-stats {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.checkbox-pair {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    align-items: center;
}

.checkbox-pair label {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.72rem;
    cursor: pointer;
}

.regulatory-notes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1.5rem;
}

.note-box {
    background: #f0f4ff;
    border: 1px solid #c7d2fe;
    border-radius: 10px;
    padding: 1rem;
}

.note-box h4 {
    color: var(--caly-primary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.note-box ul {
    list-style: none;
    font-size: 0.82rem;
    line-height: 1.8;
}

.note-box ul li::before {
    content: '•';
    color: var(--caly-primary);
    margin-left: 0.5rem;
}

.acknowledgment-box {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 10px;
    padding: 1.25rem;
    margin-top: 1.5rem;
}

.acknowledgment-box h4 {
    color: #92400e;
    margin-bottom: 0.5rem;
}

.objection-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-start;
    margin-top: 0.85rem;
}

.objection-form-panel {
    width: 100%;
    margin-top: 0.25rem;
}

.objection-form-panel > summary {
    list-style: none;
    cursor: pointer;
    display: inline-flex;
}

.objection-form-panel > summary::-webkit-details-marker {
    display: none;
}

.objection-form {
    margin-top: 0.85rem;
    padding: 1rem;
    border: 1px solid var(--caly-border);
    border-radius: 10px;
    background: #f8fafc;
}

.objection-form__hint {
    margin-bottom: 0.85rem;
    font-size: 0.86rem;
    color: var(--caly-muted);
}

.objection-status-card,
.objection-review-card {
    margin-top: 0.85rem;
    padding: 1rem;
    border-radius: 10px;
    border: 1px solid #fde68a;
    background: #fffbeb;
}

.objection-status-card__head,
.objection-review-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.objection-review-card__sub {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.78rem;
    color: var(--caly-muted);
    font-weight: 500;
}

.objection-status-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.55rem;
    font-size: 0.8rem;
    color: var(--caly-muted);
}

.objection-review-card + .objection-review-card {
    margin-top: 0.75rem;
}

.objection-review-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
    margin-top: 0.85rem;
}

@media (max-width: 768px) {
    .objection-review-actions {
        grid-template-columns: 1fr;
    }
}

.approval-timeline {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.approval-step {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--caly-border);
}

.approval-step form {
    margin: 0;
    margin-inline-start: auto;
}

.approval-step.approved {
    border-color: #a7f3d0;
    background: #ecfdf5;
}

.approval-step.pending {
    border-color: #fde68a;
    background: #fffbeb;
}

.approval-step.rejected {
    border-color: #fecaca;
    background: #fef2f2;
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--caly-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(ellipse 80% 60% at 100% 0%, rgba(130, 247, 255, 0.35) 0%, transparent 55%),
        radial-gradient(ellipse 70% 50% at 0% 100%, rgba(59, 68, 255, 0.1) 0%, transparent 50%),
        linear-gradient(160deg, #f8faff 0%, #eef2ff 45%, #f4f7fb 100%);
}

.login-card {
    background: #fff;
    border-radius: 16px;
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    border: 1px solid var(--caly-border);
    box-shadow: 0 12px 40px rgba(11, 16, 38, 0.08);
}

.login-logo {
    text-align: center;
    margin-bottom: 1.5rem;
}

.login-logo img {
    height: 60px;
}

.login-logo__title {
    margin-top: 0.85rem;
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.35;
    color: var(--caly-dark);
}

.login-logo__desc {
    margin-top: 0.75rem;
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1.5;
    color: var(--caly-muted);
}

.accounts-page {
    min-height: 100vh;
    padding: 2rem 1.25rem 3rem;
    background:
        radial-gradient(ellipse 90% 55% at 100% 0%, rgba(130, 247, 255, 0.4) 0%, transparent 55%),
        radial-gradient(ellipse 70% 45% at 0% 100%, rgba(59, 68, 255, 0.12) 0%, transparent 50%),
        linear-gradient(165deg, #f7f9ff 0%, #eef3ff 40%, #f5f7fb 100%);
}

.accounts-hero {
    max-width: 1100px;
    margin: 0 auto 1.75rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.accounts-hero__brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.accounts-hero__logo {
    height: 52px;
    width: auto;
}

.accounts-hero__eyebrow {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--caly-primary);
    margin-bottom: 0.2rem;
}

.accounts-hero h1 {
    font-size: clamp(1.6rem, 3vw, 2.1rem);
    font-weight: 800;
    color: var(--caly-dark);
    margin: 0;
}

.accounts-hero__lead {
    margin-top: 0.35rem;
    color: var(--caly-muted);
    font-size: 0.92rem;
}

.accounts-grid {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

@media (max-width: 900px) {
    .accounts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .accounts-grid {
        grid-template-columns: 1fr;
    }
}

.account-card {
    background: #fff;
    border: 1px solid var(--caly-border);
    border-radius: 14px;
    padding: 1.15rem;
    display: flex;
    flex-direction: column;
    gap: 0.95rem;
    box-shadow: 0 8px 28px rgba(11, 16, 38, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.account-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(11, 16, 38, 0.08);
}

.account-card__head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.account-card__avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 1.05rem;
    flex-shrink: 0;
}

.account-card h2 {
    margin: 0 0 0.35rem;
    font-size: 1rem;
    font-weight: 800;
    color: var(--caly-dark);
}

.account-card__role {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
}

.account-card__meta {
    display: grid;
    gap: 0.55rem;
    margin: 0;
}

.account-card__meta dt {
    font-size: 0.72rem;
    color: var(--caly-muted);
    font-weight: 600;
    margin-bottom: 0.15rem;
}

.account-card__meta dd {
    margin: 0;
}

.account-card__meta code {
    display: block;
    font-family: 'Cairo', sans-serif;
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--caly-dark);
    background: #f4f7ff;
    border: 1px solid var(--caly-border);
    border-radius: 8px;
    padding: 0.45rem 0.6rem;
    direction: ltr;
    text-align: left;
}

.account-card__enter {
    width: 100%;
    justify-content: center;
}

@media (max-width: 640px) {
    .accounts-hero {
        align-items: flex-start;
    }
}

.pagination {
    display: flex;
    gap: 0.25rem;
    justify-content: center;
    margin-top: 1rem;
}

.pagination a,
.pagination span {
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    border: 1px solid var(--caly-border);
}

.pagination .active {
    background: var(--caly-primary);
    color: #fff;
    border-color: var(--caly-primary);
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.team-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.team-list-card__body {
    padding: 0;
    overflow: visible;
}

.team-table-wrap {
    overflow-x: auto;
    width: 100%;
    -webkit-overflow-scrolling: touch;
}

.team-table {
    width: 100%;
    min-width: 0;
    table-layout: auto;
    font-size: 0.8rem;
}

.team-table th,
.team-table td {
    vertical-align: middle;
    padding: 0.7rem 0.75rem;
    white-space: nowrap;
}

.team-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f8fafc;
    font-size: 0.72rem;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.team-table tbody tr:hover td {
    background: #f8faff;
}

.team-table__row--inactive td {
    opacity: 0.72;
}

.team-table th:first-child,
.team-table td:first-child {
    min-width: 200px;
    white-space: normal;
}

.team-table__person {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.team-table__avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--caly-primary), #5b63ff);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(59, 68, 255, 0.18);
}

.team-table__avatar.has-image {
    background: #e2e8f0;
    box-shadow: none;
}

.team-table__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.team-table__person-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
    flex: 1;
}

.team-table__name {
    display: block;
    color: var(--caly-dark);
    font-size: 0.82rem;
    line-height: 1.3;
    white-space: nowrap;
}

.team-table__email {
    display: block;
    font-size: 0.68rem;
    color: var(--caly-muted);
    line-height: 1.3;
    direction: ltr;
    unicode-bidi: isolate;
    text-align: right;
    white-space: nowrap;
}

.team-table__primary {
    color: var(--caly-text);
    font-weight: 600;
    font-size: 0.78rem;
    line-height: 1.35;
    white-space: nowrap;
}

.team-table__meta {
    margin-top: 0.1rem;
    font-size: 0.68rem;
    color: var(--caly-muted);
    line-height: 1.3;
    white-space: nowrap;
}

.team-table__code {
    display: inline-block;
    padding: 0.15rem 0.4rem;
    border-radius: 6px;
    background: #f1f5f9;
    border: 1px solid var(--caly-border);
    color: var(--caly-dark);
    font-size: 0.7rem;
    font-weight: 600;
    direction: ltr;
    unicode-bidi: isolate;
    white-space: nowrap;
}

.team-table__salary {
    font-weight: 700;
    font-size: 0.78rem;
    color: var(--caly-dark);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.team-table__salary small {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--caly-muted);
}

.sar-symbol {
    font-family: 'SaudiRiyal', 'Cairo', system-ui, sans-serif;
    font-style: normal;
    font-weight: inherit;
    line-height: 1;
    speak: never;
}

.sar-amount {
    display: inline-flex;
    flex-direction: row;
    align-items: baseline;
    gap: 0.25em;
    direction: ltr;
    unicode-bidi: isolate;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.sar-amount .sar-symbol {
    order: 1;
}

.sar-amount__num {
    order: 2;
}

.team-table__salary .sar-symbol {
    font-size: 0.85em;
    color: var(--caly-muted);
    font-weight: 600;
}

.team-table__pill {
    display: inline-block;
    margin-top: 0.2rem;
    padding: 0.08rem 0.4rem;
    border-radius: 6px;
    font-size: 0.64rem;
    font-weight: 700;
}

.team-table__pill--ops {
    background: #ecfdf5;
    color: #047857;
}

.team-table__pill--admin {
    background: #f1f5f9;
    color: #475569;
}

.team-table__empty {
    color: #94a3b8;
}

.team-table__empty-row {
    text-align: center;
    color: var(--caly-muted);
    padding: 2rem 1rem !important;
}

.team-list-card__footer {
    padding: 0.75rem 1.15rem;
    border-top: 1px solid var(--caly-border);
    background: #fafbfc;
    font-size: 0.8rem;
    color: var(--caly-muted);
}

.team-list-card__footer strong {
    color: var(--caly-dark);
}

.team-table .badge {
    vertical-align: middle;
    white-space: nowrap;
}

.team-table__actions .field-icon-btn {
    width: 30px;
    height: 30px;
}

.team-table__actions .field-icon-btn svg {
    width: 14px;
    height: 14px;
}

.team-manage-card__avatar {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    color: #fff;
    background: linear-gradient(135deg, var(--caly-primary), #5b63ff);
    overflow: hidden;
    flex-shrink: 0;
}

.team-manage-card__avatar.has-image {
    background: #e2e8f0;
}

.team-manage-card__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.team-manage-card--inactive {
    opacity: 0.72;
}

.team-manage-card__email {
    direction: ltr;
    unicode-bidi: isolate;
    text-align: right;
    margin: 0;
}

.team-manage-card__facts {
    display: grid;
    gap: 0.55rem;
}

.team-manage-card__fact {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.8rem;
}

.team-manage-card__fact > span:first-child {
    color: var(--caly-muted);
    flex-shrink: 0;
}

.team-manage-card__fact strong {
    text-align: left;
    font-weight: 600;
    color: var(--caly-dark);
    line-height: 1.4;
    max-width: 65%;
}

.team-manage-card__fact strong small {
    display: block;
    margin-top: 0.15rem;
    font-weight: 500;
    font-size: 0.72rem;
    color: var(--caly-muted);
}

.roles-view--compact .team-manage-card__avatar {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 0.8rem;
}

.roles-view--compact .team-manage-card__facts {
    gap: 0.35rem;
}

.roles-view--compact .team-manage-card__fact {
    font-size: 0.74rem;
}

.roles-view--comfortable .team-manage-card__avatar {
    width: 48px;
    height: 48px;
}

.roles-view--compact .team-table th,
.roles-view--compact .team-table td {
    padding: 0.45rem 0.55rem;
    font-size: 0.76rem;
}

.roles-view--comfortable .team-table th,
.roles-view--comfortable .team-table td {
    padding: 0.95rem 0.9rem;
}

.roles-view-toolbar__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 0.9rem;
    padding-bottom: 0.9rem;
}

.roles-view-toolbar__group {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.roles-view-toolbar__label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--caly-muted);
}

.roles-view-toolbar__modes {
    display: inline-flex;
    gap: 0.35rem;
}

.roles-view-toolbar__select {
    width: auto;
    min-width: 120px;
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
}

.roles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.roles-view--compact .roles-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.65rem;
}

.roles-view--compact .role-manage-card {
    padding: 0.75rem;
    gap: 0.5rem;
}

.roles-view--compact .role-manage-card__top h3 {
    font-size: 0.88rem;
}

.roles-view--compact .role-manage-card__desc {
    font-size: 0.74rem;
}

.roles-view--comfortable .roles-grid {
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.25rem;
}

.roles-view--comfortable .role-manage-card {
    padding: 1.35rem;
    gap: 0.9rem;
}

.roles-view--comfortable .role-manage-card__top h3 {
    font-size: 1.05rem;
}

.roles-view--compact .roles-table th,
.roles-view--compact .roles-table td {
    padding: 0.45rem 0.65rem;
    font-size: 0.82rem;
}

.roles-view--comfortable .roles-table th,
.roles-view--comfortable .roles-table td {
    padding: 1rem 1.1rem;
}

.roles-table__desc {
    font-size: 0.75rem;
    color: var(--caly-muted);
    margin-top: 0.2rem;
    max-width: 280px;
}

.role-manage-card {
    background: #fff;
    border: 1px solid var(--caly-border);
    border-radius: 12px;
    padding: 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.role-manage-card__top {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.role-manage-card__top h3 {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--caly-dark);
}

.role-manage-card__desc {
    font-size: 0.8rem;
    color: var(--caly-muted);
    line-height: 1.6;
}

.role-manage-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.78rem;
    color: var(--caly-muted);
}

.role-manage-card__footer {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: auto;
}

.role-manage-card__badges {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.role-manage-card__actions {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    align-items: center;
}

.action-btns {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.action-btns > form {
    display: inline-flex;
    margin: 0;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    min-height: 32px;
    padding: 0.3rem 0.7rem;
    border-radius: 8px;
    border: 1px solid var(--caly-border);
    background: #fff;
    color: var(--caly-muted);
    font-family: 'Cairo', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.action-btn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.action-btn--edit {
    color: #0f766e;
    border-color: #99f6e4;
    background: #f0fdfa;
}

.action-btn--edit:hover {
    color: #0d9488;
    border-color: #14b8a6;
    background: #ccfbf1;
}

.action-btn--copy {
    color: var(--caly-primary);
    border-color: #c7d2fe;
    background: #f8faff;
}

.action-btn--copy:hover {
    color: #2d35cc;
    border-color: var(--caly-primary);
    background: #eef2ff;
}

.action-btn--danger {
    color: var(--caly-danger);
    border-color: #fecaca;
    background: #fef2f2;
}

.action-btn--danger:hover:not(:disabled) {
    color: #b91c1c;
    border-color: #f87171;
    background: #fee2e2;
}

.action-btn:disabled,
.action-btn[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
}

.roles-table__actions {
    white-space: nowrap;
    width: 1%;
}

.roles-table__actions .action-btns {
    flex-wrap: nowrap;
}

.role-color-swatch {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.role-color-swatch--lg {
    width: 36px;
    height: 36px;
}

.roles-table__color {
    width: 1%;
    white-space: nowrap;
    vertical-align: middle;
}

.role-color-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.25rem 0.55rem 0.25rem 0.3rem;
    border: 1px solid var(--caly-border);
    border-radius: 10px;
    background: #f8fafc;
}

.role-color-chip__swatch {
    width: 22px;
    height: 22px;
    border-radius: 7px;
    flex-shrink: 0;
    border: 2px solid #fff;
}

.role-color-chip__hex {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--caly-muted);
    background: transparent;
    padding: 0;
}

.color-picker-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.color-picker-row input[type="color"] {
    width: 44px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--caly-border);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
}

.roles-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.75rem;
}

.role-overview-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.75rem;
    border: 1px solid var(--caly-border);
    border-radius: 10px;
    background: #f8faff;
}

.form-hint {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.75rem;
    color: var(--caly-muted);
}

.settings-preview {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.85rem;
}

.settings-preview__logo {
    max-height: 72px;
    max-width: 100%;
    object-fit: contain;
}

.settings-preview__icon {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border: 1px solid var(--caly-border);
    border-radius: 8px;
    padding: 0.35rem;
    background: #fff;
}

.settings-preview__icon-placeholder {
    font-size: 0.85rem;
    color: var(--caly-muted);
    padding: 0.75rem 1rem;
    border: 1px dashed var(--caly-border);
    border-radius: 8px;
    width: 100%;
    text-align: center;
}

.settings-preview p {
    font-size: 0.85rem;
    color: var(--caly-muted);
    margin-top: 0.25rem;
}

.team-location-hint {
    margin: 0;
    font-size: 0.78rem;
    color: var(--caly-muted);
    line-height: 1.5;
}

.team-table__actions {
    white-space: nowrap;
    width: 1%;
    vertical-align: middle;
}

.team-table__actions .field-icon-actions {
    flex-wrap: nowrap;
}

.team-table__actions form {
    display: inline-flex;
    margin: 0;
}

.field-with-icons {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.45rem;
}

.field-with-icons > .form-control {
    flex: 1;
    min-width: 0;
}

.field-icon-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

.field-icon-actions > form {
    display: inline-flex;
    margin: 0;
}

.field-icon-btn {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid var(--caly-border);
    background: #fff;
    color: var(--caly-muted);
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    padding: 0;
}

.field-icon-btn svg {
    width: 16px;
    height: 16px;
}

.field-icon-btn--add {
    color: var(--caly-primary);
    border-color: #c7d2fe;
    background: #f8faff;
}

.field-icon-btn--add:hover {
    color: #fff;
    background: var(--caly-primary);
    border-color: var(--caly-primary);
}

.field-icon-btn--edit {
    color: #0f766e;
    border-color: #99f6e4;
    background: #f0fdfa;
}

.field-icon-btn--edit:hover {
    color: #fff;
    background: #0d9488;
    border-color: #0d9488;
}

.field-icon-btn--copy {
    color: #1d4ed8;
    border-color: #bfdbfe;
    background: #eff6ff;
}

.field-icon-btn--copy:hover {
    color: #fff;
    background: #1d4ed8;
    border-color: #1d4ed8;
}

.field-icon-btn--delete {
    color: var(--caly-danger);
    border-color: #fecaca;
    background: #fef2f2;
}

.field-icon-btn--delete:hover:not(:disabled) {
    color: #fff;
    background: var(--caly-danger);
    border-color: var(--caly-danger);
}

.field-icon-btn:disabled,
.field-icon-btn[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
}

.roles-table__actions {
    white-space: nowrap;
    width: 1%;
    vertical-align: middle;
}

.roles-table__actions .field-icon-actions {
    flex-wrap: nowrap;
}

.roles-table__actions .field-icon-btn {
    width: 30px;
    height: 30px;
}

.roles-table__actions .field-icon-btn svg {
    width: 14px;
    height: 14px;
}

.roles-table__actions form {
    display: inline-flex;
    margin: 0;
}

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

.select-with-action {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.select-with-action .form-control {
    flex: 1;
}

.select-with-action .btn {
    flex-shrink: 0;
    white-space: nowrap;
}

.btn-dept-add {
    background: var(--caly-primary);
    color: #fff;
    border: 1px solid var(--caly-primary);
}

.btn-dept-add:hover {
    background: #2d35cc;
    border-color: #2d35cc;
}

.btn-dept-edit {
    background: #fff;
    color: #0f766e;
    border: 1px solid #14b8a6;
}

.btn-dept-edit:hover {
    background: #f0fdfa;
    color: #0d9488;
    border-color: #0d9488;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(11, 16, 38, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-overlay[hidden] {
    display: none !important;
}

.modal-card {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18);
    overflow: hidden;
}

.modal-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--caly-border);
}

.modal-card__header h3 {
    font-size: 1rem;
    font-weight: 800;
    color: var(--caly-dark);
}

.modal-close {
    border: none;
    background: transparent;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: var(--caly-muted);
}

.modal-card__body {
    padding: 1.25rem;
}

.modal-card__footer {
    display: flex;
    gap: 0.5rem;
    padding: 0 1.25rem 1.25rem;
}

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(100%);
        transition: transform 0.25s ease;
        box-shadow: none;
    }

    .app-shell.sidebar-open .sidebar {
        transform: translateX(0);
        box-shadow: -8px 0 28px rgba(11, 16, 38, 0.18);
    }

    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(11, 16, 38, 0.35);
        z-index: 95;
        border: 0;
        padding: 0;
        cursor: pointer;
    }

    .sidebar-backdrop[hidden] {
        display: none;
    }

    .main-content {
        margin-right: 0;
    }

    .app-header {
        padding: 0.75rem 1rem;
    }

    .menu-toggle {
        display: inline-flex;
    }

    .page-heading {
        flex-wrap: wrap;
        padding: 1rem;
    }

    .page-heading__actions {
        width: 100%;
    }

    .content-area {
        padding: 1rem;
    }

    .regulatory-notes,
    .grid-2 {
        grid-template-columns: 1fr;
    }
    .week-eval__top {
        flex-direction: column;
    }
    .week-eval__tabbar {
        grid-template-columns: repeat(2, 1fr);
    }
    .week-eval__overview-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .week-kpi-item {
        flex-direction: column;
        align-items: stretch;
    }
    .week-kpi-item__actions {
        justify-content: center;
    }

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

    .team-filters .form-group {
        min-width: 0 !important;
        width: 100%;
    }

    .team-filters .btn {
        width: 100%;
        justify-content: center;
    }

    .eval-hero__inner {
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
    }

    .eval-hero__meta {
        justify-content: flex-start;
    }

    .eval-hero__title {
        font-size: 1.05rem;
    }

    .ops-follow__grid {
        grid-template-columns: 1fr;
        padding: 1rem;
    }

    .ops-week-card__row {
        grid-template-columns: 1fr;
    }

    .ops-follow__monthly {
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
    }
}

/* Permissions admin */
.permissions-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 1rem;
    align-items: start;
}

.permissions-roles {
    background: #fff;
    border: 1px solid var(--caly-border);
    border-radius: 12px;
    padding: 0.85rem;
}

.permissions-roles__title {
    font-size: 0.85rem;
    font-weight: 800;
    margin: 0 0 0.75rem;
}

.permissions-roles__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.35rem;
    max-height: 70vh;
    overflow: auto;
}

.permissions-roles__item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 0.6rem;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    border: 1px solid transparent;
}

.permissions-roles__item strong {
    display: block;
    font-size: 0.82rem;
}

.permissions-roles__item small {
    color: var(--caly-muted);
    font-size: 0.72rem;
}

.permissions-roles__item:hover,
.permissions-roles__item.is-active {
    background: #f4f7ff;
    border-color: var(--caly-border);
}

.permission-module {
    margin-bottom: 1.5rem;
}

.permission-module h3 {
    font-size: 0.95rem;
    font-weight: 800;
    margin: 0 0 0.65rem;
    color: var(--caly-primary);
}

.permission-name {
    font-weight: 700;
    font-size: 0.88rem;
}

.permission-key {
    font-size: 0.72rem;
    color: var(--caly-muted);
    direction: ltr;
    display: inline-block;
    margin-top: 0.15rem;
}

.permission-desc {
    font-size: 0.75rem;
    color: var(--caly-muted);
    margin-top: 0.2rem;
}

.user-perm-row {
    border: 1px solid var(--caly-border);
    border-radius: 10px;
    padding: 0.75rem;
    margin-bottom: 0.55rem;
    background: #fafbff;
}

.user-perm-row__check {
    display: flex;
    gap: 0.55rem;
    align-items: flex-start;
    margin-bottom: 0.55rem;
    cursor: pointer;
}

.user-perm-row__check code {
    display: block;
    font-size: 0.7rem;
    color: var(--caly-muted);
    direction: ltr;
}

.user-perm-row__fields {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.45rem;
}

.audit-pre {
    white-space: pre-wrap;
    font-size: 0.72rem;
    background: #0f172a;
    color: #e2e8f0;
    padding: 0.75rem;
    border-radius: 8px;
    max-width: 420px;
    overflow: auto;
    direction: ltr;
    text-align: left;
}

@media (max-width: 900px) {
    .permissions-layout {
        grid-template-columns: 1fr;
    }

    .user-perm-row__fields {
        grid-template-columns: 1fr 1fr;
    }
}
