/* Admin Portal Premium Styling */
.ommtax-admin-container {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #1e293b;
    background: #fafafa;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    margin: 20px 0;
}

/* Common Components */
.ommtax-white-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.ommtax-text-muted {
    color: #64748b;
}

.ommtax-hover-blue:hover {
    color: #3b82f6;
    text-decoration: underline;
}

/* Dashboard Header */
.ommtax-admin-header {
    margin-bottom: 24px;
    padding: 20px 24px;
}

.ommtax-admin-header-flex {
    margin-bottom: 24px;
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.ommtax-admin-header h2,
.ommtax-admin-header-flex h2 {
    margin: 0 0 8px 0;
    font-size: 1.6rem;
    color: #0f172a;
    font-weight: 600;
}

.ommtax-admin-header p,
.ommtax-admin-header-flex p {
    margin: 0;
    color: #64748b;
    font-size: 1rem;
}

/* Search Modal Variables */
.ommtax-btn-search-trigger {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #0f172a;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.ommtax-btn-search-trigger:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

.ommtax-search-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999999;
    /* high z-index to cover WP admin sidebar */
    padding-top: 10vh;
    display: none;
    opacity: 0;
    transition: opacity 0.2s;
}

.ommtax-search-modal.active {
    display: block;
    opacity: 1;
}

.ommtax-search-modal-content {
    background: #ffffff;
    width: 90%;
    max-width: 650px;
    margin: 0 auto;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

.ommtax-search-modal-header {
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid #e2e8f0;
}

#ommtaxSearchInput {
    width: 100%;
    border: none;
    padding: 24px 16px;
    font-size: 1.2rem;
    color: #0f172a;
    outline: none;
    box-sizing: border-box;
    background: transparent;
}

#ommtaxSearchInput::placeholder {
    color: #94a3b8;
}

.ommtax-search-results {
    max-height: 400px;
    overflow-y: auto;
}

.ommtax-search-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid #f1f5f9;
    text-decoration: none;
    color: #334155;
    transition: background 0.2s;
}

.ommtax-search-item:last-child {
    border-bottom: none;
}

.ommtax-search-item:hover {
    background: #f8fafc;
}

.ommtax-search-item-info strong {
    color: #0f172a;
    font-size: 1.05rem;
    margin-right: 8px;
}

.ommtax-search-item-info span {
    display: block;
    color: #64748b;
    font-size: 0.9rem;
    margin-top: 4px;
}

.ommtax-search-empty {
    padding: 30px;
    text-align: center;
    color: #64748b;
    font-size: 1rem;
}

/* Statistics Grid */
.ommtax-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.ommtax-stat-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 18px 20px;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ommtax-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.05);
}

/* Clickable stat card link */
.ommtax-stat-card-link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    outline: none;
}

.ommtax-stat-card-link:hover {
    text-decoration: none;
    color: inherit;
}

.ommtax-stat-card-link:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Active (selected) state */
.ommtax-stat-active {
    border-width: 2px;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12), 0 4px 10px rgba(0, 0, 0, 0.05);
}

.ommtax-stat-active-green {
    border-color: #16a34a;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.12), 0 4px 10px rgba(0, 0, 0, 0.05);
}

.ommtax-stat-active-orange {
    border-color: #f97316;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.12), 0 4px 10px rgba(0, 0, 0, 0.05);
}

/* Active filter bar */
.ommtax-filter-active-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
    border-radius: 8px;
    padding: 10px 16px;
    margin-bottom: 16px;
    font-size: 0.875rem;
    font-weight: 500;
}

.ommtax-filter-active-bar span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ommtax-filter-active-bar strong {
    font-weight: 700;
}

.ommtax-filter-clear {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #ffffff;
    border: 1px solid #93c5fd;
    color: #1d4ed8;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    white-space: nowrap;
    transition: all 0.2s;
    flex-shrink: 0;
}

.ommtax-filter-clear:hover {
    background: #dbeafe;
    border-color: #60a5fa;
    color: #1e40af;
    text-decoration: none;
}

.ommtax-stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ommtax-icon-blue {
    background: #eff6ff;
    color: #3b82f6;
}

.ommtax-icon-green {
    background: #f0fdf4;
    color: #16a34a;
}

.ommtax-icon-orange {
    background: #fff7ed;
    color: #f97316;
}

