/* ============================================================
   CHOIR MANAGEMENT SYSTEM — Design System
   Premium SaaS-Quality Stylesheet
   ============================================================ */

/* -------------------------------------------------------
   Google Fonts
   ------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Outfit:wght@500;600;700&display=swap');

/* -------------------------------------------------------
   1. CSS Custom Properties
   ------------------------------------------------------- */
:root {
    /* Brand Colors - Rich Indigo / Violet Palette */
    --primary: #4f46e5;
    --primary-light: #6366f1;
    --primary-dark: #3730a3;
    --primary-50: #eef2ff;
    --primary-100: #e0e7ff;
    --primary-200: #c7d2fe;
    --secondary: #8b5cf6;
    --secondary-light: #a78bfa;
    --secondary-dark: #6d28d9;

    /* Semantic Colors */
    --success: #10b981;
    --success-light: #d1fae5;
    --success-dark: #047857;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --warning-dark: #b45309;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --danger-dark: #b91c1c;
    --info: #0ea5e9;
    --info-light: #e0f2fe;
    --info-dark: #0369a1;

    /* Sidebar Gradient - Deeper and more vibrant */
    --sidebar-bg: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #312e81 100%);
    --sidebar-width: 270px;
    --sidebar-collapsed-width: 80px;
    --header-height: 72px;

    /* Backgrounds - Soft and clean */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --bg-glass: rgba(255, 255, 255, 0.75);

    /* Text */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-white: #ffffff;

    /* Borders */
    --border-color: #e2e8f0;
    --border-radius: 16px;
    --border-radius-sm: 10px;
    --border-radius-lg: 24px;
    --border-radius-full: 9999px;

    /* Soft, multi-layered Shadows */
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.05), 0 2px 4px -2px rgba(15, 23, 42, 0.025);
    --shadow-md: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.05);
    --shadow-xl: 0 25px 50px -12px rgba(15, 23, 42, 0.15);
    --shadow-glow: 0 0 15px rgba(79, 70, 229, 0.3);

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-heading: 'Outfit', var(--font-family);

    /* Spacing System */
    --space-xs: 6px;
    --space-sm: 12px;
    --space-md: 20px;
    --space-lg: 32px;
    --space-xl: 48px;
    --space-2xl: 64px;

    /* Transitions */
    --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-fast: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-bounce: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Global Keyframes */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulseGlow {
    0% { box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(79, 70, 229, 0); }
    100% { box-shadow: 0 0 0 0 rgba(79, 70, 229, 0); }
}

/* -------------------------------------------------------
   2. Global Reset & Base
   ------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-family);
    font-size: 16px;
    line-height: 1.75;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    background-image: radial-gradient(circle at top right, rgba(79, 70, 229, 0.04) 0%, transparent 40%),
                      radial-gradient(circle at bottom left, rgba(139, 92, 246, 0.04) 0%, transparent 40%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

::selection {
    background-color: var(--primary-100);
    color: var(--primary-dark);
}

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

a:hover {
    color: var(--primary-dark);
}

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

ul, ol {
    list-style: none;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
}

h1 { font-size: 1.8rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.9rem; }

p {
    margin-bottom: var(--space-md);
}

hr {
    border: none;
    height: 1px;
    background: var(--border-color);
    margin: var(--space-lg) 0;
}

/* -------------------------------------------------------
   3. Layout System
   ------------------------------------------------------- */

/* App Wrapper */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--text-white);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    transition: var(--transition);
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar.collapsed .sidebar-logo span,
.sidebar.collapsed .sidebar-nav-section,
.sidebar.collapsed .sidebar-nav-link span,
.sidebar.collapsed .nav-badge,
.sidebar.collapsed .sidebar-footer-info {
    display: none !important;
}

.sidebar.collapsed .sidebar-header {
    justify-content: center;
    padding: 20px 10px;
}

.sidebar.collapsed .sidebar-nav-link {
    justify-content: center;
    padding: 12px;
}

.sidebar.collapsed .sidebar-nav-link i {
    margin: 0;
    font-size: 1.2rem;
}

.sidebar.collapsed .sidebar-nav-item {
    margin: 2px 8px;
}

/* Sidebar Header */
.sidebar-header {
    padding: 22px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.sidebar-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px;
    display: none;
}

@media (max-width: 991px) {
    .sidebar-close {
        display: block;
    }
}

.sidebar-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-white);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-white);
}

.sidebar-logo .logo-icon {
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
    backdrop-filter: blur(10px);
}

.sidebar-logo span {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    white-space: nowrap;
}

/* Sidebar Navigation */
.sidebar-nav {
    padding: 15px 0;
    flex: 1;
}

.sidebar-nav-section {
    padding: 12px 20px 6px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.35);
    font-weight: 600;
    margin-top: 8px;
    white-space: nowrap;
}

.sidebar-nav-item {
    margin: 2px 10px;
}

.sidebar-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 15px;
    color: rgba(255, 255, 255, 0.65);
    text-decoration: none;
    border-radius: 10px;
    transition: var(--transition);
    font-size: 0.9rem;
    font-weight: 400;
    overflow: hidden;
    position: relative;
}

.sidebar-nav-link span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.sidebar-nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-white);
    transform: translateX(3px);
}

.sidebar-nav-link.active {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-white);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.sidebar-nav-link.active::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background: var(--text-white);
    border-radius: 0 4px 4px 0;
}

