:root {
    --scp-primary: #0f2b46;
    --scp-primary-light: #1a3d5c;
    --scp-accent: #0d9488;
    --scp-accent-hover: #0f766e;
    --scp-accent-soft: rgba(13, 148, 136, 0.12);
    --scp-success: #059669;
    --scp-warning: #d97706;
    --scp-danger: #dc2626;
    --scp-info: #0284c7;
    --scp-bg: #f0f4f8;
    --scp-surface: #ffffff;
    --scp-border: #e2e8f0;
    --scp-text: #1e293b;
    --scp-text-muted: #64748b;
    --scp-sidebar-width: 260px;
    --scp-header-height: 56px;
    --scp-radius: 10px;
    --scp-radius-lg: 14px;
    --scp-shadow: 0 1px 2px rgba(15, 43, 70, 0.06), 0 4px 16px rgba(15, 43, 70, 0.08);
    --scp-shadow-lg: 0 10px 36px rgba(15, 43, 70, 0.14);
    --scp-shadow-accent: 0 4px 14px rgba(13, 148, 136, 0.28);
    --scp-font-base: 0.875rem;
    --scp-font-sm: 0.8125rem;
    --scp-font-xs: 0.75rem;
    --scp-control-height: 36px;
    --scp-btn-height: 36px;
    --scp-btn-height-sm: 32px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: var(--scp-font-base);
    color: var(--scp-text);
    background: var(--scp-bg);
    -webkit-font-smoothing: antialiased;
}

/* ─── Auth Layout ─── */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
}

.auth-brand-panel {
    flex: 1;
    background: linear-gradient(145deg, var(--scp-primary) 0%, #0d3d56 50%, var(--scp-accent) 100%);
    color: #fff;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.auth-brand-panel::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 80%;
    height: 150%;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
    pointer-events: none;
}

.auth-brand-panel .brand-logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

.auth-brand-panel .brand-logo span {
    color: #5eead4;
}

.auth-brand-panel h1 {
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.auth-brand-panel p {
    font-size: 1.05rem;
    opacity: 0.9;
    line-height: 1.6;
    max-width: 420px;
    position: relative;
    z-index: 1;
}

.auth-features {
    margin-top: 3rem;
    position: relative;
    z-index: 1;
}

.auth-feature-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.auth-feature-item .icon {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.15);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.auth-feature-item strong {
    display: block;
    margin-bottom: 0.15rem;
}

.auth-feature-item small {
    opacity: 0.8;
    font-size: 0.875rem;
}

.auth-form-panel {
    width: 100%;
    max-width: 520px;
    padding: 2.5rem 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--scp-surface);
}

.auth-form-panel h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.auth-form-panel .subtitle {
    color: var(--scp-text-muted);
    margin-bottom: 2rem;
}

.auth-form-panel .form-label {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--scp-text);
}

.auth-form-panel .form-control {
    border-radius: 8px;
    border-color: var(--scp-border);
    padding: 0.625rem 0.875rem;
}

.auth-form-panel .form-control:focus {
    border-color: var(--scp-accent);
    box-shadow: 0 0 0 3px var(--scp-accent-soft);
}

