/*
 * ============================================================
 *  Raynet HR - Production Stylesheet
 *  Corporate Colors 2024
 *
 *  dk1: #000000   dk2: #F00048   lt1: #FFFFFF   lt2: #203142
 *  accent1: #10918F  accent2: #0092D4  accent3: #005092
 *  accent4: #A4C5C5  accent5: #9CC7EB  accent6: #919EC8
 * ============================================================
 */

/* ----------------------------------------------------------- */
/*  0. CUSTOM PROPERTIES                                       */
/* ----------------------------------------------------------- */
:root {
    /* --- Core palette --- */
    --rn-black:         #000000;
    --rn-white:         #FFFFFF;
    --rn-brand-red:     #F00048;
    --rn-navy:          #203142;

    --rn-teal:          #10918F;
    --rn-blue:          #0092D4;
    --rn-dark-blue:     #005092;
    --rn-light-teal:    #A4C5C5;
    --rn-light-blue:    #9CC7EB;
    --rn-lavender:      #919EC8;

    /* --- Teal scale --- */
    --rn-teal-50:       #E8F6F6;
    --rn-teal-100:      #C6EBEA;
    --rn-teal-200:      #89D3D2;
    --rn-teal-300:      #3FB1B0;
    --rn-teal-400:      #10918F;
    --rn-teal-500:      #0E7E7D;
    --rn-teal-600:      #0B6564;
    --rn-teal-700:      #084C4B;
    --rn-teal-800:      #053332;
    --rn-teal-900:      #031A19;

    /* --- Navy scale --- */
    --rn-navy-50:       #E9EDF0;
    --rn-navy-100:      #C8D1D9;
    --rn-navy-200:      #93A3B2;
    --rn-navy-300:      #5E758C;
    --rn-navy-400:      #2D4A61;
    --rn-navy-500:      #203142;
    --rn-navy-600:      #1A2835;
    --rn-navy-700:      #141F29;
    --rn-navy-800:      #0E161C;
    --rn-navy-900:      #080C0F;

    /* --- Semantic: surfaces --- */
    --body-bg:          #F4F6F9;
    --surface:          #FFFFFF;
    --surface-alt:      #F8FAFB;
    --surface-hover:    #F0F3F6;
    --border-color:     #E2E8F0;
    --border-light:     #EDF2F7;
    --border-focus:     #10918F;

    /* --- Semantic: text --- */
    --text-primary:     #1A202C;
    --text-secondary:   #64748B;
    --text-muted:       #94A3B8;
    --text-inverse:     #FFFFFF;
    --link-color:       #10918F;
    --link-hover:       #0E7E7D;

    /* --- Sidebar --- */
    --sidebar-width:    260px;
    --sidebar-collapsed:68px;
    --sidebar-bg:       #203142;
    --sidebar-bg-dark:  #1A2835;
    --sidebar-text:     #CBD5E1;
    --sidebar-text-active:#FFFFFF;
    --sidebar-hover:    rgba(16,145,143,0.15);
    --sidebar-active:   rgba(16,145,143,0.25);
    --sidebar-accent:   #10918F;
    --sidebar-divider:  rgba(255,255,255,0.08);

    /* --- Header --- */
    --header-height:    64px;
    --header-bg:        #FFFFFF;
    --header-border:    #E2E8F0;

    /* --- States --- */
    --primary:          #10918F;
    --primary-hover:    #0E7E7D;
    --primary-light:    #E8F6F6;
    --primary-rgb:      16,145,143;

    --secondary:        #64748B;
    --secondary-hover:  #475569;
    --secondary-light:  #F1F5F9;

    --success:          #059669;
    --success-hover:    #047857;
    --success-light:    #ECFDF5;
    --success-rgb:      5,150,105;

    --danger:           #DC2626;
    --danger-hover:     #B91C1C;
    --danger-light:     #FEF2F2;
    --danger-rgb:       220,38,38;

    --warning:          #D97706;
    --warning-hover:    #B45309;
    --warning-light:    #FFFBEB;
    --warning-rgb:      217,119,6;

    --info:             #0092D4;
    --info-hover:       #0074A9;
    --info-light:       #EFF8FF;
    --info-rgb:         0,146,212;

    /* --- Shadows --- */
    --shadow-xs:        0 1px 2px rgba(0,0,0,0.04);
    --shadow-sm:        0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md:        0 4px 6px rgba(0,0,0,0.05), 0 2px 4px rgba(0,0,0,0.04);
    --shadow-lg:        0 10px 15px rgba(0,0,0,0.06), 0 4px 6px rgba(0,0,0,0.04);
    --shadow-xl:        0 20px 25px rgba(0,0,0,0.08), 0 10px 10px rgba(0,0,0,0.04);
    --shadow-card:      0 1px 3px rgba(32,49,66,0.06), 0 1px 2px rgba(32,49,66,0.04);
    --shadow-card-hover:0 4px 12px rgba(32,49,66,0.08), 0 2px 4px rgba(32,49,66,0.04);
    --shadow-dropdown:  0 4px 16px rgba(32,49,66,0.12);
    --shadow-modal:     0 20px 60px rgba(32,49,66,0.15);

    /* --- Radii --- */
    --radius-xs:        4px;
    --radius-sm:        6px;
    --radius-md:        8px;
    --radius-lg:        12px;
    --radius-xl:        16px;
    --radius-pill:      9999px;

    /* --- Typography --- */
    --font-family:      'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-mono:        'JetBrains Mono', 'Fira Code', monospace;
    --font-size-base:   0.9375rem;
    --line-height-base: 1.6;

    /* --- Transitions --- */
    --transition-fast:   150ms ease;
    --transition-normal: 200ms ease;
    --transition-slow:   300ms ease;
    --transition-sidebar:250ms cubic-bezier(0.4,0,0.2,1);

    /* --- Z-index layers --- */
    --z-sidebar:        1040;
    --z-header:         1030;
    --z-dropdown:       1050;
    --z-modal-backdrop: 1060;
    --z-modal:          1070;
    --z-toast:          1080;
    --z-tooltip:        1090;
}


/* ----------------------------------------------------------- */
/*  1. BASE / RESET                                            */
/* ----------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: var(--text-primary);
    background-color: var(--body-bg);
    overflow-x: hidden;
}

a {
    color: var(--link-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}
a:hover {
    color: var(--link-hover);
    text-decoration: none;
}

img { max-width: 100%; height: auto; }

h1, h2, h3, h4, h5, h6 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
}
h1 { font-size: 1.75rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

p { margin-top: 0; margin-bottom: 1rem; }

::selection {
    background-color: var(--rn-teal-100);
    color: var(--rn-teal-800);
}

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}


/* ----------------------------------------------------------- */
/*  2. APP LAYOUT (Sidebar + Header + Content)                 */
/* ----------------------------------------------------------- */
.app-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    z-index: 1060;
    display: flex;
    flex-direction: column;
    transition: width var(--transition-sidebar), transform var(--transition-sidebar);
    overflow: hidden;
}

.app-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    display: flex;
    flex-direction: column;
    height: 100vh;
    transition: margin-left var(--transition-sidebar), width var(--transition-sidebar);
    overflow-x: hidden;
    overflow-y: auto;
}

.app-header {
    position: sticky;
    top: 0;
    height: var(--header-height);
    background: var(--header-bg);
    border-bottom: 1px solid var(--header-border);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    z-index: var(--z-header);
    gap: 1rem;
}

.app-content {
    flex: 1;
    padding: 1.25rem 1.5rem;
    width: 100%;
    max-width: 100%;
    overflow: auto;
    box-sizing: border-box;
}
.app-content:has(.org-page) {
    display: flex;
    flex-direction: column;
    overflow: visible;
}
.app-content:has(.ep-container) {
    display: flex;
    flex-direction: column;
}
.app-content > .container-fluid {
    padding: 0 !important;
}

/* Sidebar collapsed */
.sidebar-collapsed .app-sidebar {
    width: var(--sidebar-collapsed);
}
.sidebar-collapsed .app-main {
    margin-left: var(--sidebar-collapsed);
    width: calc(100% - var(--sidebar-collapsed));
}
.sidebar-collapsed .sidebar-label,
.sidebar-collapsed .sidebar-group-label,
.sidebar-collapsed .sidebar-brand-text,
.sidebar-collapsed .sidebar-nav-arrow,
.sidebar-collapsed .sidebar-footer-info {
    opacity: 0;
    visibility: hidden;
    width: 0;
    overflow: hidden;
    white-space: nowrap;
}
.sidebar-collapsed .sidebar-brand {
    justify-content: center;
    padding: 0;
}
.sidebar-collapsed .sidebar-nav-link {
    justify-content: center;
    padding: 0.625rem 0;
}
.sidebar-collapsed .sidebar-nav-link .sidebar-icon {
    margin-right: 0;
}
.sidebar-collapsed .sidebar-group-items {
    display: none !important;
}


/* ----------------------------------------------------------- */
/*  3. SIDEBAR                                                 */
/* ----------------------------------------------------------- */
.sidebar-brand {
    display: block;
    text-align: center;
    min-height: var(--header-height);
    padding: 5% 0;
    border-bottom: 1px solid var(--sidebar-divider);
    flex-shrink: 0;
}

.sidebar-brand-logo {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.sidebar-brand-logo svg,
.sidebar-brand-logo img {
    width: 100%;
    height: 100%;
}

.sidebar-brand-text {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-inverse);
    letter-spacing: -0.025em;
    transition: opacity var(--transition-sidebar);
    white-space: nowrap;
}

.sidebar-brand-text .brand-accent {
    color: var(--sidebar-accent);
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.75rem 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.15) transparent;
}
.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}
.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
    border-radius: var(--radius-pill);
}

.sidebar-group {
    margin-bottom: 0.25rem;
}

.sidebar-group-label {
    display: flex;
    align-items: center;
    padding: 0.5rem 1.25rem 0.375rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--rn-navy-200);
    white-space: nowrap;
    transition: opacity var(--transition-sidebar);
    user-select: none;
}

.sidebar-group-items {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-group.collapsed > .sidebar-group-items {
    display: none;
}

.sidebar-nav-item {
    margin: 1px 0.625rem;
}

.sidebar-nav-link {
    display: flex;
    align-items: center;
    padding: 0.5625rem 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--sidebar-text);
    font-size: 0.875rem;
    font-weight: 400;
    transition: all var(--transition-fast);
    text-decoration: none;
    position: relative;
    gap: 0.25rem;
    white-space: nowrap;
}

.sidebar-nav-link:hover {
    background: var(--sidebar-hover);
    color: var(--text-inverse);
    text-decoration: none;
}

.sidebar-nav-link.active {
    background: var(--sidebar-active);
    color: var(--text-inverse);
    font-weight: 500;
}

.sidebar-nav-link.active::before {
    content: '';
    position: absolute;
    left: -0.625rem;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--sidebar-accent);
    border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
}