.sidebar-nav-link i {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.sidebar-nav-link .nav-badge {
    margin-left: auto;
    background: var(--danger);
    color: var(--text-white);
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    line-height: 1.4;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 15px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.sidebar-footer-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
}

.sidebar-footer-user:hover {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-footer-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--border-radius-full);
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.sidebar-footer-info {
    overflow: hidden;
}

.sidebar-footer-name {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-footer-role {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    width: calc(100vw - var(--sidebar-width));
    max-width: calc(100vw - var(--sidebar-width));
    min-width: 0;
    flex: none;
    min-height: 100vh;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.sidebar.collapsed ~ .main-content,
.main-content.expanded {
    margin-left: var(--sidebar-collapsed-width);
    width: calc(100vw - var(--sidebar-collapsed-width));
    max-width: calc(100vw - var(--sidebar-collapsed-width));
}

/* Top Header */
.top-header {
    height: var(--header-height);
    background: var(--bg-glass);
    border-bottom: 1px solid rgba(255, 255, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-toggle:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Header Search */
.header-search {
    position: relative;
}

.header-search i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
}

.header-search input {
    padding: 9px 16px 9px 40px;
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-tertiary);
    font-size: 0.88rem;
    color: var(--text-primary);
    width: 300px;
    transition: var(--transition);
    font-family: var(--font-family);
}

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

.header-search input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-secondary);
    box-shadow: 0 0 0 3px var(--primary-50);
    width: 350px;
}

/* Header Right */
.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-icon-btn {
    position: relative;
    background: none;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
    font-size: 1.15rem;
}

.header-icon-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.header-icon-btn .badge-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 9px;
    height: 9px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid var(--bg-secondary);
}

.header-notification {
    position: relative;
}

.header-notification .notification-count {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    background: var(--danger);
    color: var(--text-white);
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid var(--bg-secondary);
}

/* Header User */
.header-user-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 10px;
    transition: var(--transition-fast);
    margin-left: 8px;
    background: transparent;
    border: none;
    font-family: inherit;
    text-align: left;
}

.header-user-btn:hover {
    background: var(--bg-tertiary);
}

.header-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--border-radius-full);
    object-fit: cover;
    border: 2px solid var(--primary-100);
}

.header-user-info {
    line-height: 1.3;
}

.header-user-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
}