.btn-scp-primary {
    background: linear-gradient(180deg, #14b8a6 0%, var(--scp-accent) 100%);
    border-color: var(--scp-accent);
    color: #fff;
    font-weight: 600;
    font-size: var(--scp-font-sm);
    min-height: var(--scp-btn-height);
    padding: 0.375rem 0.875rem;
    line-height: 1.25;
    border-radius: 8px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    box-shadow: var(--scp-shadow-accent);
}

.btn-scp-primary:hover {
    background: linear-gradient(180deg, var(--scp-accent) 0%, var(--scp-accent-hover) 100%);
    border-color: var(--scp-accent-hover);
    color: #fff;
    box-shadow: 0 6px 18px rgba(13, 148, 136, 0.35);
}

.btn-scp-outline {
    border: 1px solid var(--scp-border);
    color: var(--scp-text);
    font-weight: 500;
    font-size: var(--scp-font-sm);
    min-height: var(--scp-btn-height);
    padding: 0.375rem 0.875rem;
    line-height: 1.25;
    border-radius: 8px;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.btn-scp-outline:hover {
    background: var(--scp-bg);
    border-color: var(--scp-text-muted);
    color: var(--scp-text);
}

.btn-scp-ghost {
    border: 1px solid transparent;
    color: var(--scp-text-muted);
    font-weight: 500;
    font-size: var(--scp-font-sm);
    min-height: var(--scp-btn-height);
    padding: 0.375rem 0.875rem;
    line-height: 1.25;
    border-radius: 8px;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-scp-ghost:hover {
    background: var(--scp-bg);
    color: var(--scp-text);
}

.portal-page .btn-scp-primary.btn-sm,
.portal-page .btn-scp-outline.btn-sm,
.portal-page .btn-scp-ghost.btn-sm {
    min-height: var(--scp-btn-height-sm);
    padding: 0.25rem 0.625rem;
    font-size: var(--scp-font-xs);
}

.portal-page .form-label {
    font-size: var(--scp-font-sm);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.portal-page .form-control {
    height: var(--scp-control-height);
    font-size: var(--scp-font-sm);
    padding: 0.375rem 0.75rem;
    border-radius: 8px;
    border-color: var(--scp-border);
}

.portal-page .form-select {
    height: var(--scp-control-height);
    font-size: var(--scp-font-sm);
    padding: 0.375rem 2.25rem 0.375rem 0.75rem; /* keep Bootstrap caret gutter */
    border-radius: 8px;
    border-color: var(--scp-border);
}

.portal-page .form-select.form-select-sm,
.portal-page .form-select-sm {
    height: var(--scp-btn-height-sm);
    padding: 0.25rem 2rem 0.25rem 0.5rem;
    font-size: var(--scp-font-xs);
}

.portal-page textarea.form-control {
    height: auto;
    min-height: calc(var(--scp-control-height) * 2);
}

.portal-page .input-group-search {
    position: relative;
}

.portal-page .input-group-search .search-inline-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--scp-text-muted);
    font-size: var(--scp-font-sm);
    pointer-events: none;
    z-index: 2;
}

.portal-page .input-group-search .form-control {
    padding-left: 2.25rem;
}

/* ─── Portal dropdowns — compact uniform ─── */
.portal-page .dropdown-menu {
    font-size: var(--scp-font-sm);
    padding: 0.35rem;
    border-radius: 8px;
    border-color: var(--scp-border);
    box-shadow: var(--scp-shadow-lg);
    min-width: 11rem;
}

.portal-page .dropdown-item {
    font-size: var(--scp-font-sm);
    font-weight: 500;
    padding: 0.4rem 0.65rem;
    border-radius: 6px;
    color: var(--scp-text);
    line-height: 1.35;
}

.portal-page .dropdown-item i {
    font-size: 0.95em;
    opacity: 0.85;
}

.portal-page .dropdown-item:hover,
.portal-page .dropdown-item:focus,
.portal-page .dropdown-item.active {
    background: var(--scp-bg);
    color: var(--scp-text);
}

.portal-page .dropdown-item.text-danger:hover,
.portal-page .dropdown-item.text-danger:focus {
    background: rgba(220, 38, 38, 0.08);
    color: var(--scp-danger);
}

.portal-page .dropdown-header {
    font-size: var(--scp-font-xs);
    font-weight: 600;
    color: var(--scp-text-muted);
    padding: 0.35rem 0.65rem 0.25rem;
    letter-spacing: 0;
    text-transform: none;
}

.portal-page .dropdown-divider {
    margin: 0.35rem 0;
    border-color: var(--scp-border);
}

.portal-page .dropdown-toggle::after {
    margin-left: 0.35rem;
    vertical-align: 0.12em;
    border-width: 0.3em 0.3em 0;
}

.portal-page .dropdown-toggle.btn-scp-outline.btn-sm,
.portal-page .dropdown-toggle.btn-scp-primary.btn-sm {
    padding-right: 0.5rem;
}

.portal-page .btn-scp-outline.btn-sm[data-bs-toggle="dropdown"]:not(.dropdown-toggle) {
    width: var(--scp-btn-height-sm);
    min-width: var(--scp-btn-height-sm);
    padding: 0;
}

/* ─── Portal buttons — normalize Bootstrap variants ─── */
.portal-page .btn {
    font-size: var(--scp-font-sm);
    line-height: 1.25;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.portal-page .btn-sm {
    min-height: var(--scp-btn-height-sm);
    padding: 0.25rem 0.625rem;
    font-size: var(--scp-font-xs);
}

.portal-page .btn:not(.btn-sm):not(.btn-scp-primary):not(.btn-scp-outline):not(.btn-scp-ghost) {
    min-height: var(--scp-btn-height);
    padding: 0.375rem 0.875rem;
}

.portal-page .btn-outline-secondary,
.portal-page .btn-outline-success {
    border: 1px solid var(--scp-border);
    color: var(--scp-text);
    font-weight: 500;
    background: #fff;
}

.portal-page .btn-outline-secondary:hover,
.portal-page .btn-outline-success:hover {
    background: var(--scp-bg);
    border-color: var(--scp-text-muted);
    color: var(--scp-text);
}

.portal-page .btn-outline-success {
    border-color: rgba(5, 150, 105, 0.35);
    color: var(--scp-success);
    background: rgba(5, 150, 105, 0.06);
}

.portal-page .btn-scp-success {
    border: 1px solid rgba(5, 150, 105, 0.35);
    color: var(--scp-success);
    font-weight: 500;
    font-size: var(--scp-font-xs);
    min-height: var(--scp-btn-height-sm);
    padding: 0.25rem 0.625rem;
    line-height: 1.25;
    border-radius: 8px;
    background: rgba(5, 150, 105, 0.08);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.portal-page .btn-danger {
    font-size: var(--scp-font-sm);
    font-weight: 600;
    min-height: var(--scp-btn-height);
    padding: 0.375rem 0.875rem;
    line-height: 1.25;
    border-radius: 8px;
}

.portal-page .btn-danger.btn-sm {
    min-height: var(--scp-btn-height-sm);
    padding: 0.25rem 0.625rem;
    font-size: var(--scp-font-xs);
}

.portal-page .filter-card .btn-scp-outline {
    min-height: var(--scp-control-height);
    height: var(--scp-control-height);
}

.portal-page .leave-item .btn {
    white-space: nowrap;
}

.portal-page .pagination {
    gap: 0.2rem;
}

.portal-page .pagination .page-link {
    font-size: var(--scp-font-xs);
    padding: 0.25rem 0.55rem;
    min-width: 2rem;
    min-height: var(--scp-btn-height-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    color: var(--scp-text);
    border-color: var(--scp-border);
}

.portal-page .pagination .page-item.active .page-link {
    background: var(--scp-accent);
    border-color: var(--scp-accent);
}

.portal-page .modal-title {
    font-size: 1rem;
    font-weight: 600;
}

.portal-page .modal-body {
    font-size: var(--scp-font-sm);
}

.portal-page .modal-footer {
    gap: 0.5rem;
}

.table-pagination .page-info {
    font-size: var(--scp-font-sm);
    color: var(--scp-text-muted);
}

.trial-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--scp-accent-soft);
    color: var(--scp-accent-hover);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    margin-bottom: 1.5rem;
}

.password-strength {
    height: 4px;
    border-radius: 2px;
    background: var(--scp-border);
    margin-top: 0.5rem;
    overflow: hidden;
}

.password-strength-bar {
    height: 100%;
    width: 0;
    border-radius: 2px;
    transition: width 0.3s, background 0.3s;
}

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

.app-sidebar {
    width: var(--scp-sidebar-width);
    background: var(--scp-primary);
    color: #fff;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.app-sidebar .sidebar-brand {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.app-sidebar .sidebar-brand span {
    color: #5eead4;
}

.app-sidebar .org-name {
    padding: 0.75rem 1.5rem;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.65);
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.app-sidebar .org-name strong {
    display: block;
    color: #fff;
    font-size: 0.875rem;
    margin-top: 0.15rem;
}

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

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

.sidebar-nav .nav-section {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.45);
    padding: 0.75rem 0.75rem 0.35rem;
    margin-top: 0.5rem;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.5rem 0.65rem;
    color: rgba(255,255,255,0.75);
    border-radius: 8px;
    font-size: var(--scp-font-sm);
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s;
    margin-bottom: 2px;
}

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

.sidebar-nav .nav-link.active {
    background: var(--scp-accent);
    color: #fff;
}

.sidebar-nav .nav-link .badge {
    margin-left: auto;
    font-size: 0.7rem;
    background: rgba(255,255,255,0.2);
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.75rem;
    color: rgba(255,255,255,0.5);
}

.app-main {
    flex: 1;
    margin-left: var(--scp-sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background:
        radial-gradient(1200px 480px at 12% -10%, rgba(13, 148, 136, 0.07), transparent 55%),
        radial-gradient(900px 420px at 100% 0%, rgba(15, 43, 70, 0.06), transparent 50%),
        var(--scp-bg);
}

.app-header {
    height: var(--scp-header-height);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--scp-border);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.app-header .header-search {
    flex: 1;
    max-width: 360px;
}

.app-header .header-search .form-control {
    border-radius: 8px;
    border-color: var(--scp-border);
    background: var(--scp-bg);
    font-size: var(--scp-font-sm);
    height: var(--scp-control-height);
    padding-left: 2.25rem;
}

.app-header .search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--scp-text-muted);
}

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

.header-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--scp-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: background 0.15s;
    font-size: 1.1rem;
}

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