.sidebar-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-right: 0.75rem;
    opacity: 0.7;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity var(--transition-fast);
}

.sidebar-nav-link:hover .sidebar-icon,
.sidebar-nav-link.active .sidebar-icon {
    opacity: 1;
}

.sidebar-label {
    flex: 1;
    transition: opacity var(--transition-sidebar);
}


.sidebar-nav-arrow {
    width: 16px;
    height: 16px;
    opacity: 0.4;
    transition: transform var(--transition-fast), opacity var(--transition-sidebar);
    flex-shrink: 0;
}

.sidebar-group:not(.collapsed) > .sidebar-group-toggle .sidebar-nav-arrow {
    transform: rotate(90deg);
}

.sidebar-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: var(--radius-pill);
    background: var(--rn-brand-red);
    color: var(--text-inverse);
    margin-left: auto;
    line-height: 1;
}

.sidebar-divider {
    height: 1px;
    background: var(--sidebar-divider);
    margin: 0.5rem 1.25rem;
}

.sidebar-footer {
    border-top: 1px solid var(--sidebar-divider);
    padding: 0.75rem 1rem;
    flex-shrink: 0;
}

.sidebar-footer-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.375rem 0.25rem;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}
.sidebar-footer-user:hover {
    background: var(--sidebar-hover);
}

.sidebar-footer-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--sidebar-accent);
    color: var(--text-inverse);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    flex-shrink: 0;
}

.sidebar-footer-info {
    flex: 1;
    min-width: 0;
    transition: opacity var(--transition-sidebar);
}

.sidebar-footer-name {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-inverse);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-footer-role {
    font-size: 0.6875rem;
    color: var(--rn-navy-200);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: calc(var(--z-sidebar) - 1);
    backdrop-filter: blur(2px);
}
.sidebar-open .sidebar-overlay {
    display: block;
}


/* ----------------------------------------------------------- */
/*  4. HEADER BAR                                              */
/* ----------------------------------------------------------- */
.header-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}
.header-toggle:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.header-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    flex: 1;
    min-width: 0;
}
.header-breadcrumb a {
    color: var(--text-secondary);
    white-space: nowrap;
}
.header-breadcrumb a:hover {
    color: var(--primary);
}
.header-breadcrumb .breadcrumb-sep {
    color: var(--text-muted);
    font-size: 0.75rem;
}
.header-breadcrumb .breadcrumb-current {
    color: var(--text-primary);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-search {
    position: relative;
    width: 280px;
    flex-shrink: 0;
}
.header-search-input {
    width: 100%;
    height: 38px;
    padding: 0 0.875rem 0 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-pill);
    background: var(--surface-alt);
    font-size: 0.8125rem;
    color: var(--text-primary);
    transition: all var(--transition-fast);
}
.header-search-input::placeholder {
    color: var(--text-muted);
}
.header-search-input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}
.header-search-icon {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    pointer-events: none;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}

.header-action-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}
.header-action-btn:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}
.header-action-btn .action-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    font-size: 0.625rem;
    font-weight: 700;
    border-radius: var(--radius-pill);
    background: var(--rn-brand-red);
    color: var(--text-inverse);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Locale Switcher */
.locale-switcher {
    position: relative;
}
.locale-switcher-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.625rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: transparent;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-transform: uppercase;
}
.locale-switcher-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.locale-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 120px;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-dropdown);
    padding: 0.375rem;
    z-index: var(--z-dropdown);
    display: none;
}
.locale-dropdown.show {
    display: block;
}
.locale-dropdown a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    color: var(--text-primary);
    border-radius: var(--radius-xs);
    transition: background var(--transition-fast);
}
.locale-dropdown a:hover {
    background: var(--surface-hover);
}
.locale-dropdown a.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 500;
}

/* User dropdown */
.header-user {
    position: relative;
}
.header-user-btn {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.25rem 0.5rem 0.25rem 0.25rem;
    border: none;
    background: transparent;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: background var(--transition-fast);
}
.header-user-btn:hover {
    background: var(--surface-hover);
}
.header-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--text-inverse);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
    font-weight: 600;
}
.header-user-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}
.header-user-name {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-primary);
}
.header-user-chevron {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    transition: transform var(--transition-fast);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-dropdown);
    padding: 0.375rem;
    z-index: var(--z-dropdown);
    display: none;
}
.user-dropdown.show {
    display: block;
}
.user-dropdown-header {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 0.25rem;
}
.user-dropdown-header .user-email {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.125rem;
}
.user-dropdown a,
.user-dropdown button {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    color: var(--text-primary);
    border-radius: var(--radius-xs);
    transition: background var(--transition-fast);
    border: none;
    background: none;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
}
.user-dropdown a:hover,
.user-dropdown button:hover {
    background: var(--surface-hover);
}
.user-dropdown .dropdown-divider {
    height: 1px;
    background: var(--border-light);
    margin: 0.25rem 0;
}
.user-dropdown .dropdown-danger {
    color: var(--danger);
}
.user-dropdown .dropdown-danger:hover {
    background: var(--danger-light);
}


/* ----------------------------------------------------------- */
/*  5. CARDS                                                   */
/* ----------------------------------------------------------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    transition: box-shadow var(--transition-normal);
}
.card:hover {
    box-shadow: var(--shadow-card-hover);
}
.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.card-header h3,
.card-header h4,
.card-header h5 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}
.card-body {
    padding: 1.5rem;
}
.card-body-flush {
    padding: 0;
}
.card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-light);
    background: var(--surface-alt);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}


/* ----------------------------------------------------------- */
/*  6. BUTTONS                                                 */
/* ----------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5625rem 1.125rem;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.5;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
    user-select: none;
    -webkit-appearance: none;
}
.btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
.btn:disabled,
.btn.disabled {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--text-inverse);
}
.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    color: var(--text-inverse);
}

.btn-secondary {
    background: var(--secondary);
    border-color: var(--secondary);
    color: var(--text-inverse);
}
.btn-secondary:hover {
    background: var(--secondary-hover);
    border-color: var(--secondary-hover);
    color: var(--text-inverse);
}

.btn-success {
    background: var(--success);
    border-color: var(--success);
    color: var(--text-inverse);
}
.btn-success:hover {
    background: var(--success-hover);
    border-color: var(--success-hover);
    color: var(--text-inverse);
}

.btn-danger {
    background: var(--danger);
    border-color: var(--danger);
    color: var(--text-inverse);
}
.btn-danger:hover {
    background: var(--danger-hover);
    border-color: var(--danger-hover);
    color: var(--text-inverse);
}

.btn-warning {
    background: var(--warning);
    border-color: var(--warning);
    color: var(--text-inverse);
}
.btn-warning:hover {
    background: var(--warning-hover);
    border-color: var(--warning-hover);
    color: var(--text-inverse);
}

.btn-info {
    background: var(--info);
    border-color: var(--info);
    color: var(--text-inverse);
}
.btn-info:hover {
    background: var(--info-hover);
    border-color: var(--info-hover);
    color: var(--text-inverse);
}

/* Outline variants */
.btn-outline-primary {
    background: transparent;
    border-color: var(--primary);
    color: var(--primary);
}
.btn-outline-primary:hover {
    background: var(--primary);
    color: var(--text-inverse);
}

.btn-outline-secondary {
    background: transparent;
    border-color: var(--border-color);
    color: var(--text-secondary);
}
.btn-outline-secondary:hover {
    background: var(--surface-hover);
    border-color: var(--secondary);
    color: var(--text-primary);
}

.btn-outline-danger {
    background: transparent;
    border-color: var(--danger);
    color: var(--danger);
}
.btn-outline-danger:hover {
    background: var(--danger);
    color: var(--text-inverse);
}

.btn-outline-success {
    background: transparent;
    border-color: var(--success);
    color: var(--success);
}
.btn-outline-success:hover {
    background: var(--success);
    color: var(--text-inverse);
}

/* Ghost (text-only) */
.btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--text-secondary);
}
.btn-ghost:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}
.btn-ghost-primary {
    background: transparent;
    border-color: transparent;
    color: var(--primary);
}
.btn-ghost-primary:hover {
    background: var(--primary-light);
    color: var(--primary-hover);
}
.btn-ghost-danger {
    background: transparent;
    border-color: transparent;
    color: var(--danger);
}
.btn-ghost-danger:hover {
    background: var(--danger-light);
    color: var(--danger-hover);
}

/* Soft (light background) */
.btn-soft-primary {
    background: var(--primary-light);
    border-color: transparent;
    color: var(--primary);
}
.btn-soft-primary:hover {
    background: var(--rn-teal-100);
    color: var(--primary-hover);
}

/* Sizes */
.btn-xs {
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    border-radius: var(--radius-xs);
}
.btn-sm {
    padding: 0.375rem 0.875rem;
    font-size: 0.8125rem;
}
.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}
.btn-xl {
    padding: 0.875rem 2rem;
    font-size: 1.125rem;
    border-radius: var(--radius-md);
}

/* Icon-only button */
.btn-icon {
    width: 38px;
    height: 38px;
    padding: 0;
}
.btn-icon.btn-sm {
    width: 32px;
    height: 32px;
}
.btn-icon.btn-xs {
    width: 28px;
    height: 28px;
}
.btn-icon.btn-lg {
    width: 44px;
    height: 44px;
}

/* Button group */
.btn-group {
    display: inline-flex;
}
.btn-group .btn {
    border-radius: 0;
}
.btn-group .btn:first-child {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}
.btn-group .btn:last-child {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.btn-group .btn + .btn {
    margin-left: -1px;
}

/* Full width */
.btn-block {
    display: flex;
    width: 100%;
}


/* ----------------------------------------------------------- */
/*  7. FORMS                                                   */
/* ----------------------------------------------------------- */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.375rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-primary);
}
.form-label .required {
    color: var(--danger);
    margin-left: 2px;
}
.form-label-optional {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-muted);
    margin-left: 0.375rem;
}

.form-control,
.form-select {
    display: block;
    width: 100%;
    padding: 0.5625rem 0.875rem;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}
.form-select option {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.875rem;
    font-weight: 400;
    padding: 0.5rem 0.75rem;
}
.form-control::placeholder,
.form-select::placeholder {
    color: var(--text-muted);
}
.form-control:hover,
.form-select:hover {
    border-color: var(--rn-light-teal);
}
.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: var(--rn-teal);
    box-shadow: 0 0 0 3px rgba(16, 145, 143, 0.12);
}
.form-select {
    padding-right: 2.5rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2364748B' viewBox='0 0 16 16'%3E%3Cpath d='M4.646 6.354l3 3a.5.5 0 00.708 0l3-3a.5.5 0 10-.708-.708L8 8.293 5.354 5.646a.5.5 0 10-.708.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.875rem center;
    background-size: 16px;
    cursor: pointer;
}
.form-select option {
    padding: 0.5rem 0.75rem;
}
.form-select:focus option:checked {
    background: var(--rn-teal);
    color: #fff;
}
.form-control:disabled,
.form-control[readonly] {
    background: var(--surface-alt);
    color: var(--text-muted);
    cursor: not-allowed;
}
.form-control.is-invalid {
    border-color: var(--danger);
}
.form-control.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(var(--danger-rgb), 0.1);
}
.form-control.is-valid {
    border-color: var(--success);
}
.form-control.is-valid:focus {
    box-shadow: 0 0 0 3px rgba(var(--success-rgb), 0.1);
}