.header-user-role {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Content Area */
.content-area {
    padding: var(--space-lg) var(--space-xl);
    flex: 1;
}

/* -------------------------------------------------------
   4. Page Headers
   ------------------------------------------------------- */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.page-header-left {
    flex: 1;
    min-width: 0;
}

.page-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.page-title {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.3;
}

.page-title i {
    color: var(--primary);
    font-size: 1.3rem;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 2px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

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

.breadcrumb a:hover {
    text-decoration: underline;
}

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

/* -------------------------------------------------------
   5. Cards
   ------------------------------------------------------- */
.card {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: var(--transition-bounce);
    margin-bottom: var(--space-lg);
    position: relative;
    z-index: 1;
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
    border-color: rgba(79, 70, 229, 0.2);
}

.card-header {
    padding: var(--space-lg) var(--space-xl);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-secondary);
}

.card-title {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title i {
    color: var(--primary);
}

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

.card-body {
    padding: var(--space-xl);
}

.card-body:empty {
    padding: 0;
}

.card-footer {
    padding: var(--space-md) var(--space-xl);
    border-top: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

/* -------------------------------------------------------
   6. Stat Cards
   ------------------------------------------------------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.stat-card {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: var(--space-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: var(--transition-bounce);
    position: relative;
    overflow: hidden;
    cursor: default;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    border-radius: 0 4px 4px 0;
}

.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:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(79, 70, 229, 0.2);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
    box-shadow: inset 0 2px 4px rgba(255,255,255,0.3);
    transition: var(--transition-bounce);
}

.stat-card:hover .stat-icon {
    transform: scale(1.1) rotate(5deg);
}

.stat-primary .stat-icon { background: var(--primary-50); color: var(--primary); }
.stat-success .stat-icon { background: var(--success-light); color: var(--success); }
.stat-warning .stat-icon { background: var(--warning-light); color: var(--warning); }
.stat-danger .stat-icon  { background: var(--danger-light); color: var(--danger); }
.stat-info .stat-icon    { background: var(--info-light); color: var(--info); }

.stat-details {
    flex: 1;
    min-width: 0;
}

.stat-number {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.stat-change {
    font-size: 0.78rem;
    font-weight: 600;
    margin-top: 4px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* -------------------------------------------------------
   7. Buttons
   ------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition-bounce);
    text-decoration: none;
    justify-content: center;
    font-family: var(--font-family);
    line-height: 1.4;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 150%;
    height: 150%;
    background: rgba(255, 255, 255, 0.1);
    transform: translate(-50%, -50%) scale(0);
    border-radius: 50%;
    transition: transform 0.4s ease-out;
}

.btn:active::after {
    transform: translate(-50%, -50%) scale(1);
    transition: 0s;
}

.btn:active {
    transform: scale(0.96);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--text-white);
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
    border: 1px solid rgba(255,255,255,0.1);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-light), var(--secondary-light));
    color: var(--text-white);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(79, 70, 229, 0.4);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: #e2e8f0;
    color: var(--text-primary);
}

.btn-success {
    background: var(--success);
    color: var(--text-white);
    box-shadow: 0 1px 2px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    background: #059669;
    color: var(--text-white);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

.btn-danger {
    background: var(--danger);
    color: var(--text-white);
    box-shadow: 0 1px 2px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: #dc2626;
    color: var(--text-white);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
}

.btn-warning {
    background: var(--warning);
    color: var(--text-white);
    box-shadow: 0 1px 2px rgba(245, 158, 11, 0.3);
}

.btn-warning:hover {
    background: #d97706;
    color: var(--text-white);
    transform: translateY(-1px);
}

.btn-info {
    background: var(--info);
    color: var(--text-white);
    box-shadow: 0 1px 2px rgba(6, 182, 212, 0.3);
}

.btn-info:hover {
    background: #0891b2;
    color: var(--text-white);
    transform: translateY(-1px);
}

.btn-light {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-light:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-dark {
    background: var(--text-primary);
    color: var(--text-white);
}

.btn-dark:hover {
    background: #0f172a;
    color: var(--text-white);
}

.btn-outline-primary {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline-primary:hover {
    background: var(--primary);
    color: var(--text-white);
}

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

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

.btn-outline-danger {
    background: transparent;
    border: 2px solid var(--danger);
    color: var(--danger);
}

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

.btn-sm {
    padding: 8px 20px;
    font-size: 0.85rem;
    border-radius: 30px;
}

.btn-lg {
    padding: 18px 36px;
    font-size: 1.05rem;
}

.btn-block {
    width: 100%;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 10px;
    justify-content: center;
}

.btn-icon.btn-sm {
    width: 30px;
    height: 30px;
    border-radius: 8px;
}

.btn:disabled,
.btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn-group {
    display: inline-flex;
    gap: 0;
}

.btn-group .btn {
    border-radius: 0;
}

.btn-group .btn:first-child {
    border-radius: var(--border-radius-sm) 0 0 var(--border-radius-sm);
}

.btn-group .btn:last-child {
    border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
}

/* -------------------------------------------------------
   8. Forms
   ------------------------------------------------------- */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-label {
    display: block;
    margin-bottom: var(--space-sm);
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.form-label .required {
    color: var(--danger);
    margin-left: 2px;
}

.form-control {
    width: 100%;
    padding: 10px 15px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 0.95rem;
    transition: var(--transition);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: var(--font-family);
    line-height: 1.5;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 4px var(--primary-50), inset 0 2px 4px rgba(0,0,0,0.02);
    background: #ffffff;
}

.form-control:disabled,
.form-control[readonly] {
    background: var(--bg-tertiary);
    cursor: not-allowed;
    opacity: 0.7;
}

.form-control.is-invalid {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px var(--danger-light);
}

.form-control.is-valid {
    border-color: var(--success);
}

.form-select {
    width: 100%;
    padding: 10px 35px 10px 15px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 0.95rem;
    transition: var(--transition);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: var(--font-family);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    cursor: pointer;
}

.form-select:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-50);
}

textarea.form-control,
.form-textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.6;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    margin-bottom: 8px;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
}

.form-check label {
    font-size: 0.9rem;
    cursor: pointer;
    color: var(--text-primary);
}

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

.form-row.three-cols {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.form-row.four-cols {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.input-group {
    display: flex;
}

.input-group .form-control {
    border-radius: 0;
    flex: 1;
}

.input-group .form-control:first-child {
    border-radius: var(--border-radius-sm) 0 0 var(--border-radius-sm);
}

.input-group .form-control:last-child {
    border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
}

.input-group-text {
    padding: 10px 14px;
    background: var(--bg-tertiary);
    border: 1.5px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.input-group-text:first-child {
    border-right: none;
    border-radius: var(--border-radius-sm) 0 0 var(--border-radius-sm);
}

.input-group-text:last-child {
    border-left: none;
    border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
}

.input-group .input-group-text + .form-control {
    border-left: none;
}

.invalid-feedback {
    color: var(--danger);
    font-size: 0.8rem;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.form-text {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 4px;
}

/* File input */
.form-file-input {
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg-tertiary);
}

.form-file-input:hover {
    border-color: var(--primary);
    background: var(--primary-50);
}

.form-file-input i {
    font-size: 2rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.form-file-input p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* -------------------------------------------------------
   9. Tables
   ------------------------------------------------------- */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--border-radius-sm);
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
}

.table th {
    padding: 16px 24px;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    border-bottom: 2px solid var(--border-color);
    position: sticky;
    top: 0;
}

.table td {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
    vertical-align: middle;
    color: var(--text-primary);
}

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

.table-hover tbody tr {
    transition: var(--transition-fast);
}

.table-hover tbody tr:hover {
    background: var(--primary-50);
}

.table-striped tbody tr:nth-child(even) {
    background: var(--bg-tertiary);
}

.table-striped.table-hover tbody tr:hover {
    background: var(--primary-50);
}

.table td .member-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.table td .member-info .avatar {
    flex-shrink: 0;
}

/* -------------------------------------------------------
   10. Badges
   ------------------------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: var(--border-radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.4;
    gap: 4px;
    white-space: nowrap;
}

.badge-primary { background: var(--primary-100); color: var(--primary-dark); }
.badge-success { background: var(--success-light); color: var(--success-dark); }
.badge-warning { background: var(--warning-light); color: var(--warning-dark); }
.badge-danger  { background: var(--danger-light); color: var(--danger-dark); }
.badge-info    { background: var(--info-light); color: var(--info-dark); }
.badge-secondary { background: var(--bg-tertiary); color: var(--text-secondary); }

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.badge-dot.dot-success { background: var(--success); }
.badge-dot.dot-danger { background: var(--danger); }
.badge-dot.dot-warning { background: var(--warning); }

/* -------------------------------------------------------
   11. Alerts
   ------------------------------------------------------- */
.alert {
    padding: 14px 20px;
    border-radius: var(--border-radius-sm);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    border-left: 4px solid;
    animation: slideDown 0.3s ease;
    position: relative;
}

.alert-success {
    background: var(--success-light);
    color: var(--success-dark);
    border-color: var(--success);
}

.alert-error {
    background: var(--danger-light);
    color: var(--danger-dark);
    border-color: var(--danger);
}

.alert-warning {
    background: var(--warning-light);
    color: var(--warning-dark);
    border-color: var(--warning);
}

.alert-info {
    background: var(--info-light);
    color: var(--info-dark);
    border-color: var(--info);
}

.alert i:first-child {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.alert-dismissible {
    padding-right: 45px;
}

.alert-dismissible .alert-close {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
    transition: var(--transition-fast);
    padding: 4px;
}

.alert-dismissible .alert-close:hover {
    opacity: 1;
}

/* -------------------------------------------------------
   12. Modals
   ------------------------------------------------------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.modal {
    background: var(--bg-secondary);
    border-radius: var(--border-radius-lg);
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.3s ease;
}

.modal-sm { max-width: 400px; }
.modal-lg { max-width: 800px; }
.modal-xl { max-width: 1000px; }

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

.modal-header h3 {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.15rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 4px;
    border-radius: 6px;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: var(--bg-tertiary);
}

/* -------------------------------------------------------
   13. Grid System
   ------------------------------------------------------- */
.grid {
    display: grid;
    gap: var(--space-xl);
}

.grid > * {
    min-width: 0;
}

.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.col-span-1 { grid-column: span 1; }
.col-span-2 { grid-column: span 2; }
.col-span-3 { grid-column: span 3; }
.col-span-4 { grid-column: span 4; }

@media (max-width: 991px) {
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
    .col-span-1, .col-span-2, .col-span-3, .col-span-4 {
        grid-column: span 1 !important;
    }
}

/* -------------------------------------------------------
   14. Flexbox Utilities
   ------------------------------------------------------- */
.d-flex { display: flex !important; }
.d-inline-flex { display: inline-flex !important; }
.d-none { display: none !important; }
.d-inline { display: inline !important; }
.d-block { display: block !important; }
.d-inline-block { display: inline-block !important; }

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

.align-items-start { align-items: flex-start !important; }
.align-items-center { align-items: center !important; }
.align-items-end { align-items: flex-end !important; }
.align-items-stretch { align-items: stretch !important; }

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

.gap-0 { gap: 0 !important; }
.gap-1 { gap: 5px !important; }
.gap-2 { gap: 10px !important; }
.gap-3 { gap: 15px !important; }
.gap-4 { gap: 20px !important; }
.gap-5 { gap: 30px !important; }

/* -------------------------------------------------------
   15. Spacing Utilities
   ------------------------------------------------------- */
.m-0 { margin: 0 !important; }
.m-1 { margin: 5px !important; }
.m-2 { margin: 10px !important; }
.m-3 { margin: 15px !important; }
.m-4 { margin: 20px !important; }
.m-5 { margin: 30px !important; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 5px !important; }
.mt-2 { margin-top: 10px !important; }
.mt-3 { margin-top: 15px !important; }
.mt-4 { margin-top: 20px !important; }
.mt-5 { margin-top: 30px !important; }

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 5px !important; }
.mb-2 { margin-bottom: 10px !important; }
.mb-3 { margin-bottom: 15px !important; }
.mb-4 { margin-bottom: 20px !important; }
.mb-5 { margin-bottom: 30px !important; }

.ml-0 { margin-left: 0 !important; }
.ml-1 { margin-left: 5px !important; }
.ml-2 { margin-left: 10px !important; }
.ml-3 { margin-left: 15px !important; }
.ml-4 { margin-left: 20px !important; }
.ml-auto { margin-left: auto !important; }

.mr-0 { margin-right: 0 !important; }
.mr-1 { margin-right: 5px !important; }
.mr-2 { margin-right: 10px !important; }
.mr-3 { margin-right: 15px !important; }
.mr-4 { margin-right: 20px !important; }
.mr-auto { margin-right: auto !important; }

.mx-auto { margin-left: auto !important; margin-right: auto !important; }

.p-0 { padding: 0 !important; }
.p-1 { padding: 5px !important; }
.p-2 { padding: 10px !important; }
.p-3 { padding: 15px !important; }
.p-4 { padding: 20px !important; }
.p-5 { padding: 30px !important; }

.pt-0 { padding-top: 0 !important; }
.pt-1 { padding-top: 5px !important; }
.pt-2 { padding-top: 10px !important; }
.pt-3 { padding-top: 15px !important; }
.pt-4 { padding-top: 20px !important; }
.pt-5 { padding-top: 30px !important; }

.pb-0 { padding-bottom: 0 !important; }
.pb-1 { padding-bottom: 5px !important; }
.pb-2 { padding-bottom: 10px !important; }
.pb-3 { padding-bottom: 15px !important; }
.pb-4 { padding-bottom: 20px !important; }
.pb-5 { padding-bottom: 30px !important; }

.pl-0 { padding-left: 0 !important; }
.pl-1 { padding-left: 5px !important; }
.pl-2 { padding-left: 10px !important; }
.pl-3 { padding-left: 15px !important; }
.pl-4 { padding-left: 20px !important; }

.pr-0 { padding-right: 0 !important; }
.pr-1 { padding-right: 5px !important; }
.pr-2 { padding-right: 10px !important; }
.pr-3 { padding-right: 15px !important; }
.pr-4 { padding-right: 20px !important; }

/* -------------------------------------------------------
   16. Text Utilities
   ------------------------------------------------------- */
.text-left { text-align: left !important; }
.text-center { text-align: center !important; }
.text-right { text-align: right !important; }

.text-primary { color: var(--primary) !important; }
.text-secondary-color { color: var(--secondary) !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-muted { color: var(--text-muted) !important; }
.text-dark { color: var(--text-primary) !important; }
.text-white { color: var(--text-white) !important; }

.font-weight-normal { font-weight: 400 !important; }
.font-weight-medium { font-weight: 500 !important; }
.font-weight-bold { font-weight: 600 !important; }
.font-weight-bolder { font-weight: 700 !important; }

.text-sm { font-size: 0.85rem !important; }
.text-md { font-size: 0.95rem !important; }
.text-lg { font-size: 1.1rem !important; }
.text-xl { font-size: 1.3rem !important; }

.text-uppercase { text-transform: uppercase !important; }
.text-lowercase { text-transform: lowercase !important; }
.text-capitalize { text-transform: capitalize !important; }
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.text-nowrap { white-space: nowrap !important; }
.text-wrap { white-space: normal !important; }

/* -------------------------------------------------------
   17. Avatar
   ------------------------------------------------------- */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius-full);
    object-fit: cover;
    flex-shrink: 0;
}

.avatar-sm { width: 32px; height: 32px; }
.avatar-md { width: 48px; height: 48px; }
.avatar-lg { width: 64px; height: 64px; }
.avatar-xl { width: 80px; height: 80px; }
.avatar-xxl { width: 100px; height: 100px; }

.avatar-initials {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-100);
    color: var(--primary);
    font-weight: 600;
    font-family: var(--font-heading);
    line-height: 1;
}

.avatar-initials.avatar-sm { font-size: 0.75rem; }
.avatar-initials.avatar-md { font-size: 1rem; }
.avatar-initials.avatar-lg { font-size: 1.3rem; }
.avatar-initials.avatar-xl { font-size: 1.6rem; }
.avatar-initials.avatar-xxl { font-size: 2rem; }

.avatar-group {
    display: flex;
}

.avatar-group .avatar {
    margin-left: -8px;
    border: 2px solid var(--bg-secondary);
}

.avatar-group .avatar:first-child {
    margin-left: 0;
}

/* -------------------------------------------------------
   18. Pagination
   ------------------------------------------------------- */
.pagination {
    display: flex;
    gap: 5px;
    justify-content: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

.page-item {
    list-style: none;
}

.page-link {
    padding: 8px 14px;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition-fast);
    font-size: 0.88rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
}

.page-link:hover {
    background: var(--primary-50);
    border-color: var(--primary);
    color: var(--primary);
}

.page-item.active .page-link {
    background: var(--primary);
    color: var(--text-white);
    border-color: var(--primary);
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.3);
}

