/* Staff Account Management - Dark Theme Styles */
/* Matches UserTypeManagement card UI patterns */

/* ── Page Container ─────────────────────────────────────────────── */
.sam-page {
    background: #0F1412;
    min-height: 100vh;
    padding-bottom: 2rem;
}

/* ── Tab Bar ──────────────────────────────────────────────────────── */
.sam-tabs {
    display: flex;
    gap: 0;
    padding: 0 1.25rem;
    border-bottom: 2px solid #2E2E2E;
    background: #0F1412;
}

.sam-tab {
    padding: 0.75rem 1.25rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: #6B7280;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: inherit;
    transition: color 0.2s, border-color 0.2s;
}

.sam-tab:hover {
    color: #D1D5DB;
}

.sam-tab--active {
    color: #2DD4BF;
    border-bottom-color: #2DD4BF;
}

.sam-tab i {
    font-size: 0.813rem;
}

/* ── List Header ─────────────────────────────────────────────────── */
.sam-header {
    position: sticky;
    top: 0;
    z-index: 200;
    background: #0F1412;
    border-bottom: 2px solid #2E2E2E;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.sam-header-info {
    flex: 1;
    min-width: 0;
}

.sam-header-title {
    color: #fff;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sam-header-title i {
    color: #2DD4BF;
    font-size: 1.125rem;
}

.sam-header-subtitle {
    color: #6B7280;
    font-size: 0.813rem;
}

/* ── Search Bar ──────────────────────────────────────────────────── */
.sam-search-bar {
    padding: 0.75rem 1.25rem;
    border-bottom: 2px solid #2E2E2E;
}

.sam-search-wrap {
    position: relative;
    max-width: 380px;
}

.sam-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.813rem;
    color: #6B7280;
    pointer-events: none;
}

.sam-search-input {
    width: 100%;
    padding: 0.625rem 1rem 0.625rem 2.5rem;
    background: #1A1D1C;
    border: 1px solid #2E2E2E;
    border-radius: 0.625rem;
    color: #fff;
    font-size: 0.875rem;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.sam-search-input:focus {
    border-color: #2DD4BF;
    box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.08);
}

/* ── Card Grid ────────────────────────────────────────────────────── */
.sam-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 1.25rem;
}

/* ── Card ──────────────────────────────────────────────────────────── */
.sam-card {
    background: #1A1D1C;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0px 6px 20px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease;
    border: none;
}

.sam-card:hover {
    transform: translateY(-4px);
}

.sam-card *,
.sam-card *::before,
.sam-card *::after {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background-image: none !important;
}

.sam-card-top,
.sam-card-info,
.sam-card-badges,
.sam-card-meta {
    background: transparent !important;
}

/* ── Card Top Row ─────────────────────────────────────────────────── */
.sam-card-top {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
}

/* ── Staff Avatar ─────────────────────────────────────────────────── */
.sam-card-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: #252927;
}

.sam-card-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ── Role Icon ────────────────────────────────────────────────────── */
.sam-card-icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(45, 212, 191, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #2DD4BF;
    font-size: 1.25rem;
}

/* ── Card Info ─────────────────────────────────────────────────────── */
.sam-card-info {
    flex: 1;
    min-width: 0;
}

.sam-card-title {
    color: #FFFFFF;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
    line-height: 1.25;
}

.sam-card-desc {
    color: #A3A3A3;
    font-size: 14px;
    line-height: 1.4;
}

.sam-card-username {
    color: #6B7280;
    font-size: 12px;
    margin-top: 2px;
}

.sam-card-meta {
    color: #9CA3AF;
    font-size: 13px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sam-card-meta i {
    font-size: 11px;
    color: #6B7280;
}

/* ── Card Badges ──────────────────────────────────────────────────── */
.sam-card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.sam-card-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
}

.sam-card-badge--blocked {
    background: rgba(239, 68, 68, 0.12);
    color: #EF4444;
}

.sam-card-badge--id {
    background: #252927;
    color: #6B7280;
}

/* ── Card Actions ──────────────────────────────────────────────────── */
.sam-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.sam-btn--edit {
    flex: 1;
    padding: 10px;
    background: #252927;
    border: 1px solid #2E2E2E;
    border-radius: 12px;
    color: #FFFFFF;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
    font-family: inherit;
}

.sam-btn--edit:hover {
    background: #2E2E2E;
}

.sam-btn--block {
    flex: 1;
    padding: 10px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid #F59E0B;
    border-radius: 12px;
    color: #F59E0B;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
    font-family: inherit;
}