/* Sizes */
.form-control-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}
.form-control-lg {
    padding: 0.75rem 1rem;
    font-size: 1rem;
}

/* Textarea */
textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

/* Date / Time inputs - compact with inline calendar icon */
input[type="date"].form-control,
input[type="datetime-local"].form-control,
input[type="month"].form-control,
input[type="week"].form-control,
input[type="time"].form-control {
    padding-right: 0.5rem;
    cursor: pointer;
    position: relative;
}
input[type="date"].form-control::-webkit-calendar-picker-indicator,
input[type="datetime-local"].form-control::-webkit-calendar-picker-indicator,
input[type="month"].form-control::-webkit-calendar-picker-indicator,
input[type="week"].form-control::-webkit-calendar-picker-indicator,
input[type="time"].form-control::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.5;
    padding: 4px;
    margin-left: 4px;
    border-radius: 4px;
    transition: opacity 0.2s, background 0.2s;
}
input[type="date"].form-control::-webkit-calendar-picker-indicator:hover,
input[type="datetime-local"].form-control::-webkit-calendar-picker-indicator:hover,
input[type="month"].form-control::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
    background: var(--rn-teal-50, #E8F6F6);
}
/* Click anywhere on the date field opens the picker */
input[type="date"].form-control,
input[type="datetime-local"].form-control,
input[type="month"].form-control {
    position: relative;
}

/* Select - form-control variant inherits from .form-select */
select.form-control {
    padding-right: 2.5rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2364748B' viewBox='0 0 16 16'%3E%3Cpath d='M4.646 6.354l3 3a.5.5 0 00.708 0l3-3a.5.5 0 10-.708-.708L8 8.293 5.354 5.646a.5.5 0 10-.708.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.875rem center;
    background-size: 16px;
    cursor: pointer;
}
select.form-control:hover {
    border-color: var(--rn-light-teal);
}
select.form-control:focus {
    border-color: var(--rn-teal);
    box-shadow: 0 0 0 3px rgba(16, 145, 143, 0.12);
}
select.form-control[multiple] {
    padding-right: 0.875rem;
    background-image: none;
}

/* Validation messages */
.invalid-feedback {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--danger);
}
/* Form labels - premium style matching org panels */
.form-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.375rem;
}
.form-label .text-danger {
    color: var(--rn-brand-red);
    font-weight: 700;
}

/* Form groups */
.mb-3 .form-label,
.form-group .form-label {
    margin-bottom: 0.375rem;
}

/* Card forms - clean look */
.card .card-header {
    font-weight: 600;
    font-size: 0.875rem;
    letter-spacing: 0.02em;
    border-bottom: 1px solid var(--border-color);
}

/* Form select sizes matching form-control */
.form-select-sm {
    padding: 0.375rem 2rem 0.375rem 0.75rem;
    font-size: 0.8125rem;
}
.form-select-lg {
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    font-size: 1rem;
}

/* Form select disabled */
.form-select:disabled {
    background-color: var(--surface-alt);
    color: var(--text-muted);
    cursor: not-allowed;
}

.valid-feedback {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--success);
}
.form-text {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Checkbox & Radio (custom) */
.form-check {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
}
.form-check-input {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    flex-shrink: 0;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-xs);
    background: var(--surface);
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    transition: all var(--transition-fast);
}
.form-check-input[type="radio"] {
    border-radius: 50%;
}
.form-check-input:checked {
    background: var(--primary);
    border-color: var(--primary);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23fff' d='M10.28 2.72a.75.75 0 010 1.06l-5.25 5.25a.75.75 0 01-1.06 0L1.72 6.78a.75.75 0 111.06-1.06L4.5 7.44l4.72-4.72a.75.75 0 011.06 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 12px;
}
.form-check-input[type="radio"]:checked {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3E%3Ccircle cx='4' cy='4' r='4' fill='%23fff'/%3E%3C/svg%3E");
    background-size: 8px;
}
.form-check-input:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
.form-check-label {
    font-size: 0.875rem;
    color: var(--text-primary);
    cursor: pointer;
    user-select: none;
}

/* Toggle switch */
.form-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    cursor: pointer;
}
.form-switch-input {
    width: 44px;
    height: 24px;
    border-radius: var(--radius-pill);
    background: var(--rn-navy-100);
    border: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    position: relative;
    transition: background var(--transition-fast);
    flex-shrink: 0;
}
.form-switch-input::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast);
}
.form-switch-input:checked {
    background: var(--primary);
}
.form-switch-input:checked::after {
    transform: translateX(20px);
}
.form-switch-label {
    font-size: 0.875rem;
    color: var(--text-primary);
    user-select: none;
}

/* File upload */
.form-file {
    position: relative;
}
.form-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}
.form-file-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    background: var(--surface-alt);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: center;
    justify-content: center;
    flex-direction: column;
    min-height: 100px;
}
.form-file-label:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}
.form-file-label .file-icon {
    width: 32px;
    height: 32px;
    color: var(--text-muted);
}
.form-file-label .file-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
}
.form-file-label .file-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Input groups */
.input-group {
    display: flex;
    align-items: stretch;
}
.input-group .form-control {
    border-radius: 0;
    flex: 1;
}
.input-group .form-control:first-child {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}
.input-group .form-control:last-child {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.input-group-text {
    display: flex;
    align-items: center;
    padding: 0 0.875rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    background: var(--surface-alt);
    border: 1px solid var(--border-color);
    white-space: nowrap;
}
.input-group-text:first-child {
    border-right: 0;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}
.input-group-text:last-child {
    border-left: 0;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.input-group .btn:first-child {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}
.input-group .btn:last-child {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* Form row / grid */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}


/* ----------------------------------------------------------- */
/*  8. TABLES                                                  */
/* ----------------------------------------------------------- */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}
.table thead th {
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    background: var(--surface-alt);
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
    text-align: left;
    position: sticky;
    top: 0;
}
.table tbody td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
    vertical-align: middle;
}
.table tbody tr:last-child td {
    border-bottom: none;
}

/* Sortable columns */
.table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: color var(--transition-fast);
}
.table th.sortable:hover {
    color: var(--primary);
}
.table th.sortable .sort-icon {
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-left: 0.25rem;
    vertical-align: middle;
    opacity: 0.3;
}
.table th.sorted-asc .sort-icon,
.table th.sorted-desc .sort-icon {
    opacity: 1;
    color: var(--primary);
}

/* Striped */
.table-striped tbody tr:nth-child(even) {
    background: var(--surface-alt);
}

/* Hoverable */
.table-hover tbody tr {
    transition: background var(--transition-fast);
}
.table-hover tbody tr:hover {
    background: var(--surface-hover);
}

/* Compact */
.table-compact thead th,
.table-compact tbody td {
    padding: 0.5rem 0.75rem;
}

/* Table actions column */
.table .actions-cell {
    text-align: right;
    white-space: nowrap;
    width: 1%;
}
.table .actions-cell .btn + .btn {
    margin-left: 0.25rem;
}

/* Row checkbox */
.table .row-checkbox {
    width: 1%;
    padding-right: 0;
}


/* ----------------------------------------------------------- */
/*  9. BADGES                                                  */
/* ----------------------------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.1875rem 0.625rem;
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1.4;
    border-radius: var(--radius-pill);
    white-space: nowrap;
    letter-spacing: 0.02em;
}

.badge-primary {
    background: var(--primary-light);
    color: var(--primary);
}
.badge-secondary {
    background: var(--secondary-light);
    color: var(--secondary);
}
.badge-success {
    background: var(--success-light);
    color: var(--success);
}
.badge-danger {
    background: var(--danger-light);
    color: var(--danger);
}
.badge-warning {
    background: var(--warning-light);
    color: var(--warning);
}
.badge-info {
    background: var(--info-light);
    color: var(--info);
}

/* Solid badges */
.badge-solid-primary {
    background: var(--primary);
    color: var(--text-inverse);
}
.badge-solid-danger {
    background: var(--danger);
    color: var(--text-inverse);
}
.badge-solid-success {
    background: var(--success);
    color: var(--text-inverse);
}

/* Badge with dot */
.badge-dot {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0;
    background: none;
    font-size: 0.8125rem;
    font-weight: 400;
    color: var(--text-primary);
}
.badge-dot::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.badge-dot.dot-primary::before   { background: var(--primary); }
.badge-dot.dot-success::before   { background: var(--success); }
.badge-dot.dot-danger::before    { background: var(--danger); }
.badge-dot.dot-warning::before   { background: var(--warning); }
.badge-dot.dot-info::before      { background: var(--info); }
.badge-dot.dot-secondary::before { background: var(--secondary); }


/* ----------------------------------------------------------- */
/*  10. ALERTS                                                 */
/* ----------------------------------------------------------- */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    line-height: 1.5;
    border: 1px solid transparent;
    margin-bottom: 1rem;
}
.alert-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 1px;
}
.alert-content {
    flex: 1;
}
.alert-title {
    font-weight: 600;
    margin-bottom: 0.125rem;
}
.alert-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin: -0.25rem -0.375rem -0.25rem 0;
    border: none;
    background: transparent;
    border-radius: var(--radius-xs);
    cursor: pointer;
    opacity: 0.5;
    transition: opacity var(--transition-fast);
    flex-shrink: 0;
}
.alert-close:hover {
    opacity: 1;
}

.alert-success {
    background: var(--success-light);
    border-color: #bbf7d0;
    color: #065f46;
}
.alert-success .alert-icon { color: var(--success); }

.alert-danger, .alert-error {
    background: var(--danger-light);
    border-color: #fecaca;
    color: #991b1b;
}
.alert-danger .alert-icon,
.alert-error .alert-icon { color: var(--danger); }

.alert-warning {
    background: var(--warning-light);
    border-color: #fde68a;
    color: #92400e;
}
.alert-warning .alert-icon { color: var(--warning); }

.alert-info {
    background: var(--info-light);
    border-color: #bae6fd;
    color: #0c4a6e;
}
.alert-info .alert-icon { color: var(--info); }