.page-item.disabled .page-link {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* -------------------------------------------------------
   19. Tabs
   ------------------------------------------------------- */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    gap: 0;
    margin-bottom: 20px;
    overflow-x: auto;
}

.tab-item {
    padding: 12px 20px;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: var(--transition-fast);
    white-space: nowrap;
    font-size: 0.9rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.tab-item:hover {
    color: var(--primary);
    background: var(--primary-50);
}

.tab-item.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

.tab-content .tab-pane {
    display: none;
}

.tab-content .tab-pane.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* -------------------------------------------------------
   20. Search & Filters
   ------------------------------------------------------- */
.search-box {
    position: relative;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
    pointer-events: none;
}

.search-box input {
    padding: 9px 14px 9px 38px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 0.88rem;
    min-width: 250px;
    transition: var(--transition);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: var(--font-family);
}

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

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-50);
}

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

.filter-group .form-select {
    min-width: 150px;
    padding: 8px 36px 8px 12px;
    font-size: 0.85rem;
}

/* -------------------------------------------------------
   21. Action Buttons (in tables)
   ------------------------------------------------------- */
.action-buttons {
    display: flex;
    gap: 5px;
    align-items: center;
}

.action-buttons .btn {
    width: auto;
    height: auto;
    padding: 6px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    border-radius: 8px;
}

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

