/**
 * SC Attendance - Professional Light Theme Design
 * Modern UI with Animations
 */

/* =====================================================
   CSS Variables - Light Theme
===================================================== */
:root {
    /* Primary Colors - Modern Blue (v1.8.0 redesign) */
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #60a5fa;
    --primary-soft: #eff4ff;       /* very light tint for active states/hover */
    --primary-rgb: 37, 99, 235;

    /* Accent - Soft Indigo */
    --accent: #6366f1;
    --accent-dark: #4f46e5;
    --accent-rgb: 99, 102, 241;

    /* Secondary */
    --secondary: #64748b;

    /* Status Colors */
    --success: #22c55e;
    --success-light: rgba(34, 197, 94, 0.1);
    --danger: #ef4444;
    --danger-light: rgba(239, 68, 68, 0.1);
    --warning: #f59e0b;
    --warning-light: rgba(245, 158, 11, 0.1);
    --info: #3b82f6;
    --info-light: rgba(59, 130, 246, 0.1);

    /* Light Theme Colors (v1.8.0 — softer, lighter) */
    --bg-body: #f6f8fc;
    --bg-sidebar: #ffffff;          /* light sidebar (Soft Modern) */
    --bg-sidebar-hover: #f1f5f9;
    --bg-header: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    --bg-input: #ffffff;
    --bg-table-header: #f8fafc;
    --bg-table-row: #ffffff;
    --bg-table-row-alt: #f8fafc;

    /* Text Colors */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-sidebar: #475569;        /* dark text on light sidebar */
    --text-sidebar-muted: #94a3b8;

    /* Border Colors */
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;

    /* Gray Scale (for light theme) */
    --dark: #1e293b;
    --light: #f8fafc;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;

    /* Design Tokens (v1.8.0 — Soft Modern) */
    --font-family: 'Tajawal', 'Segoe UI', Tahoma, sans-serif;
    --border-radius: 20px;
    --border-radius-sm: 14px;
    --border-radius-lg: 28px;
    --border-radius-xl: 32px;
    /* Soft, colored shadows (tinted with primary) */
    --shadow-sm: 0 1px 3px rgba(37, 99, 235, 0.06);
    --shadow: 0 4px 16px rgba(37, 99, 235, 0.08);
    --shadow-md: 0 8px 24px rgba(37, 99, 235, 0.10);
    --shadow-lg: 0 16px 40px rgba(37, 99, 235, 0.12);
    --shadow-soft: 0 2px 12px rgba(15, 23, 42, 0.05);  /* neutral soft for cards */
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);

    /* Gradient (softer for Soft Modern) */
    --gradient-primary: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    --gradient-accent: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    --gradient-success: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    --gradient-danger: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

/* =====================================================
   Base Styles
===================================================== */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;800;900&display=swap');

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-body);
    direction: rtl;
    text-align: right;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

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

/* Headings */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family);
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
    margin-top: 0;
    margin-bottom: 0.75rem;
}

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

/* Lists */
ul, ol {
    padding-right: 1.5rem;
    margin-bottom: 1rem;
}

li {
    margin-bottom: 0.25rem;
}

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

/* Small text */
small, .small {
    font-size: 0.85rem;
}

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

/* =====================================================
   Auth Pages (Login, Register, Forgot Password)
===================================================== */
.sca-auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: linear-gradient(135deg, #0983e2 0%, #0769b8 100%);
    position: relative;
    overflow: hidden;
}

.sca-auth-card {
    width: 100%;
    max-width: 600px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 0;
    padding-top: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    z-index: 1;
    animation: slideUp 0.6s ease-out;
}

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

.sca-auth-logo img {
    max-height: 80px;
    animation: pulse 2s ease-in-out infinite;
}

.sca-auth-logo h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark);
    margin-top: 1.25rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sca-auth-logo p {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-top: 0.75rem;
}

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

.sca-auth-form {
    max-width: 90%;
    margin: auto;
}

.sca-auth-form .form-group {
    margin-bottom: 1.75rem;
    position: relative;
}

.sca-auth-form label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.625rem;
    font-size: 1rem;
}

.sca-auth-form .form-control {
    width: 100%;
    padding: 15px 20px;
    padding-right: 3.5rem;
    font-size: 1.1rem;
    font-family: inherit;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    background: var(--bg-input);
    color: var(--text-primary);
    transition: var(--transition);
}

.sca-auth-form .form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.1);
    background: var(--bg-input);
}

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

.sca-auth-form .input-icon {
    position: absolute;
    top: 50%;
    right: 1.25rem;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.25rem;
    transition: var(--transition);
}

.sca-auth-form .form-group:focus-within .input-icon {
    color: var(--primary);
}

.sca-auth-form .btn-primary {
    width: 100%;
    padding: 1.125rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    margin-top: 0.5rem;
}

.sca-auth-form .btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: 0.5s;
}

.sca-auth-form .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(var(--primary-rgb), 0.3);
}

.sca-auth-form .btn-primary:hover::before {
    left: 100%;
}

.sca-auth-form .btn-primary:active {
    transform: translateY(0);
}

.sca-auth-links {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.sca-auth-links a {
    color: var(--primary);
    font-weight: 600;
}

.sca-auth-links a:hover {
    text-decoration: underline;
}

.sca-auth-divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

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

.sca-auth-divider span {
    padding: 0 1rem;
}

/* =====================================================
   Dashboard Layout
===================================================== */
.sca-dashboard {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sca-sidebar {
    width: 280px;
    background: var(--bg-sidebar);
    color: #fff;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    border-left: 1px solid rgba(255, 255, 255, 0.05);
}

.sca-sidebar-header {
    padding: 1.5rem;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.sca-sidebar-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.sca-sidebar-logo img {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    object-fit: contain;
}

.sca-sidebar-logo h2 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    color: #fff;
}

.sca-sidebar-logo span {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
    display: block;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.sca-sidebar-nav {
    flex: 1;
    padding: 1.5rem 0;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) rgba(255, 255, 255, 0.05);
}

.sca-sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sca-sidebar-nav::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

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

.sca-sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.35);
}

.sca-nav-section {
    padding: 0 0.75rem;
    margin-bottom: 0.5rem;
}

.sca-nav-section-title {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.5);
    padding: 0.5rem 1rem;
    margin-bottom: 0.5rem;
}

.sca-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    color: rgba(255, 255, 255, 0.85);
    border-radius: var(--border-radius);
    margin-bottom: 0.25rem;
    transition: var(--transition);
    position: relative;
}

.sca-nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.sca-nav-item.active {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: 0 4px 15px rgba(var(--primary-rgb), 0.4);
}

.sca-nav-item i {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
}

.sca-nav-item span {
    font-weight: 500;
    font-size: 0.9rem;
}

.sca-nav-item .badge {
    margin-right: auto;
    padding: 0.2rem 0.5rem;
    font-size: 0.65rem;
    background: var(--accent);
    color: var(--dark);
    border-radius: 50px;
    font-weight: 600;
}

.sca-nav-item .sca-nav-arrow {
    margin-right: auto;
    font-size: 0.8rem;
    transition: var(--transition);
}

.sca-nav-group.open .sca-nav-arrow {
    transform: rotate(-180deg);
}

.sca-nav-submenu {
    /* v1.6.0 — smooth height transition instead of display:none */
    max-height: 0;
    overflow: hidden;
    padding-right: 2.5rem;
    margin-top: 0;
    opacity: 0;
    transition: max-height 0.3s ease, margin-top 0.25s ease, opacity 0.2s ease;
}

.sca-nav-group.open .sca-nav-submenu {
    max-height: 700px; /* large enough for any submenu */
    margin-top: 0.25rem;
    opacity: 1;
}

.sca-nav-submenu .sca-nav-item {
    padding: 0.625rem 1rem;
    font-size: 0.85rem;
    position: relative;
}

.sca-nav-submenu .sca-nav-item::before {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: var(--transition);
}

.sca-nav-submenu .sca-nav-item.active::before,
.sca-nav-submenu .sca-nav-item:hover::before {
    background: var(--accent);
}

.sca-nav-submenu .sca-nav-item.active {
    background: transparent;
    color: #fff;
    box-shadow: none;
}

/* Sidebar User */
.sca-sidebar-user {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sca-sidebar-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
}

.sca-sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sca-sidebar-user-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sca-sidebar-user-role {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
}

/* Logout Button */
.sca-nav-item.sca-logout {
    color: var(--danger);
    margin-top: 0.5rem;
}

.sca-nav-item.sca-logout:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

/* Main Content */
.sca-main {
    flex: 1;
    margin-right: 280px;
    transition: var(--transition);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Top Header */
.sca-header {
    background: var(--bg-header);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.sca-header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sca-header-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sca-header-user-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--gradient-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.sca-header-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sca-header-user-info {
    text-align: right;
}

.sca-header-user-greeting {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.sca-header-user-name {
    font-weight: 600;
    color: var(--accent);
    font-size: 1rem;
}

.sca-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

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

.sca-breadcrumb a:hover {
    color: var(--accent);
}

.sca-breadcrumb .separator {
    color: var(--border-color);
}

.sca-breadcrumb .current {
    color: var(--text-primary);
    font-weight: 600;
}

.sca-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sca-header-btn {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius-sm);
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.sca-header-btn:hover {
    background: var(--bg-card-hover);
    color: var(--accent);
    border-color: var(--accent);
}

.sca-header-btn .badge {
    position: absolute;
    top: -4px;
    left: -4px;
    width: 18px;
    height: 18px;
    font-size: 0.6rem;
    background: var(--danger);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* Content Area */
.sca-content {
    padding: 2rem;
    flex: 1;
}

.sca-container {
    max-width: 100%;
}

.sca-page-header {
    margin-bottom: 2rem;
    animation: fadeInDown 0.5s ease;
    text-align: center;
}

.sca-page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.sca-page-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.sca-page-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--border-radius);
    color: var(--danger);
    font-size: 0.9rem;
    margin-top: 1rem;
}

.sca-page-notice.info {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.2);
    color: var(--info);
}

.sca-page-notice.success {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.2);
    color: var(--success);
}

/* =====================================================
   Cards
===================================================== */
.sca-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.5s ease;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.sca-card:hover {
    border-color: var(--border-light);
}

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

.sca-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.sca-card-body {
    padding: 1.5rem;
}

.sca-card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--gray-100);
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

/* Stats Cards */
.sca-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.sca-stat-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.sca-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    transform: scaleX(0);
    transform-origin: right;
    transition: var(--transition);
}

.sca-stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.sca-stat-card:hover::before {
    transform: scaleX(1);
}

.sca-stat-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
    flex-shrink: 0;
}

.sca-stat-icon.primary { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); }
.sca-stat-icon.success { background: linear-gradient(135deg, var(--success), #16a34a); }
.sca-stat-icon.warning { background: linear-gradient(135deg, var(--warning), #d97706); }
.sca-stat-icon.danger { background: linear-gradient(135deg, var(--danger), #dc2626); }
.sca-stat-icon.info { background: linear-gradient(135deg, var(--info), #2563eb); }

.sca-stat-content h3 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    line-height: 1;
}

.sca-stat-content p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0.25rem 0 0;
}

.sca-stat-change {
    font-size: 0.8rem;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

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

/* =====================================================
   Tables
===================================================== */
.sca-table-container {
    overflow-x: auto;
}

.sca-table {
    width: 100%;
    border-collapse: collapse;
}

.sca-table th {
    background: var(--gray-50);
    padding: 1rem;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--gray-600);
    text-align: right;
    white-space: nowrap;
    border-bottom: 2px solid var(--gray-200);
}

.sca-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
}

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

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

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

/* =====================================================
   Buttons
===================================================== */
.sca-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    border-radius: var(--border-radius-sm);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.sca-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.sca-btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
}

.sca-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(var(--primary-rgb), 0.3);
    color: #fff;
}

.sca-btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
}

.sca-btn-secondary:hover {
    background: var(--gray-200);
    color: var(--gray-800);
}

.sca-btn-success {
    background: linear-gradient(135deg, var(--success), #16a34a);
    color: #fff;
}

.sca-btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(34, 197, 94, 0.3);
    color: #fff;
}

.sca-btn-danger {
    background: linear-gradient(135deg, var(--danger), #dc2626);
    color: #fff;
}

.sca-btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(239, 68, 68, 0.3);
    color: #fff;
}

.sca-btn-outline {
    background: transparent;
    border: 2px solid var(--gray-200);
    color: var(--gray-600);
}

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

.sca-btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

.sca-btn-lg {
    padding: 1.1rem 2rem;
    font-size: 1.1rem;
}

.sca-btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
}

/* =====================================================
   Forms
===================================================== */
.sca-form-group {
    margin-bottom: 1.5rem;
}

.sca-form-label {
    display: block;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.sca-form-label .required {
    color: var(--danger);
}

.sca-form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    font-family: inherit;
    border: 2px solid var(--gray-200);
    border-radius: var(--border-radius-sm);
    background: #fff;
    color: var(--gray-700);
    transition: var(--transition);
}

.sca-form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.1);
}

.sca-form-control::placeholder {
    color: var(--gray-400);
}

.sca-form-control:disabled {
    background: var(--gray-100);
    cursor: not-allowed;
}

textarea.sca-form-control {
    min-height: 120px;
    resize: vertical;
}

select.sca-form-control {
    cursor: pointer;
}

.sca-form-hint {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-top: 0.5rem;
}

.sca-form-error {
    font-size: 0.8rem;
    color: var(--danger);
    margin-top: 0.5rem;
}

/* =====================================================
   Badges
===================================================== */
.sca-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 50px;
    white-space: nowrap;
}

.sca-badge-primary {
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
}

.sca-badge-success {
    background: var(--success-light);
    color: var(--success);
}

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