/* ----------------------------------------------------------- */
/*  11. MODALS                                                 */
/* ----------------------------------------------------------- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(32,49,66,0.4);
    backdrop-filter: blur(4px);
    z-index: var(--z-modal-backdrop);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}
.modal-backdrop.show {
    opacity: 1;
    visibility: visible;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 3rem 1rem;
    z-index: var(--z-modal);
    pointer-events: none;
    overflow-y: auto;
}
.modal.show {
    pointer-events: auto;
}

.modal-dialog {
    width: 100%;
    max-width: 520px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-modal);
    opacity: 0;
    transform: translateY(-20px) scale(0.98);
    transition: all var(--transition-normal);
}
.modal.show .modal-dialog {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.modal-sm .modal-dialog { max-width: 400px; }
.modal-lg .modal-dialog { max-width: 700px; }
.modal-xl .modal-dialog { max-width: 960px; }

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
}
.modal-header h4,
.modal-header h5 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
}
.modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}
.modal-close:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-light);
    background: var(--surface-alt);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}


/* ----------------------------------------------------------- */
/*  12. TABS                                                   */
/* ----------------------------------------------------------- */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    gap: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.tab-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    text-decoration: none;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    font-family: inherit;
}
.tab-item:hover {
    color: var(--primary);
}
.tab-item.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
    padding: 1.5rem 0;
}
.tab-content.active {
    display: block;
}


/* ----------------------------------------------------------- */
/*  13. BREADCRUMBS                                            */
/* ----------------------------------------------------------- */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.875rem;
}
.breadcrumbs li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
}
.breadcrumbs li::after {
    content: '/';
    color: var(--text-muted);
    font-size: 0.75rem;
}
.breadcrumbs li:last-child::after {
    display: none;
}
.breadcrumbs li:last-child {
    color: var(--text-primary);
    font-weight: 500;
}
.breadcrumbs a {
    color: var(--text-secondary);
}
.breadcrumbs a:hover {
    color: var(--primary);
}


/* ----------------------------------------------------------- */
/*  14. STAT CARDS (Dashboard KPIs)                            */
/* ----------------------------------------------------------- */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-card);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}
.stat-card:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-1px);
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}
.stat-card.stat-primary::before   { background: var(--primary); }
.stat-card.stat-success::before   { background: var(--success); }
.stat-card.stat-warning::before   { background: var(--warning); }
.stat-card.stat-danger::before    { background: var(--danger); }
.stat-card.stat-info::before      { background: var(--info); }
.stat-card.stat-lavender::before  { background: var(--rn-lavender); }

.stat-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1rem;
}
.stat-card-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.stat-card-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.stat-card.stat-primary .stat-card-icon   { background: var(--primary-light); color: var(--primary); }
.stat-card.stat-success .stat-card-icon   { background: var(--success-light); color: var(--success); }
.stat-card.stat-warning .stat-card-icon   { background: var(--warning-light); color: var(--warning); }
.stat-card.stat-danger .stat-card-icon    { background: var(--danger-light); color: var(--danger); }
.stat-card.stat-info .stat-card-icon      { background: var(--info-light); color: var(--info); }

.stat-card-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--text-primary);
    margin-bottom: 0.375rem;
    letter-spacing: -0.025em;
}
.stat-card-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.stat-card-trend {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
}
.stat-card-trend.up {
    color: var(--success);
}
.stat-card-trend.down {
    color: var(--danger);
}


/* ----------------------------------------------------------- */
/*  15. PAGINATION                                             */
/* ----------------------------------------------------------- */
.pagination {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}
.page-item .page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 0.5rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: all var(--transition-fast);
}
.page-item .page-link:hover {
    background: var(--surface-hover);
    border-color: var(--primary);
    color: var(--primary);
}
.page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--text-inverse);
}
.page-item.disabled .page-link {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.pagination-info {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.pagination-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    flex-wrap: wrap;
    gap: 1rem;
}


/* ----------------------------------------------------------- */
/*  16. TIMELINE                                               */
/* ----------------------------------------------------------- */
.timeline {
    position: relative;
    padding-left: 2rem;
}
.timeline::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 0.5rem;
    bottom: 0.5rem;
    width: 2px;
    background: var(--border-color);
}

.timeline-item {
    position: relative;
    padding-bottom: 1.5rem;
}
.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -1.75rem;
    top: 0.25rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--surface);
    border: 2px solid var(--primary);
    z-index: 1;
}
.timeline-dot.dot-success { border-color: var(--success); }
.timeline-dot.dot-danger  { border-color: var(--danger); }
.timeline-dot.dot-warning { border-color: var(--warning); }
.timeline-dot.dot-info    { border-color: var(--info); }

.timeline-content {
    font-size: 0.875rem;
}
.timeline-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}


/* ----------------------------------------------------------- */
/*  17. AVATARS                                                */
/* ----------------------------------------------------------- */
.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 600;
    color: var(--text-inverse);
    background: var(--primary);
    flex-shrink: 0;
    overflow: hidden;
    line-height: 1;
}
.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-xs  { width: 24px; height: 24px; font-size: 0.625rem; }
.avatar-sm  { width: 32px; height: 32px; font-size: 0.75rem; }
.avatar-md  { width: 40px; height: 40px; font-size: 0.875rem; }
.avatar-lg  { width: 48px; height: 48px; font-size: 1rem; }
.avatar-xl  { width: 64px; height: 64px; font-size: 1.25rem; }
.avatar-2xl { width: 80px; height: 80px; font-size: 1.5rem; }

.avatar-navy     { background: var(--rn-navy); }
.avatar-teal     { background: var(--rn-teal); }
.avatar-blue     { background: var(--rn-blue); }
.avatar-lavender { background: var(--rn-lavender); }
.avatar-red      { background: var(--rn-brand-red); }

.avatar-group {
    display: flex;
    align-items: center;
}
.avatar-group .avatar {
    border: 2px solid var(--surface);
}
.avatar-group .avatar + .avatar {
    margin-left: -8px;
}
.avatar-group .avatar-count {
    background: var(--rn-navy-100);
    color: var(--text-secondary);
}


/* ----------------------------------------------------------- */
/*  18. STATUS DOTS                                            */
/* ----------------------------------------------------------- */
.status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.status-dot-sm { width: 8px; height: 8px; }
.status-dot-lg { width: 12px; height: 12px; }

.status-dot-success  { background: var(--success); }
.status-dot-danger   { background: var(--danger); }
.status-dot-warning  { background: var(--warning); }
.status-dot-info     { background: var(--info); }
.status-dot-primary  { background: var(--primary); }
.status-dot-muted    { background: var(--text-muted); }

.status-dot-pulse {
    position: relative;
}
.status-dot-pulse::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 2px solid currentColor;
    opacity: 0;
    animation: status-pulse 2s ease-out infinite;
}
.status-dot-pulse.status-dot-success { color: var(--success); }
.status-dot-pulse.status-dot-danger  { color: var(--danger); }
.status-dot-pulse.status-dot-warning { color: var(--warning); }

@keyframes status-pulse {
    0%   { opacity: 0.6; transform: scale(1); }
    100% { opacity: 0; transform: scale(1.8); }
}


/* ----------------------------------------------------------- */
/*  19. LOADING SPINNER                                        */
/* ----------------------------------------------------------- */
.spinner {
    display: inline-block;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spinner-rotate 0.7s linear infinite;
}
.spinner-sm { width: 20px; height: 20px; border-width: 2px; }
.spinner-md { width: 32px; height: 32px; border-width: 3px; }
.spinner-lg { width: 48px; height: 48px; border-width: 4px; }

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

.loading-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.75);
    border-radius: inherit;
    z-index: 10;
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, var(--surface-alt) 25%, var(--border-light) 50%, var(--surface-alt) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}
.skeleton-text {
    height: 14px;
    margin-bottom: 0.5rem;
}
.skeleton-text-sm {
    height: 10px;
    margin-bottom: 0.375rem;
    width: 60%;
}
.skeleton-avatar {
    border-radius: 50%;
}
.skeleton-rect {
    border-radius: var(--radius-md);
}

@keyframes skeleton-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}


/* ----------------------------------------------------------- */
/*  20. TOASTS                                                 */
/* ----------------------------------------------------------- */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 400px;
    width: 100%;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    pointer-events: auto;
    animation: toast-slide-in 0.3s ease;
    border-left: 4px solid var(--primary);
}
.toast-success { border-left-color: var(--success); }
.toast-danger, .toast-error { border-left-color: var(--danger); }
.toast-warning { border-left-color: var(--warning); }
.toast-info    { border-left-color: var(--info); }

.toast-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 1px;
}
.toast-success .toast-icon { color: var(--success); }
.toast-danger .toast-icon,
.toast-error .toast-icon   { color: var(--danger); }
.toast-warning .toast-icon { color: var(--warning); }
.toast-info .toast-icon    { color: var(--info); }

.toast-body {
    flex: 1;
    font-size: 0.875rem;
}
.toast-title {
    font-weight: 600;
    margin-bottom: 0.125rem;
}
.toast-message {
    color: var(--text-secondary);
}

.toast-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    border-radius: var(--radius-xs);
    color: var(--text-muted);
    cursor: pointer;
    flex-shrink: 0;
    transition: all var(--transition-fast);
}
.toast-close:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.toast-exit {
    animation: toast-slide-out 0.25s ease forwards;
}

@keyframes toast-slide-in {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}
@keyframes toast-slide-out {
    from { transform: translateX(0); opacity: 1; }
    to   { transform: translateX(100%); opacity: 0; }
}


/* ----------------------------------------------------------- */
/*  21. EMPTY STATES                                           */
/* ----------------------------------------------------------- */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    text-align: center;
}
.empty-state-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 1.25rem;
    color: var(--text-muted);
    opacity: 0.4;
}
.empty-state-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}
.empty-state-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    max-width: 360px;
    margin-bottom: 1.5rem;
}


/* ----------------------------------------------------------- */
/*  22. SEARCH & FILTER BAR                                    */
/* ----------------------------------------------------------- */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border-light);
    flex-wrap: wrap;
}

.filter-search {
    position: relative;
    flex: 1;
    min-width: 200px;
    max-width: 360px;
}
.filter-search .form-control {
    padding-left: 2.5rem;
}
.filter-search-icon {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    pointer-events: none;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.filter-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
}
.filter-select {
    min-width: 140px;
}

.filter-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.active-filters {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 0 1.5rem 0.75rem;
}
.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: var(--radius-pill);
    font-weight: 500;
}
.filter-tag-remove {
    width: 16px;
    height: 16px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity var(--transition-fast);
}
.filter-tag-remove:hover {
    opacity: 1;
}


/* ----------------------------------------------------------- */
/*  23. DROPDOWNS                                              */
/* ----------------------------------------------------------- */
.dropdown {
    position: relative;
    display: inline-flex;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 180px;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-dropdown);
    padding: 0.375rem;
    z-index: var(--z-dropdown);
    display: none;
}
.dropdown-menu.show {
    display: block;
}
.dropdown-menu.dropdown-right {
    left: auto;
    right: 0;
}
.dropdown-menu.dropdown-up {
    top: auto;
    bottom: calc(100% + 4px);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    color: var(--text-primary);
    border-radius: var(--radius-xs);
    transition: background var(--transition-fast);
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
    text-decoration: none;
}
.dropdown-item:hover {
    background: var(--surface-hover);
    text-decoration: none;
    color: var(--text-primary);
}
.dropdown-item.active {
    background: var(--primary-light);
    color: var(--primary);
}
.dropdown-item-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    opacity: 0.7;
}
.dropdown-item-danger {
    color: var(--danger);
}
.dropdown-item-danger:hover {
    background: var(--danger-light);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-light);
    margin: 0.25rem 0;
}
.dropdown-header {
    padding: 0.5rem 0.75rem;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}