/* -------------------------------------------------------
   App Footer
   ------------------------------------------------------- */
.app-footer {
    padding: 20px 30px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: auto;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.footer-text, .footer-version {
    margin: 0;
}

/* -------------------------------------------------------
   22. Empty State
   ------------------------------------------------------- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state i {
    font-size: 4rem;
    color: var(--text-muted);
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-state h3 {
    font-family: var(--font-heading);
    margin-bottom: 8px;
    color: var(--text-primary);
    font-size: 1.2rem;
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    max-width: 400px;
    margin: 0 auto 20px;
}

/* -------------------------------------------------------
   23. Loading
   ------------------------------------------------------- */
.loading-spinner {
    border: 3px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

.loading-spinner-sm {
    width: 18px;
    height: 18px;
    border-width: 2px;
}

.loading-spinner-lg {
    width: 44px;
    height: 44px;
    border-width: 4px;
}

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

/* -------------------------------------------------------
   24. Dropdown
   ------------------------------------------------------- */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 5px);
    right: 0;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    min-width: 200px;
    z-index: 1000;
    display: none;
    animation: fadeIn 0.15s ease;
    overflow: hidden;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-menu.dropdown-left {
    right: auto;
    left: 0;
}

.dropdown-item {
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition-fast);
    font-size: 0.88rem;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: var(--font-family);
}

.dropdown-item:hover {
    background: var(--bg-tertiary);
    color: var(--primary);
}

.dropdown-item i {
    width: 18px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.dropdown-item:hover i {
    color: var(--primary);
}

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

.dropdown-item.text-danger:hover {
    background: var(--danger-light);
    color: var(--danger-dark);
}

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

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 5px 0;
}