.header-btn .notif-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: var(--scp-danger);
    border-radius: 50%;
    border: 2px solid #fff;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.35rem 0.5rem 0.35rem 0.35rem;
    border: 1px solid var(--scp-border);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
}

.user-menu-btn .avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--scp-accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem;
}

.user-menu-btn .user-info {
    text-align: left;
    line-height: 1.2;
}

.user-menu-btn .user-info strong {
    display: block;
    font-size: var(--scp-font-sm);
}

.user-menu-btn .user-info small {
    color: var(--scp-text-muted);
    font-size: var(--scp-font-xs);
}

.app-content {
    padding: 1.25rem;
    flex: 1;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1.35rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header .quick-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.page-header > .d-flex {
    align-items: center;
}

.page-header h1 {
    font-size: 1.375rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.25rem;
}

.page-header .breadcrumb {
    font-size: var(--scp-font-sm);
    margin-bottom: 0;
}

.page-header .breadcrumb-item a {
    color: var(--scp-text-muted);
    text-decoration: none;
}

.page-header .breadcrumb-item.active {
    color: var(--scp-text);
}

.page-header .text-muted {
    font-size: var(--scp-font-sm);
}

/* ─── Dashboard Cards ─── */
.stat-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--scp-surface);
    border-radius: var(--scp-radius-lg);
    padding: 1.15rem 1.2rem;
    border: 1px solid var(--scp-border);
    box-shadow: var(--scp-shadow);
    height: 100%;
    overflow: hidden;
    transition: box-shadow 0.22s ease, transform 0.22s ease, border-color 0.22s ease;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: transparent;
    transition: background 0.22s ease;
}