/* ----------------------------------------------------------- */
/*  24. TOOLTIPS                                               */
/* ----------------------------------------------------------- */
.tooltip {
    position: relative;
    display: inline-flex;
}
.tooltip-text {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-inverse);
    background: var(--rn-navy);
    border-radius: var(--radius-sm);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
    z-index: var(--z-tooltip);
}
.tooltip-text::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: var(--rn-navy);
}
.tooltip:hover .tooltip-text {
    opacity: 1;
    visibility: visible;
}

[data-tooltip] {
    position: relative;
}
[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-inverse);
    background: var(--rn-navy);
    border-radius: var(--radius-sm);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
    z-index: var(--z-tooltip);
}
[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
}


/* ----------------------------------------------------------- */
/*  25. PROGRESS BARS                                          */
/* ----------------------------------------------------------- */
.progress {
    width: 100%;
    height: 8px;
    background: var(--border-light);
    border-radius: var(--radius-pill);
    overflow: hidden;
}
.progress-sm { height: 4px; }
.progress-lg { height: 12px; }

.progress-bar {
    height: 100%;
    border-radius: var(--radius-pill);
    background: var(--primary);
    transition: width 0.6s ease;
}
.progress-bar-success { background: var(--success); }
.progress-bar-warning { background: var(--warning); }
.progress-bar-danger  { background: var(--danger); }
.progress-bar-info    { background: var(--info); }

.progress-labeled {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.progress-labeled .progress {
    flex: 1;
}
.progress-value {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 40px;
    text-align: right;
}


/* ----------------------------------------------------------- */
/*  26. PAGE-LEVEL ELEMENTS                                    */
/* ----------------------------------------------------------- */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}
.page-header h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}
.page-header-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}
.page-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.content-section {
    margin-bottom: 2rem;
}
.section-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-light);
}


/* ----------------------------------------------------------- */
/*  27. DASHBOARD WIDGETS                                      */
/* ----------------------------------------------------------- */
.widget-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.widget-list-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-light);
}
.widget-list-item:last-child {
    border-bottom: none;
}
.widget-list-item a {
    color: var(--text-primary);
    font-weight: 500;
}
.widget-list-item a:hover {
    color: var(--primary);
}

.holiday-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--border-light);
}
.holiday-item:last-child {
    border-bottom: none;
}
.holiday-name {
    font-size: 0.875rem;
    font-weight: 500;
}
.holiday-date {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.activity-feed-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-light);
}
.activity-feed-item:last-child {
    border-bottom: none;
}
.activity-feed-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--surface-alt);
    color: var(--text-secondary);
}
.activity-feed-content {
    flex: 1;
    min-width: 0;
}
.activity-feed-text {
    font-size: 0.8125rem;
    color: var(--text-primary);
}
.activity-feed-text strong {
    font-weight: 600;
}
.activity-feed-time {
    font-size: 0.6875rem;
    color: var(--text-muted);
    margin-top: 0.125rem;
}

.leave-request-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-light);
}
.leave-request-item:last-child {
    border-bottom: none;
}
.leave-request-info {
    flex: 1;
    min-width: 0;
}
.leave-request-name {
    font-size: 0.875rem;
    font-weight: 500;
}
.leave-request-dates {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.125rem;
}
.leave-request-type {
    font-size: 0.75rem;
}
.leave-request-actions {
    display: flex;
    gap: 0.375rem;
    flex-shrink: 0;
}


/* ----------------------------------------------------------- */
/*  28. FLASH MESSAGES                                         */
/* ----------------------------------------------------------- */
.flash-messages {
    margin-bottom: 1rem;
}

.flash {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    animation: flash-in 0.3s ease;
    border: 1px solid transparent;
}
.flash-success {
    background: var(--success-light);
    border-color: #bbf7d0;
    color: #065f46;
}
.flash-error {
    background: var(--danger-light);
    border-color: #fecaca;
    color: #991b1b;
}
.flash-warning {
    background: var(--warning-light);
    border-color: #fde68a;
    color: #92400e;
}
.flash-info {
    background: var(--info-light);
    border-color: #bae6fd;
    color: #0c4a6e;
}
.flash-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}
.flash-text {
    flex: 1;
}
.flash-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    border-radius: var(--radius-xs);
    cursor: pointer;
    opacity: 0.5;
    transition: opacity var(--transition-fast);
    flex-shrink: 0;
}
.flash-close:hover {
    opacity: 1;
}

@keyframes flash-in {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}


/* ----------------------------------------------------------- */
/*  29. AUTH PAGES                                             */
/* ----------------------------------------------------------- */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--rn-navy) 0%, var(--rn-navy-700) 50%, var(--rn-teal-700) 100%);
    padding: 2rem 1rem;
    position: relative;
}
.auth-wrapper::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--surface);
    border-radius: var(--radius-xl);
    box-shadow: 0 25px 60px rgba(0,0,0,0.25);
    padding: 2.5rem;
    position: relative;
    z-index: 1;
}

.auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}
.auth-logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}
.auth-logo-text .brand-accent {
    color: var(--primary);
}
.auth-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 0.375rem;
}

.auth-form {
    margin-top: 1.5rem;
}
.auth-form .form-group {
    margin-bottom: 1.25rem;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-size: 0.8125rem;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.auth-sso-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--surface);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    font-family: inherit;
}
.auth-sso-btn:hover {
    background: var(--surface-hover);
    border-color: var(--secondary);
    text-decoration: none;
    color: var(--text-primary);
}
.auth-sso-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
}


/* ----------------------------------------------------------- */
/*  30. ERROR PAGES                                            */
/* ----------------------------------------------------------- */
.error-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--body-bg);
    padding: 2rem;
}
.error-content {
    text-align: center;
    max-width: 480px;
}
.error-code {
    font-size: 6rem;
    font-weight: 800;
    line-height: 1;
    color: var(--rn-navy);
    margin-bottom: 1rem;
    letter-spacing: -0.05em;
}
.error-code .accent {
    color: var(--primary);
}
.error-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}
.error-message {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.6;
}


/* ----------------------------------------------------------- */
/*  31. UTILITY CLASSES                                        */
/* ----------------------------------------------------------- */

/* Text */
.text-primary     { color: var(--primary) !important; }
.text-secondary   { color: var(--text-secondary) !important; }
.text-muted       { color: var(--text-muted) !important; }
.text-success     { color: var(--success) !important; }
.text-danger      { color: var(--danger) !important; }
.text-warning     { color: var(--warning) !important; }
.text-info        { color: var(--info) !important; }
.text-navy        { color: var(--rn-navy) !important; }
.text-teal        { color: var(--rn-teal) !important; }
.text-brand-red   { color: var(--rn-brand-red) !important; }
.text-white       { color: var(--rn-white) !important; }

.text-sm   { font-size: 0.8125rem !important; }
.text-xs   { font-size: 0.75rem !important; }
.text-lg   { font-size: 1.125rem !important; }
.text-xl   { font-size: 1.25rem !important; }
.text-2xl  { font-size: 1.5rem !important; }
.text-3xl  { font-size: 1.75rem !important; }

.fw-400 { font-weight: 400 !important; }
.fw-500 { font-weight: 500 !important; }
.fw-600 { font-weight: 600 !important; }
.fw-700 { font-weight: 700 !important; }

.text-start   { text-align: left !important; }
.text-center  { text-align: center !important; }
.text-end     { text-align: right !important; }
.text-nowrap  { white-space: nowrap !important; }
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Background */
.bg-primary      { background-color: var(--primary) !important; }
.bg-primary-light{ background-color: var(--primary-light) !important; }
.bg-success-light{ background-color: var(--success-light) !important; }
.bg-danger-light { background-color: var(--danger-light) !important; }
.bg-warning-light{ background-color: var(--warning-light) !important; }
.bg-info-light   { background-color: var(--info-light) !important; }
.bg-surface      { background-color: var(--surface) !important; }
.bg-surface-alt  { background-color: var(--surface-alt) !important; }