.sca-badge-warning {
    background: var(--warning-light);
    color: var(--warning);
}

.sca-badge-info {
    background: var(--info-light);
    color: var(--info);
}

/* =====================================================
   Alerts
===================================================== */
.sca-alert {
    padding: 1rem 1.25rem;
    border-radius: var(--border-radius-sm);
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    animation: fadeInDown 0.3s ease;
}

.sca-alert i {
    font-size: 1.25rem;
    margin-top: 0.1rem;
}

.sca-alert-content {
    flex: 1;
}

.sca-alert-content strong {
    display: block;
    margin-bottom: 0.25rem;
}

.sca-alert-success {
    background: var(--success-light);
    color: #166534;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.sca-alert-danger {
    background: var(--danger-light);
    color: #991b1b;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.sca-alert-warning {
    background: var(--warning-light);
    color: #92400e;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.sca-alert-info {
    background: var(--info-light);
    color: #1e40af;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.sca-alert-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0.5;
    transition: var(--transition);
}

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

/* =====================================================
   Dashboard Alerts Panel
===================================================== */
.sca-alerts-card {
    border: 2px solid var(--warning);
    border-radius: var(--border-radius);
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

.sca-alerts-card .card-header {
    background: transparent;
    border-bottom: 1px solid rgba(245, 158, 11, 0.2);
}

.sca-alerts-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sca-alert-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1rem;
    border-radius: var(--border-radius-sm);
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: var(--transition);
}

.sca-alert-item:hover {
    transform: translateX(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.sca-alert-item.sca-alert-danger {
    border-right: 4px solid var(--danger);
}

.sca-alert-item.sca-alert-warning {
    border-right: 4px solid var(--warning);
}

.sca-alert-item.sca-alert-info {
    border-right: 4px solid var(--info);
}

.sca-alert-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sca-alert-danger .sca-alert-icon {
    background: var(--danger-light);
    color: var(--danger);
}

.sca-alert-warning .sca-alert-icon {
    background: var(--warning-light);
    color: var(--warning);
}

.sca-alert-info .sca-alert-icon {
    background: var(--info-light);
    color: var(--info);
}

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

.sca-alert-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.25rem;
}

.sca-alert-title strong {
    font-size: 0.95rem;
    color: var(--gray-800);
}

.sca-alert-message {
    font-size: 0.85rem;
    color: var(--gray-600);
}

.sca-alert-action {
    flex-shrink: 0;
}

/* Responsive */
@media (max-width: 576px) {
    .sca-alert-item {
        flex-wrap: wrap;
    }

    .sca-alert-action {
        width: 100%;
        margin-top: 0.5rem;
    }

    .sca-alert-action .btn {
        width: 100%;
    }
}

/* =====================================================
   Empty State
===================================================== */
.sca-empty {
    text-align: center;
    padding: 3rem 2rem;
}

.sca-empty-icon {
    font-size: 4rem;
    color: var(--gray-300);
    margin-bottom: 1rem;
    animation: bounce 2s ease infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.sca-empty h3 {
    font-size: 1.25rem;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.sca-empty p {
    color: var(--gray-500);
    margin-bottom: 1.5rem;
}

/* =====================================================
   Loading
===================================================== */
.sca-loading {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.sca-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.sca-loading-spinner {
    text-align: center;
}

.sca-loading-spinner .sca-loading {
    width: 48px;
    height: 48px;
    border-width: 4px;
}

.sca-loading-spinner p {
    margin-top: 1rem;
    color: var(--gray-600);
    font-weight: 500;
}

/* =====================================================
   Animations
===================================================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

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

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-fade-in { animation: fadeIn 0.5s ease; }
.animate-fade-in-up { animation: fadeInUp 0.5s ease; }
.animate-fade-in-down { animation: fadeInDown 0.5s ease; }
.animate-slide-up { animation: slideUp 0.5s ease; }
.animate-slide-in-right { animation: slideInRight 0.5s ease; }
.animate-scale-in { animation: scaleIn 0.3s ease; }

/* Stagger animations */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }

/* =====================================================
   QR Code Scanner
===================================================== */
.sca-qr-scanner {
    background: var(--dark);
    border-radius: var(--border-radius);
    overflow: hidden;
    position: relative;
}

.sca-qr-scanner video {
    width: 100%;
    display: block;
}

.sca-qr-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    border: 3px solid var(--primary);
    border-radius: var(--border-radius);
    animation: qrPulse 2s ease-in-out infinite;
}

@keyframes qrPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(var(--primary-rgb), 0.4);
    }
    50% {
        box-shadow: 0 0 0 20px rgba(var(--primary-rgb), 0);
    }
}

.sca-qr-result {
    padding: 1.5rem;
    text-align: center;
}

.sca-qr-result.success {
    background: var(--success-light);
}

.sca-qr-result.error {
    background: var(--danger-light);
}

/* =====================================================
   Student Cards
===================================================== */
.sca-student-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
}

.sca-student-card {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    display: flex;
    gap: 1rem;
    transition: var(--transition);
}

.sca-student-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 15px rgba(var(--primary-rgb), 0.2);
}

.sca-student-card-qr {
    width: 100px;
    height: 100px;
    background: #fff;
    border-radius: var(--border-radius-sm);
    padding: 0.5rem;
    box-shadow: var(--shadow-sm);
}

.sca-student-card-qr img {
    width: 100%;
    height: 100%;
}

.sca-student-card-info {
    flex: 1;
}

.sca-student-card-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.sca-student-card-group {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

/* =====================================================
   Mobile Toggle
===================================================== */
.sca-mobile-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border: none;
    background: var(--bg-card);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.sca-mobile-toggle span {
    width: 20px;
    height: 2px;
    background: var(--text-secondary);
    transition: var(--transition);
}

/* =====================================================
   Responsive
===================================================== */
/* Note: Mobile sidebar styles moved to @media (max-width: 991px) section below */

@media (max-width: 768px) {
    .sca-content {
        padding: 1rem;
    }

    .sca-header {
        padding: 1rem;
    }

    .sca-stats-grid {
        grid-template-columns: 1fr;
    }

    .sca-card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .sca-auth-card {
        padding: 1.5rem;
    }

    .sca-page-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .sca-auth-wrapper {
        padding: 1rem;
    }

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

    .sca-table th,
    .sca-table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
    }
}

/* =====================================================
   Print Styles
===================================================== */
@media print {
    /* الفلاتر والأزرار والتنقّل مالهمش لازمة على ورقة.
       `.btn` كان ناقص — بوتستراب بيستخدمه، فأزرار الإجراءات كانت
       بتتطبع مع الجدول وتاكل نص الصفحة. */
    .sca-sidebar,
    .sca-header,
    .sca-btn,
    .btn,
    .no-print,
    form.row,
    .pagination,
    .breadcrumb,
    .modal,
    .modal-backdrop {
        display: none !important;
    }

    /* ترويسة الورقة — مخفية على الشاشة وبتبان في الطباعة بس. */
    .print-only {
        display: block !important;
    }

    .sca-main {
        margin: 0 !important;
    }

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

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

    /* الجدول الطويل بيتقسّم على صفحات، والعناوين بتتكرر فوق كل واحدة —
       من غير كده الصفحة التانية بتبقى أرقام من غير عناوين. */
    table { width: 100% !important; border-collapse: collapse !important; }
    thead { display: table-header-group; }
    tr, img { break-inside: avoid; }

    table th, table td {
        border: 1px solid #ccc !important;
        padding: 4px 6px !important;
        font-size: 11px !important;
    }

    /* الألوان بتتشال في الطباعة الاقتصادية فالشارات بتبقى بيضا على
       بيضا — بنخلّيها إطار ونص. */
    .badge {
        border: 1px solid #666 !important;
        background: transparent !important;
        color: #000 !important;
    }

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

    @page { margin: 10mm; }
}

/* =====================================================
   Utilities
===================================================== */
.text-primary { color: var(--primary) !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-secondary { color: var(--text-secondary) !important; }
.text-white { color: #fff !important; }
.text-light { color: var(--text-primary) !important; }

.bg-primary-light { background: rgba(var(--primary-rgb), 0.15) !important; }
.bg-success-light { background: var(--success-light) !important; }
.bg-danger-light { background: var(--danger-light) !important; }
.bg-warning-light { background: var(--warning-light) !important; }
.bg-info-light { background: var(--info-light) !important; }
.bg-accent-light { background: rgba(var(--accent-rgb), 0.15) !important; }

/* Progress Bar */
.progress {
    display: flex;
    height: 1rem;
    overflow: hidden;
    font-size: 0.75rem;
    background-color: var(--bg-input);
    border-radius: var(--border-radius-sm);
}

.progress-bar {
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    transition: width 0.6s ease;
}

.progress-bar.bg-success {
    background: var(--gradient-success) !important;
}

.progress-bar.bg-danger {
    background: var(--gradient-danger) !important;
}

.progress-bar.bg-primary {
    background: var(--gradient-primary) !important;
}

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 0.5rem !important; }
.mt-2 { margin-top: 1rem !important; }
.mt-3 { margin-top: 1.5rem !important; }
.mt-4 { margin-top: 2rem !important; }

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.5rem !important; }
.mb-2 { margin-bottom: 1rem !important; }
.mb-3 { margin-bottom: 1.5rem !important; }
.mb-4 { margin-bottom: 2rem !important; }

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

.d-flex { display: flex !important; }
.d-block { display: block !important; }
.d-none { display: none !important; }

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

.gap-1 { gap: 0.5rem !important; }
.gap-2 { gap: 1rem !important; }
.gap-3 { gap: 1.5rem !important; }

.w-100 { width: 100% !important; }
.h-100 { height: 100% !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; }

.shadow { box-shadow: var(--shadow) !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; }

/* =====================================================
   Auth Page Styles (New)
===================================================== */
.sca-auth-page {
    background: linear-gradient(135deg, #0983e2 0%, #0769b8 100%);
    min-height: 100vh;
}

.sca-floating-elements {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.sca-floating-element {
    position: absolute;
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: floatElement 20s ease-in-out infinite;
}

.sca-floating-element:nth-child(1) { top: 10%; right: 10%; animation-delay: 0s; }
.sca-floating-element:nth-child(2) { top: 60%; right: 30%; animation-delay: -5s; width: 150px; height: 150px; }
.sca-floating-element:nth-child(3) { top: 30%; left: 10%; animation-delay: -10s; width: 80px; height: 80px; }
.sca-floating-element:nth-child(4) { bottom: 20%; left: 20%; animation-delay: -15s; width: 120px; height: 120px; }
.sca-floating-element:nth-child(5) { bottom: 40%; right: 15%; animation-delay: -7s; width: 60px; height: 60px; }

@keyframes floatElement {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(20px, -30px) rotate(90deg); }
    50% { transform: translate(-10px, 20px) rotate(180deg); }
    75% { transform: translate(30px, 10px) rotate(270deg); }
}

.sca-auth-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark);
    text-align: center;
    margin-bottom: 0.5rem;
}

.sca-auth-subtitle {
    text-align: center;
    color: var(--gray-500);
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
}

.sca-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.sca-label {
    display: block;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.sca-required {
    color: var(--danger);
    margin-right: 0.25rem;
}

.sca-input {
    width: 100%;
    padding: 1rem 1.25rem;
    padding-right: 3.25rem;
    font-size: 1.05rem;
    font-family: inherit;
    border: 2px solid var(--gray-200);
    border-radius: var(--border-radius-sm);
    background: var(--light);
    color: var(--gray-700);
    transition: var(--transition);
}

.sca-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.1);
    background: #fff;
}

.sca-input::placeholder {
    color: var(--gray-400);
}

.sca-input-icon {
    position: relative;
}

.sca-input-icon > i:first-child {
    position: absolute;
    top: 50%;
    right: 1.1rem;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: 1.1rem;
    pointer-events: none;
    transition: var(--transition);
}

.sca-input-icon:focus-within > i:first-child {
    color: var(--primary);
}

.sca-input-password .sca-password-toggle {
    position: absolute;
    top: 50%;
    left: 1.1rem;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    padding: 0;
    font-size: 1.1rem;
    transition: var(--transition);
}

.sca-input-password .sca-password-toggle:hover {
    color: var(--primary);
}

/* OTP Input Styles */
.sca-otp-container {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    direction: ltr;
    margin: 1.5rem 0;
}

.sca-otp-input {
    width: 50px;
    height: 60px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    background: var(--bg-input);
    color: var(--text-primary);
    transition: var(--transition);
}

.sca-otp-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.1);
}

.sca-otp-input.is-invalid {
    border-color: var(--danger);
}

.sca-resend-otp {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    transition: var(--transition);
}

.sca-resend-otp:hover:not(.disabled) {
    text-decoration: underline;
}

.sca-resend-otp.disabled {
    color: var(--text-muted);
    cursor: not-allowed;
}

.sca-resend-countdown {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-right: 0.5rem;
}

.sca-otp-info {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.sca-otp-info .email-highlight {
    color: var(--primary);
    font-weight: 600;
}

/* Steps Indicator */
.sca-steps {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 2rem;
}

.sca-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sca-step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gray-200);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
}

.sca-step.active .sca-step-number {
    background: var(--gradient-primary);
    color: #fff;
}

.sca-step.completed .sca-step-number {
    background: var(--success);
    color: #fff;
}

.sca-step-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: none;
}

.sca-step.active .sca-step-label,
.sca-step.completed .sca-step-label {
    color: var(--text-primary);
}

.sca-step-line {
    width: 40px;
    height: 2px;
    background: var(--gray-200);
    margin: 0 0.5rem;
}

.sca-step-line.completed {
    background: var(--success);
}

@media (min-width: 480px) {
    .sca-step-label {
        display: block;
    }

    .sca-otp-input {
        width: 55px;
        height: 65px;
    }
}