.stat-card:hover {
    box-shadow: var(--scp-shadow-lg);
    transform: translateY(-2px);
    border-color: rgba(13, 148, 136, 0.28);
}

.stat-card:hover::before {
    background: linear-gradient(90deg, var(--scp-accent), var(--scp-primary-light));
}

.stat-card .stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-bottom: 0.85rem;
    flex-shrink: 0;
}

.stat-card .stat-icon.primary { background: rgba(15, 43, 70, 0.12); color: var(--scp-primary); }
.stat-card .stat-icon.accent { background: var(--scp-accent-soft); color: var(--scp-accent); }
.stat-card .stat-icon.success { background: rgba(5, 150, 105, 0.14); color: var(--scp-success); }
.stat-card .stat-icon.warning { background: rgba(217, 119, 6, 0.14); color: var(--scp-warning); }
.stat-card .stat-icon.danger { background: rgba(220, 38, 38, 0.12); color: var(--scp-danger); }

.stat-card .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin-bottom: 0.3rem;
}

.stat-card .stat-label {
    font-size: var(--scp-font-sm);
    color: var(--scp-text-muted);
    font-weight: 500;
}

.stat-card .stat-change,
.stat-card .stat-footer {
    font-size: 0.8rem;
    margin-top: auto;
    padding-top: 0.65rem;
}

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

.dashboard-card {
    background: var(--scp-surface);
    border-radius: var(--scp-radius-lg);
    border: 1px solid var(--scp-border);
    box-shadow: var(--scp-shadow);
    height: 100%;
    transition: box-shadow 0.22s ease, transform 0.22s ease;
}

.dashboard-card:hover {
    box-shadow: var(--scp-shadow-lg);
}

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

.dashboard-card .card-header h5 {
    font-size: var(--scp-font-sm);
    font-weight: 600;
    margin: 0;
}

.dashboard-card .card-body {
    padding: 1rem 1.25rem;
}

.dashboard-card .card-body.card-body-tight {
    padding: 0.85rem 1.1rem;
}

