/* ==========================================================================
   EcoCare Monitor — Modern Unified Admin Dashboard Layout
   ========================================================================== */

/* ---- KPI Grid & Hero ---- */
.adm-v6-kpi-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    width: 100% !important;
    max-width: 100% !important;
    gap: 16px !important;
}

.ov6-kpi-strip {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-bottom: 20px !important;
}

/* ---- Unified 2-Column Dashboard Grid ---- */
.adm-v6-dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.85fr) minmax(340px, 1fr);
    gap: 20px;
    align-items: start;
    width: 100%;
}

.adm-v6-main-col {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

.adm-v6-side-col {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

/* ---- Card Containers ---- */
.adm-v6-users-card,
.adm-v6-create-card,
.adm-v6-security-card,
.adm-v6-audit-card {
    border-radius: 16px;
    border: 1px solid var(--ov6-border, #e2e8f0);
    background: var(--ov6-surface, #ffffff);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    overflow: visible !important;
}

.dark-theme .adm-v6-users-card,
.dark-theme .adm-v6-create-card,
.dark-theme .adm-v6-security-card,
.dark-theme .adm-v6-audit-card {
    background: #0f172a;
    border-color: #1e293b;
}

/* Card Header */
.adm-v6-users-head,
.adm-v6-create-head,
.adm-v6-security-head,
.adm-v6-audit-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--ov6-border, #e2e8f0);
}

.dark-theme .adm-v6-users-head,
.dark-theme .adm-v6-create-head,
.dark-theme .adm-v6-security-head,
.dark-theme .adm-v6-audit-head {
    border-bottom-color: #1e293b;
}

.adm-v6-head-title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.adm-v6-head-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--ov6-brand, #0071bc);
    background: rgba(0, 113, 188, 0.1);
    flex-shrink: 0;
}

.dark-theme .adm-v6-head-icon {
    background: rgba(56, 189, 248, 0.12);
    color: #38bdf8;
}

.adm-v6-head-icon-emerald {
    color: #059669;
    background: rgba(5, 150, 105, 0.1);
}

.dark-theme .adm-v6-head-icon-emerald {
    color: #34d399;
    background: rgba(52, 211, 153, 0.15);
}

.adm-v6-head-icon-violet {
    color: #7c3aed;
    background: rgba(124, 58, 237, 0.1);
}

.dark-theme .adm-v6-head-icon-violet {
    color: #a78bfa;
    background: rgba(167, 139, 250, 0.15);
}

.adm-v6-head-icon-amber {
    color: #d97706;
    background: rgba(217, 119, 6, 0.1);
}

.dark-theme .adm-v6-head-icon-amber {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.15);
}

.adm-v6-head-title-wrap h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 800;
    color: var(--ov6-text, #0f172a);
    display: flex;
    align-items: center;
    gap: 8px;
}

.dark-theme .adm-v6-head-title-wrap h3 {
    color: #f8fafc;
}

.adm-v6-card-sub {
    margin: 2px 0 0;
    font-size: 11px;
    font-weight: 600;
    color: var(--ov6-text-muted, #64748b);
    line-height: 1.4;
}

.dark-theme .adm-v6-card-sub {
    color: #94a3b8;
}

/* Toolbar & Filters */
.adm-v6-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.adm-v6-filter-wrap {
    position: relative;
    display: inline-flex;
}

.adm-v6-select-filter {
    height: 36px;
    padding: 0 32px 0 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--ov6-text, #0f172a);
    background-color: var(--ov6-bg, #f8fafc);
    border: 1px solid var(--ov6-border, #cbd5e1);
    border-radius: 9px;
    outline: none;
    cursor: pointer;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 9px center;
    background-size: 11px;
    min-width: 125px;
    transition: all 0.15s ease;
}

.adm-v6-select-filter:focus {
    border-color: var(--ov6-brand, #0071bc);
    box-shadow: 0 0 0 3px rgba(0, 113, 188, 0.1);
}

.dark-theme .adm-v6-select-filter {
    background-color: #1e293b;
    border-color: #334155;
    color: #f8fafc;
}

.adm-v6-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.adm-v6-search-wrap > i {
    position: absolute;
    left: 11px;
    font-size: 11px;
    color: var(--ov6-text-muted, #64748b);
    pointer-events: none;
}

.adm-v6-search {
    width: 200px;
    max-width: 100%;
    height: 36px;
    padding: 0 12px 0 32px;
    font-size: 12px;
    font-weight: 600;
    color: var(--ov6-text, #0f172a);
    background: var(--ov6-bg, #f8fafc);
    border: 1px solid var(--ov6-border, #cbd5e1);
    border-radius: 9px;
    outline: none;
    transition: all 0.15s ease;
}

.adm-v6-search:focus {
    border-color: var(--ov6-brand, #0071bc);
    box-shadow: 0 0 0 3px rgba(0, 113, 188, 0.1);
    background: var(--ov6-surface, #ffffff);
}

.dark-theme .adm-v6-search {
    background: #1e293b;
    border-color: #334155;
    color: #f8fafc;
}

.adm-v6-refresh-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    font-size: 12px;
    color: var(--ov6-text-secondary, #475569);
    background: var(--ov6-bg, #f8fafc);
    border: 1px solid var(--ov6-border, #cbd5e1);
    border-radius: 9px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.adm-v6-refresh-btn:hover {
    background: #e2e8f0;
    color: var(--ov6-brand, #0071bc);
}

.adm-v6-refresh-btn:hover i {
    transform: rotate(180deg);
    transition: transform 0.3s ease;
}

.dark-theme .adm-v6-refresh-btn {
    background: #1e293b;
    border-color: #334155;
    color: #cbd5e1;
}

/* ---- User Table Styles & Columns ---- */
.adm-v6-table-wrap {
    overflow-x: auto;
    overflow-y: visible !important;
    max-height: 560px;
}

.adm-v6-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.adm-v6-table thead th {
    padding: 12px 16px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ov6-text-muted, #64748b);
    background: var(--ov6-bg, #f8fafc);
    border-bottom: 1px solid var(--ov6-border, #e2e8f0);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 5;
}

.dark-theme .adm-v6-table thead th {
    background: #1e293b;
    border-bottom-color: #334155;
    color: #94a3b8;
}

/* Precise Column Proportions */
.adm-v6-table th:nth-child(1), .adm-v6-table td:nth-child(1) { width: 32%; min-width: 200px; }
.adm-v6-table th:nth-child(2), .adm-v6-table td:nth-child(2) { width: 17%; min-width: 130px; }
.adm-v6-table th:nth-child(3), .adm-v6-table td:nth-child(3) { width: 17%; min-width: 120px; }
.adm-v6-table th:nth-child(4), .adm-v6-table td:nth-child(4) { width: 18%; min-width: 130px; }
.adm-v6-table th:nth-child(5), .adm-v6-table td:nth-child(5) { width: 16%; min-width: 120px; text-align: right; }

.adm-v6-table tbody tr {
    transition: background 0.15s ease;
    border-bottom: 1px solid var(--ov6-border-soft, #f1f5f9);
}

.dark-theme .adm-v6-table tbody tr {
    border-bottom-color: #1e293b;
}

.adm-v6-table tbody tr:hover {
    background: rgba(0, 113, 188, 0.02);
}

.dark-theme .adm-v6-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.adm-v6-table tbody td {
    padding: 12px 16px;
    font-size: 13px;
    color: var(--ov6-text, #0f172a);
    vertical-align: middle;
}

.dark-theme .adm-v6-table tbody td {
    color: #f8fafc;
}

.adm-v6-table tbody tr.adm-v6-group-row td {
    padding: 9px 16px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ov6-text-secondary, #475569);
    background: var(--ov6-bg, #f1f5f9);
    border-bottom: 1px solid var(--ov6-border, #e2e8f0);
}

.dark-theme .adm-v6-table tbody tr.adm-v6-group-row td {
    background: #1e293b;
    border-bottom-color: #334155;
    color: #94a3b8;
}

.adm-v6-table tbody tr.adm-v6-group-row i {
    margin-right: 8px;
    color: var(--ov6-brand, #0071bc);
}

/* User cell & Avatar */
.adm-v6-user-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.adm-v6-avatar {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 900;
    color: var(--ov6-brand, #0071bc);
    background: linear-gradient(135deg, rgba(0, 113, 188, 0.15) 0%, rgba(2, 132, 199, 0.1) 100%);
    border: 1px solid rgba(0, 113, 188, 0.2);
    border-radius: 50%;
}

.adm-v6-user-name {
    display: block;
    font-size: 13px;
    font-weight: 800;
    color: var(--ov6-text, #0f172a);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dark-theme .adm-v6-user-name {
    color: #f8fafc;
}

.adm-v6-user-email {
    display: block;
    font-size: 10px;
    font-weight: 600;
    color: var(--ov6-text-muted, #64748b);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 1px;
}

/* Role dropdown trigger */
.adm-v6-dropdown-container {
    position: relative;
    display: inline-flex;
    vertical-align: middle;
}

.adm-v6-dropdown-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 5px;
    min-width: 105px;
    height: 26px;
    padding: 0 8px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    border-radius: 7px;
    cursor: pointer;
    box-sizing: border-box;
    transition: all 0.15s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.adm-v6-dropdown-trigger.adm-v6-role-user {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
}
.adm-v6-dropdown-trigger.adm-v6-role-user:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
}

.adm-v6-dropdown-trigger.adm-v6-role-manager {
    background: #ede9fe;
    color: #6d28d9;
    border: 1px solid #ddd6fe;
}
.adm-v6-dropdown-trigger.adm-v6-role-manager:hover {
    background: #ddd6fe;
    border-color: #c084fc;
}

.adm-v6-dropdown-trigger.adm-v6-role-admin {
    background: #dbeafe;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}
.adm-v6-dropdown-trigger.adm-v6-role-admin:hover {
    background: #bfdbfe;
    border-color: #60a5fa;
}

.adm-v6-role-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-radius: 7px;
}

.adm-v6-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 5px;
    z-index: 9999;
    min-width: 135px;
    background: var(--ov6-surface, #ffffff);
    border: 1px solid var(--ov6-border, #e2e8f0);
    border-radius: 10px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    padding: 5px;
    animation: dropdownFadeIn 0.15s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.dark-theme .adm-v6-dropdown-menu {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-6px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.adm-v6-dropdown-menu.show {
    display: block;
}

.adm-v6-dropdown-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 7px 10px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--ov6-text-secondary, #475569);
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
}

.adm-v6-dropdown-item:hover {
    background: var(--ov6-bg, #f1f5f9);
    color: var(--ov6-text, #0f172a);
}

.dark-theme .adm-v6-dropdown-item {
    color: #cbd5e1;
}

.dark-theme .adm-v6-dropdown-item:hover {
    background: #334155;
    color: #f8fafc;
}

.adm-v6-dropdown-item::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-right: 8px;
}

.adm-v6-dropdown-item[data-value="user"]::before { background: #64748b; }
.adm-v6-dropdown-item[data-value="manager"]::before { background: #8b5cf6; }
.adm-v6-dropdown-item[data-value="admin"]::before { background: #3b82f6; }

.adm-v6-dropdown-item.active {
    font-weight: 800;
}
.adm-v6-dropdown-item.active[data-value="user"] { color: #475569; background: #f1f5f9; }
.adm-v6-dropdown-item.active[data-value="manager"] { color: #6d28d9; background: #ede9fe; }
.adm-v6-dropdown-item.active[data-value="admin"] { color: #1d4ed8; background: #dbeafe; }

/* Table Action Buttons */
.adm-v6-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 5px;
}

.adm-v6-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    font-size: 11px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.adm-v6-action-btn:hover {
    transform: translateY(-1px);
}

.adm-v6-action-btn:active {
    transform: scale(0.95);
}

.adm-v6-action-reset { background: #eff6ff; color: #2563eb; }
.adm-v6-action-reset:hover { background: #dbeafe; color: #1d4ed8; }

.adm-v6-action-logout { background: #fff7ed; color: #ea580c; }
.adm-v6-action-logout:hover { background: #ffedd5; color: #c2410c; }

.adm-v6-action-delete { background: #fef2f2; color: #dc2626; }
.adm-v6-action-delete:hover { background: #fee2e2; color: #b91c1c; }

.dark-theme .adm-v6-action-reset { background: rgba(37, 99, 235, 0.15); color: #60a5fa; }
.dark-theme .adm-v6-action-logout { background: rgba(234, 88, 12, 0.15); color: #fb923c; }
.dark-theme .adm-v6-action-delete { background: rgba(220, 38, 38, 0.15); color: #f87171; }

.adm-v6-system-label {
    font-size: 11px;
    font-style: italic;
    font-weight: 700;
    color: var(--ov6-text-muted, #64748b);
}

/* ---- Empty State in Table ---- */
.adm-v6-empty-td {
    padding: 48px 20px !important;
    text-align: center;
    background: transparent !important;
}

.adm-v6-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    max-width: 380px;
    margin: 0 auto;
}

.adm-v6-empty-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: rgba(0, 113, 188, 0.08);
    color: var(--ov6-brand, #0071bc);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.dark-theme .adm-v6-empty-icon {
    background: rgba(56, 189, 248, 0.12);
    color: #38bdf8;
}

.adm-v6-empty-title {
    font-size: 14px;
    font-weight: 800;
    color: var(--ov6-text, #0f172a);
    margin: 0;
}

.dark-theme .adm-v6-empty-title {
    color: #f8fafc;
}

.adm-v6-empty-desc {
    font-size: 11px;
    font-weight: 600;
    color: var(--ov6-text-muted, #64748b);
    margin: 0;
    line-height: 1.45;
}

.adm-v6-empty-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 18px;
    font-size: 12px;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(135deg, #0071bc 0%, #0284c7 100%);
    border: none;
    border-radius: 9px;
    cursor: pointer;
    margin-top: 4px;
    box-shadow: 0 4px 12px rgba(0, 113, 188, 0.25);
    transition: all 0.2s ease;
}

.adm-v6-empty-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 113, 188, 0.35);
}

/* ---- Right Column Forms (Create User & Security) ---- */
.adm-v6-side-form-stack {
    display: flex;
    flex-direction: column;
    gap: 13px;
}

.adm-v6-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.adm-v6-label {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ov6-text-muted, #64748b);
    display: flex;
    align-items: center;
}

.adm-v6-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.adm-v6-input-icon {
    position: absolute;
    left: 12px;
    font-size: 12px;
    color: var(--ov6-text-muted, #64748b);
    pointer-events: none;
}

.adm-v6-input {
    width: 100%;
    min-height: 40px;
    height: 40px;
    padding: 0 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ov6-text, #0f172a);
    background: var(--ov6-surface, #ffffff);
    border: 1px solid var(--ov6-border, #cbd5e1);
    border-radius: 9px;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.dark-theme .adm-v6-input {
    background: #1e293b;
    border-color: #334155;
    color: #f8fafc;
}

.adm-v6-input-iconed { padding-left: 36px; }

.adm-v6-select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    padding-right: 34px !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 11px;
}

.adm-v6-input:focus {
    border-color: var(--ov6-brand, #0071bc);
    box-shadow: 0 0 0 3px rgba(0, 113, 188, 0.1);
}

.dark-theme .adm-v6-input:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.adm-v6-input-pass {
    padding-right: 36px;
}

.adm-v6-toggle-pass {
    position: absolute;
    right: 10px;
    background: transparent;
    border: none;
    color: var(--ov6-text-muted, #64748b);
    cursor: pointer;
    font-size: 12px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    z-index: 10;
}

.adm-v6-toggle-pass:hover {
    color: var(--ov6-text, #0f172a);
}

.adm-v6-submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    min-height: 40px;
    padding: 0 18px;
    font-size: 12px;
    font-weight: 800;
    border-radius: 9px;
    cursor: pointer;
    border: none;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
}

.adm-v6-btn-primary {
    color: #ffffff;
    background: linear-gradient(135deg, #0071bc 0%, #0284c7 100%);
    box-shadow: 0 2px 8px rgba(0, 113, 188, 0.25);
}

.adm-v6-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 113, 188, 0.35);
    background: linear-gradient(135deg, #005a94 0%, #0369a1 100%);
}

.adm-v6-btn-primary:active {
    transform: scale(0.98);
}

.adm-v6-submit-btn-secondary {
    color: var(--ov6-text, #0f172a);
    background: var(--ov6-bg, #f8fafc);
    border: 1px solid var(--ov6-border, #cbd5e1);
}

.adm-v6-submit-btn-secondary:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
}

.dark-theme .adm-v6-submit-btn-secondary {
    background: #1e293b;
    border-color: #334155;
    color: #f8fafc;
}

/* Security tip */
.adm-v6-security-tip {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 4px 0 0;
    padding: 10px 12px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.45;
    color: var(--ov6-text-muted, #64748b);
    background: var(--ov6-bg, #f8fafc);
    border: 1px solid var(--ov6-border-soft, #e2e8f0);
    border-radius: 9px;
}

.dark-theme .adm-v6-security-tip {
    background: #1e293b;
    border-color: #334155;
    color: #94a3b8;
}

.adm-v6-security-tip i {
    margin-top: 1px;
    color: var(--ov6-brand, #0071bc);
    flex-shrink: 0;
}

/* ---- Email @ Autocomplete ---- */
.email-ac-list {
    margin: 0;
    padding: 4px;
    list-style: none;
    background: var(--ov6-surface, #ffffff);
    border: 1px solid var(--ov6-border, #e2e8f0);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
    max-height: 160px;
    overflow-y: auto;
}

.email-ac-list-fixed {
    position: fixed;
    z-index: 10050;
}

.email-ac-list.hidden { display: none; }

.email-ac-item {
    padding: 8px 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ov6-text, #0f172a);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.12s;
}

.email-ac-item:hover,
.email-ac-item.active {
    background: rgba(16, 185, 129, 0.12);
}

.email-ac-local { color: var(--ov6-text, #0f172a); }
.email-ac-at { color: var(--ov6-text-muted, #64748b); }
.email-ac-domain { color: #059669; font-weight: 700; }

/* ---- Premium Subscriptions ---- */
.badge-premium {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 7px;
    text-transform: uppercase;
}
.badge-premium.active {
    background-color: #fef3c7;
    color: #d97706;
    border: 1px solid #fde68a;
}
.dark-theme .badge-premium.active {
    background-color: rgba(217, 119, 6, 0.15);
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.25);
}
.badge-premium.expired {
    background-color: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
}
.dark-theme .badge-premium.expired {
    background-color: rgba(220, 38, 38, 0.15);
    color: #fca5a5;
    border-color: rgba(252, 165, 165, 0.25);
}
.badge-free {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 7px;
    background-color: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
    text-transform: uppercase;
}
.dark-theme .badge-free {
    background-color: #1e293b;
    color: #94a3b8;
    border-color: #334155;
}

.adm-v6-plan-badge-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: transform 0.15s ease;
}
.adm-v6-plan-badge-btn:hover {
    transform: scale(1.05);
}

/* Modal Configuration */
.ov5-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ov5-modal-card {
    background-color: var(--ov6-surface, #ffffff);
    border: 1px solid var(--ov6-border, #e2e8f0);
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 420px;
    overflow: hidden;
    animation: modal-slide-in 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.ov5-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--ov6-border, #e2e8f0);
}
.ov5-modal-header h3 {
    font-size: 15px;
    font-weight: 800;
    color: var(--ov6-text, #1e293b);
    display: flex;
    align-items: center;
    gap: 8px;
}
.ov5-modal-close-btn {
    background: none;
    border: none;
    font-size: 20px;
    font-weight: 600;
    color: #94a3b8;
    cursor: pointer;
}
.ov5-modal-body {
    padding: 20px;
}
.ov5-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 20px;
    background-color: var(--ov6-bg, #f8fafc);
    border-top: 1px solid var(--ov6-border, #e2e8f0);
}
.ov5-btn-secondary {
    background-color: var(--ov6-surface, #ffffff);
    color: var(--ov6-text, #1e293b);
    border: 1px solid var(--ov6-border, #e2e8f0);
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
}
.ov5-btn-primary {
    background-color: var(--ov6-brand, #0071bc);
    color: #ffffff;
    border: none;
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
}
@keyframes modal-slide-in {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ---- Audit Log UI Styles ---- */
.audit-pagination {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--ov6-border-soft, #f1f5f9);
}
.dark-theme .audit-pagination {
    border-top-color: #334155;
}
.audit-view-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Mobile & Tablet Responsive Overrides */
@media (max-width: 1100px) {
    .adm-v6-dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .adm-v6-kpi-grid {
        grid-template-columns: 1fr !important;
    }
    .adm-v6-users-head,
    .adm-v6-create-head,
    .adm-v6-security-head,
    .adm-v6-audit-head {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    .adm-v6-toolbar {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
    }
    .adm-v6-filter-wrap,
    .adm-v6-select-filter {
        width: 100% !important;
        min-width: 0;
    }
    .adm-v6-search-wrap {
        flex: 1;
        min-width: 0;
    }
    .adm-v6-search {
        width: 100%;
    }
}