/* Spacing */
.m-0  { margin: 0 !important; }
.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mt-5 { margin-top: 2rem !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mb-5 { margin-bottom: 2rem !important; }
.ms-auto { margin-left: auto !important; }
.me-auto { margin-right: auto !important; }
.mx-auto { margin-left: auto !important; margin-right: auto !important; }

.p-0  { padding: 0 !important; }
.p-1  { padding: 0.25rem !important; }
.p-2  { padding: 0.5rem !important; }
.p-3  { padding: 1rem !important; }
.p-4  { padding: 1.5rem !important; }
.p-5  { padding: 2rem !important; }

/* Display */
.d-none          { display: none !important; }
.d-flex          { display: flex !important; }
.d-inline-flex   { display: inline-flex !important; }
.d-block         { display: block !important; }
.d-inline-block  { display: inline-block !important; }
.d-grid          { display: grid !important; }

.flex-column     { flex-direction: column !important; }
.flex-wrap       { flex-wrap: wrap !important; }
.flex-1          { flex: 1 !important; }
.flex-shrink-0   { flex-shrink: 0 !important; }

.align-items-center    { align-items: center !important; }
.align-items-start     { align-items: flex-start !important; }
.align-items-end       { align-items: flex-end !important; }
.justify-content-center  { justify-content: center !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-end     { justify-content: flex-end !important; }

.gap-1 { gap: 0.25rem !important; }
.gap-2 { gap: 0.5rem !important; }
.gap-3 { gap: 0.75rem !important; }
.gap-4 { gap: 1rem !important; }
.gap-5 { gap: 1.5rem !important; }

/* Border */
.border       { border: 1px solid var(--border-color) !important; }
.border-top   { border-top: 1px solid var(--border-color) !important; }
.border-bottom{ border-bottom: 1px solid var(--border-color) !important; }
.border-0     { border: 0 !important; }
.rounded      { border-radius: var(--radius-md) !important; }
.rounded-lg   { border-radius: var(--radius-lg) !important; }
.rounded-pill { border-radius: var(--radius-pill) !important; }

/* Shadow */
.shadow-none { box-shadow: none !important; }
.shadow-sm   { box-shadow: var(--shadow-sm) !important; }
.shadow-md   { box-shadow: var(--shadow-md) !important; }
.shadow-lg   { box-shadow: var(--shadow-lg) !important; }

/* Overflow */
.overflow-hidden { overflow: hidden !important; }
.overflow-auto   { overflow: auto !important; }

/* Width */
.w-100 { width: 100% !important; }
.w-auto { width: auto !important; }

/* Visibility */
.visible   { visibility: visible !important; }
.invisible { visibility: hidden !important; }

/* Position */
.position-relative { position: relative !important; }
.position-absolute { position: absolute !important; }

/* Cursor */
.cursor-pointer { cursor: pointer !important; }


/* ----------------------------------------------------------- */
/*  32. RESPONSIVE                                             */
/* ----------------------------------------------------------- */

/* Tablet (768px) */
@media (max-width: 991.98px) {
    .app-sidebar {
        transform: translateX(-100%);
    }
    .sidebar-open .app-sidebar {
        transform: translateX(0);
    }
    .app-main {
        margin-left: 0;
    }
    .sidebar-collapsed .app-main {
        margin-left: 0;
    }

    .header-search {
        width: 200px;
    }
    .header-user-name {
        display: none;
    }

    .stat-cards {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .filter-search {
        max-width: 100%;
    }
    .filter-actions {
        margin-left: 0;
    }
}

/* Mobile (576px) */
@media (max-width: 575.98px) {
    .app-content {
        padding: 1rem;
    }

    .header-search {
        display: none;
    }
    .header-breadcrumb {
        display: none;
    }

    .stat-cards {
        grid-template-columns: 1fr;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .page-actions {
        width: 100%;
    }
    .page-actions .btn {
        flex: 1;
    }

    .card-header {
        padding: 1rem;
    }
    .card-body {
        padding: 1rem;
    }

    .modal {
        padding: 1rem;
    }
    .modal-dialog {
        max-width: 100%;
    }

    .auth-card {
        padding: 1.5rem;
    }

    .table thead th,
    .table tbody td {
        padding: 0.5rem 0.75rem;
    }

    .toast-container {
        left: 1rem;
    }

    .btn-block-mobile {
        display: flex;
        width: 100%;
    }

    .hide-mobile { display: none !important; }
}

/* Desktop (1200px+) */
@media (min-width: 1200px) {
    .hide-desktop { display: none !important; }
}

/* Large screens */
@media (min-width: 1600px) {
    .app-content {
        max-width: 100%;
    }
}


/* ----------------------------------------------------------- */
/*  33. PRINT STYLES                                           */
/* ----------------------------------------------------------- */
@media print {
    * {
        box-shadow: none !important;
        text-shadow: none !important;
    }

    body {
        background: #fff !important;
        color: #000 !important;
        font-size: 12pt;
    }

    .app-sidebar,
    .app-header,
    .sidebar-overlay,
    .toast-container,
    .modal-backdrop,
    .btn,
    .filter-bar,
    .pagination,
    .no-print {
        display: none !important;
    }

    .app-main {
        margin-left: 0 !important;
    }

    .app-content {
        padding: 0 !important;
    }

    .card {
        border: 1px solid #ddd !important;
        break-inside: avoid;
    }

    .table {
        border-collapse: collapse !important;
    }
    .table thead th {
        background: #f5f5f5 !important;
        border-bottom: 2px solid #000 !important;
    }
    .table td {
        border-bottom: 1px solid #ddd !important;
    }

    a {
        color: #000 !important;
        text-decoration: underline;
    }
    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }
    a[href^="#"]::after,
    a[href^="javascript"]::after {
        content: "";
    }

    .page-header {
        border-bottom: 2px solid #000;
        padding-bottom: 0.5rem;
    }

    .print-only { display: block !important; }
}

.print-only {
    display: none;
}


/* ----------------------------------------------------------- */
/*  34. ANIMATIONS & TRANSITIONS                               */
/* ----------------------------------------------------------- */
@keyframes fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes fade-in-up {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in-down {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes slide-in-left {
    from { transform: translateX(-100%); }
    to   { transform: translateX(0); }
}

@keyframes slide-in-right {
    from { transform: translateX(100%); }
    to   { transform: translateX(0); }
}

@keyframes scale-in {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}

.animate-fade-in     { animation: fade-in 0.3s ease; }
.animate-fade-in-up  { animation: fade-in-up 0.3s ease; }
.animate-fade-in-down{ animation: fade-in-down 0.3s ease; }
.animate-scale-in    { animation: scale-in 0.2s ease; }

/* Staggered children */
.stagger-children > * {
    opacity: 0;
    animation: fade-in-up 0.4s ease forwards;
}
.stagger-children > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.3s; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}


/* ----------------------------------------------------------- */
/*  27. ORGANISATION / PEOPLE MANAGEMENT                       */
/* ----------------------------------------------------------- */

/* --- Page Layout --- */
.org-page {
    max-width: 100%;
    padding: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.org-header {
    margin-bottom: 0.25rem;
}

.org-title {
    font-size: 1.625rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.02em;
}

/* --- Tabs --- */
.org-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 1rem;
}

.org-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s, border-color 0.2s;
    white-space: nowrap;
}

.org-tab:hover {
    color: var(--rn-teal);
}

.org-tab--active {
    color: var(--rn-teal);
    border-bottom-color: var(--rn-teal);
    font-weight: 600;
}

.org-tab svg {
    opacity: 0.7;
}

.org-tab--active svg {
    opacity: 1;
}

/* --- Toolbar --- */
.org-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 0;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.org-toolbar-left,
.org-toolbar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.org-toolbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.4375rem 0.875rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.4;
}

.org-toolbar-btn:hover {
    color: var(--text-primary);
    background: var(--surface-hover);
    border-color: var(--rn-teal-200);
}

.org-toolbar-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.3125rem;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--surface-alt);
    border-radius: 0.625rem;
}

.org-toolbar-badge--active {
    color: #fff;
    background: var(--rn-teal);
}

.org-employee-count {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-muted);
    padding: 0.4375rem 0.75rem;
}

/* --- Search --- */
.org-search {
    position: relative;
    min-width: 220px;
}

.org-search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.org-search-input {
    width: 100%;
    padding: 0.4375rem 0.875rem 0.4375rem 2.25rem;
    font-size: 0.8125rem;
    color: var(--text-primary);
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.org-search-input:focus {
    border-color: var(--rn-teal);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.org-search-input::placeholder {
    color: var(--text-muted);
}

/* --- Filter Tags --- */
.org-filter-tags {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.org-filter-tags-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.org-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--rn-teal-700);
    background: var(--rn-teal-50);
    border: 1px solid var(--rn-teal-200);
    border-radius: 1rem;
    white-space: nowrap;
}

.org-filter-tag-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    font-size: 0.875rem;
    color: var(--rn-teal-600);
    text-decoration: none;
    border-radius: 50%;
    transition: background 0.15s;
    line-height: 1;
}

.org-filter-tag-remove:hover {
    background: var(--rn-teal-200);
    color: var(--rn-teal-800);
}

.org-filter-clear {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--rn-teal);
    text-decoration: none;
    margin-left: 0.5rem;
}

.org-filter-clear:hover {
    color: var(--rn-teal-600);
    text-decoration: underline;
}

/* --- Views Dropdown --- */
.org-views-dropdown {
    position: relative;
}

.org-views-trigger {
    font-weight: 600 !important;
    color: var(--text-primary) !important;
}

.org-views-current {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.org-views-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 260px;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
    z-index: 1000;
    overflow: hidden;
    animation: fade-in-down 0.15s ease;
}

.org-views-menu.show {
    display: block;
}

.org-views-section {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-light);
}

.org-views-section:last-of-type {
    border-bottom: none;
}

.org-views-section-title {
    padding: 0.375rem 1rem;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.org-views-item {
    display: block;
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: background 0.1s;
}

.org-views-item:hover {
    background: var(--surface-hover);
}

.org-views-item--active {
    color: var(--rn-teal);
    font-weight: 600;
    background: var(--rn-teal-50);
}

.org-views-item-row {
    display: flex;
    align-items: center;
}

.org-views-item-row .org-views-item {
    flex: 1;
}

.org-views-delete {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: none;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 0.375rem;
    margin-right: 0.25rem;
    transition: color 0.15s, background 0.15s;
}

.org-views-delete:hover {
    color: var(--danger);
    background: var(--danger-light, #FEF2F2);
}

.org-views-empty {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-style: italic;
}

.org-views-footer {
    padding: 0.5rem;
    border-top: 1px solid var(--border-light);
}

.org-views-save-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--rn-teal);
    background: none;
    border: 1px dashed var(--rn-teal-200);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background 0.15s;
}

.org-views-save-btn:hover {
    background: var(--rn-teal-50);
}

/* --- Table --- */
.org-table-wrapper {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    overflow: visible;
    flex: 1;
    position: relative;
}

.table-employee {
    margin-bottom: 0;
    font-size: 0.8125rem;
    width: 100%;
    table-layout: auto;
}

.table-employee thead {
    background: var(--surface-alt);
    border-bottom: 2px solid var(--border-color);
}
.org-page .table-employee thead {
    position: sticky;
    top: 0;
    z-index: 3;
}

.table-employee thead th {
    padding: 0.625rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    border: none;
    vertical-align: middle;
}

/* Column header dropdown */
.org-col-header {
    position: relative;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    user-select: none;
    padding: 0.125rem 0;
}
.org-col-header-label {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    border-radius: var(--radius-xs);
    padding: 0.125rem 0.25rem;
    margin: -0.125rem -0.25rem;
    transition: background var(--transition-fast);
}
.org-col-header:hover .org-col-header-label {
    background: rgba(0, 0, 0, 0.04);
}
.org-col-dropdown {
    display: none;
    position: fixed;
    min-width: 220px;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-dropdown);
    z-index: 1060;
    padding: 0.375rem 0;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}
.org-col-header.open .org-col-dropdown {
    display: block;
}
.org-col-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    font-weight: 400;
    color: var(--text-primary);
    text-decoration: none;
    text-transform: none;
    letter-spacing: 0;
    white-space: nowrap;
    transition: background var(--transition-fast);
}
.org-col-dropdown-item:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
    text-decoration: none;
}
.org-col-dropdown-item svg {
    flex-shrink: 0;
    color: var(--text-muted);
}
.org-col-dropdown-item--danger {
    color: var(--danger);
}
.org-col-dropdown-item--danger svg {
    color: var(--danger);
    opacity: 0.7;
}
.org-col-dropdown-item--danger:hover {
    background: var(--danger-light);
    color: var(--danger);
}
.org-col-dropdown-divider {
    height: 1px;
    background: var(--border-light);
    margin: 0.375rem 0;
}
.org-col-filter {
    padding: 0.25rem 0.75rem 0.5rem;
}
.org-col-filter-search {
    width: 100%;
    padding: 0.4375rem 0.625rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    color: var(--text-primary);
    margin-bottom: 0.375rem;
    outline: none;
    background: var(--surface);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.org-col-filter-search:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}