.dropdown-header {
    padding: 8px 16px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dropdown-user-header {
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
    gap: 8px;
    border-radius: var(--border-radius-sm) var(--border-radius-sm) 0 0;
}
.dropdown-user-header strong {
    font-size: 1rem;
    color: var(--text-primary);
    display: block;
}
.dropdown-user-header .text-muted {
    text-transform: none;
    letter-spacing: normal;
    font-weight: normal;
}

.notification-empty {
    padding: 30px 20px;
    text-align: center;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.notification-empty i {
    font-size: 2rem;
    color: var(--border-color);
}
.dropdown-footer {
    padding: 12px;
    text-align: center;
    border-top: 1px solid var(--border-color);
}
.dropdown-footer a {
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
}
.dropdown-footer a:hover {
    text-decoration: underline;
}

/* -------------------------------------------------------
   25. Toast Notifications
   ------------------------------------------------------- */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    padding: 14px 20px;
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideInRight 0.3s ease;
    min-width: 320px;
    max-width: 450px;
    pointer-events: all;
    font-size: 0.9rem;
}

.toast-success {
    background: var(--success-dark);
    color: var(--text-white);
}

.toast-error {
    background: var(--danger-dark);
    color: var(--text-white);
}

.toast-warning {
    background: var(--warning-dark);
    color: var(--text-white);
}

.toast-info {
    background: var(--info-dark);
    color: var(--text-white);
}

.toast i:first-child {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    line-height: 1.4;
}

.toast-close {
    margin-left: auto;
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    opacity: 0.7;
    transition: var(--transition-fast);
    padding: 2px;
    font-size: 1rem;
    flex-shrink: 0;
}

.toast-close:hover {
    opacity: 1;
}

.toast.toast-exit {
    animation: slideOutRight 0.3s ease forwards;
}

/* -------------------------------------------------------
   26. Progress Bar
   ------------------------------------------------------- */
.progress {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius-full);
    overflow: hidden;
}

.progress-sm { height: 4px; }
.progress-lg { height: 12px; }

.progress-bar {
    height: 100%;
    border-radius: var(--border-radius-full);
    transition: width 0.6s ease;
    position: relative;
}

.progress-bar-primary { background: var(--primary); }
.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-bar-striped {
    background-image: linear-gradient(
        45deg,
        rgba(255,255,255,0.15) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255,255,255,0.15) 50%,
        rgba(255,255,255,0.15) 75%,
        transparent 75%
    );
    background-size: 1rem 1rem;
}

.progress-bar-animated {
    animation: progressStripe 1s linear infinite;
}

@keyframes progressStripe {
    from { background-position: 1rem 0; }
    to { background-position: 0 0; }
}

/* -------------------------------------------------------
   27. Divider
   ------------------------------------------------------- */
.divider {
    height: 1px;
    background: var(--border-color);
    margin: 20px 0;
}

.divider-text {
    display: flex;
    align-items: center;
    gap: 15px;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 20px 0;
}

.divider-text::before,
.divider-text::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

/* -------------------------------------------------------
   28. Member Card (grid view)
   ------------------------------------------------------- */
.member-card {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    padding: 24px;
    text-align: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.member-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.member-card .member-avatar {
    width: 80px;
    height: 80px;
    border-radius: var(--border-radius-full);
    margin: 0 auto 15px;
    object-fit: cover;
    border: 3px solid var(--primary-100);
}

.member-card .member-initials {
    width: 80px;
    height: 80px;
    border-radius: var(--border-radius-full);
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-50);
    color: var(--primary);
    font-size: 1.6rem;
    font-weight: 700;
    font-family: var(--font-heading);
}

.member-card .member-name {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.05rem;
    margin-bottom: 4px;
}

.member-card .member-name a {
    color: var(--text-primary);
    text-decoration: none;
}

.member-card .member-name a:hover {
    color: var(--primary);
}