.dashboard-card .card-body.pt-0 {
    padding-top: 0;
}

.quick-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.quick-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.375rem 0.875rem;
    min-height: var(--scp-btn-height);
    border-radius: 8px;
    font-size: var(--scp-font-sm);
    font-weight: 500;
    text-decoration: none;
    border: 1px solid var(--scp-border);
    color: var(--scp-text);
    background: #fff;
    transition: all 0.15s;
    cursor: pointer;
}

.quick-action-btn:hover {
    border-color: var(--scp-accent);
    color: var(--scp-accent);
    background: var(--scp-accent-soft);
}

.quick-action-btn.primary {
    background: linear-gradient(180deg, #14b8a6 0%, var(--scp-accent) 100%);
    border-color: var(--scp-accent);
    color: #fff;
    box-shadow: var(--scp-shadow-accent);
}

.quick-action-btn.primary:hover {
    background: linear-gradient(180deg, var(--scp-accent) 0%, var(--scp-accent-hover) 100%);
    border-color: var(--scp-accent-hover);
    color: #fff;
}

.quick-action-btn.disabled,
.quick-action-btn[aria-disabled="true"] {
    opacity: 0.55;
    pointer-events: none;
}

.compliance-bar {
    margin-bottom: 1rem;
}

.compliance-bar:last-child {
    margin-bottom: 0;
}

.compliance-bar .label {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-bottom: 0.35rem;
}

.compliance-bar .progress {
    height: 8px;
    border-radius: 4px;
    background: var(--scp-bg);
}

.compliance-bar .progress-bar {
    border-radius: 4px;
}

.activity-timeline {
    list-style: none;
    padding: 0;
    margin: 0;
}

.activity-timeline li {
    display: flex;
    gap: 0.75rem;
    padding-bottom: 1rem;
    position: relative;
}

.activity-timeline li:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 32px;
    bottom: 0;
    width: 2px;
    background: var(--scp-border);
}

.activity-timeline .timeline-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.85rem;
    z-index: 1;
}

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

.activity-timeline .timeline-content p {
    margin: 0;
    font-size: var(--scp-font-sm);
}

.activity-timeline .timeline-content small {
    color: var(--scp-text-muted);
    font-size: var(--scp-font-xs);
}

.leave-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--scp-border);
}

.leave-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.leave-item .leave-avatar {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--scp-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--scp-primary);
}

.leave-item .leave-info {
    flex: 1;
}

.leave-item .leave-info strong {
    display: block;
    font-size: var(--scp-font-sm);
}

.leave-item .leave-info small {
    font-size: var(--scp-font-xs);
    color: var(--scp-text-muted);
}

.subscription-card {
    background: linear-gradient(135deg, var(--scp-primary) 0%, var(--scp-primary-light) 100%);
    color: #fff;
    border: none;
}

.subscription-card .plan-name {
    font-size: 1.1rem;
    font-weight: 700;
}

.subscription-card .plan-detail {
    opacity: 0.85;
    font-size: 0.875rem;
}

.subscription-card .usage-bar {
    height: 6px;
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
    margin: 0.75rem 0;
}

.subscription-card .usage-bar-fill {
    height: 100%;
    background: #5eead4;
    border-radius: 3px;
}

.payroll-status-card .status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.payroll-status-card .status-badge.ready {
    background: rgba(5, 150, 105, 0.15);
    color: var(--scp-success);
}

.payroll-status-card .status-badge.pending {
    background: rgba(217, 119, 6, 0.15);
    color: var(--scp-warning);
}

.status-pill {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-pill.success { background: rgba(5,150,105,0.12); color: var(--scp-success); }
.status-pill.warning { background: rgba(217,119,6,0.12); color: var(--scp-warning); }
.status-pill.info { background: rgba(2,132,199,0.12); color: var(--scp-info); }
.status-pill.secondary { background: rgba(100,116,139,0.12); color: var(--scp-text-muted); }
.status-pill.danger { background: rgba(220,38,38,0.12); color: var(--scp-danger); }

/* Payroll / workflow status aliases (map domain status → pill tone) */
.status-pill.draft,
.status-pill.generated,
.status-pill.reversed { background: rgba(100,116,139,0.12); color: var(--scp-text-muted); }
.status-pill.calculated,
.status-pill.pending_approval { background: rgba(217,119,6,0.12); color: var(--scp-warning); }
.status-pill.approved,
.status-pill.finalized,
.status-pill.published,
.status-pill.paid,
.status-pill.calculated_ok { background: rgba(5,150,105,0.12); color: var(--scp-success); }
.status-pill.held { background: rgba(220,38,38,0.12); color: var(--scp-danger); }

/* Toast */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
}