.org-col-filter-options {
    max-height: 200px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 0.5rem;
}
.org-col-filter-options:empty {
    display: none;
}
.org-col-filter-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.25rem;
    font-size: 0.8125rem;
    color: var(--text-primary);
    cursor: pointer;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    border-radius: var(--radius-xs);
    transition: background var(--transition-fast);
    margin: 0;
}
.org-col-filter-option:hover {
    background: var(--surface-hover);
}
.org-col-filter-option input[type="checkbox"] {
    accent-color: var(--primary);
    width: 16px;
    height: 16px;
    cursor: pointer;
    flex-shrink: 0;
}
.org-col-filter-apply {
    display: block;
    width: 100%;
    padding: 0.375rem 0.75rem;
    background: var(--primary);
    color: var(--text-inverse);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    text-transform: none;
    letter-spacing: 0;
    transition: background var(--transition-fast);
}
.org-col-filter-apply:hover {
    background: var(--primary-hover);
}
.org-col-filter-selected {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 0.25rem;
}
.org-col-filter-selected:empty {
    display: none;
}
.org-col-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.375rem;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
}
.org-col-filter-tag-remove {
    border: none;
    background: none;
    color: var(--primary);
    cursor: pointer;
    padding: 0;
    font-size: 0.875rem;
    line-height: 1;
    opacity: 0.6;
}
.org-col-filter-tag-remove:hover {
    opacity: 1;
}
.org-col-filter-empty {
    padding: 0.5rem 0;
    font-size: 0.8125rem;
    color: var(--text-muted);
    text-align: center;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
}
.org-col-filter-text-apply {
    padding: 0.25rem 0;
}

.org-th-pinned {
    position: sticky;
    left: 0;
    z-index: 2;
    background: var(--surface-alt);
}

.org-th-sorted {
    color: var(--rn-teal) !important;
}

.org-sort-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: inherit;
    text-decoration: none;
}

.org-sort-link:hover {
    color: var(--rn-teal);
}

.org-sort-icon {
    flex-shrink: 0;
}

.table-employee tbody tr {
    border-bottom: 1px solid var(--border-light);
    transition: background 0.1s;
}

.table-employee tbody tr:hover {
    background: var(--surface-hover);
}

.table-employee tbody tr:last-child {
    border-bottom: none;
}

.table-employee tbody td {
    padding: 0.5rem 0.75rem;
    vertical-align: middle;
    color: var(--text-primary);
    border: none;
}

.org-td-name {
    position: sticky;
    left: 0;
    z-index: 1;
    background: var(--surface);
    min-width: 200px;
}

.table-employee tbody tr:hover .org-td-name {
    background: var(--surface-hover);
}

.org-td-check,
.org-th-check {
    width: 40px;
    text-align: center;
}

/* --- Name Cell --- */
.org-name-cell {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.org-avatar-sm {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.625rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.02em;
}

.org-name-link {
    font-weight: 500;
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.15s;
}

.org-name-link:hover {
    color: var(--rn-teal);
}

/* --- Status Badge --- */
.org-status-badge {
    display: inline-block;
    padding: 0.1875rem 0.625rem;
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: 1rem;
    white-space: nowrap;
    text-transform: capitalize;
    letter-spacing: 0.01em;
}

.badge-status-active {
    color: #065F46;
    background: #ECFDF5;
}

.badge-status-leave {
    color: #92400E;
    background: #FFFBEB;
}

.badge-status-suspended {
    color: #9A3412;
    background: #FFF7ED;
}

.badge-status-terminated {
    color: #991B1B;
    background: #FEF2F2;
}

.badge-status-probation {
    color: #1E40AF;
    background: #EFF6FF;
}

.badge-status-default {
    color: var(--text-secondary);
    background: var(--surface-alt);
}

/* --- Truncate --- */
.org-truncate {
    display: inline-block;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}

/* --- Checkbox --- */
.org-checkbox {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin: 0;
    padding: 0;
}

.org-checkbox input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.org-checkbox-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.125rem;
    height: 1.125rem;
    border: 2px solid var(--border-color);
    border-radius: 0.25rem;
    transition: all 0.15s;
    background: var(--surface);
}

.org-checkbox input:checked + .org-checkbox-mark {
    background: var(--rn-teal);
    border-color: var(--rn-teal);
}

.org-checkbox input:checked + .org-checkbox-mark::after {
    content: '';
    display: block;
    width: 0.3125rem;
    height: 0.5625rem;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-top: -1px;
}

/* --- Pagination --- */
.org-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border-light);
}

.org-pagination-info {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* --- Empty State --- */
.org-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 0;
}

.org-empty-icon {
    color: var(--text-muted);
    opacity: 0.3;
}

/* --- Column Panel --- */
.org-column-panel {
    position: fixed;
    top: 0;
    right: -380px;
    width: 360px;
    height: 100vh;
    background: var(--surface);
    border-left: 1px solid var(--border-color);
    box-shadow: -10px 0 40px rgba(0,0,0,0.1);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.org-column-panel.show {
    right: 0;
}
.org-panel-overlay,
.org-filter-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.3);
    z-index: 1040;
    cursor: pointer;
}
.org-panel-overlay.show,
.org-filter-overlay.show {
    display: block;
}

.org-column-panel-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.org-column-panel-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    flex: 1;
}

.org-column-count {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--rn-teal);
    background: var(--rn-teal-50);
    padding: 0.1875rem 0.5rem;
    border-radius: 1rem;
}

.org-column-panel-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    font-size: 1.25rem;
    color: var(--text-muted);
    background: none;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background 0.15s;
}

.org-column-panel-close:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.org-column-panel-search {
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
}

.org-column-search-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    outline: none;
    transition: border-color 0.2s;
}

.org-column-search-input:focus {
    border-color: var(--rn-teal);
}

.org-column-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 0;
}

.org-column-section {
    padding: 0 0 0.5rem;
}

.org-column-section-title {
    padding: 0.375rem 1.5rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.org-column-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.5rem 1.5rem;
}

.org-column-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 1.5rem;
    transition: background 0.1s;
}

.org-column-item:hover {
    background: var(--surface-hover);
}

.org-column-item--pinned {
    opacity: 0.7;
}

.org-column-item--hidden .org-column-label {
    color: var(--text-muted);
}

.org-column-drag {
    display: flex;
    align-items: center;
    color: var(--text-muted);
    cursor: grab;
    flex-shrink: 0;
}

.org-column-label {
    flex: 1;
    font-size: 0.8125rem;
    color: var(--text-primary);
}

/* --- Toggle Switch --- */
.org-toggle {
    position: relative;
    display: inline-block;
    width: 2.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

.org-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.org-toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--border-color);
    border-radius: 0.625rem;
    transition: background 0.2s;
}

.org-toggle-slider::before {
    content: '';
    position: absolute;
    width: 0.875rem;
    height: 0.875rem;
    left: 0.1875rem;
    bottom: 0.1875rem;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.org-toggle input:checked + .org-toggle-slider {
    background: var(--rn-teal);
}

.org-toggle input:checked + .org-toggle-slider::before {
    transform: translateX(1rem);
}

.org-toggle--disabled .org-toggle-slider {
    cursor: not-allowed;
    opacity: 0.5;
}

/* --- Panel Overlay --- */
.org-panel-overlay,
.org-filter-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    z-index: 1040;
    transition: opacity 0.2s;
}

.org-panel-overlay.show,
.org-filter-overlay.show {
    display: block;
}

/* --- Filter Panel --- */
.org-filter-panel {
    position: fixed;
    top: 0;
    right: -380px;
    width: 360px;
    height: 100vh;
    background: var(--surface);
    border-left: 1px solid var(--border-color);
    box-shadow: -10px 0 40px rgba(0,0,0,0.1);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
}

.org-filter-panel.show {
    right: 0;
}

.org-filter-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.org-filter-panel-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.org-filter-panel-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    font-size: 1.25rem;
    color: var(--text-muted);
    background: none;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background 0.15s;
}

.org-filter-panel-close:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.org-filter-form {
    padding: 1rem 1.5rem;
    flex: 1;
}

.org-filter-group {
    margin-bottom: 1rem;
}

.org-filter-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.375rem;
}

.org-filter-select {
    width: 100%;
    padding: 0.4375rem 0.75rem;
    font-size: 0.8125rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    background: var(--surface);
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s;
}

.org-filter-select:focus {
    border-color: var(--rn-teal);
}

.org-filter-actions {
    display: flex;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
    margin-top: 0.5rem;
}

.org-filter-actions .btn {
    flex: 1;
}

/* --- Save View Modal --- */
.org-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1060;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.4);
}

.org-modal.show {
    display: flex;
}

.org-modal-dialog {
    background: var(--surface);
    border-radius: 0.75rem;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    animation: scale-in 0.2s ease;
}

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

.org-modal-header h4 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.org-modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    font-size: 1.25rem;
    color: var(--text-muted);
    background: none;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
}

.org-modal-close:hover {
    background: var(--surface-hover);
}

.org-modal-body {
    padding: 1.5rem;
}

.org-modal-info {
    margin-top: 1rem;
    padding: 0.75rem;
    background: var(--surface-alt);
    border-radius: 0.5rem;
}

.org-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* --- Org Chart --- */
.org-chart-wrapper {
    position: relative;
    background: var(--surface-alt);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    overflow: hidden;
    min-height: 600px;
}

.orgchart-container {
    width: 100%;
    height: 600px;
    overflow: auto;
    position: relative;
    cursor: grab;
}

.orgchart-container:active {
    cursor: grabbing;
}

.orgchart-canvas {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    min-width: 100%;
    min-height: 100%;
    padding: 3rem 2rem;
    transform-origin: top center;
    transition: transform 0.2s;
}

.orgchart-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem;
    color: var(--text-muted);
}

.orgchart-spinner {
    width: 2rem;
    height: 2rem;
    border: 3px solid var(--border-color);
    border-top-color: var(--rn-teal);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 0.75rem;
}

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

/* --- Org Chart Controls --- */
.orgchart-controls {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    z-index: 10;
}

.orgchart-ctrl-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.orgchart-ctrl-btn:hover {
    color: var(--rn-teal);
    border-color: var(--rn-teal-200);
    background: var(--rn-teal-50);
}

/* --- Org Chart Tree --- */
.orgchart-tree {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.orgchart-node-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.orgchart-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.125rem;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    cursor: pointer;
    transition: all 0.2s;
    min-width: 220px;
    max-width: 280px;
    position: relative;
    border-left: 3px solid var(--rn-teal);
}

.orgchart-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    border-color: var(--rn-teal-200);
    transform: translateY(-1px);
}

.orgchart-card--spotlight {
    border-left-color: var(--rn-brand-red);
    box-shadow: 0 0 0 3px rgba(240, 0, 72, 0.15), 0 4px 16px rgba(0,0,0,0.1);
}

.orgchart-card-avatar {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.02em;
}

.orgchart-card-info {
    flex: 1;
    min-width: 0;
}

.orgchart-card-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.orgchart-card-role {
    font-size: 0.6875rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 0.125rem;
}