.sam-btn--block:hover {
    background: rgba(245, 158, 11, 0.2);
}

.sam-btn--unblock {
    flex: 1;
    padding: 10px;
    background: rgba(45, 212, 191, 0.1);
    border: 1px solid #2DD4BF;
    border-radius: 12px;
    color: #2DD4BF;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
    font-family: inherit;
}

.sam-btn--unblock:hover {
    background: rgba(45, 212, 191, 0.2);
}

.sam-btn--delete {
    flex: 1;
    padding: 10px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid #EF4444;
    border-radius: 12px;
    color: #EF4444;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
    font-family: inherit;
}

.sam-btn--delete:hover {
    background: rgba(239, 68, 68, 0.2);
}

.sam-btn--modules {
    flex: 1;
    padding: 10px;
    background: rgba(45, 212, 191, 0.1);
    border: 1px solid rgba(45, 212, 191, 0.3);
    border-radius: 12px;
    color: #2DD4BF;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
    font-family: inherit;
}

.sam-btn--modules:hover {
    background: rgba(45, 212, 191, 0.2);
}

/* ── Detail View ──────────────────────────────────────────────────── */
.sam-detail-header {
    position: sticky;
    top: 0;
    z-index: 200;
    background: #0F1412;
    border-bottom: 2px solid #2E2E2E;
    padding: 0.875rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sam-detail-identity {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.sam-detail-icon {
    font-size: 1.75rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(45, 212, 191, 0.12);
    color: #2DD4BF;
    flex-shrink: 0;
}

.sam-detail-title {
    color: #fff;
    font-size: 1.125rem;
    font-weight: 700;
}

.sam-detail-subtitle {
    color: #A3A3A3;
    font-size: 0.75rem;
}

.sam-detail-id {
    color: #6B7280;
    font-size: 0.75rem;
    flex-shrink: 0;
    background: #1A1D1C;
    padding: 3px 10px;
    border-radius: 6px;
    border: 1px solid #2E2E2E;
}

.sam-detail-body {
    max-width: 900px;
    margin: 0 auto;
    padding: 1.25rem;
}

.sam-detail-loading {
    text-align: center;
    padding: 2rem;
    color: #A3A3A3;
}

.sam-detail-loading-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
    color: #2DD4BF;
}

/* ── Module Panel ─────────────────────────────────────────────────── */
.sam-module-panel {
    background: #1A1D1C;
    border: 1px solid #2E2E2E;
    border-radius: 0.875rem;
    padding: 1.5rem;
}

.sam-module-panel-header {
    margin-bottom: 1.25rem;
}

.sam-module-panel-title {
    color: #fff;
    font-size: 1.063rem;
    font-weight: 600;
    margin-bottom: 0.375rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sam-module-panel-title i {
    color: #2DD4BF;
}

.sam-module-panel-desc {
    color: #6B7280;
    font-size: 0.813rem;
}

.sam-module-group {
    margin-bottom: 1.5rem;
}

.sam-module-group:last-child {
    margin-bottom: 0;
}

.sam-module-group-title {
    color: #fff;
    font-size: 0.938rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sam-module-group-title i {
    font-size: 0.875rem;
}

.sam-module-count {
    background: #252927;
    color: #9CA3AF;
    font-size: 0.688rem;
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 600;
}

.sam-module-empty {
    color: #6B7280;
    font-size: 0.813rem;
    padding: 1rem 0;
}

.sam-module-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.sam-module-chip {
    display: flex;
    flex-direction: column;
    padding: 0.5rem 0.75rem;
    border-radius: 10px;
    font-size: 0.813rem;
    font-weight: 500;
    transition: transform 0.15s;
    width: 100%;
}

.sam-module-chip:hover {
    transform: translateY(-1px);
}

.sam-module-chip--assigned {
    border: 1px solid rgba(34, 197, 94, 0.25);
    background: rgba(34, 197, 94, 0.06);
    color: #D1D5DB;
}

.sam-module-chip--available {
    border: 1px solid #2E2E2E;
    background: #1E2120;
    color: #9CA3AF;
}

.sam-module-chip-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sam-module-chip-icon {
    font-size: 0.75rem;
    opacity: 0.6;
}

.sam-module-chip--assigned .sam-module-chip-icon {
    color: #22C55E;
    opacity: 0.8;
}

.sam-module-chip--available .sam-module-chip-icon {
    color: #6B7280;
}

.sam-module-chip-row span {
    flex: 1;
    min-width: 0;
}

/* ── Module Toggle (assign/unassign) ──────────────────────────────── */
.sam-module-toggle {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 0.563rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s, background 0.15s;
    margin-left: 0.25rem;
    flex-shrink: 0;
}

.sam-module-toggle--add {
    background: rgba(34, 197, 94, 0.15);
    color: #22C55E;
}

.sam-module-toggle--add:hover {
    background: rgba(34, 197, 94, 0.3);
    transform: scale(1.15);
}

/* ── ON/OFF Toggle ────────────────────────────────────────────────── */
.sam-toggle {
    padding: 4px 10px;
    border-radius: 16px;
    border: none;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s;
    font-family: inherit;
    flex-shrink: 0;
    white-space: nowrap;
}

.sam-toggle--on {
    background: rgba(34, 197, 94, 0.15);
    color: #22C55E;
}

.sam-toggle--on:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #EF4444;
}

.sam-toggle--off {
    background: rgba(239, 68, 68, 0.1);
    color: #EF4444;
}

.sam-toggle--off:hover {
    background: rgba(34, 197, 94, 0.15);
    color: #22C55E;
}

/* ── Function List ─────────────────────────────────────────────────── */
.sam-function-list {
    padding-left: 1.5rem;
    margin-top: 0.5rem;
    border-top: 1px solid rgba(255,255,255,0.06);
    padding-top: 0.5rem;
}

.sam-function-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
}

.sam-function-name {
    color: #9CA3AF;
    font-size: 12px;
}

/* ── Buttons ──────────────────────────────────────────────────────── */
.sam-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.813rem;
    border-radius: 0.5rem;
    transition: all 0.15s;
    font-family: inherit;
}

