/* Admin panel theme — RTL fintech-style layout */

:root {
    --bg-page: #f4f6f9;
    --bg-card: #ffffff;
    --bg-sidebar: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --card-radius: 1rem;
    --shadow-soft: 0 1px 3px rgba(15, 23, 42, 0.06), 0 4px 12px rgba(15, 23, 42, 0.04);
    --shadow-card: 0 2px 8px rgba(15, 23, 42, 0.08);
    --gradient-primary: linear-gradient(to left, #6366f1, #a855f7);
    --gradient-primary-hover: linear-gradient(to left, #4f46e5, #9333ea);
    --sidebar-width: 260px;
    --header-height: 64px;
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;
    --color-info: #3b82f6;
    --color-purple: #8b5cf6;
}

/* Layout */
.admin-layout {
    display: flex;
    min-height: 100vh;
    background: var(--bg-page);
}

.admin-sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 1040;
    transition: transform 0.3s ease;
}

.admin-main {
    flex: 1;
    margin-right: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.admin-header {
    height: var(--header-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.admin-content {
    flex: 1;
    padding: 1.5rem;
}

/* Sidebar branding */
.sidebar-brand {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-brand-icon {
    width: 42px;
    height: 42px;
    background: var(--gradient-primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.sidebar-brand-text h6 {
    margin: 0;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.sidebar-brand-text small {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* Sidebar nav */
.sidebar-nav {
    flex: 1;
    padding: 1rem 0.75rem;
    overflow-y: auto;
}

.sidebar-nav .nav-section {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 0.5rem 0.75rem;
    margin-top: 0.5rem;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    border-radius: 0.65rem;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    text-decoration: none;
    margin-bottom: 0.15rem;
    transition: all 0.2s ease;
}

.sidebar-nav .nav-link i {
    width: 20px;
    text-align: center;
    font-size: 0.95rem;
}

.sidebar-nav .nav-link:hover {
    background: #f1f5f9;
    color: var(--text-primary);
}

.sidebar-nav .nav-link.active {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.sidebar-nav .nav-link.active:hover {
    color: #fff;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
}

/* Header */
.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.35rem 0.75rem;
    border-radius: 0.65rem;
    cursor: pointer;
    border: none;
    background: transparent;
}

.header-user:hover {
    background: #f1f5f9;
}

.header-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
}

.header-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 0.65rem;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    position: relative;
    transition: all 0.2s ease;
}

.header-icon-btn:hover {
    background: #f1f5f9;
    color: var(--text-primary);
}

.header-badge {
    position: absolute;
    top: -4px;
    left: -4px;
    width: 18px;
    height: 18px;
    background: var(--color-danger);
    color: #fff;
    border-radius: 50%;
    font-size: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* Page title bar */
.page-title-bar {
    margin-bottom: 1.5rem;
}

.page-title-bar h1 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.breadcrumb-admin {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.breadcrumb-admin li + li::before {
    content: "/";
    margin-left: 0.35rem;
    color: var(--text-muted);
}

.breadcrumb-admin a {
    color: var(--text-secondary);
    text-decoration: none;
}

.breadcrumb-admin a:hover {
    color: #6366f1;
}

/* Stat cards */
.stat-card {
    background: var(--bg-card);
    border-radius: var(--card-radius);
    padding: 1.25rem;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-color);
    height: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    transition: box-shadow 0.2s ease;
}

.stat-card:hover {
    box-shadow: var(--shadow-card);
}

.stat-card-body h6 {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.stat-card-body .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-card-body .stat-trend {
    font-size: 0.8rem;
    margin-top: 0.35rem;
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.stat-icon-purple { background: rgba(139, 92, 246, 0.12); color: #8b5cf6; }
.stat-icon-blue { background: rgba(59, 130, 246, 0.12); color: #3b82f6; }
.stat-icon-green { background: rgba(16, 185, 129, 0.12); color: #10b981; }
.stat-icon-orange { background: rgba(245, 158, 11, 0.12); color: #f59e0b; }
.stat-icon-red { background: rgba(239, 68, 68, 0.12); color: #ef4444; }
.stat-icon-teal { background: rgba(20, 184, 166, 0.12); color: #14b8a6; }

/* Data table card */
.data-table-card {
    background: var(--bg-card);
    border-radius: var(--card-radius);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.data-table-card .card-header-custom {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
}

.data-table-card .card-header-custom h5 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.data-table-card .table {
    margin-bottom: 0;
}

.data-table-card .table thead th {
    background: #f8fafc;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-secondary);
    padding: 0.85rem 1rem;
    white-space: nowrap;
}

.data-table-card .table tbody td {
    padding: 0.85rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.data-table-card .table tbody tr:last-child td {
    border-bottom: none;
}

.data-table-card .table tbody tr:hover {
    background: #f8fafc;
}

/* Form card */
.form-card {
    background: var(--bg-card);
    border-radius: var(--card-radius);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
}

/* Chart card */
.chart-card {
    background: var(--bg-card);
    border-radius: var(--card-radius);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-color);
    padding: 1.25rem;
    height: 100%;
}

.chart-card h5 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

/* Status pills */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
}

.status-pill-success { background: #d1fae5; color: #065f46; }
.status-pill-danger { background: #fee2e2; color: #991b1b; }
.status-pill-warning { background: #fef3c7; color: #92400e; }
.status-pill-info { background: #dbeafe; color: #1e40af; }
.status-pill-secondary { background: #f1f5f9; color: #475569; }

/* Buttons */
.btn-gradient {
    background: var(--gradient-primary);
    border: none;
    color: #fff;
    font-weight: 500;
    border-radius: 0.65rem;
    padding: 0.5rem 1.25rem;
    transition: all 0.2s ease;
}

.btn-gradient:hover {
    background: var(--gradient-primary-hover);
    color: #fff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.btn-outline-admin {
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    border-radius: 0.65rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
}

.btn-outline-admin:hover {
    background: #f1f5f9;
    color: var(--text-primary);
    border-color: var(--border-color);
}

/* Auth layout */
.auth-layout {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-page);
    padding: 1.5rem;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border-radius: var(--card-radius);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-color);
    padding: 2.5rem;
}

.auth-logo {
    width: 64px;
    height: 64px;
    background: var(--gradient-primary);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.5rem;
    margin: 0 auto 1.25rem;
}

/* Public layout */
.public-navbar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 0;
}

.public-hero {
    background: var(--gradient-primary);
    color: #fff;
    padding: 4rem 0;
}

.public-feature-card {
    background: var(--bg-card);
    border-radius: var(--card-radius);
    border: 1px solid var(--border-color);
    padding: 2rem;
    text-align: center;
    height: 100%;
    transition: box-shadow 0.2s ease;
}

.public-feature-card:hover {
    box-shadow: var(--shadow-card);
}

.public-feature-icon {
    width: 64px;
    height: 64px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    color: #6366f1;
    font-size: 1.5rem;
}

/* Mobile sidebar */
.sidebar-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-color);
    border-radius: 0.65rem;
    background: var(--bg-card);
    color: var(--text-secondary);
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    z-index: 1035;
}

@media (max-width: 991.98px) {
    .admin-sidebar {
        transform: translateX(100%);
    }

    .admin-sidebar.show {
        transform: translateX(0);
    }

    .admin-main {
        margin-right: 0;
    }

    .sidebar-toggle {
        display: flex;
    }

    .sidebar-overlay.show {
        display: block;
    }
}

/* Role badge */
.role-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 0.35rem;
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
    font-weight: 600;
}

/* Multi-user picker (payroll) */
.user-picker-panel {
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.user-picker-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 1rem;
}

.user-picker-search {
    flex: 1;
    min-width: 200px;
    position: relative;
}

.user-picker-search i {
    position: absolute;
    right: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.user-picker-search input {
    padding-right: 2.5rem;
    border-radius: 0.65rem;
    border: 1px solid var(--border-color);
}

.user-picker-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.user-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.75rem;
    max-height: 320px;
    overflow-y: auto;
    padding: 0.25rem;
}

.user-picker-card {
    position: relative;
    border: 2px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 0.85rem 1rem;
    background: var(--bg-card);
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    user-select: none;
}

.user-picker-card:hover {
    border-color: #c7d2fe;
    box-shadow: var(--shadow-soft);
}

.user-picker-card.selected {
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.06);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.user-picker-card input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.user-picker-card .user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    flex-shrink: 0;
}

.user-picker-card .user-meta {
    min-width: 0;
}

.user-picker-card .user-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-picker-card .user-nid {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: monospace;
}

.user-picker-card .check-icon {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    color: transparent;
    transition: all 0.2s;
}

.user-picker-card.selected .check-icon {
    background: #6366f1;
    border-color: #6366f1;
    color: #fff;
}

.user-picker-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--border-color);
}

.user-picker-empty,
.user-picker-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-muted);
}

.user-picker-select-all {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1rem;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 0.65rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    color: #4f46e5;
    transition: background 0.2s;
}

.user-picker-select-all:hover {
    background: rgba(99, 102, 241, 0.14);
}

.user-picker-select-all.active {
    background: #6366f1;
    color: #fff;
    border-color: #6366f1;
}