.member-card .member-section {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.member-card .member-contact {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.member-card .member-actions {
    margin-top: 16px;
    display: flex;
    gap: 8px;
    justify-content: center;
}

.member-card .member-status {
    position: absolute;
    top: 12px;
    right: 12px;
}

/* -------------------------------------------------------
   29. Timeline
   ------------------------------------------------------- */
.timeline {
    position: relative;
    padding-left: 0;
}

.timeline-item {
    position: relative;
    padding-left: 35px;
    padding-bottom: 25px;
    border-left: 2px solid var(--border-color);
    margin-left: 10px;
}

.timeline-item:last-child {
    border-left-color: transparent;
    padding-bottom: 0;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -7px;
    top: 3px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid var(--bg-secondary);
    box-shadow: 0 0 0 2px var(--primary-100);
}

.timeline-item.timeline-success::before { background: var(--success); box-shadow: 0 0 0 2px var(--success-light); }
.timeline-item.timeline-warning::before { background: var(--warning); box-shadow: 0 0 0 2px var(--warning-light); }
.timeline-item.timeline-danger::before  { background: var(--danger); box-shadow: 0 0 0 2px var(--danger-light); }

.timeline-date {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 4px;
    font-weight: 500;
}

.timeline-content {
    background: var(--bg-tertiary);
    padding: 12px 16px;
    border-radius: var(--border-radius-sm);
    font-size: 0.9rem;
}

.timeline-content h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.timeline-content p {
    color: var(--text-secondary);
    margin: 0;
    font-size: 0.85rem;
}

/* -------------------------------------------------------
   30. Calendar Grid
   ------------------------------------------------------- */
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.calendar-title {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 600;
}

.calendar-nav {
    display: flex;
    gap: 8px;
}

.calendar-nav .btn {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--border-color);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
}

.calendar-day-header {
    background: var(--bg-tertiary);
    padding: 10px;
    text-align: center;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.calendar-day {
    background: var(--bg-secondary);
    padding: 10px;
    min-height: 100px;
    cursor: pointer;
    transition: var(--transition-fast);
    position: relative;
}

.calendar-day:hover {
    background: var(--primary-50);
}

.calendar-day.other-month {
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

.calendar-day.today {
    background: var(--primary-50);
}

.calendar-day.today .day-number {
    background: var(--primary);
    color: var(--text-white);
    border-radius: var(--border-radius-full);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.day-number {
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 4px;
}

.calendar-event {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.72rem;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.calendar-event.event-primary { background: var(--primary-100); color: var(--primary-dark); }
.calendar-event.event-success { background: var(--success-light); color: var(--success-dark); }
.calendar-event.event-warning { background: var(--warning-light); color: var(--warning-dark); }
.calendar-event.event-danger  { background: var(--danger-light); color: var(--danger-dark); }

/* -------------------------------------------------------
   31. Chat / Messages
   ------------------------------------------------------- */
.chat-container {
    display: flex;
    height: calc(100vh - var(--header-height) - 80px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    background: var(--bg-secondary);
}

.chat-sidebar {
    width: 320px;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.chat-sidebar-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.chat-conversations {
    flex: 1;
    overflow-y: auto;
}

.chat-conversation-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    transition: var(--transition-fast);
    border-bottom: 1px solid var(--border-color);
}

.chat-conversation-item:hover,
.chat-conversation-item.active {
    background: var(--primary-50);
}

.chat-conversation-item .avatar {
    flex-shrink: 0;
}

.chat-conversation-info {
    flex: 1;
    min-width: 0;
}

.chat-conversation-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 2px;
}

.chat-conversation-preview {
    font-size: 0.82rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-conversation-time {
    font-size: 0.72rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chat-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-bubble {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 0.9rem;
    line-height: 1.5;
    position: relative;
}

.chat-bubble.sent {
    align-self: flex-end;
    background: var(--primary);
    color: var(--text-white);
    border-bottom-right-radius: 4px;
}

.chat-bubble.received {
    align-self: flex-start;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

.chat-bubble-time {
    font-size: 0.7rem;
    margin-top: 4px;
    opacity: 0.7;
}

.chat-input {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
    align-items: center;
}

.chat-input input {
    flex: 1;
    padding: 10px 16px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--border-radius-full);
    font-size: 0.9rem;
    font-family: var(--font-family);
    background: var(--bg-tertiary);
}

.chat-input input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-secondary);
}

.chat-typing {
    padding: 8px 20px;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
}

/* -------------------------------------------------------
   32. Profile Header
   ------------------------------------------------------- */
.profile-header {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    overflow: hidden;
    margin-bottom: 25px;
}

.profile-cover {
    height: 160px;
    background: var(--sidebar-bg);
    position: relative;
}

.profile-info {
    display: flex;
    align-items: flex-end;
    gap: 20px;
    padding: 0 30px 20px;
    margin-top: -40px;
    position: relative;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: var(--border-radius-full);
    border: 4px solid var(--bg-secondary);
    box-shadow: var(--shadow-md);
    object-fit: cover;
    flex-shrink: 0;
}

.profile-avatar-initials {
    width: 100px;
    height: 100px;
    border-radius: var(--border-radius-full);
    border: 4px solid var(--bg-secondary);
    box-shadow: var(--shadow-md);
    background: var(--primary-100);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    font-family: var(--font-heading);
    flex-shrink: 0;
}

.profile-details {
    flex: 1;
    padding-bottom: 5px;
}

.profile-name {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.profile-role {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.profile-actions {
    flex-shrink: 0;
    display: flex;
    gap: 8px;
    padding-bottom: 5px;
}

/* -------------------------------------------------------
   33. Notification List
   ------------------------------------------------------- */
.notification-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 380px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-color);
    z-index: 1000;
    display: none;
    animation: fadeIn 0.2s ease;
    max-height: 450px;
    overflow: hidden;
}

.notification-panel.show {
    display: block;
}

.notification-panel-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notification-panel-header h4 {
    font-family: var(--font-heading);
    font-weight: 600;
}

.notification-list {
    max-height: 350px;
    overflow-y: auto;
}

.notification-item {
    padding: 14px 20px;
    display: flex;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition-fast);
    cursor: pointer;
}

.notification-item:hover {
    background: var(--bg-tertiary);
}

.notification-item.unread {
    background: var(--primary-50);
}

.notification-item .notification-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.notification-item .notification-icon.icon-primary { background: var(--primary-50); color: var(--primary); }
.notification-item .notification-icon.icon-success { background: var(--success-light); color: var(--success); }
.notification-item .notification-icon.icon-warning { background: var(--warning-light); color: var(--warning); }
.notification-item .notification-icon.icon-danger  { background: var(--danger-light); color: var(--danger); }

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-text {
    font-size: 0.88rem;
    line-height: 1.4;
    margin-bottom: 2px;
}

.notification-text strong {
    font-weight: 600;
}

.notification-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* -------------------------------------------------------
   34. Animations & Keyframes
   ------------------------------------------------------- */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes slideDown {
    from { transform: translateY(-10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOutRight {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

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

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

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

@keyframes float {
    0% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(10deg); }
    100% { transform: translateY(0) rotate(0deg); }
}

@keyframes bounceIn {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.05); }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); opacity: 1; }
}

.fade-in { animation: fadeIn 0.5s ease; }
.slide-up { animation: slideUp 0.4s ease; }
.slide-down { animation: slideDown 0.3s ease; }
.bounce-in { animation: bounceIn 0.5s ease; }

/* Count-up animation helper */
.count-up {
    display: inline-block;
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, #e2e8f0 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--border-radius-sm);
}

.skeleton-text {
    height: 14px;
    margin-bottom: 8px;
    width: 100%;
}

.skeleton-text:last-child {
    width: 60%;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius-full);
}

/* -------------------------------------------------------
   35. Scrollbar
   ------------------------------------------------------- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--text-muted) transparent;
}

/* -------------------------------------------------------
   36. Width & Height Utilities
   ------------------------------------------------------- */
.w-25 { width: 25% !important; }
.w-50 { width: 50% !important; }
.w-75 { width: 75% !important; }
.w-100 { width: 100% !important; }
.w-auto { width: auto !important; }

.h-100 { height: 100% !important; }
.h-auto { height: auto !important; }

.mw-100 { max-width: 100% !important; }
.mh-100 { max-height: 100% !important; }

/* -------------------------------------------------------
   37. Border Utilities
   ------------------------------------------------------- */
.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-left { border-left: 1px solid var(--border-color) !important; }
.border-right { border-right: 1px solid var(--border-color) !important; }
.border-0 { border: none !important; }

.rounded { border-radius: var(--border-radius) !important; }
.rounded-sm { border-radius: var(--border-radius-sm) !important; }
.rounded-lg { border-radius: var(--border-radius-lg) !important; }
.rounded-full { border-radius: var(--border-radius-full) !important; }
.rounded-0 { border-radius: 0 !important; }

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

/* -------------------------------------------------------
   39. Background Utilities
   ------------------------------------------------------- */
.bg-primary { background-color: var(--primary) !important; }
.bg-success { background-color: var(--success) !important; }
.bg-danger { background-color: var(--danger) !important; }
.bg-warning { background-color: var(--warning) !important; }
.bg-info { background-color: var(--info) !important; }
.bg-light { background-color: var(--bg-tertiary) !important; }
.bg-white { background-color: var(--bg-secondary) !important; }
.bg-transparent { background-color: transparent !important; }

/* -------------------------------------------------------
   40. Misc / Special Components
   ------------------------------------------------------- */

/* Detail list for show/detail pages */
.detail-list {
    list-style: none;
}

.detail-item {
    display: flex;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    gap: 20px;
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 500;
    color: var(--text-secondary);
    min-width: 160px;
    flex-shrink: 0;
    font-size: 0.9rem;
}

.detail-value {
    color: var(--text-primary);
    font-size: 0.9rem;
    flex: 1;
}

/* Attendance grid */
.attendance-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    font-size: 0.8rem;
}

.attendance-present { background: var(--success-light); color: var(--success); }
.attendance-absent { background: var(--danger-light); color: var(--danger); }
.attendance-late { background: var(--warning-light); color: var(--warning); }
.attendance-excused { background: var(--info-light); color: var(--info); }

/* Status indicator dot */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
}