/* Gender Radio Cards */
.sca-gender-options {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.sca-radio-card {
    flex: 1;
    cursor: pointer;
}

.sca-radio-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.sca-radio-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
}

.sca-radio-content i {
    font-size: 1.5rem;
    color: var(--text-muted);
    transition: var(--transition);
}

.sca-radio-content span {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition);
}

.sca-radio-card:hover .sca-radio-content {
    border-color: var(--primary-light);
}

.sca-radio-card input[type="radio"]:checked + .sca-radio-content {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb), 0.05);
}

.sca-radio-card input[type="radio"]:checked + .sca-radio-content i,
.sca-radio-card input[type="radio"]:checked + .sca-radio-content span {
    color: var(--primary);
}

/* Textarea Styles */
.sca-textarea {
    min-height: 100px;
    resize: vertical;
    padding: 0.75rem 1rem !important;
    line-height: 1.6;
}

/* Form Row - Two Columns */
.sca-form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 576px) {
    .sca-form-row-2 {
        grid-template-columns: 1fr;
    }

    .sca-gender-options {
        flex-direction: column;
    }
}

/* Email Info Display */
.sca-email-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(var(--primary-rgb), 0.08);
    border-radius: var(--border-radius-sm);
    margin-bottom: 1.5rem;
    direction: ltr;
}

.sca-email-info i {
    color: var(--primary);
}

.sca-email-info span {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.95rem;
}

/* OTP Hint */
.sca-otp-hint {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 0.5rem;
    margin-bottom: 0;
}

/* Label Center */
.sca-label-center {
    text-align: center;
    display: block;
}

/* Resend Section */
.sca-resend-section {
    text-align: center;
    margin-top: 1.5rem;
}

.sca-resend-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.sca-resend-link {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
}

.sca-resend-link:hover {
    text-decoration: underline;
}

.sca-form-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.sca-form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 480px) {
    .sca-form-row-2 {
        grid-template-columns: 1fr;
    }
}

.sca-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--gray-600);
}

.sca-checkbox input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.sca-link {
    color: var(--primary);
    font-size: 0.9rem;
    text-decoration: none;
    transition: var(--transition);
}

.sca-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.sca-btn-block {
    width: 100%;
    justify-content: center;
}

.sca-auth-link {
    text-align: center;
    color: var(--gray-500);
    font-size: 0.9rem;
}

.sca-auth-link a {
    color: var(--primary);
    font-weight: 600;
    margin-right: 0.25rem;
}

.sca-auth-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-200);
}

.sca-auth-footer p {
    color: var(--gray-500);
    font-size: 0.8rem;
    margin: 0;
}

/* =====================================================
   Dashboard Page Styles (New)
===================================================== */
.sca-dashboard-page {
    background: var(--gray-100);
}

.sca-layout {
    display: flex;
    min-height: 100vh;
}

.sca-container {
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* Preloader */
.sca-preloader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sca-preloader-hidden {
    opacity: 0;
    visibility: hidden;
}

.sca-preloader-spinner {
    text-align: center;
}

.sca-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.sca-spinner-sm {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

/* Full-screen page navigation loader (sidebar action feedback) */
.sca-page-loader {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.72);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}
.sca-page-loader.show {
    opacity: 1;
    visibility: visible;
}
.sca-page-loader .sca-spinner {
    width: 56px;
    height: 56px;
    border-width: 5px;
}

/* Sidebar Enhancements */
.sca-sidebar-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.sca-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    justify-content: center;
}

.sca-logo-icon {
    width: 100%;
    height: 48px;
    border-radius: 12px;
    object-fit: contain;
    flex-shrink: 0;
    padding: 6px 12px;
    background: #fff;
}

/* Marquee Announcement Bar */
.sca-marquee-bar {
    background: linear-gradient(135deg, #0983e2, #0769b8);
    color: white;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    overflow: hidden;
}
.sca-marquee-content {
    display: flex;
    align-items: center;
    gap: 12px;
}
.sca-marquee-content i {
    flex-shrink: 0;
    font-size: 16px;
    animation: pulse-icon 2s ease-in-out infinite;
}
.sca-marquee-content marquee {
    flex: 1;
}
@keyframes pulse-icon {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.sca-sidebar-close {
    display: none;
    background: none;
    border: none;
    color: var(--gray-400);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    transition: var(--transition);
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

.sca-sidebar-close:hover {
    color: #fff;
}

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

.sca-sidebar-user {
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sca-sidebar-user-avatar img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.2);
}

.sca-sidebar-user-info h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    margin: 0 0 0.25rem 0;
}

.sca-sidebar-user-info a {
    background: #25d366;
    color: #fff !important;
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 35px !important;
    position: absolute;
    left: 20px;
}

.sca-sidebar-footer {
    padding: 1rem 1.5rem;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Subscription Status in Sidebar */
.sca-sidebar-subscription {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    margin: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    text-decoration: none;
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.sca-sidebar-subscription:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.sca-subscription-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sca-subscription-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.sca-subscription-status.success {
    color: #10b981;
}

.sca-subscription-status.info {
    color: #3b82f6;
}

.sca-subscription-status.warning {
    color: #f59e0b;
}

.sca-subscription-status.danger {
    color: #ef4444;
}

.sca-subscription-days {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
}

.sca-subscription-arrow {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.75rem;
    transition: var(--transition);
}

.sca-sidebar-subscription:hover .sca-subscription-arrow {
    color: rgba(255, 255, 255, 0.8);
    transform: translateX(-3px);
}

/* Navigation */
.sca-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

/* Custom Scrollbar for Sidebar */
.sca-nav::-webkit-scrollbar {
    width: 6px;
}

.sca-nav::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.sca-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    transition: background 0.3s ease;
}

.sca-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.35);
}

/* Firefox scrollbar */
.sca-nav {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) rgba(255, 255, 255, 0.05);
}

.sca-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    color: var(--gray-300);
    text-decoration: none;
    transition: var(--transition);
    position: relative;
}

.sca-nav-item::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary);
    transform: scaleY(0);
    transition: var(--transition);
}

.sca-nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.sca-nav-item.active {
    background: rgba(var(--primary-rgb), 0.2);
    color: var(--primary-light);
}

.sca-nav-item.active::before {
    transform: scaleY(1);
}

.sca-nav-item i {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

.sca-nav-group .sca-nav-arrow {
    margin-right: auto;
    font-size: 0.75rem;
    transition: var(--transition);
}

.sca-nav-group.open .sca-nav-arrow {
    transform: rotate(180deg);
}

.sca-nav-submenu {
    display: none;
    padding-right: 1rem;
}

.sca-nav-group.open .sca-nav-submenu {
    display: block;
}

.sca-nav-subitem {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.5rem 0.625rem 2.5rem;
    color: var(--gray-400);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}

.sca-nav-subitem:hover {
    color: #fff;
}

.sca-nav-subitem i {
    font-size: 0.8rem;
    width: 20px;
}

.sca-nav-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 1rem 1.5rem;
}

.sca-nav-label {
    display: block;
    padding: 0.5rem 1.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gray-500);
}

/* Header */
.sca-header-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sca-sidebar-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border: none;
    background: var(--gray-100);
    border-radius: var(--border-radius-sm);
    color: var(--gray-600);
    font-size: 1.25rem;
    cursor: pointer;
    transition: var(--transition);
}

.sca-sidebar-toggle:hover {
    background: var(--gray-200);
    color: var(--primary);
}

@media (max-width: 991px) {
    .sca-sidebar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

.sca-header-title {
    flex: 1;
}

.sca-header-title h1 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--dark);
    margin: 0;
}

.sca-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sca-header-action {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--gray-100);
    color: var(--gray-600);
    text-decoration: none;
    transition: var(--transition);
}

.sca-header-action:hover {
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
}

.sca-header-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    padding-left: 1rem;
    background: var(--gray-100);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition);
}

.sca-header-user:hover {
    background: var(--gray-200);
}

.sca-header-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

.sca-header-user-info {
    text-align: right;
}

.sca-header-user-name {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--dark);
}

.sca-header-user-role {
    display: block;
    font-size: 0.75rem;
    color: var(--gray-500);
}

.sca-header-user > i:last-child {
    color: var(--gray-400);
    font-size: 0.75rem;
    margin-right: 0.5rem;
}

/* Dropdown */
.sca-dropdown {
    position: relative;
}

.sca-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
    z-index: 1000;
    margin-top: 0.5rem;
    border: 1px solid var(--gray-100);
    overflow: hidden;
}

.sca-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.sca-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--gray-700);
    text-decoration: none;
    transition: var(--transition);
}

.sca-dropdown-item:hover {
    background: var(--gray-50);
    color: var(--primary);
}

.sca-dropdown-item i {
    width: 20px;
    text-align: center;
    color: var(--gray-400);
}

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

.sca-dropdown-divider {
    height: 1px;
    background: var(--gray-100);
    margin: 0.5rem 0;
}

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

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

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

/* Breadcrumb */
.sca-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.sca-breadcrumb-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray-500);
    text-decoration: none;
}

.sca-breadcrumb-item:hover {
    color: var(--primary);
}

.sca-breadcrumb-item:not(:last-child)::after {
    content: '/';
    color: var(--gray-300);
    margin-right: 0.5rem;
}

.sca-breadcrumb-active {
    color: var(--gray-700);
    font-weight: 600;
}