.orgchart-card-dept {
    font-size: 0.625rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.orgchart-card-count {
    font-size: 0.625rem;
    font-weight: 600;
    color: var(--rn-teal);
    background: var(--rn-teal-50);
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    white-space: nowrap;
    margin-top: 0.25rem;
    display: inline-block;
}

/* --- Org Chart Connectors --- */
.orgchart-children {
    display: flex;
    justify-content: center;
    gap: 0;
    position: relative;
    padding-top: 1.5rem;
}

.orgchart-children::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 2px;
    height: 1.5rem;
    background: var(--border-color);
    transform: translateX(-50%);
}

.orgchart-children > .orgchart-node-group {
    position: relative;
    padding: 0 0.75rem;
}

.orgchart-children > .orgchart-node-group::before {
    content: '';
    position: absolute;
    top: -1.5rem;
    left: 50%;
    width: 2px;
    height: 1.5rem;
    background: var(--border-color);
    transform: translateX(-50%);
}

.orgchart-connector-h {
    position: absolute;
    top: 0;
    height: 2px;
    background: var(--border-color);
}

.orgchart-expand-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: var(--surface);
    border: 2px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.875rem;
    cursor: pointer;
    margin: 0.5rem auto 0;
    transition: all 0.15s;
    position: relative;
    z-index: 5;
}

.orgchart-expand-btn:hover {
    border-color: var(--rn-teal);
    color: var(--rn-teal);
    background: var(--rn-teal-50);
}

/* --- Mobile Responsive --- */
@media (max-width: 991px) {
    .org-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .org-toolbar-left,
    .org-toolbar-right {
        width: 100%;
        justify-content: flex-start;
    }
    .org-search {
        min-width: 100%;
    }
    .org-column-panel,
    .org-filter-panel {
        width: 100%;
        right: -100%;
    }
    .orgchart-container {
        height: 400px;
    }
}

@media (max-width: 575px) {
    .org-tabs {
        gap: 0;
    }
    .org-tab {
        padding: 0.625rem 0.875rem;
        font-size: 0.8125rem;
    }
    .org-toolbar-btn {
        padding: 0.375rem 0.625rem;
        font-size: 0.75rem;
    }
    .org-employee-count {
        display: none;
    }
    .orgchart-card {
        min-width: 180px;
        padding: 0.625rem 0.875rem;
    }
}


/* ----------------------------------------------------------- */
/*  EMPLOYEE PROFILE (Personio-style)                          */
/* ----------------------------------------------------------- */
.ep-container {
    padding: 0;
    margin: -1.25rem -1.5rem 0;
    width: calc(100% + 3rem);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* --- Header --- */
.ep-header {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    padding: 1.5rem 2rem 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border-color);
}
.ep-header-avatar {
    position: relative;
    flex-shrink: 0;
}
.ep-profile-avatar {
    width: 100px;
    height: 100px;
    font-size: 2rem;
    border: 3px solid var(--border-color);
}
.ep-avatar-edit {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 28px;
    height: 28px;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 0.75rem;
    transition: all var(--transition-fast);
    text-decoration: none;
}
.ep-avatar-edit:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.ep-header-info {
    flex: 1;
    min-width: 0;
    padding-bottom: 0;
}
.ep-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.ep-name {
    font-size: 1.625rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.2;
}
.ep-header-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}
.ep-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}
.ep-icon-btn:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
    border-color: var(--text-muted);
}
.ep-icon-btn-sm {
    width: 28px;
    height: 28px;
    font-size: 0.75rem;
}

.ep-header-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.375rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}
.ep-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.625rem;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.5;
}
.ep-badge-success { background: var(--success-light); color: var(--success); }
.ep-badge-warning { background: var(--warning-light); color: var(--warning); }
.ep-badge-danger  { background: var(--danger-light); color: var(--danger); }
.ep-badge-info    { background: var(--info-light); color: var(--info); }
.ep-badge-secondary { background: var(--secondary-light); color: var(--secondary); }

.ep-meta-sep::before {
    content: "\00B7";
    margin-right: 0.5rem;
}
.ep-link {
    color: var(--link-color);
    text-decoration: none;
}
.ep-link:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

.ep-header-details {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin-top: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}
.ep-detail-item {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}
.ep-detail-item i {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* --- Tabs --- */
.ep-tabs {
    display: flex;
    gap: 0;
    background: var(--surface);
    padding: 0 2rem;
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
}
.ep-tab {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    transition: all var(--transition-fast);
}
.ep-tab:hover {
    color: var(--text-primary);
    background: var(--surface-hover);
}
.ep-tab-active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}
.ep-tab-active:hover {
    color: var(--primary);
}

/* --- Content --- */
.ep-content {
    padding: 1.5rem 2rem 2rem;
}

/* --- Two Column Layout --- */
.ep-two-col {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 1.5rem;
    align-items: start;
}

/* --- Cards --- */
.ep-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    margin-bottom: 1rem;
    overflow: hidden;
}
.ep-card:hover {
    box-shadow: var(--shadow-card-hover);
}
.ep-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-light);
}
.ep-card-header .avatar-group {
    margin-left: auto;
}
.ep-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}
.ep-card-body {
    padding: 1rem 1.25rem;
}
.ep-card-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8125rem;
    color: var(--link-color);
    text-decoration: none;
    font-weight: 500;
}
.ep-card-link:hover {
    color: var(--link-hover);
    text-decoration: underline;
}
.ep-card-link i {
    font-size: 0.625rem;
}

/* --- Department Card --- */
.ep-dept-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.25rem;
}
.ep-dept-parent {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin: 0 0 0.75rem;
}

/* --- Leadership Chain --- */
.ep-leadership-chain {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.ep-leader-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    background: var(--surface-alt);
    margin-bottom: 2px;
}
.ep-leader-indent {
    margin-left: 1.5rem;
}
.ep-leader-indent2 {
    margin-left: 3rem;
}
.ep-leader-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.ep-leader-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    text-decoration: none;
}
a.ep-leader-name:hover {
    color: var(--link-color);
    text-decoration: underline;
}
.ep-leader-current {
    font-weight: 600;
}
.ep-leader-title {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* --- Direct Reports --- */
.ep-reports-toggle {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    cursor: pointer;
}
.ep-toggle-icon {
    font-size: 0.75rem;
    color: var(--text-secondary);
    transition: transform var(--transition-fast);
}
.ep-reports-toggle[aria-expanded="false"] .ep-toggle-icon {
    transform: rotate(-90deg);
}
.ep-reports-count {
    margin-left: auto;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-weight: 500;
}
.ep-reports-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.25rem;
}
.ep-report-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.5rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-primary);
    transition: background var(--transition-fast);
    min-width: 0;
}
.ep-report-item:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}
.ep-report-text {
    display: flex;
    align-items: baseline;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 0.8125rem;
}
.ep-report-name {
    font-weight: 500;
}
.ep-report-sep {
    margin: 0 0.25rem;
    color: var(--text-muted);
}
.ep-report-title {
    color: var(--text-secondary);
}
.ep-reports-more {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.5rem;
}
.ep-more-text {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

/* --- Local Time Card --- */
.ep-time-card {
    text-align: center;
}
.ep-time-display {
    padding: 1.5rem 1.25rem 1rem;
    background: linear-gradient(135deg, var(--rn-teal-50), var(--surface));
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.ep-time-value {
    display: block;
    font-size: 3rem;
    font-weight: 300;
    color: var(--text-primary);
    line-height: 1;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}
.ep-time-label {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.125rem 0.75rem;
    background: var(--rn-teal-100);
    color: var(--rn-teal-600);
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 500;
}
.ep-time-actions {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    padding: 1rem 1.25rem;
}
.ep-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.75rem;
    border: none;
    background: none;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}
.ep-action-btn:hover {
    color: var(--primary);
    background: var(--primary-light);
}
.ep-action-btn i {
    font-size: 1.125rem;
}

/* --- Performance Card --- */
.ep-perf-actions {
    display: flex;
    gap: 0.5rem;
}

/* --- Office Card --- */
.ep-office-map {
    height: 140px;
    background: var(--surface-alt);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--rn-teal-50) 0%, var(--rn-light-blue) 50%, var(--surface-alt) 100%);
    opacity: 0.9;
}
.ep-map-placeholder-icon {
    font-size: 2.5rem;
    color: var(--rn-teal);
    opacity: 0.5;
}
.ep-office-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.25rem;
}
.ep-office-address {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin: 0 0 0.75rem;
    line-height: 1.4;
}
.ep-office-actions {
    display: flex;
    gap: 0.5rem;
}
.ep-office-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--surface);
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.ep-office-btn:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
    border-color: var(--text-muted);
}

/* --- Personal Information Layout --- */
.ep-personal-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 1.5rem;
    align-items: start;
}
.ep-personal-sidebar {
    position: sticky;
    top: calc(var(--header-height) + 1rem);
}
.ep-section-nav {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}
.ep-section-link {
    display: block;
    padding: 0.625rem 1rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: all var(--transition-fast);
}
.ep-section-link:hover {
    color: var(--text-primary);
    background: var(--surface-hover);
}
.ep-section-link-active {
    color: var(--primary);
    border-left-color: var(--primary);
    background: var(--primary-light);
    font-weight: 500;
}

.ep-personal-content {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* --- Data Sections --- */
.ep-data-section {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    margin-bottom: 1rem;
    overflow: hidden;
}
.ep-section-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-light);
}
.ep-data-table {
    width: 100%;
    border-collapse: collapse;
}
.ep-data-table tr {
    border-bottom: 1px solid var(--border-light);
}
.ep-data-table tr:last-child {
    border-bottom: none;
}
.ep-data-table td,
.ep-data-table th {
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    vertical-align: top;
}
.ep-data-label {
    width: 200px;
    color: var(--text-secondary);
    font-weight: 400;
}
.ep-data-value {
    color: var(--text-primary);
}

/* --- Responsive --- */
@media (max-width: 991px) {
    .ep-two-col {
        grid-template-columns: 1fr;
    }
    .ep-personal-layout {
        grid-template-columns: 1fr;
    }
    .ep-personal-sidebar {
        position: static;
    }
    .ep-section-nav {
        flex-direction: row;
        overflow-x: auto;
    }
    .ep-section-link {
        white-space: nowrap;
        border-left: none;
        border-bottom: 3px solid transparent;
    }
    .ep-section-link-active {
        border-left-color: transparent;
        border-bottom-color: var(--primary);
    }
}
@media (max-width: 768px) {
    .ep-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 1.25rem 1rem 0;
    }
    .ep-header-meta,
    .ep-header-details {
        justify-content: center;
    }
    .ep-tabs {
        padding: 0 1rem;
    }
    .ep-content {
        padding: 1rem;
    }
    .ep-profile-avatar {
        width: 80px;
        height: 80px;
        font-size: 1.5rem;
    }
    .ep-reports-grid {
        grid-template-columns: 1fr;
    }
}