.status-dot.online { background: var(--success); }
.status-dot.offline { background: var(--text-muted); }
.status-dot.busy { background: var(--danger); }
.status-dot.away { background: var(--warning); }

/* Floating action button */
.fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 56px;
    height: 56px;
    border-radius: var(--border-radius-full);
    background: var(--primary);
    color: var(--text-white);
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    transition: var(--transition);
    z-index: 500;
}

.fab:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-xl);
    background: var(--primary-dark);
}

/* Data value with icon */
.data-with-icon {
    display: flex;
    align-items: center;
    gap: 8px;
}

.data-with-icon i {
    color: var(--text-muted);
    font-size: 0.9rem;
    width: 18px;
    text-align: center;
}

/* Info box */
.info-box {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 16px 20px;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius-sm);
    margin-bottom: 15px;
}

.info-box-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

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

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

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

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

/* -------------------------------------------------------
   41. Print Styles
   ------------------------------------------------------- */
@media print {
    .sidebar,
    .top-header,
    .bottom-nav,
    .sidebar-toggle,
    .page-header-right,
    .action-buttons,
    .btn,
    .toast-container,
    .modal-overlay,
    .fab,
    .no-print {
        display: none !important;
    }

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

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

    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        break-inside: auto;
    }

    body {
        background: white !important;
        color: black !important;
        font-size: 12pt;
    }

    .table th,
    .table td {
        padding: 8px !important;
    }

    a {
        color: black !important;
        text-decoration: none !important;
    }

    .badge {
        border: 1px solid #999;
    }
}

/* -------------------------------------------------------
   13. Modern App Utilities (Unified UI)
   ------------------------------------------------------- */
.app-card {
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    border-radius: 12px;
    background: var(--bg-secondary);
    overflow: hidden;
    margin-bottom: var(--space-lg);
}

.app-card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-secondary);
}

.list-group {
    display: flex;
    flex-direction: column;
    padding-left: 0;
    margin-bottom: 0;
}

.list-group-flush .list-group-item {
    border-right-width: 0;
    border-left-width: 0;
    border-radius: 0;
}

.list-group-item {
    position: relative;
    display: block;
    padding: 16px 20px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

.list-group-item-action {
    width: 100%;
    color: var(--text-primary);
    text-align: inherit;
    transition: var(--transition-fast);
}

.list-group-item-action:hover, .list-group-item-action:focus {
    z-index: 1;
    color: var(--text-primary);
    text-decoration: none;
    background-color: var(--bg-tertiary);
}

.list-group-item.active {
    z-index: 2;
    color: var(--text-primary);
    background-color: var(--primary-50);
    border-color: var(--border-color);
}

/* Avatar Utilities */
.avatar {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.avatar-sm {
    width: 32px;
    height: 32px;
    font-size: 0.85rem;
}

.avatar-md {
    width: 48px;
    height: 48px;
    font-size: 1.2rem;
}

.avatar-initials {
    background-color: var(--primary-100);
    color: var(--primary);
    font-weight: 600;
}
