/* Dashboard V2: Horizontal Layout */
:root {
    --nav-height: 80px;
}

body.dashboard-body {
    background-color: #f8fafc;
    /* Professional slate-light background */
    margin: 0;
    padding: 0 !important;
    /* Force reset padding from style.css */
    font-family: 'Inter', sans-serif;
    color: #1e293b;
    overflow-x: hidden;
    display: flex;
    align-items: flex-start !important;
    /* Prevent vertical centering from style.css */
    justify-content: flex-start !important;
    /* Ensure horizontal start */
    min-height: 100vh;
}


/* Floating Side Logos */
.floating-side-logo {
    position: fixed;
    top: 140px;
    z-index: 10;
    width: 140px;
    pointer-events: none;
    opacity: 0.9;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.floating-side-logo.left {
    left: 40px;
}

.floating-side-logo.right {
    right: 40px;
}

.floating-side-logo.hidden {
    opacity: 0;
    transform: translateY(-20px);
}

.floating-side-logo img {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.15));
    opacity: 0.9;
}

/* Glass Sidebar Structure */
.sidebar {
    width: 280px;
    background: rgba(255, 255, 255, 0.45) !important;
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-right: 1px solid rgba(255, 255, 255, 0.3);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    padding: 20px 0;
}

.sidebar-brand-area {
    padding: 0 25px 30px 25px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.sidebar-role-badge {
    padding: 6px 16px;
    background: #1e3a8a;
    color: white;
    font-size: 0.85rem;
    font-weight: 800;
    border-radius: 8px;
    letter-spacing: 1.5px;
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.2);
    text-transform: uppercase;
}