.ommtax-stat-card h3 {
    margin: 0 0 4px 0;
    font-size: 0.85rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.ommtax-stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.ommtax-text-blue {
    color: #3b82f6;
}

.ommtax-text-green {
    color: #16a34a;
}

.ommtax-text-orange {
    color: #f97316;
}

/* Dashboard Table */
.ommtax-table-wrapper {
    overflow-x: auto;
    padding: 0;
}

.ommtax-admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.ommtax-admin-table th {
    background: #f8fafc;
    padding: 12px 16px;
    text-align: left;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #64748b;
    font-weight: 600;
    border-bottom: 2px solid #e2e8f0;
}

.ommtax-admin-table td {
    padding: 8px 16px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    font-size: 0.85rem;
}

.ommtax-admin-table tr:last-child td {
    border-bottom: none;
}

.ommtax-row-highlight {
    background-color: #fcfcfd;
}

/* Badges & Text Elements */
.ommtax-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ommtax-badge-new {
    background: #dbeafe;
    color: #1d4ed8;
}

.ommtax-badge-viewed {
    background: #ffedd5;
    color: #c2410c;
}

.ommtax-badge-downloaded {
    background: #dcfce7;
    color: #15803d;
}

.ommtax-client-name {
    font-weight: 600;
    color: #0f172a;
    font-size: 0.9rem;
}

/* Table Actions */
.ommtax-action-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ommtax-btn-view-profile {
    display: inline-block;
    padding: 4px 10px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #334155;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s;
    height: 30px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ommtax-btn-view-profile:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #0f172a;
}

.ommtax-btn-download-action {
    background: #ffffff;
    border-color: #bbf7d0;
    color: #16a34a;
}

.ommtax-btn-download-action:hover {
    background: #f0fdf4;
    border-color: #86efac;
    color: #15803d;
}

.ommtax-inline-form {
    margin: 0;
    padding: 0;
}

.ommtax-btn-icon-del {
    background: #ffffff;
    border: 1px solid #fecaca;
    color: #ef4444;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 30px;
    box-sizing: border-box;
}

.ommtax-btn-icon-del:hover {
    background: #fef2f2;
    border-color: #fca5a5;
}

/* Empty State */
.ommtax-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
}

.ommtax-empty-state svg {
    margin-bottom: 15px;
    color: #cbd5e1;
}

/* =========================================
   PROFILE VIEW STYLES
   ========================================= */

.ommtax-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #64748b;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 24px;
    transition: color 0.2s;
}

.ommtax-back-link:hover {
    color: #0f172a;
}

.ommtax-profile-title {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}

.ommtax-profile-avatar {
    width: 64px;
    height: 64px;
    background: #3b82f6;
    color: white;
    font-size: 1.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.2);
}

.ommtax-profile-title h2 {
    margin: 0 0 4px 0;
    font-size: 1.8rem;
    color: #0f172a;
}

.ommtax-email-link {
    color: #64748b;
    text-decoration: none;
    font-size: 1.05rem;
}

.ommtax-email-link:hover {
    color: #3b82f6;
    text-decoration: underline;
}

.ommtax-profile-content {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 24px;
}

/* Sidebar Details */
.ommtax-detail-group {
    margin-bottom: 24px;
}

.ommtax-detail-group:last-child {
    margin-bottom: 0;
}

.ommtax-detail-group label {
    display: block;
    font-size: 0.85rem;
    text-transform: uppercase;
    color: #64748b;
    font-weight: 600;
    margin-bottom: 8px;
}

.ommtax-detail-group p {
    margin: 0;
    color: #0f172a;
    font-size: 1rem;
}

.ommtax-stat-highlight {
    font-size: 2rem !important;
    font-weight: 700;
    color: #3b82f6 !important;
}

.ommtax-recipient-badge {
    display: inline-block;
    background: #ede9fe;
    color: #5b21b6;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
}

.ommtax-message-box {
    background: #f8fafc;
    padding: 16px;
    border-left: 4px solid #cbd5e1;
    border-radius: 4px 8px 8px 4px;
    font-size: 0.95rem;
    color: #475569;
    line-height: 1.5;
}

/* Documents Main Area */
.ommtax-profile-main h3 {
    margin: 0 0 20px 0;
    font-size: 1.25rem;
    color: #0f172a;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.ommtax-document-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.ommtax-doc-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    transition: background 0.2s, border-color 0.2s;
}

.ommtax-doc-card:hover {
    background: #ffffff;
    border-color: #cbd5e1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.ommtax-doc-icon {
    width: 40px;
    height: 40px;
    background: #e2e8f0;
    color: #475569;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ommtax-doc-info {
    flex-grow: 1;
    min-width: 0;
    /* allows text truncation */
}

.ommtax-doc-name {
    font-weight: 500;
    color: #0f172a;
    font-size: 0.95rem;
    margin-bottom: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ommtax-doc-actions {
    display: flex;
    gap: 8px;
}

.ommtax-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}

.ommtax-btn-view {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #334155;
}

.ommtax-btn-view:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.ommtax-btn-download {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
}

.ommtax-btn-download:hover {
    background: #dbeafe;
    border-color: #93c5fd;
}

/* Responsiveness */
@media (max-width: 1024px) {
    .ommtax-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .ommtax-stats-grid {
        grid-template-columns: 1fr;
    }

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