/*
 * ============================================================
 *  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: var(--z-sidebar);
    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);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left var(--transition-sidebar);
}

.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.5rem;
    max-width: 100%;
}

/* Sidebar collapsed */
.sidebar-collapsed .app-sidebar {
    width: var(--sidebar-collapsed);
}
.sidebar-collapsed .app-main {
    margin-left: 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: flex;
    align-items: center;
    height: var(--header-height);
    padding: 0 1.25rem;
    border-bottom: 1px solid var(--sidebar-divider);
    flex-shrink: 0;
    gap: 0.75rem;
}

.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 {
    display: block;
    width: 100%;
    padding: 0.5625rem 0.875rem;
    font-family: inherit;
    font-size: 0.875rem;
    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 var(--transition-fast), box-shadow var(--transition-fast);
    -webkit-appearance: none;
}
.form-control::placeholder {
    color: var(--text-muted);
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}
.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;
}

/* 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;
}
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);
}
.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: 1400px;
    }
}


/* ----------------------------------------------------------- */
/*  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;
    }
}