/* Footer */
.sca-footer {
    padding: 1.5rem 2rem;
    background: var(--bg-header);
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

.sca-footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.sca-footer-version {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Mobile Overlay */
.sca-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.sca-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Mobile sidebar - CRITICAL FIXES */
@media (max-width: 991px) {
    /* Hide sidebar by default on mobile */
    .sca-sidebar {
        position: fixed !important;
        top: 0 !important;
        right: -300px !important;
        bottom: 0 !important;
        left: auto !important;
        width: 280px !important;
        max-width: 85vw !important;
        z-index: 1050 !important;
        transform: none !important;
        transition: right 0.3s ease !important;
        visibility: visible !important;
        overflow-y: auto;
    }

    /* Show sidebar when open */
    .sca-sidebar.open {
        right: 0 !important;
    }

    /* Ensure main content takes full width on mobile */
    .sca-main {
        margin-right: 0 !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    /* Layout should not have sidebar space on mobile */
    .sca-layout {
        display: block !important;
    }

    /* Overlay should be above content but below sidebar */
    .sca-overlay {
        z-index: 1040 !important;
        display: none;
    }

    .sca-overlay.active {
        display: block;
    }

    /* Body scroll lock when sidebar is open */
    body.sca-sidebar-open {
        overflow: hidden !important;
        position: fixed;
        width: 100%;
    }

    /* Show toggle button */
    .sca-sidebar-toggle {
        display: flex !important;
    }

    /* Show close button inside sidebar */
    .sca-sidebar-close {
        display: block !important;
    }
}

/* Content adjustments */
.sca-content {
    flex: 1;
    padding: 2rem;
}

.sca-main {
    display: flex;
    flex-direction: column;
    flex: 1;
    margin-right: 280px;
    transition: var(--transition);
    min-height: 100vh;
}

@media (max-width: 991px) {
    .sca-main {
        margin-right: 0 !important;
        min-width: 100%;
    }

    .sca-layout {
        flex-direction: column;
    }

    .sca-content {
        padding: 1rem;
    }
}

/* =====================================================
   Bootstrap-Compatible Grid System
===================================================== */
.container,
.container-fluid {
    width: 100%;
    padding-right: 1rem;
    padding-left: 1rem;
    margin-right: auto;
    margin-left: auto;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -0.75rem;
    margin-left: -0.75rem;
}

.row > * {
    flex-shrink: 0;
    width: 100%;
    max-width: 100%;
    padding-right: 0.75rem;
    padding-left: 0.75rem;
}

.col { flex: 1 0 0%; }
.col-auto { flex: 0 0 auto; width: auto; }
.col-1 { flex: 0 0 auto; width: 8.333333%; }
.col-2 { flex: 0 0 auto; width: 16.666667%; }
.col-3 { flex: 0 0 auto; width: 25%; }
.col-4 { flex: 0 0 auto; width: 33.333333%; }
.col-5 { flex: 0 0 auto; width: 41.666667%; }
.col-6 { flex: 0 0 auto; width: 50%; }
.col-7 { flex: 0 0 auto; width: 58.333333%; }
.col-8 { flex: 0 0 auto; width: 66.666667%; }
.col-9 { flex: 0 0 auto; width: 75%; }
.col-10 { flex: 0 0 auto; width: 83.333333%; }
.col-11 { flex: 0 0 auto; width: 91.666667%; }
.col-12 { flex: 0 0 auto; width: 100%; }

@media (min-width: 576px) {
    .col-sm-1 { flex: 0 0 auto; width: 8.333333%; }
    .col-sm-2 { flex: 0 0 auto; width: 16.666667%; }
    .col-sm-3 { flex: 0 0 auto; width: 25%; }
    .col-sm-4 { flex: 0 0 auto; width: 33.333333%; }
    .col-sm-5 { flex: 0 0 auto; width: 41.666667%; }
    .col-sm-6 { flex: 0 0 auto; width: 50%; }
    .col-sm-7 { flex: 0 0 auto; width: 58.333333%; }
    .col-sm-8 { flex: 0 0 auto; width: 66.666667%; }
    .col-sm-9 { flex: 0 0 auto; width: 75%; }
    .col-sm-10 { flex: 0 0 auto; width: 83.333333%; }
    .col-sm-11 { flex: 0 0 auto; width: 91.666667%; }
    .col-sm-12 { flex: 0 0 auto; width: 100%; }
}

@media (min-width: 768px) {
    .col-md-1 { flex: 0 0 auto; width: 8.333333%; }
    .col-md-2 { flex: 0 0 auto; width: 16.666667%; }
    .col-md-3 { flex: 0 0 auto; width: 25%; }
    .col-md-4 { flex: 0 0 auto; width: 33.333333%; }
    .col-md-5 { flex: 0 0 auto; width: 41.666667%; }
    .col-md-6 { flex: 0 0 auto; width: 50%; }
    .col-md-7 { flex: 0 0 auto; width: 58.333333%; }
    .col-md-8 { flex: 0 0 auto; width: 66.666667%; }
    .col-md-9 { flex: 0 0 auto; width: 75%; }
    .col-md-10 { flex: 0 0 auto; width: 83.333333%; }
    .col-md-11 { flex: 0 0 auto; width: 91.666667%; }
    .col-md-12 { flex: 0 0 auto; width: 100%; }
}

@media (min-width: 992px) {
    .col-lg-1 { flex: 0 0 auto; width: 8.333333%; }
    .col-lg-2 { flex: 0 0 auto; width: 16.666667%; }
    .col-lg-3 { flex: 0 0 auto; width: 25%; }
    .col-lg-4 { flex: 0 0 auto; width: 33.333333%; }
    .col-lg-5 { flex: 0 0 auto; width: 41.666667%; }
    .col-lg-6 { flex: 0 0 auto; width: 50%; }
    .col-lg-7 { flex: 0 0 auto; width: 58.333333%; }
    .col-lg-8 { flex: 0 0 auto; width: 66.666667%; }
    .col-lg-9 { flex: 0 0 auto; width: 75%; }
    .col-lg-10 { flex: 0 0 auto; width: 83.333333%; }
    .col-lg-11 { flex: 0 0 auto; width: 91.666667%; }
    .col-lg-12 { flex: 0 0 auto; width: 100%; }
}

@media (min-width: 1200px) {
    .col-xl-1 { flex: 0 0 auto; width: 8.333333%; }
    .col-xl-2 { flex: 0 0 auto; width: 16.666667%; }
    .col-xl-3 { flex: 0 0 auto; width: 25%; }
    .col-xl-4 { flex: 0 0 auto; width: 33.333333%; }
    .col-xl-5 { flex: 0 0 auto; width: 41.666667%; }
    .col-xl-6 { flex: 0 0 auto; width: 50%; }
    .col-xl-7 { flex: 0 0 auto; width: 58.333333%; }
    .col-xl-8 { flex: 0 0 auto; width: 66.666667%; }
    .col-xl-9 { flex: 0 0 auto; width: 75%; }
    .col-xl-10 { flex: 0 0 auto; width: 83.333333%; }
    .col-xl-11 { flex: 0 0 auto; width: 91.666667%; }
    .col-xl-12 { flex: 0 0 auto; width: 100%; }
}

@media (min-width: 1400px) {
    .col-xxl-1 { flex: 0 0 auto; width: 8.333333%; }
    .col-xxl-2 { flex: 0 0 auto; width: 16.666667%; }
    .col-xxl-3 { flex: 0 0 auto; width: 25%; }
    .col-xxl-4 { flex: 0 0 auto; width: 33.333333%; }
    .col-xxl-5 { flex: 0 0 auto; width: 41.666667%; }
    .col-xxl-6 { flex: 0 0 auto; width: 50%; }
    .col-xxl-7 { flex: 0 0 auto; width: 58.333333%; }
    .col-xxl-8 { flex: 0 0 auto; width: 66.666667%; }
    .col-xxl-9 { flex: 0 0 auto; width: 75%; }
    .col-xxl-10 { flex: 0 0 auto; width: 83.333333%; }
    .col-xxl-11 { flex: 0 0 auto; width: 91.666667%; }
    .col-xxl-12 { flex: 0 0 auto; width: 100%; }
}

/* =====================================================
   Bootstrap-Compatible Cards
===================================================== */
.card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
    animation: fadeInUp 0.5s ease;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.card:hover {
    border-color: var(--border-light);
}

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

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.2);
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

/* Colored Cards */
.card.bg-primary,
.card.bg-success,
.card.bg-warning,
.card.bg-danger,
.card.bg-info {
    border: none;
}

.card.bg-primary { background: var(--gradient-primary) !important; }
.card.bg-success { background: var(--gradient-success) !important; }
.card.bg-warning { background: linear-gradient(135deg, var(--warning), #d97706) !important; }
.card.bg-danger { background: var(--gradient-danger) !important; }
.card.bg-info { background: linear-gradient(135deg, var(--info), #2563eb) !important; }

.card.bg-primary .card-title,
.card.bg-success .card-title,
.card.bg-danger .card-title,
.card.bg-info .card-title {
    color: #fff;
}

.card.bg-warning .card-title {
    color: #000;
}

/* Stat Card Icon (v1.5.0 — fixed vertical alignment + vibrant icons) */
.card.bg-primary .card-body,
.card.bg-success .card-body,
.card.bg-warning .card-body,
.card.bg-danger .card-body,
.card.bg-info .card-body {
    padding: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}
.card.bg-primary .card-body > div:first-child,
.card.bg-success .card-body > div:first-child,
.card.bg-warning .card-body > div:first-child,
.card.bg-danger .card-body > div:first-child,
.card.bg-info .card-body > div:first-child {
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.card.bg-primary,
.card.bg-success,
.card.bg-warning,
.card.bg-danger,
.card.bg-info {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.card.bg-primary:hover,
.card.bg-success:hover,
.card.bg-warning:hover,
.card.bg-danger:hover,
.card.bg-info:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
}

.card .icon {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 14px;
    flex-shrink: 0;
    color: #fff;
}

.card .icon svg {
    width: 32px;
    height: 32px;
}

.card.bg-primary .card-body p,
.card.bg-success .card-body p,
.card.bg-warning .card-body p,
.card.bg-danger .card-body p,
.card.bg-info .card-body p {
    font-size: 0.95rem;
    margin: 0 0 6px;
    opacity: 0.95;
}

.card.bg-primary .card-body span,
.card.bg-success .card-body span,
.card.bg-warning .card-body span,
.card.bg-danger .card-body span,
.card.bg-info .card-body span {
    font-size: 2.3rem;
    font-weight: 700;
    line-height: 1;
    display: block;
}

@media (max-width: 768px) {
    .card .icon { width: 50px; height: 50px; }
    .card .icon svg { width: 26px; height: 26px; }
    .card.bg-primary .card-body span,
    .card.bg-success .card-body span,
    .card.bg-warning .card-body span,
    .card.bg-danger .card-body span,
    .card.bg-info .card-body span { font-size: 1.8rem; }
}

/* =====================================================
   Unified Card System (v1.6.0)
   - .sca-stat-card: Big KPI cards (gradient + white text + icon)
   - .sca-info-card: Soft summary boxes (light tint + colored text)
===================================================== */

.sca-stat-card {
    border: 0;
    border-radius: 14px;
    padding: 1.5rem;
    color: #fff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    text-decoration: none;
    height: 100%; /* ارتفاع موحّد للبطاقات داخل الصف الواحد */
}
/* الرابط الملتفّ حول البطاقة يمدّ بارتفاع كامل حتى تتساوى البطاقات */
a.d-block > .sca-stat-card { height: 100%; }
.sca-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    color: #fff;
}
.sca-stat-card > div:first-child { flex: 1; min-width: 0; }
.sca-stat-card .sca-stat-label  { font-size: 0.9rem; opacity: 0.92; margin: 0 0 0.35rem; color: #fff; }
.sca-stat-card .sca-stat-value  { font-size: 1.85rem; font-weight: 700; line-height: 1.1; margin: 0; color: #fff; }
.sca-stat-card .sca-stat-sub    { font-size: 0.8rem; opacity: 0.85; margin: 0.25rem 0 0; color: #fff; }
.sca-stat-card .sca-stat-icon   { font-size: 2.2rem; opacity: 0.35; flex-shrink: 0; }

.sca-stat-card--success { background: linear-gradient(135deg, #10b981, #059669); }
.sca-stat-card--danger  { background: linear-gradient(135deg, #ef4444, #dc2626); }
.sca-stat-card--primary { background: linear-gradient(135deg, #0983e2, #0769b8); }
.sca-stat-card--warning { background: linear-gradient(135deg, #f59e0b, #d97706); }
.sca-stat-card--info    { background: linear-gradient(135deg, #06b6d4, #0891b2); }

.sca-info-card {
    border-radius: 12px;
    padding: 1rem 1.25rem;
    text-align: center;
    border: 1px solid transparent;
    background: #f8fafc;
}
.sca-info-card .sca-info-label { font-size: 0.85rem; color: var(--text-muted, #64748b); margin: 0 0 0.35rem; }
.sca-info-card .sca-info-value { font-size: 1.5rem; font-weight: 700; margin: 0; line-height: 1.2; }
.sca-info-card .sca-info-sub   { font-size: 0.75rem; color: var(--text-muted, #64748b); margin: 0.25rem 0 0; }

.sca-info-card--success { background: rgba(16, 185, 129, 0.08); border-color: rgba(16, 185, 129, 0.18); }
.sca-info-card--success .sca-info-value { color: #059669; }
.sca-info-card--danger  { background: rgba(239, 68, 68, 0.08);  border-color: rgba(239, 68, 68, 0.18); }
.sca-info-card--danger  .sca-info-value { color: #dc2626; }
.sca-info-card--primary { background: rgba(9, 131, 226, 0.08); border-color: rgba(9, 131, 226, 0.18); }
.sca-info-card--primary .sca-info-value { color: #0769b8; }
.sca-info-card--warning { background: rgba(245, 158, 11, 0.08); border-color: rgba(245, 158, 11, 0.18); }
.sca-info-card--warning .sca-info-value { color: #d97706; }
.sca-info-card--info    { background: rgba(6, 182, 212, 0.08); border-color: rgba(6, 182, 212, 0.18); }
.sca-info-card--info    .sca-info-value { color: #0891b2; }

@media (max-width: 768px) {
    .sca-stat-card { padding: 1rem 1.1rem; border-radius: 12px; gap: 0.6rem; }
    .sca-stat-card .sca-stat-label { font-size: 0.78rem; margin-bottom: 0.2rem; }
    .sca-stat-card .sca-stat-value { font-size: 1.4rem; }
    .sca-stat-card .sca-stat-icon { font-size: 1.6rem; }
    .sca-info-card .sca-info-value { font-size: 1.2rem; }
}

/* الموبايل: بطاقات الإحصائيات/المال في عمودين مرتبين بدل عمود واحد طويل */
@media (max-width: 575.98px) {
    .sca-stat-card { padding: 0.8rem 0.85rem; border-radius: 12px; gap: 0.35rem; }
    .sca-stat-card .sca-stat-label { font-size: 0.72rem; margin-bottom: 0.1rem; }
    .sca-stat-card .sca-stat-value { font-size: 1.3rem; }
    .sca-stat-card .sca-stat-sub   { font-size: 0.64rem; margin-top: 0.15rem; line-height: 1.25; }
    .sca-stat-card .sca-stat-icon  { font-size: 1.35rem; }
    /* فراغ واضح رأسيًا بين صفوف البطاقات على الموبايل — gutter-y لا يُطبَّق في هذا
       القالب (row.margin-top=0)، فنفرض المسافة عبر row-gap صراحةً. الأفقي 16px كافٍ. */
    [data-tour="dash-stats"],
    .sca-gen-stats,
    .sca-money-cards { row-gap: 0.9rem; }
    /* البطاقات المالية: خط أصغر لا يفيض */
    .sca-money-cards .card-body { padding: 0.75rem 0.85rem; }
    .sca-money-cards h4 { font-size: 1.05rem; }
    .sca-money-cards .card-body i { font-size: 1.1rem !important; }
    /* الإحصائيات العامة (صفوف/مجموعات/حضور): 3 بطاقات مضغوطة في صفّ واحد بلا أيقونة */
    .sca-gen-stats .sca-stat-card { flex-direction: column; text-align: center; justify-content: center; padding: 0.7rem 0.35rem; gap: 0.1rem; }
    .sca-gen-stats .sca-stat-icon { display: none; }
    .sca-gen-stats .sca-stat-label { font-size: 0.66rem; }
    .sca-gen-stats .sca-stat-value { font-size: 1.2rem; }
    .sca-gen-stats .sca-stat-card > div:first-child { flex: 0 0 auto; }

    /* الإجراءات السريعة: بلاطات موحّدة (أيقونة فوق النص) بارتفاع واحد */
    .sca-quick-actions .btn {
        display: flex; flex-direction: column; align-items: center; justify-content: center;
        gap: 0.3rem; min-height: 78px; height: 100%;
        padding: 0.7rem 0.4rem !important; font-size: 0.8rem; line-height: 1.2; text-align: center;
    }
    .sca-quick-actions .btn i { margin: 0 !important; font-size: 1.5rem; }
    .sca-quick-actions .btn .badge { position: absolute; top: 6px; inset-inline-start: 6px; }
}

/* =====================================================
   bg-opacity-10 utility (Bootstrap parity)
   Fixes legacy templates using `bg-{color} bg-opacity-10` pattern.
===================================================== */
.bg-success.bg-opacity-10 { background-color: rgba(16, 185, 129, 0.1) !important; background-image: none !important; }
.bg-danger.bg-opacity-10  { background-color: rgba(239, 68, 68, 0.1)  !important; background-image: none !important; }
.bg-primary.bg-opacity-10 { background-color: rgba(9, 131, 226, 0.1)  !important; background-image: none !important; }
.bg-warning.bg-opacity-10 { background-color: rgba(245, 158, 11, 0.1) !important; background-image: none !important; }
.bg-info.bg-opacity-10    { background-color: rgba(6, 182, 212, 0.1)  !important; background-image: none !important; }

/* =====================================================
   Bootstrap-Compatible Forms - Dark Theme
===================================================== */
.form-control {
    display: block;
    width: 100%;
    padding: 0.875rem 1.25rem;
    font-size: 0.95rem;
    font-family: inherit;
    font-weight: 400;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--bg-input);
    background-clip: padding-box;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    transition: var(--transition);
    appearance: none;
}

.form-control:focus {
    color: var(--text-primary);
    background-color: var(--bg-input);
    border-color: var(--primary);
    outline: 0;
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.15);
}

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

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

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

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

.form-select {
    display: block;
    width: 100%;
    padding: 0.875rem 2.5rem 0.875rem 1.25rem;
    font-size: 0.95rem;
    font-family: inherit;
    font-weight: 400;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--bg-input);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2394a3b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: left 1rem center;
    background-size: 16px 12px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    transition: var(--transition);
    appearance: none;
    cursor: pointer;
}

.form-select:focus {
    border-color: var(--primary);
    outline: 0;
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.15);
}

.form-select option {
    background-color: var(--bg-card);
    color: var(--text-primary);
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 1.5rem;
    padding-right: 0;
    margin-bottom: 0.5rem;
}

.form-check-input {
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0;
    vertical-align: top;
    background-color: var(--bg-input);
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    border: 2px solid var(--border-color);
    appearance: none;
    cursor: pointer;
    transition: var(--transition);
}

.form-check-input[type="checkbox"] {
    border-radius: 6px;
}

.form-check-input[type="radio"] {
    border-radius: 50%;
}

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.form-check-input:checked[type="checkbox"] {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e");
}

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

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

/* Toggle Switch */
.form-switch {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.form-switch .form-check-input {
    width: 3rem;
    height: 1.5rem;
    border-radius: 1.5rem;
    background-color: var(--border-color);
    border: none;
    position: relative;
    cursor: pointer;
}

.form-switch .form-check-input::before {
    content: '';
    position: absolute;
    top: 3px;
    right: 3px;
    width: calc(1.5rem - 6px);
    height: calc(1.5rem - 6px);
    border-radius: 50%;
    background-color: var(--text-primary);
    transition: var(--transition);
}

.form-switch .form-check-input:checked {
    background: var(--gradient-success);
}

.form-switch .form-check-input:checked::before {
    right: calc(100% - 1.5rem + 3px);
    background-color: #fff;
}

/* =====================================================
   Bootstrap-Compatible Buttons - Dark Theme
===================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    border: none;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.btn:disabled,
.btn.disabled {
    pointer-events: none;
    opacity: 0.5;
}

.btn-primary {
    color: #fff;
    background: var(--gradient-primary);
    box-shadow: 0 4px 15px rgba(var(--primary-rgb), 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(var(--primary-rgb), 0.4);
    color: #fff;
}

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

.btn-secondary:hover {
    background-color: var(--bg-card-hover);
    border-color: var(--border-light);
}

.btn-success {
    color: #fff;
    background: var(--gradient-success);
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(34, 197, 94, 0.4);
    color: #fff;
}

.btn-danger {
    color: #fff;
    background: var(--gradient-danger);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.4);
    color: #fff;
}

.btn-warning {
    color: #000;
    background: linear-gradient(135deg, var(--warning), #d97706);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.4);
}

.btn-info {
    color: #fff;
    background: linear-gradient(135deg, var(--info), #2563eb);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.btn-info:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

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

.btn-light:hover {
    background-color: var(--border-light);
}

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

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

.btn-outline-primary:hover {
    color: #fff;
    background: var(--gradient-primary);
    border-color: transparent;
}

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

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

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

.btn-outline-danger:hover {
    color: #fff;
    background: var(--gradient-danger);
    border-color: transparent;
}

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

.btn-outline-success:hover {
    color: #fff;
    background: var(--gradient-success);
    border-color: transparent;
}

/* الطقم كان ناقص info وwarning، فأي زرار بيستخدمهم كان بيطلع
   بلا إطار ولا لون — الصفحة مافيهاش CSS بوتستراب يغطّي الناقص. */
.btn-outline-info {
    color: var(--info);
    border: 2px solid var(--info);
    background-color: transparent;
}

.btn-outline-info:hover {
    color: #fff;
    background: var(--info);
    border-color: transparent;
}

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

.btn-outline-warning:hover {
    color: #fff;
    background: var(--warning);
    border-color: transparent;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    border-radius: var(--border-radius-sm);
}

.btn-lg {
    padding: 1rem 2.5rem;
    font-size: 1rem;
}

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

/* Icon Buttons */
.btn-icon {
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: var(--border-radius-sm);
}

.btn-icon.btn-sm {
    width: 32px;
    height: 32px;
}

.btn-icon.btn-lg {
    width: 52px;
    height: 52px;
}

/* =====================================================
   Bootstrap-Compatible Tables
===================================================== */
.table {
    width: 100%;
    margin-bottom: 1rem;
    color: var(--text-primary);
    vertical-align: top;
    border-color: var(--border-color);
    border-collapse: separate;
    border-spacing: 0;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.table > :not(caption) > * > * {
    padding: 1rem 1.25rem;
    background-color: transparent;
    border-bottom: 1px solid var(--border-color);
}

.table-sm > :not(caption) > * > * {
    padding: 0.5rem 0.65rem;
}

.table > thead {
    vertical-align: bottom;
}

.table > thead > tr > th {
    background: var(--bg-table-header);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: right;
    white-space: nowrap;
    border-bottom: 2px solid var(--border-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table > tbody > tr {
    transition: var(--transition);
    background-color: var(--bg-table-row);
}

.table > tbody > tr:nth-of-type(odd) {
    background-color: var(--bg-table-row-alt);
}

.table > tbody > tr:hover {
    background-color: var(--bg-card-hover);
}

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

.table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: var(--bg-table-row-alt);
}

.table-hover > tbody > tr:hover > * {
    background-color: var(--bg-card-hover);
}

.table-bordered {
    border: 1px solid var(--border-color);
}

.table-bordered > :not(caption) > * > * {
    border: 1px solid var(--border-color);
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.table-responsive .table {
    margin-bottom: 0;
    border-radius: 0;
}

/* Table Dark Header */
.table-dark,
thead.table-dark {
    background-color: var(--dark);
    color: #fff;
}

thead.table-dark th {
    background-color: var(--dark);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.1);
}

/* =====================================================
   Bootstrap-Compatible Utilities
===================================================== */
/* Spacing */
.m-0 { margin: 0 !important; }
.m-1 { margin: 0.25rem !important; }
.m-2 { margin: 0.5rem !important; }
.m-3 { margin: 1rem !important; }
.m-4 { margin: 1.5rem !important; }
.m-5 { margin: 3rem !important; }

.mx-auto { margin-right: auto !important; margin-left: auto !important; }
.my-0 { margin-top: 0 !important; margin-bottom: 0 !important; }
.my-1 { margin-top: 0.25rem !important; margin-bottom: 0.25rem !important; }
.my-2 { margin-top: 0.5rem !important; margin-bottom: 0.5rem !important; }
.my-3 { margin-top: 1rem !important; margin-bottom: 1rem !important; }
.my-4 { margin-top: 1.5rem !important; margin-bottom: 1.5rem !important; }
.my-5 { margin-top: 3rem !important; margin-bottom: 3rem !important; }

.me-1 { margin-left: 0.25rem !important; }
.me-2 { margin-left: 0.5rem !important; }
.me-3 { margin-left: 1rem !important; }
.me-4 { margin-left: 1.5rem !important; }
.me-auto { margin-left: auto !important; }

.ms-1 { margin-right: 0.25rem !important; }
.ms-2 { margin-right: 0.5rem !important; }
.ms-3 { margin-right: 1rem !important; }
.ms-4 { margin-right: 1.5rem !important; }
.ms-auto { 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: 3rem !important; }

.px-0 { padding-right: 0 !important; padding-left: 0 !important; }
.px-1 { padding-right: 0.25rem !important; padding-left: 0.25rem !important; }
.px-2 { padding-right: 0.5rem !important; padding-left: 0.5rem !important; }
.px-3 { padding-right: 1rem !important; padding-left: 1rem !important; }
.px-4 { padding-right: 1.5rem !important; padding-left: 1.5rem !important; }

.py-0 { padding-top: 0 !important; padding-bottom: 0 !important; }
.py-1 { padding-top: 0.25rem !important; padding-bottom: 0.25rem !important; }
.py-2 { padding-top: 0.5rem !important; padding-bottom: 0.5rem !important; }
.py-3 { padding-top: 1rem !important; padding-bottom: 1rem !important; }
.py-4 { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }

.pe-1 { padding-left: 0.25rem !important; }
.pe-2 { padding-left: 0.5rem !important; }
.pe-3 { padding-left: 1rem !important; }

.ps-1 { padding-right: 0.25rem !important; }
.ps-2 { padding-right: 0.5rem !important; }
.ps-3 { padding-right: 1rem !important; }

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

.text-lowercase { text-transform: lowercase !important; }
.text-uppercase { text-transform: uppercase !important; }
.text-capitalize { text-transform: capitalize !important; }

.fw-light { font-weight: 300 !important; }
.fw-normal { font-weight: 400 !important; }
.fw-medium { font-weight: 500 !important; }
.fw-semibold { font-weight: 600 !important; }
.fw-bold { font-weight: 700 !important; }

.fs-1 { font-size: 2.5rem !important; }
.fs-2 { font-size: 2rem !important; }
.fs-3 { font-size: 1.75rem !important; }
.fs-4 { font-size: 1.5rem !important; }
.fs-5 { font-size: 1.25rem !important; }
.fs-6 { font-size: 1rem !important; }

.text-decoration-none { text-decoration: none !important; }
.text-decoration-underline { text-decoration: underline !important; }

/* Colors */
.text-primary { color: var(--primary) !important; }
.text-secondary { 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-light { color: var(--light) !important; }
.text-dark { color: var(--dark) !important; }
.text-muted { color: var(--gray-500) !important; }
.text-white { color: #fff !important; }

.bg-primary { background-color: var(--primary) !important; }
.bg-secondary { background-color: var(--secondary) !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-card) !important; }
.bg-dark { background-color: var(--dark) !important; }
.bg-white { background-color: var(--bg-card) !important; }
.bg-transparent { background-color: transparent !important; }

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

@media (min-width: 576px) {
    .d-sm-none { display: none !important; }
    .d-sm-block { display: block !important; }
    .d-sm-flex { display: flex !important; }
}

@media (min-width: 768px) {
    .d-md-none { display: none !important; }
    .d-md-block { display: block !important; }
    .d-md-flex { display: flex !important; }
}

@media (min-width: 992px) {
    .d-lg-none { display: none !important; }
    .d-lg-block { display: block !important; }
    .d-lg-flex { display: flex !important; }
}

/* Flexbox */
.flex-row { flex-direction: row !important; }
.flex-column { flex-direction: column !important; }
.flex-row-reverse { flex-direction: row-reverse !important; }
.flex-column-reverse { flex-direction: column-reverse !important; }

.flex-wrap { flex-wrap: wrap !important; }
.flex-nowrap { flex-wrap: nowrap !important; }

.flex-grow-0 { flex-grow: 0 !important; }
.flex-grow-1 { flex-grow: 1 !important; }

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

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

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

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

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

/* Borders */
.border { border: 1px solid var(--gray-200) !important; }
.border-0 { border: 0 !important; }
.border-top { border-top: 1px solid var(--gray-200) !important; }
.border-end { border-left: 1px solid var(--gray-200) !important; }
.border-bottom { border-bottom: 1px solid var(--gray-200) !important; }
.border-start { border-right: 1px solid var(--gray-200) !important; }

.border-primary { border-color: var(--primary) !important; }
.border-secondary { border-color: var(--secondary) !important; }
.border-success { border-color: var(--success) !important; }
.border-danger { border-color: var(--danger) !important; }

.rounded { border-radius: var(--border-radius-sm) !important; }
.rounded-0 { border-radius: 0 !important; }
.rounded-1 { border-radius: 4px !important; }
.rounded-2 { border-radius: 8px !important; }
.rounded-3 { border-radius: 12px !important; }
.rounded-circle { border-radius: 50% !important; }
.rounded-pill { border-radius: 50rem !important; }

/* Sizing */
.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-25 { height: 25% !important; }
.h-50 { height: 50% !important; }
.h-75 { height: 75% !important; }
.h-100 { height: 100% !important; }
.h-auto { height: auto !important; }

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

/* Font Sizes */
.fs-12 { font-size: 0.75rem !important; }
.fs-14 { font-size: 0.875rem !important; }
.fs-16 { font-size: 1rem !important; }
.fs-18 { font-size: 1.125rem !important; }
.fs-20 { font-size: 1.25rem !important; }
.fs-24 { font-size: 1.5rem !important; }
.fs-28 { font-size: 1.75rem !important; }
.fs-32 { font-size: 2rem !important; }
.fs-36 { font-size: 2.25rem !important; }
.fs-40 { font-size: 2.5rem !important; }

/* Font Weights */
.font-w300, .fw-light { font-weight: 300 !important; }
.font-w400, .fw-normal { font-weight: 400 !important; }
.font-w500, .fw-medium { font-weight: 500 !important; }
.font-w600, .fw-semibold { font-weight: 600 !important; }
.font-w700, .fw-bold { font-weight: 700 !important; }
.font-w800, .fw-bolder { font-weight: 800 !important; }

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

.top-0 { top: 0 !important; }
.top-50 { top: 50% !important; }
.top-100 { top: 100% !important; }

.bottom-0 { bottom: 0 !important; }
.bottom-50 { bottom: 50% !important; }
.bottom-100 { bottom: 100% !important; }

.start-0 { right: 0 !important; }
.start-50 { right: 50% !important; }
.start-100 { right: 100% !important; }

.end-0 { left: 0 !important; }
.end-50 { left: 50% !important; }
.end-100 { left: 100% !important; }

.translate-middle {
    transform: translate(50%, -50%) !important;
}

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

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

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

/* Other */
.img-fluid { max-width: 100%; height: auto; }
.img-thumbnail {
    padding: 0.25rem;
    background-color: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-sm);
    max-width: 100%;
    height: auto;
}

hr {
    margin: 1.5rem 0;
    color: inherit;
    border: 0;
    border-top: 1px solid var(--gray-200);
    opacity: 1;
}

small,
.small {
    font-size: 0.875em;
}

/* =====================================================
   Bootstrap-Compatible Badges
===================================================== */
.badge {
    display: inline-block;
    padding: 0.35em 0.65em;
    font-size: 0.75em;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 50px;
}

.bg-primary.badge { background-color: var(--primary) !important; color: #fff; }
.bg-secondary.badge { background-color: var(--secondary) !important; color: #fff; }
.bg-success.badge { background-color: var(--success) !important; color: #fff; }
.bg-danger.badge { background-color: var(--danger) !important; color: #fff; }
.bg-warning.badge { background-color: var(--warning) !important; color: #000; }
.bg-info.badge { background-color: var(--info) !important; color: #fff; }
.bg-light.badge { background-color: var(--bg-card) !important; color: var(--text-primary); }
.bg-dark.badge { background-color: var(--dark) !important; color: #fff; }

/* =====================================================
   Bootstrap-Compatible Alerts
===================================================== */
.alert {
    position: relative;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.alert-primary {
    color: #084298;
    background-color: #cfe2ff;
    border-color: #b6d4fe;
}

.alert-secondary {
    color: #41464b;
    background-color: #e2e3e5;
    border-color: #d3d6d8;
}

.alert-success {
    color: #0f5132;
    background-color: #d1e7dd;
    border-color: #badbcc;
}

.alert-danger {
    color: #842029;
    background-color: #f8d7da;
    border-color: #f5c2c7;
}

.alert-warning {
    color: #664d03;
    background-color: #fff3cd;
    border-color: #ffecb5;
}

.alert-info {
    color: #055160;
    background-color: #cff4fc;
    border-color: #b6effb;
}

.alert-dismissible {
    padding-left: 3rem;
}

.alert-dismissible .btn-close {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    padding: 1.25rem 1rem;
}

/* =====================================================
   Bootstrap-Compatible Modals
===================================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1055;
    display: none;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    outline: 0;
    background: rgba(0, 0, 0, 0.5);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-dialog {
    position: relative;
    width: auto;
    margin: 1.75rem auto;
    pointer-events: none;
    max-width: 500px;
}

.modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    pointer-events: auto;
    background-color: var(--bg-card);
    background-clip: padding-box;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    outline: 0;
    box-shadow: var(--shadow-lg);
}

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

.modal-title {
    margin-bottom: 0;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.5;
    color: var(--text-primary);
}

.modal-body {
    position: relative;
    flex: 1 1 auto;
    padding: 1.5rem;
    color: var(--text-primary);
}

.modal-footer {
    display: flex;
    flex-wrap: wrap;
    flex-shrink: 0;
    align-items: center;
    justify-content: flex-end;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    gap: 0.5rem;
}

.btn-close {
    box-sizing: content-box;
    width: 1em;
    height: 1em;
    padding: 0.25em 0.25em;
    color: var(--text-secondary);
    background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e") center/1em auto no-repeat;
    border: 0;
    border-radius: 0.375rem;
    opacity: 0.5;
    cursor: pointer;
}

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

/* =====================================================
   Bootstrap-Compatible Input Groups
===================================================== */
.input-group {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    width: 100%;
}

.input-group > .form-control,
.input-group > .form-select {
    position: relative;
    flex: 1 1 auto;
    width: 1%;
    min-width: 0;
}

.input-group > .form-control:focus,
.input-group > .form-select:focus {
    z-index: 3;
}

.input-group-text {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--text-secondary);
    text-align: center;
    white-space: nowrap;
    background-color: var(--bg-table-header);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
}

.input-group:not(.has-validation) > :not(:last-child):not(.dropdown-toggle):not(.dropdown-menu),
.input-group:not(.has-validation) > .dropdown-toggle:nth-last-child(n+3) {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.input-group > :not(:first-child):not(.dropdown-menu):not(.valid-tooltip):not(.valid-feedback):not(.invalid-tooltip):not(.invalid-feedback) {
    margin-right: -2px;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

/* =====================================================
   Avatar Upload Styling
===================================================== */
.avatar-upload {
    position: relative;
    display: inline-block;
}

.avatar-upload img {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border: 4px solid var(--border-color);
    box-shadow: var(--shadow);
}

/* =====================================================
   Enhanced Mobile Responsive Styles
===================================================== */

/* Mobile Breakpoint: 991px and below */
@media (max-width: 991px) {
    /* Header adjustments */
    .sca-header {
        padding: 0.75rem 1rem;
    }

    .sca-header-title h1 {
        font-size: 1.1rem;
    }

    .sca-header-user-info {
        display: none;
    }

    .sca-header-actions {
        gap: 0.5rem;
    }

    .sca-header-action {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    /* Content adjustments */
    .sca-content {
        padding: 1rem;
        overflow-x: hidden;
    }

    .sca-container {
        padding: 0;
        max-width: 100%;
        overflow-x: hidden;
    }

    /* Force table responsive */
    .table-responsive,
    .sca-table-wrapper {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Cards full width */
    .card {
        margin-left: 0;
        margin-right: 0;
        border-radius: 0.5rem;
    }

    /* Row no negative margins on mobile */
    .row {
        margin-left: -0.5rem;
        margin-right: -0.5rem;
    }

    .row > * {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    /* Stats grid */
    .sca-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    /* Card adjustments */
    .sca-card {
        border-radius: 12px;
    }

    .sca-card-header {
        padding: 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

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

    /* Table responsive */
    .sca-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .sca-table {
        min-width: 600px;
    }

    .sca-table th,
    .sca-table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
        white-space: nowrap;
    }

    /* Buttons */
    .sca-btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }

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

    /* Form controls */
    .sca-form-control {
        padding: 0.625rem 0.875rem;
        font-size: 0.9rem;
    }

    /* Page title */
    .sca-page-title {
        font-size: 1.25rem;
    }

    /* Toolbar */
    .sca-toolbar {
        flex-direction: column;
        gap: 0.75rem;
    }

    .sca-toolbar-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .sca-toolbar-actions .sca-btn {
        flex: 1;
        min-width: calc(50% - 0.375rem);
    }

    /* Modal */
    .sca-modal-dialog {
        margin: 0.5rem;
        max-height: calc(100vh - 1rem);
    }

    .sca-modal-content {
        border-radius: 12px;
    }

    /* Dropdown */
    .sca-dropdown-menu {
        min-width: 200px;
    }

    /* Alert */
    .sca-alert {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    /* Breadcrumb */
    .sca-breadcrumb {
        font-size: 0.85rem;
        flex-wrap: wrap;
    }
}

/* Small mobile: 576px and below */
@media (max-width: 576px) {
    /* Stats grid to single column */
    .sca-stats-grid {
        grid-template-columns: 1fr;
    }

    /* Stat card */
    .sca-stat-card {
        padding: 1rem;
    }

    .sca-stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .sca-stat-value {
        font-size: 1.5rem;
    }

    /* Full width buttons */
    .sca-toolbar-actions .sca-btn {
        min-width: 100%;
    }

    /* Header */
    .sca-header-title h1 {
        font-size: 1rem;
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Hide some header actions */
    .sca-header-action:not(:last-child) {
        display: none;
    }

    /* Card */
    .sca-card-header {
        padding: 0.875rem;
    }

    .sca-card-body {
        padding: 0.875rem;
    }

    /* Table minimum width for very small screens */
    .sca-table {
        min-width: 500px;
        font-size: 0.8rem;
    }

    /* Form layout */
    .sca-form-row {
        flex-direction: column;
    }

    .sca-form-row > * {
        width: 100%;
    }

    /* Action buttons in table */
    .sca-actions {
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    .sca-actions .sca-btn-icon {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }

    /* Footer */
    .sca-footer {
        padding: 1rem;
    }

    .sca-footer-content {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    /* Modal */
    .sca-modal-dialog {
        margin: 0.25rem;
    }

    .sca-modal-header,
    .sca-modal-body,
    .sca-modal-footer {
        padding: 1rem;
    }

    /* Quick stats in dashboard */
    .sca-quick-stats {
        flex-direction: column;
    }

    .sca-quick-stat {
        width: 100%;
    }
}

/* Extra small mobile: 360px and below */
@media (max-width: 360px) {
    .sca-content {
        padding: 0.75rem;
    }

    .sca-card-header,
    .sca-card-body {
        padding: 0.75rem;
    }

    .sca-header-title h1 {
        max-width: 100px;
        font-size: 0.9rem;
    }

    .sca-sidebar-toggle {
        width: 36px;
        height: 36px;
    }
}

/* Touch-friendly adjustments */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    .sca-btn {
        min-height: 44px;
    }

    .sca-form-control,
    .sca-select {
        min-height: 44px;
    }

    .sca-nav-item {
        min-height: 48px;
    }

    .sca-table td,
    .sca-table th {
        padding: 0.875rem 0.5rem;
    }

    /* Remove hover effects */
    .sca-btn:hover {
        transform: none;
    }

    .sca-card:hover {
        transform: none;
    }
}

/* Landscape phone */
@media (max-width: 896px) and (orientation: landscape) {
    .sca-sidebar {
        width: 260px;
    }

    .sca-modal-dialog {
        max-height: calc(100vh - 2rem);
        margin: 1rem auto;
    }

    .sca-modal-body {
        max-height: calc(100vh - 150px);
        overflow-y: auto;
    }
}

/* Safe area for notched phones */
@supports (padding: max(0px)) {
    .sca-header {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }

    .sca-content {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }

    .sca-sidebar {
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }
}

/* Hide scrollbar but keep functionality */
.sca-table-wrapper::-webkit-scrollbar {
    height: 4px;
}

.sca-table-wrapper::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 4px;
}

.sca-table-wrapper::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 4px;
}

.sca-table-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* Mobile-specific utility classes */
@media (max-width: 991px) {
    .hide-mobile { display: none !important; }
    .show-mobile { display: block !important; }
    .show-mobile-flex { display: flex !important; }
    .show-mobile-inline { display: inline !important; }
}

@media (min-width: 992px) {
    .hide-desktop { display: none !important; }
    .show-desktop { display: block !important; }
    .show-desktop-flex { display: flex !important; }
}

/* Text truncation for mobile */
.text-truncate-mobile {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (min-width: 768px) {
    .text-truncate-mobile {
        max-width: none;
    }
}

/* =====================================================
   Page-Specific Mobile Responsive Fixes
===================================================== */

/* Schedule Page Mobile */
@media (max-width: 768px) {
    .schedule-table th,
    .schedule-table td {
        min-width: 100px !important;
        font-size: 0.75rem;
    }

    .schedule-slot {
        padding: 6px !important;
    }

    .schedule-slot .slot-time {
        font-size: 11px;
    }

    .schedule-slot .slot-group {
        font-size: 12px;
    }

    .schedule-slot .slot-classroom,
    .schedule-slot .slot-students {
        font-size: 10px;
    }

    .schedule-slot .slot-actions .btn {
        padding: 2px 4px !important;
        font-size: 10px;
    }
}

/* Generic page header responsive */
@media (max-width: 768px) {
    .d-flex.justify-content-between.align-items-center.mb-4 {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 1rem;
    }

    .d-flex.justify-content-between.align-items-center.mb-4 h4 {
        text-align: center;
        margin-bottom: 0.5rem;
    }

    .d-flex.justify-content-between.align-items-center.mb-4 .d-flex.gap-2 {
        flex-wrap: wrap;
        justify-content: center;
    }

    .d-flex.justify-content-between.align-items-center.mb-4 .btn {
        flex: 1 1 auto;
        min-width: 120px;
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
    }
}

/* Card header responsive fix */
@media (max-width: 576px) {
    .card-header.d-flex {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.75rem;
    }

    .card-header .btn {
        width: 100%;
    }
}

/* Table responsive improvements */
@media (max-width: 576px) {
    .table-responsive {
        margin: 0 -1rem;
        padding: 0 1rem;
    }

    .table th,
    .table td {
        padding: 0.5rem 0.4rem;
        font-size: 0.8rem;
    }

    .table .btn-group {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .table .btn-group .btn {
        border-radius: 4px !important;
    }

    /* Hide less important columns on mobile */
    .table th:nth-child(1),
    .table td:nth-child(1) {
        display: none;
    }
}

/* Button group responsive */
@media (max-width: 576px) {
    .btn-group-sm > .btn {
        padding: 0.25rem 0.4rem;
        font-size: 0.75rem;
    }
}

/* Events sidebar responsive */
@media (max-width: 991px) {
    .col-lg-4 .card {
        margin-bottom: 1rem;
    }

    .event-item {
        padding: 0.75rem !important;
    }

    .event-date {
        min-width: 40px !important;
        padding: 0.4rem !important;
        font-size: 0.8rem;
    }

    .event-info strong {
        font-size: 0.85rem;
    }

    .event-info small {
        font-size: 0.7rem;
    }
}

/* Flex wrap helper for buttons */
@media (max-width: 576px) {
    .gap-2 {
        gap: 0.4rem !important;
    }

    .d-flex.gap-2 {
        flex-wrap: wrap;
    }

    .d-flex.gap-2 > .btn {
        flex: 1 1 calc(50% - 0.4rem);
        min-width: 0;
    }
}

/* Quick actions card mobile */
@media (max-width: 991px) {
    .d-grid.gap-2 .btn {
        padding: 0.5rem;
        font-size: 0.85rem;
    }
}

/* Custom width utilities for sm breakpoint */
@media (min-width: 576px) {
    .w-sm-auto { width: auto !important; }
    .w-sm-100 { width: 100% !important; }
    .w-sm-50 { width: 50% !important; }
}

/* Visibility utilities */
.d-sm-none { display: none; }
@media (min-width: 576px) {
    .d-sm-none { display: none !important; }
    .d-none.d-sm-inline { display: inline !important; }
    .d-none.d-sm-block { display: block !important; }
}

/* Mobile table column hiding */
@media (max-width: 576px) {
    .hide-on-mobile { display: none !important; }
}

/* =====================================================
   PWA Install Banner
===================================================== */
.pwa-install-banner {
    position: fixed;
    bottom: -100%;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 1rem;
    z-index: 9999;
    transition: bottom 0.3s ease;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
}

.pwa-install-banner.show {
    bottom: 0;
}

.pwa-install-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

.pwa-install-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pwa-install-icon i {
    font-size: 1.5rem;
    color: white;
}

.pwa-install-text {
    flex: 1;
    color: white;
}

.pwa-install-text strong {
    display: block;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.pwa-install-text span {
    font-size: 0.85rem;
    opacity: 0.9;
}

.pwa-install-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.pwa-btn {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

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

.pwa-btn-primary:hover {
    background: #f0f0f0;
    transform: translateY(-1px);
}

.pwa-btn-secondary {
    background: transparent;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.pwa-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Offline indicator */
body.is-offline::before {
    content: 'غير متصل بالإنترنت';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--warning);
    color: white;
    text-align: center;
    padding: 0.5rem;
    font-size: 0.85rem;
    z-index: 10000;
}

body.is-offline .sca-main {
    padding-top: 2.5rem;
}

/* PWA Mobile Responsive */
@media (max-width: 576px) {
    .pwa-install-content {
        flex-wrap: wrap;
    }

    .pwa-install-icon {
        width: 40px;
        height: 40px;
    }

    .pwa-install-text {
        flex: 1;
        min-width: 150px;
    }

    .pwa-install-text strong {
        font-size: 0.9rem;
    }

    .pwa-install-text span {
        font-size: 0.8rem;
    }

    .pwa-install-actions {
        width: 100%;
        justify-content: stretch;
    }

    .pwa-btn {
        flex: 1;
        text-align: center;
    }
}

/* =====================================================
   ✨ SOFT MODERN REDESIGN (v1.8.0)
   Overrides at end of cascade — light sidebar, soft
   colored shadows, larger radii, polished components.
   To revert sidebar to dark: change --bg-sidebar back to
   #1e293b, --text-sidebar to #fff, and remove the
   ".sca-sidebar (light)" block below.
===================================================== */

/* ---- Phosphor icon alignment, sizes, spin ---- */
.ph { vertical-align: -0.125em; line-height: 1; }
/* Keep legacy FA size/spin utility classes working on Phosphor icons */
.fa-lg { font-size: 1.25em; }
.fa-2x { font-size: 1.5em; }
.fa-3x { font-size: 2em; }
.fa-4x { font-size: 2.5em; }
.fa-5x { font-size: 3em; }
@keyframes sca-spin { to { transform: rotate(360deg); } }
.sca-spin, .fa-spin { display: inline-block; animation: sca-spin 0.8s linear infinite; }

/* ---- Sidebar: dark → light ---- */
.sca-sidebar {
    background: var(--bg-sidebar) !important;
    border-left: 1px solid var(--border-color);   /* RTL: sidebar on right, border on its left edge */
    box-shadow: -2px 0 16px rgba(15, 23, 42, 0.03);
}
.sca-sidebar-header { border-bottom: 1px solid var(--border-light); }
.sca-logo-icon { background: transparent; }
.sca-sidebar-close { color: var(--gray-400); }
.sca-sidebar-close:hover { color: var(--primary); }

.sca-sidebar-user { border-bottom: 1px solid var(--border-light); }
.sca-sidebar-user-avatar img { border-color: var(--border-color); }
.sca-sidebar-user-info h4 { color: var(--text-primary); }
.sca-sidebar-footer { border-top: 1px solid var(--border-light); }

.sca-sidebar-subscription {
    background: var(--gray-50);
    border: 1px solid var(--border-color);
}
.sca-sidebar-subscription:hover { background: var(--primary-soft); border-color: var(--primary-light); }
.sca-subscription-days { color: var(--text-muted); }
.sca-subscription-arrow { color: var(--text-muted); }
.sca-sidebar-subscription:hover .sca-subscription-arrow { color: var(--primary); }

.sca-nav::-webkit-scrollbar-track { background: var(--gray-100); }
.sca-nav::-webkit-scrollbar-thumb { background: var(--gray-300); }
.sca-nav::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }
.sca-nav { scrollbar-color: var(--gray-300) var(--gray-100); }

.sca-nav-item { color: var(--text-secondary); border-radius: 0; }
.sca-nav-item:hover { background: var(--gray-100); color: var(--text-primary); }
.sca-nav-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.sca-nav-item i, .sca-nav-item .ph { color: inherit; }
.sca-nav-subitem { color: var(--text-secondary); }
.sca-nav-subitem:hover { color: var(--primary); }
.sca-nav-subitem.active { color: var(--primary); font-weight: 600; }
.sca-nav-divider { background: var(--border-light); }
.sca-nav-label { color: var(--text-muted); }

/* ---- Cards: soft shadows + larger radius ---- */
.card, .sca-card {
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-soft);
}
.card:hover, .sca-card:hover { box-shadow: var(--shadow); }
.card-header { border-bottom: 1px solid var(--border-light); background: transparent; }

/* ---- Buttons: rounder + soft shadow ---- */
.btn, .sca-btn { border-radius: var(--border-radius-sm); }
.btn-primary, .sca-btn-primary { box-shadow: 0 4px 12px rgba(37, 99, 235, 0.18); }
.btn-primary:hover, .sca-btn-primary:hover { box-shadow: 0 6px 18px rgba(37, 99, 235, 0.26); }
.btn-success { box-shadow: 0 4px 12px rgba(34, 197, 94, 0.18); }
.btn-danger { box-shadow: 0 4px 12px rgba(239, 68, 68, 0.18); }

/* ---- Header: soft bottom shadow ---- */
.sca-header {
    border-bottom: 1px solid var(--border-light);
    box-shadow: 0 1px 8px rgba(15, 23, 42, 0.04);
}

/* ---- Header action buttons: labeled pills (v1.8.2) ---- */
.sca-header-action {
    width: auto;
    height: 42px;
    padding: 0 1rem;
    gap: 0.5rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
    background: var(--gray-100);
    color: var(--text-secondary);
    white-space: nowrap;
}
.sca-header-action .ph { font-size: 1.2rem; flex-shrink: 0; }
.sca-header-action:hover {
    background: var(--primary-soft);
    color: var(--primary);
    transform: translateY(-1px);
}
/* Primary quick-action (record attendance) — filled blue */
.sca-header-action--primary {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.22);
}
.sca-header-action--primary:hover {
    background: var(--gradient-primary);
    color: #fff;
    filter: brightness(1.05);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.30);
}
/* Tour launcher — soft tinted */
.sca-header-action--help {
    background: var(--primary-soft);
    color: var(--primary);
}
.sca-header-action--help:hover { background: var(--primary); color: #fff; }

/* Roomier header bar */
.sca-header-actions { gap: 0.6rem; }
.sca-header-title h1 { font-weight: 700; }

/* Collapse to icon-only on tablet/mobile */
@media (max-width: 991px) {
    .sca-header-action { width: 42px; padding: 0; justify-content: center; }
    .sca-header-action-label { display: none; }
}

/* ---- Tables: roomier + soft ---- */
.table > :not(caption) > * > *, .sca-table td, .sca-table th { padding-top: 0.9rem; padding-bottom: 0.9rem; }
.table thead th, .sca-table thead th { background: var(--bg-table-header); border-bottom: 1px solid var(--border-color); color: var(--text-secondary); }
.table tbody tr:hover, .sca-table tbody tr:hover { background: var(--gray-50); }

/* ---- Forms: rounder + soft focus ---- */
.form-control, .form-select, .sca-form-control {
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
}
.form-control:focus, .form-select:focus, .sca-form-control:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.10);
}

/* ---- Badges + alerts: softer ---- */
.badge { border-radius: 8px; font-weight: 600; }
.alert, .sca-alert { border-radius: var(--border-radius-sm); }

/* ---- Stat cards: softer shadow ---- */
.sca-stat-card { box-shadow: var(--shadow); border-radius: var(--border-radius); }
.sca-stat-card:hover { box-shadow: var(--shadow-md); }

/* =========================================================
   GROUP STAT CARDS (v1.9.0 — Task 1: كروت إحصائية للمجموعات)
   ========================================================= */
.sca-group-card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}
.sca-group-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
    border-color: var(--primary-light);
}

/* Head */
.sca-group-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .5rem;
    margin-bottom: 1rem;
}
.sca-group-card-title { min-width: 0; }
.sca-group-name {
    display: block;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-primary);
    text-decoration: none;
    line-height: 1.4;
}
.sca-group-name:hover { color: var(--primary); }
.sca-group-classroom {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    margin-top: .25rem;
    font-size: .82rem;
    color: var(--text-secondary);
}
.sca-group-classroom i { color: var(--primary); font-size: 1em; }

/* Next session bar */
.sca-group-next {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .65rem .85rem;
    margin-bottom: 1rem;
    border-radius: var(--border-radius-sm);
    background: var(--primary-soft, #eff4ff);
    color: var(--primary-dark);
}
.sca-group-next > i { font-size: 1.4rem; flex-shrink: 0; }
.sca-group-next-text { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.sca-group-next-label { font-size: .72rem; opacity: .8; }
.sca-group-next-value { font-size: .92rem; font-weight: 700; }
.sca-group-next.is-today {
    background: rgba(34, 197, 94, .12);
    color: #15803d;
}
.sca-group-next.is-empty {
    background: var(--gray-50, #f8fafc);
    color: var(--text-muted);
}
.sca-group-next.is-empty > i { color: var(--text-muted); }

/* Stats grid (2 x 2) */
.sca-group-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: .6rem;
    margin-bottom: 1rem;
}
.sca-gstat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: .7rem .4rem;
    border-radius: var(--border-radius-sm);
    background: var(--gray-50, #f8fafc);
}
.sca-gstat i { font-size: 1.25rem; margin-bottom: .2rem; color: var(--text-muted); }
.sca-gstat-num { font-size: 1.15rem; font-weight: 800; color: var(--text-primary); line-height: 1.1; }
.sca-gstat-lbl { font-size: .72rem; color: var(--text-secondary); margin-top: .15rem; }
/* Stat color variants */
.sca-gstat.is-primary  { background: rgba(37, 99, 235, .08); }
.sca-gstat.is-primary  i, .sca-gstat.is-primary  .sca-gstat-num { color: var(--primary); }
.sca-gstat.is-success  { background: rgba(34, 197, 94, .10); }
.sca-gstat.is-success  i, .sca-gstat.is-success  .sca-gstat-num { color: #16a34a; }
.sca-gstat.is-warning  { background: rgba(245, 158, 11, .12); }
.sca-gstat.is-warning  i, .sca-gstat.is-warning  .sca-gstat-num { color: #d97706; }
.sca-gstat.is-danger   { background: rgba(239, 68, 68, .10); }
.sca-gstat.is-danger   i, .sca-gstat.is-danger   .sca-gstat-num { color: #dc2626; }
.sca-gstat.is-muted    { background: var(--gray-50, #f8fafc); }

/* Capacity badge (card head) */
.sca-group-badge {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    flex-shrink: 0;
    padding: .25rem .55rem;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 700;
    white-space: nowrap;
}
.sca-group-badge i { font-size: 1em; }
.sca-group-badge.is-full { background: rgba(239, 68, 68, .12); color: #dc2626; }
.sca-group-badge.is-near { background: rgba(245, 158, 11, .15); color: #d97706; }

/* Capacity bar */
.sca-group-capacity { margin-bottom: 1rem; }
.sca-group-capacity-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: .78rem;
    color: var(--text-secondary);
    margin-bottom: .35rem;
}
.sca-group-capacity-head i { color: var(--text-muted); }
.sca-cap-count { font-weight: 700; color: var(--text-primary); }
.sca-cap-track {
    height: 8px;
    border-radius: 999px;
    background: var(--gray-100, #f1f5f9);
    overflow: hidden;
}
.sca-cap-fill {
    height: 100%;
    border-radius: 999px;
    background: var(--primary);
    transition: width .3s ease;
}
.sca-cap-ok   .sca-cap-fill { background: #16a34a; }
.sca-cap-near .sca-cap-fill { background: #d97706; }
.sca-cap-full .sca-cap-fill { background: #dc2626; }

/* Actions */
.sca-group-actions {
    display: flex;
    gap: .5rem;
    margin-top: auto;
    padding-top: .25rem;
}
.sca-group-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    padding: .5rem .6rem;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
    background: #fff;
    color: var(--text-secondary);
    font-size: .85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all .15s ease;
}
.sca-group-btn i { font-size: 1.05rem; }
.sca-group-btn:hover {
    background: var(--primary-soft, #eff4ff);
    border-color: var(--primary-light);
    color: var(--primary);
}
.sca-group-btn.is-icon { flex: 0 0 auto; }
.sca-group-btn.is-danger { flex: 0 0 auto; }
.sca-group-btn.is-danger:hover {
    background: rgba(239, 68, 68, .10);
    border-color: #fca5a5;
    color: #dc2626;
}

/* =========================================================
   BULK MOVE STUDENTS BAR (v1.9.0 — Task 2)
   ========================================================= */
.sca-bulk-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
    padding: .75rem 1rem;
    margin-bottom: 1rem;
    border-radius: var(--border-radius-sm);
    background: var(--primary-soft, #eff4ff);
    border: 1px solid var(--primary-light);
    box-shadow: var(--shadow-sm);
}
.sca-bulk-info {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    font-weight: 700;
    color: var(--primary-dark);
}
.sca-bulk-info i { font-size: 1.25rem; }
.sca-bulk-actions {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}
.sca-bulk-actions .form-select { min-width: 220px; }

/* =========================================================================
   استكمال أدوات المسافات (Spacing utilities) الناقصة
   كانت العائلات الاتجاهية تقف عند المستوى 4، و mx-/pt-/pb- غير موجودة إطلاقًا،
   فكلاسات مثل mt-5/mb-5/pt-4/mx-3 لم تكن تعمل. نضيف الناقص فقط (لا نلمس
   التعريفات القائمة) بنفس مقياس كل عائلة + المستوى 5 = 3rem لكل العائلات.
   ========================================================================= */
/* هوامش اتجاهية — المستوى 5 (top/bottom/start=يمين/end=يسار) */
.mt-5 { margin-top: 3rem !important; }
.mb-5 { margin-bottom: 3rem !important; }
.ms-0 { margin-right: 0 !important; }
.ms-5 { margin-right: 3rem !important; }
.me-0 { margin-left: 0 !important; }
.me-5 { margin-left: 3rem !important; }
/* margin-x (يمين+يسار) — كانت غير موجودة */
.mx-0 { margin-right: 0 !important; margin-left: 0 !important; }
.mx-1 { margin-right: 0.25rem !important; margin-left: 0.25rem !important; }
.mx-2 { margin-right: 0.5rem !important; margin-left: 0.5rem !important; }
.mx-3 { margin-right: 1rem !important; margin-left: 1rem !important; }
.mx-4 { margin-right: 1.5rem !important; margin-left: 1.5rem !important; }
.mx-5 { margin-right: 3rem !important; margin-left: 3rem !important; }
/* padding اتجاهي علوي/سفلي — كانت غير موجودة (مقياس قياسي) */
.pt-0 { padding-top: 0 !important; }
.pt-1 { padding-top: 0.25rem !important; }
.pt-2 { padding-top: 0.5rem !important; }
.pt-3 { padding-top: 1rem !important; }
.pt-4 { padding-top: 1.5rem !important; }
.pt-5 { padding-top: 3rem !important; }
.pb-0 { padding-bottom: 0 !important; }
.pb-1 { padding-bottom: 0.25rem !important; }
.pb-2 { padding-bottom: 0.5rem !important; }
.pb-3 { padding-bottom: 1rem !important; }
.pb-4 { padding-bottom: 1.5rem !important; }
.pb-5 { padding-bottom: 3rem !important; }
/* استكمال px/py/ps/pe للمستويات الناقصة (0/4/5) */
.px-5 { padding-right: 3rem !important; padding-left: 3rem !important; }
.py-5 { padding-top: 3rem !important; padding-bottom: 3rem !important; }
.ps-0 { padding-right: 0 !important; }
.ps-4 { padding-right: 1.5rem !important; }
.ps-5 { padding-right: 3rem !important; }
.pe-0 { padding-left: 0 !important; }
.pe-4 { padding-left: 1.5rem !important; }
.pe-5 { padding-left: 3rem !important; }

/* =========================================================
   WhatsApp status badge in the header (v1.9.13)
   ========================================================= */
.sca-wa-status {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.7rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    border: 1px solid transparent;
    white-space: nowrap;
    transition: filter .15s ease;
}
.sca-wa-status i { font-size: 1.15rem; }
.sca-wa-status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.sca-wa-status:hover { filter: brightness(0.97); }
.sca-wa-status--connected {
    background: rgba(34, 197, 94, .12); color: #15803d; border-color: rgba(34, 197, 94, .25);
}
.sca-wa-status--connected .sca-wa-status-dot { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .20); }
.sca-wa-status--disconnected {
    background: rgba(239, 68, 68, .10); color: #dc2626; border-color: rgba(239, 68, 68, .25);
}
.sca-wa-status--disconnected .sca-wa-status-dot { background: #ef4444; }
.sca-wa-status--none {
    background: var(--gray-100, #f1f5f9); color: var(--text-secondary); border-color: var(--border-color);
}
.sca-wa-status--none .sca-wa-status-dot { background: var(--text-muted); }
.sca-wa-status--banned {
    background: rgba(245, 158, 11, .14); color: #b45309; border-color: rgba(245, 158, 11, .40);
}
.sca-wa-status--banned .sca-wa-status-dot { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, .22); }
/* at-risk: connected but rising failures before a ban — orange warning */
.sca-wa-status--at-risk {
    background: rgba(249, 115, 22, .14); color: #c2410c; border-color: rgba(249, 115, 22, .40);
}
.sca-wa-status--at-risk .sca-wa-status-dot { background: #f97316; box-shadow: 0 0 0 3px rgba(249, 115, 22, .22); }
/* logged-out: session dead, needs a fresh QR — violet "action needed" */
.sca-wa-status--logged-out {
    background: rgba(124, 58, 237, .12); color: #6d28d9; border-color: rgba(124, 58, 237, .30);
}
.sca-wa-status--logged-out .sca-wa-status-dot { background: #7c3aed; }

/* On narrow screens collapse the badge to icon + dot only (like header actions) */
@media (max-width: 991px) {
    .sca-wa-status-text { display: none; }
    .sca-wa-status { padding: 0.45rem; }
}

/* =========================================================
   MOBILE UX PASS (v1.9.11) — phones (<= 767px)
   ========================================================= */
@media (max-width: 767px) {

    /* ---- Wide tables → stacked cards (added by SCA.initResponsiveTables) ---- */
    table.sca-stacked thead { display: none; }
    table.sca-stacked,
    table.sca-stacked tbody,
    table.sca-stacked tr,
    table.sca-stacked td { display: block; width: 100%; }
    table.sca-stacked tr {
        margin-bottom: 0.85rem;
        border: 1px solid var(--border-color);
        border-radius: var(--border-radius-sm);
        padding: 0.35rem 0.9rem;
        background: #fff;
        box-shadow: var(--shadow-sm);
    }
    table.sca-stacked td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        padding: 0.55rem 0;
        border: none;
        border-bottom: 1px solid var(--gray-100, #f1f5f9);
        min-height: 44px;
        text-align: start;
    }
    table.sca-stacked td:last-child { border-bottom: none; }
    table.sca-stacked td::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--text-secondary);
        font-size: 0.78rem;
        flex: 0 0 auto;
        white-space: nowrap;
    }
    /* cells with no header label (checkbox / actions) get the full width */
    table.sca-stacked td:not([data-label]) { justify-content: flex-start; }
    table.sca-stacked td:not([data-label])::before { content: ""; }
    /* actions cell: label on top, buttons in a full-width wrapping row below */
    table.sca-stacked td.sca-actions-cell {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    table.sca-stacked td .btn-group {
        display: flex;
        flex-flow: row wrap;
        gap: 0.4rem;
        width: 100%;
        justify-content: flex-start;
    }
    table.sca-stacked td .btn-group > .btn {
        flex: 0 0 auto;
        border-radius: var(--border-radius-sm) !important;
        min-width: 42px;
        min-height: 42px;
    }

    /* ---- Attendance grid: name on top, the 4 status radios in one row ---- */
    #attendance_table.sca-stacked tr { display: flex; flex-wrap: wrap; align-items: stretch; }
    #attendance_table.sca-stacked td:not(.text-center) {
        flex: 1 1 100%;
        border-bottom: 1px solid var(--gray-100, #f1f5f9);
    }
    #attendance_table.sca-stacked td[data-label="#"] { display: none; } /* redundant on mobile */
    #attendance_table.sca-stacked td.text-center {
        flex: 1 1 0;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        gap: 0.3rem;
        padding: 0.6rem 0.2rem 0.4rem;
        border-bottom: none;
        text-align: center;
        min-width: 0;
    }
    #attendance_table.sca-stacked td.text-center::before {
        font-size: 0.72rem;
        white-space: nowrap;
    }
    #attendance_table.sca-stacked td.text-center .form-check-input {
        float: none;
        margin: 0;
        width: 24px;
        height: 24px;
    }

    /* ---- Bigger tap targets on phones ---- */
    .btn-group-sm > .btn, .btn-sm { min-height: 38px; min-width: 38px; }
    .sca-content .btn { min-height: 42px; }
    .table .btn-sm, .sca-stacked .btn-sm { min-height: 36px; }

    /* ---- Roomier cards / less wasted padding ---- */
    .card-body { padding: 1rem; }
    .sca-container { padding-left: 0.75rem; padding-right: 0.75rem; }

    /* ---- Card headers with actions: stack neatly ---- */
    .card-header.d-flex { flex-wrap: wrap; gap: 0.5rem; }

    /* ---- Pagination: wrap + center ---- */
    .pagination { flex-wrap: wrap; justify-content: center; }
}

/* ===== Pagination (custom-styled; app.css doesn't ship Bootstrap's) ===== */
.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.pagination .page-item { display: inline-flex; }
.pagination .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 10px;
    background: var(--card-bg, #fff);
    color: var(--text-secondary, #64748b);
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    transition: background .15s, color .15s, border-color .15s;
}
.pagination .page-link:hover {
    background: rgba(var(--primary-rgb, 37, 99, 235), .08);
    border-color: var(--primary, #2563eb);
    color: var(--primary, #2563eb);
}
.pagination .page-item.active .page-link {
    background: var(--primary, #2563eb);
    border-color: var(--primary, #2563eb);
    color: #fff;
}
.pagination .page-item.disabled .page-link {
    background: transparent;
    border-color: transparent;
    color: var(--text-secondary, #94a3b8);
    pointer-events: none;
    cursor: default;
}


/* ============================================================
   المفتاح المقسوم (segmented control)
   ============================================================
   اللوحة مابتحمّلش CSS بوتستراب — بس الـJS بتاعه. يعني
   `nav-pills` و`tab-pane` و`btn-check` بتترسم بلا أي ستايل:
   التبويبات بتطلع نقط، والصفحات بتظهر فوق بعض. الحاجات دي
   اتكتبت هنا بدل ما نستنى بوتستراب مش موجود.

   بيتستخدم في:
   - تبويبات «إعفاء / خصم» في الفاتورة  (أزرار + JS)
   - «مخفي / اختياري / إجباري» في حقول رابط الحجز  (راديو)
   ------------------------------------------------------------ */

.sca-seg {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--gray-100, #f1f5f9);
    border-radius: 12px;
    position: relative;
}

.sca-seg > .sca-seg-btn {
    flex: 1 1 0;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 0;
    padding: 8px 10px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--text-secondary, #64748b);
    font-size: .875rem;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, color .15s, box-shadow .15s;
}

.sca-seg > .sca-seg-btn:hover {
    color: var(--text-primary, #1e293b);
}

/* الحالة المختارة — بالكلاس (أزرار) أو بالراديو المخفي */
.sca-seg > .sca-seg-btn.is-on,
.sca-seg > input[type="radio"]:checked + .sca-seg-btn {
    background: var(--bg-card, #fff);
    color: var(--primary, #2563eb);
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(37, 99, 235, .06));
}

/* الراديو نفسه مخفي، واللابل هو اللي بيتشاف — من غير كده
   بتظهر دواير راديو خام جنب الأزرار. */
.sca-seg > input[type="radio"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
    margin: 0;
}

/* لوحة المفاتيح لازم تفضل شغّالة رغم إخفاء الراديو */
.sca-seg > input[type="radio"]:focus-visible + .sca-seg-btn {
    outline: 2px solid var(--primary, #2563eb);
    outline-offset: 2px;
}

/* نبرة تحذير للاختيار «الخطر» (إجباري) — اختيارية */
.sca-seg > input[type="radio"]:checked + .sca-seg-btn.is-strong {
    color: var(--primary-dark, #1d4ed8);
}

/* الصفحة المرتبطة بالمفتاح */
.sca-seg-pane[hidden] { display: none !important; }

/* شبكة «حقول رابط الحجز» — صف لكل حقل ومفتاح مقسوم جنبه */
.sca-fields-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 10px;
}
.sca-field-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    background: var(--bg-card, #fff);
}
.sca-field-name {
    flex: 1 1 auto;
    min-width: 0;
    font-size: .9rem;
    font-weight: 600;
    color: var(--text-primary, #1e293b);
}
.sca-field-row .sca-seg { flex: 0 0 auto; width: 210px; }

@media (max-width: 420px) {
    .sca-field-row { flex-direction: column; align-items: stretch; gap: 8px; }
    .sca-field-row .sca-seg { width: auto; }
}


/* ============================================================
   أزرار الفترة السريعة
   ============================================================
   شريط صغير فوق فلاتر التاريخ. مقصود إنه خفيف بصريًا — هو اختصار
   مش الفلتر نفسه، وخانتَي التاريخ تحته بتفضل هي المرجع.
   ------------------------------------------------------------ */

.sca-period-quick {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
}

.sca-period-label {
    font-size: .8rem;
    font-weight: 600;
    color: var(--text-secondary, #64748b);
    margin-inline-end: 4px;
}

.sca-period-btn {
    border: 1px solid var(--border-color, #e2e8f0);
    background: var(--bg-card, #fff);
    color: var(--text-secondary, #64748b);
    border-radius: 999px;
    padding: 4px 14px;
    font-size: .8rem;
    font-weight: 600;
    line-height: 1.6;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, color .15s, border-color .15s;
}

.sca-period-btn:hover {
    border-color: var(--primary, #2563eb);
    color: var(--primary, #2563eb);
}

.sca-period-btn.is-on {
    background: var(--primary, #2563eb);
    border-color: var(--primary, #2563eb);
    color: #fff;
}

.sca-period-btn.is-clear {
    border-style: dashed;
}