.sam-btn--primary {
    padding: 0.625rem 1rem;
    border: none;
    background: linear-gradient(135deg, #2DD4BF, #22C55E);
    color: #0F1412;
    white-space: nowrap;
    flex-shrink: 0;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(45, 212, 191, 0.2);
}

.sam-btn--primary:hover {
    box-shadow: 0 4px 16px rgba(45, 212, 191, 0.3);
    transform: translateY(-1px);
}

.sam-btn--back {
    padding: 0.5rem 0.875rem;
    background: #1A1D1C;
    border: 1px solid #2E2E2E;
    color: #D1D5DB;
    font-size: 0.813rem;
    flex-shrink: 0;
}

.sam-btn--back:hover {
    background: #252927;
    border-color: #2DD4BF50;
}

.sam-btn--cancel {
    flex: 1;
    padding: 0.75rem;
    border-radius: 0.625rem;
    border: 1px solid #2E2E2E;
    font-weight: 600;
    font-size: 0.875rem;
    background: #1A1D1C;
    color: #D1D5DB;
}

.sam-btn--cancel:hover {
    background: #252927;
}

.sam-btn--danger {
    flex: 1;
    padding: 0.75rem;
    border-radius: 0.625rem;
    border: none;
    font-weight: 700;
    font-size: 0.875rem;
    background: #EF4444;
    color: #fff;
}

.sam-btn--danger:hover {
    background: #DC2626;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* ── Empty State ───────────────────────────────────────────────────── */
.sam-empty {
    text-align: center;
    padding: 4rem 1rem;
}

.sam-empty-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    color: #4B5563;
    display: block;
}

.sam-empty-icon--large {
    font-size: 3rem;
    color: #6B7280;
}

.sam-empty-title {
    color: #fff;
    font-size: 1.063rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.sam-empty-desc {
    color: #6B7280;
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
}

/* ── Delete Confirmation Overlay ─────────────────────────────────── */
.sam-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.sam-overlay-card {
    background: #1A1D1C;
    border: 1px solid #2E2E2E;
    border-radius: 0.875rem;
    padding: 2rem;
    max-width: 400px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.sam-overlay-icon-wrap {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.25rem;
    color: #EF4444;
}

.sam-overlay-title {
    color: #fff;
    font-size: 1.063rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.sam-overlay-desc {
    color: #9CA3AF;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.sam-overlay-actions {
    display: flex;
    gap: 0.75rem;
}

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .sam-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

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

    .sam-grid {
        grid-template-columns: 1fr;
    }

    .sam-detail-header {
        flex-wrap: wrap;
    }

    .sam-detail-id {
        display: none;
    }

    .sam-overlay-card {
        margin: 1rem;
    }

    .sam-card-actions {
        flex-direction: column;
    }
}