.sidebar-brand {
    padding: 20px 0 40px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.sidebar-brand img {
    height: 80px;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.sidebar-brand span {
    font-weight: 800;
    font-size: 0.8rem;
    letter-spacing: 2px;
    color: #1e3a8a;
    text-transform: uppercase;
}

.sidebar-menu {
    list-style: none;
    padding: 0 15px;
    margin: 0;
    flex-grow: 1;
}

.sidebar-item {
    margin-bottom: 5px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 14px 20px;
    border-radius: 12px;
    color: #475569;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.95rem;
}

.sidebar-link i {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

.sidebar-link:hover {
    background: rgba(30, 58, 138, 0.05);
    color: var(--primary-color);
    transform: translateX(5px);
}

.sidebar-link.active {
    background: #1e3a8a;
    color: white;
    box-shadow: 0 10px 20px -5px rgba(30, 58, 138, 0.3);
}

/* Sidebar Profile Section */
.sidebar-profile {
    margin-top: auto;
    padding: 20px 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.sidebar-user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.sidebar-user-card:hover {
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

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

.sidebar-user-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 0.75rem;
    color: #64748b;
}

/* Page Layout Shell */
.main-layout {
    flex-grow: 1;
    margin-left: 280px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Top Header (Corporate Style) */
/* Hide Top Header as requested */
.top-header {
    display: none;
}

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

.page-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: #1e293b;
    margin: 0;
}

.nav-user {
    position: relative;
    cursor: pointer;
}

.user-profile-trigger {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    transition: all 0.3s;
}

.user-profile-trigger:hover {
    background: rgba(255, 255, 255, 0.6);
}

.user-avatar {
    width: 35px;
    height: 35px;
    background: var(--primary-gradient);
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 200px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    display: none;
    flex-direction: column;
    padding: 10px;
    z-index: 1000;
    animation: slideDown 0.3s ease-out;
}

.profile-dropdown.active {
    display: flex;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-item {
    padding: 12px 15px;
    border-radius: 10px;
    text-decoration: none;
    color: #475569;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.2s;
}

.dropdown-item:hover {
    background: rgba(30, 58, 138, 0.05);
    color: var(--primary-color);
}

.dropdown-item.logout {
    color: #ef4444;
}

.dropdown-item.logout:hover {
    background: rgba(239, 68, 68, 0.05);
}

/* Main Content Wrapper */
.content-wrapper {
    padding: 40px 60px;
    /* Adjusted to avoid logo clipping while maintaining consistent placement */
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    z-index: 5;
}

.content-wrapper.module-active {
    opacity: 0;
    transform: scale(0.98);
    pointer-events: none;
}

/* Sliding Animations for Containers */
@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutToLeft {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(-100px);
    }
}

/* Apply animations to main content sections */
.welcome-header,
.metrics-grid,
.analytics-section,
.content-box,
.matches-display-grid {
    animation: slideInFromRight 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
}

/* Staggered animation delays for sequential appearance */
.welcome-header {
    animation-delay: 0.1s;
}

.metrics-grid {
    animation-delay: 0.2s;
}

.analytics-section {
    animation-delay: 0.3s;
}

.content-box {
    animation-delay: 0.4s;
}

.matches-display-grid {
    animation-delay: 0.3s;
}

/* Individual metric cards stagger */
.metric-card-fancy:nth-child(1) {
    animation: slideInFromRight 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 0.25s;
    opacity: 0;
}

.metric-card-fancy:nth-child(2) {
    animation: slideInFromRight 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 0.35s;
    opacity: 0;
}

/* Page transition out */
.page-exit {
    animation: slideOutToLeft 0.4s cubic-bezier(0.4, 0, 1, 1) forwards;
}

/* Consolidated Welcome Header Styles */
.welcome-header {
    margin-bottom: 40px;
    display: flex;
    justify-content: center;
    position: relative;
    width: 100%;
}

/* Styles handled in consolidated block below */

/* Experimental Metric Cards */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    margin-bottom: 40px;
}

.metric-card-fancy {
    position: relative;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    padding: 30px;
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: all 0.3s ease;
}

.metric-card-fancy:hover {
    transform: translateY(-8px) scale(1.02);
    background: rgba(255, 255, 255, 0.55);
}

.metric-card-fancy::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: var(--primary-gradient);
    filter: blur(80px);
    opacity: 0.07;
    z-index: 0;
}

.metric-content {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.metric-info h4 {
    margin: 0;
    font-size: 0.9rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.metric-info .value {
    display: block;
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-top: 5px;
}

.metric-icon-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.icon-blue {
    background: #eff6ff;
    color: #1e3a8a;
}

.icon-orange {
    background: #fffbeb;
    color: #d97706;
}

/* Charts Area */
.analytics-section {
    background: white;
    border-radius: 12px;
    /* Sharper corners for corporate feel */
    padding: 24px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
    margin-bottom: 30px;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.chart-header h3 {
    margin: 0;
    color: #1e293b;
    font-size: 1.25rem;
}

.chart-placeholder {
    width: 100%;
    height: 300px;
    position: relative;
}

/* Content Boxes / Tables */
.content-box {
    background: white;
    border-radius: 12px;
    padding: 24px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
    margin-bottom: 30px;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.table-header h3 {
    margin: 0;
    color: #1e293b;
    font-size: 1.25rem;
}


/* === Added from api/users.php === */

/* Modern Table */
.modern-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    table-layout: auto;
}

.modern-table tr {
    cursor: pointer;
    transition: background 0.2s;
}

.modern-table tr:hover:not(.row-deactivated):not(.row-incomplete) td {
    background: rgba(255, 255, 255, 0.4);
}

.row-incomplete td {
    position: relative;
    background-color: rgba(239, 68, 68, 0.05) !important;
    border-bottom: 1px solid #f1f5f9 !important;
    /* Keep the base line */
}

.row-incomplete td::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-top: 3px solid #ef4444;
    border-bottom: 3px solid #ef4444;
    pointer-events: none;
    z-index: 10;
}

.row-incomplete td:first-child::after {
    border-left: 3px solid #ef4444;
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
}

.row-incomplete td:last-child::after {
    border-right: 3px solid #ef4444;
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
}

.row-incomplete:hover td {
    background-color: rgba(239, 68, 68, 0.08) !important;
}

.modern-table th {
    padding: 15px 20px;
    text-align: left;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: #64748b;
    border-bottom: 2px solid #f1f5f9;
}

.modern-table td {
    padding: 20px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

/* Column Widths */
.col-details {
    width: 22%;
}

.col-role {
    width: 10%;
}

.col-area {
    width: 15%;
}

.col-id {
    width: 12%;
}

.col-contact {
    width: 13%;
}

.col-status {
    width: 13%;
}

.col-actions {
    width: 15%;
}

/* Filters */
.filter-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.tab-btn {
    padding: 10px 24px;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: #64748b;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.tab-btn.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 15px rgba(30, 58, 138, 0.2);
    border-color: var(--primary-color);
}

/* Status & Role Badges */
.status-badge {
    padding: 5px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 800;
    display: inline-block;
}

.status-pending {
    background: #fef3c7;
    color: #d97706;
}

.status-approved {
    background: #dcfce7;
    color: #16a34a;
}

.status-deactivated {
    background: #fee2e2;
    color: #dc2626;
}

.status-rejected {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fca5a5;
}

.role-badge {
    font-weight: 700;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 6px;
    text-transform: uppercase;
}

.role-member,
.role-R\.O,
.role-C\.R\.O {
    color: #1e3a8a;
    background: #eff6ff;
}

.role-AC,
.role-AAC {
    color: #f59e0b;
    background: #fffbeb;
}

.role-NROI,
.role-PPSA {
    color: #10b981;
    background: #f0fdf4;
}

.area-tag {
    display: block;
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 5px;
    font-weight: 500;
}

.row-deactivated td {
    background: rgba(254, 226, 226, 0.15) !important;
}

/* Actions */
.action-btns {
    display: flex;
    gap: 8px;
}

.icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.btn-approve {
    background: #16a34a;
    color: white;
}

.btn-reject {
    background: #dc2626;
    color: white;
}

.btn-edit {
    background: #2563eb;
    color: white;
}

.btn-ban {
    background: #ea580c;
    color: white;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 24px;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.detail-group {
    margin-bottom: 20px;
}

.detail-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: #94a3b8;
    font-weight: 800;
    letter-spacing: 1.2px;
    display: block;
    margin-bottom: 2px;
}

.detail-value {
    font-size: 1.05rem;
    color: #1e293b;
    font-weight: 700;
    line-height: 1.4;
}

.profile-section-title {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin: 30px 0 20px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid #f1f5f9;
    display: flex;
    align-items: center;
    gap: 12px;
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    background: #f8fafc;
    padding: 20px;
    border-radius: 16px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.profile-grid.full {
    grid-template-columns: 1fr;
}

/* User Info Cell */
.user-info-cell {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Form Styles for Modals */
.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e293b;
}

.form-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.95rem;
    color: #1e293b;
    margin-bottom: 20px;
    box-sizing: border-box;
    transition: var(--transition-speed);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn-secondary {
    background: #fff;
    color: #64748b;
    border: 1px solid #cbd5e1;
    padding: 12px 25px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-speed);
}


/* Centered Welcome Titles */
/* Redundant blocks removed to avoid conflicts */

.header-brand-box {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    position: relative;
    text-align: center;
}

.header-logo {
    height: 100px;
    filter: drop-shadow(0 8px 15px rgba(0, 0, 0, 0.1));
    position: absolute;
    left: 0;
}

.header-text h2 {
    font-size: 1.8rem !important;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin: 0;
    background: linear-gradient(to right, #1e3a8a, #3b82f6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
    line-height: 1.2;
    text-align: center;
}

.header-text p {
    font-size: 0.9rem !important;
    color: #1e3a8a;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin: 4px 0 0 0;
    opacity: 0.8;
    text-align: center;
}