/* Mobile sidebar */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1035;
}

.sidebar-toggle {
    display: none;
    margin-right: 0.75rem;
}

@media (max-width: 991.98px) {
    .auth-brand-panel {
        display: none;
    }

    .auth-form-panel {
        max-width: 100%;
    }

    .app-sidebar {
        transform: translateX(-100%);
    }

    .app-sidebar.show {
        transform: translateX(0);
    }

    .sidebar-overlay.show {
        display: block;
    }

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

    .sidebar-toggle {
        display: flex;
    }
}

@media (max-width: 575.98px) {
    .auth-form-panel {
        padding: 1.5rem;
    }

    .app-content {
        padding: 1rem;
    }

    .user-menu-btn .user-info {
        display: none;
    }
}

.invalid-feedback {
    display: none;
    font-size: 0.8rem;
}

.was-validated .form-control:invalid ~ .invalid-feedback,
.form-control.is-invalid ~ .invalid-feedback {
    display: block;
}

.chart-container {
    position: relative;
    height: 220px;
}

/* ─── Employees Page ─── */
.status-tabs {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.status-tab {
    padding: 0.4rem 0.875rem;
    border-radius: 8px;
    font-size: var(--scp-font-sm);
    font-weight: 500;
    color: var(--scp-text-muted);
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
}

.status-tab:hover {
    background: var(--scp-bg);
    color: var(--scp-text);
}

.status-tab.active {
    background: var(--scp-accent-soft);
    color: var(--scp-accent-hover);
    border-color: rgba(13, 148, 136, 0.25);
}

.status-tab .count {
    display: inline-block;
    margin-left: 0.35rem;
    padding: 0.1rem 0.45rem;
    border-radius: 10px;
    font-size: 0.75rem;
    background: rgba(0,0,0,0.06);
}

.status-tab.active .count {
    background: rgba(13, 148, 136, 0.2);
}

.filter-card {
    background: var(--scp-surface);
    border: 1px solid var(--scp-border);
    border-radius: var(--scp-radius-lg);
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--scp-shadow);
}

.data-table-card {
    background: var(--scp-surface);
    border: 1px solid var(--scp-border);
    border-radius: var(--scp-radius-lg);
    overflow: hidden;
    box-shadow: var(--scp-shadow);
}

.data-table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--scp-border);
    flex-wrap: wrap;
    gap: 0.75rem;
}

.data-table-toolbar .selected-count {
    font-size: 0.875rem;
    color: var(--scp-text-muted);
}

.data-table-toolbar .selected-count strong {
    color: var(--scp-accent);
}

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

.employee-table {
    margin-bottom: 0;
    font-size: var(--scp-font-sm);
}

.employee-table thead th {
    background: rgba(15, 43, 70, 0.035);
    font-weight: 600;
    font-size: var(--scp-font-xs);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--scp-text-muted);
    border-bottom: 1px solid var(--scp-border);
    padding: 0.75rem 1rem;
    white-space: nowrap;
    vertical-align: middle;
}

.employee-table thead th.sortable {
    cursor: pointer;
    user-select: none;
}

.employee-table thead th.sortable:hover {
    color: var(--scp-text);
}

.employee-table thead th .sort-icon {
    opacity: 0.35;
    margin-left: 0.25rem;
}

.employee-table thead th.sorted .sort-icon {
    opacity: 1;
    color: var(--scp-accent);
}

.employee-table tbody td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--scp-border);
}

.employee-table tbody td.col-actions,
.employee-table tbody td:last-child:has(.btn) {
    white-space: nowrap;
}

.employee-table tbody tr:nth-child(even) {
    background: rgba(15, 43, 70, 0.015);
}

.employee-table tbody tr:hover {
    background: rgba(13, 148, 136, 0.05);
}

.employee-table tbody tr.selected {
    background: var(--scp-accent-soft);
}

/* Compact tables inside dashboard cards */
.dashboard-card .table thead th {
    background: rgba(15, 43, 70, 0.035);
    font-weight: 600;
    font-size: var(--scp-font-xs);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--scp-text-muted);
    border-bottom: 1px solid var(--scp-border);
    padding: 0.7rem 1rem;
    vertical-align: middle;
}

.dashboard-card .table tbody td {
    padding: 0.7rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--scp-border);
}

.dashboard-card .table tbody tr:nth-child(even) {
    background: rgba(15, 43, 70, 0.015);
}

.dashboard-card .table tbody tr:hover {
    background: rgba(13, 148, 136, 0.05);
}

.dashboard-card .table tbody td.col-actions {
    white-space: nowrap;
    width: 1%;
}

/* Empty state */
.scp-empty {
    text-align: center;
    padding: 2.25rem 1.25rem;
    color: var(--scp-text-muted);
}

.scp-empty-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 0.85rem;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.45rem;
    background: var(--scp-accent-soft);
    color: var(--scp-accent);
}

.scp-empty-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--scp-text);
    margin-bottom: 0.25rem;
}

.scp-empty-text {
    font-size: var(--scp-font-sm);
    margin-bottom: 0.85rem;
    max-width: 22rem;
    margin-left: auto;
    margin-right: auto;
}

.scp-empty .btn {
    margin-top: 0.15rem;
}

.scp-quick-stack {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.scp-quick-stack .btn {
    justify-content: flex-start;
    width: 100%;
}

/* Portal entrance motion */
@keyframes scpFadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.portal-page .stat-card,
.portal-page .dashboard-card,
.portal-page .data-table-card,
.portal-page .filter-card {
    animation: scpFadeUp 0.4s ease-out both;
}

.portal-page .row > [class*="col-"]:nth-child(1) .stat-card,
.portal-page .row > [class*="col-"]:nth-child(1) .dashboard-card { animation-delay: 0.02s; }
.portal-page .row > [class*="col-"]:nth-child(2) .stat-card,
.portal-page .row > [class*="col-"]:nth-child(2) .dashboard-card { animation-delay: 0.06s; }
.portal-page .row > [class*="col-"]:nth-child(3) .stat-card,
.portal-page .row > [class*="col-"]:nth-child(3) .dashboard-card { animation-delay: 0.1s; }
.portal-page .row > [class*="col-"]:nth-child(4) .stat-card,
.portal-page .row > [class*="col-"]:nth-child(4) .dashboard-card { animation-delay: 0.14s; }

@media (prefers-reduced-motion: reduce) {
    .portal-page .stat-card,
    .portal-page .dashboard-card,
    .portal-page .data-table-card,
    .portal-page .filter-card,
    .stat-card {
        animation: none !important;
        transition: none !important;
        transform: none !important;
    }
}

.emp-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.emp-avatar {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem;
    flex-shrink: 0;
    color: #fff;
}

.emp-name strong {
    display: block;
    font-weight: 600;
    color: var(--scp-text);
}

.emp-name small {
    color: var(--scp-text-muted);
    font-size: 0.8rem;
}

.bulk-action-bar {
    display: none;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    background: var(--scp-primary);
    color: #fff;
}

.bulk-action-bar.show {
    display: flex;
    flex-wrap: wrap;
}

.bulk-action-bar .btn-bulk {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.1);
    color: #fff;
    cursor: pointer;
    transition: background 0.15s;
}

.bulk-action-bar .btn-bulk:hover {
    background: rgba(255,255,255,0.2);
}

.table-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--scp-border);
    flex-wrap: wrap;
    gap: 0.75rem;
}

.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
}

.empty-state .empty-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: var(--scp-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.75rem;
    color: var(--scp-text-muted);
}

.empty-state h5 {
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.empty-state p {
    color: var(--scp-text-muted);
    margin-bottom: 1rem;
}

.avatar-colors {
    --c1: #0d9488; --c2: #0284c7; --c3: #7c3aed; --c4: #db2777;
    --c5: #d97706; --c6: #059669; --c7: #4f46e5; --c8: #dc2626;
}

/* Laravel portal helpers */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.25rem; }
.detail-item label { display: block; font-size: 0.75rem; color: var(--scp-text-muted); margin-bottom: 0.15rem; }
.detail-item .value { font-weight: 500; }
.form-section-title { font-size: 0.95rem; font-weight: 600; margin: 0 0 1rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--scp-border); }
.nav-link.disabled { opacity: 0.45; pointer-events: none; }
