/* Shared Management Styles */
.portal-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0;
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    transition: var(--transition);
}

/* Shared Form Styles */
.form-group,
.form-group-premium {
    margin-bottom: 0.85rem;
}



.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon i {
    position: absolute;
    left: 1.25rem;
    color: var(--text-muted);
    font-size: 1rem;
    pointer-events: none;
}

[dir="rtl"] .input-with-icon i {
    left: auto;
    right: 1.25rem;
}

.input-with-icon .portal-input,
.input-with-icon .premium-input {
    padding-left: 3rem;
}

[dir="rtl"] .input-with-icon .portal-input,
[dir="rtl"] .input-with-icon .premium-input {
    padding-left: 1.25rem;
    padding-right: 3rem;
}

/* Premium Switch */
.premium-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
}

.premium-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border);
    transition: .4s;
    border-radius: 34px;
}

.switch-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

input:checked+.switch-slider {
    background-color: var(--primary);
}

input:checked+.switch-slider:before {
    transform: translateX(24px);
}


.management-container {

    padding-top: 1rem;
}

.management-header-title {
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.02em;
}

.section-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.section-panel-header-start {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.section-panel-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--bg-main);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.section-panel-icon i {
    font-size: 0.9rem;
}

.section-panel-title {
    margin: 0;
    font-weight: 700;
    color: var(--text-main);
}

.section-panel-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.section-panel-divider {
    height: 1px;
    background: var(--border);
    margin-bottom: 1.25rem;
    opacity: 0.8;
}

.chart-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.chart-panel-header-start {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.chart-panel-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--bg-main);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.chart-panel-icon i {
    font-size: 0.9rem;
}

.chart-panel-title {
    margin: 0;
    font-weight: 700;
    color: var(--text-main);
}

.chart-panel-actions {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.management-search-card {
    background: var(--bg-main);
    padding: 1rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border);
    border-radius: 16px;
}

.management-search-card .search-bar-container {
    margin-bottom: 0;
}

.btn-search {
    padding-left: 2rem !important;
    padding-right: 2rem !important;
}

.modal-loading {
    text-align: center;
    padding: 2rem;
}

.spinner-icon {
    font-size: 2rem;
    color: var(--primary);
}

@media (max-width: 768px) {
    .bulk-actions-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 1.25rem;
        padding: 1.25rem;
    }
}

.bulk-actions-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
}

.view-mode-toggles {
    display: flex;
    background: var(--bg-main);
    padding: 0.35rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    gap: 0.25rem;
}

.toggle-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: var(--btn-sm-padding-y) var(--btn-sm-padding-x);
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    line-height: var(--btn-line-height, 1.25);
}

.toggle-btn:hover {
    color: var(--primary);
}

@media (max-width: 600px) {
    .view-mode-toggles {
        width: 100%;
    }

    .toggle-btn {
        flex: 1;
        justify-content: center;
    }
}

.toggle-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

@keyframes slideDown {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Common Utility Classes */
.text-bold {
    font-weight: 600;
}

.text-medium {
    font-weight: 500;
}

.text-small {
    font-size: 0.8rem;
}

.text-xs {
    font-size: 0.75rem;
}

.text-muted {
    color: var(--text-muted);
}

.text-primary {
    color: var(--primary);
}

.text-center {
    text-align: center;
}

.mt-1 {
    margin-top: 1rem;
}

.mr-1 {
    margin-right: 4px;
}

.mb-1 {
    margin-bottom: 1rem;
}

.p-1 {
    padding: 1rem;
}

.p-2 {
    padding: 2rem;
}

.flex-1 {
    flex: 1;
}

.justify-center {
    justify-content: center;
}

.border-all {
    border: 1px solid var(--border);
}

.col-check {
    width: 40px;
}

.d-flex {
    display: flex;
}

.align-center {
    align-items: center;
}

.gap-1 {
    gap: 1rem;
}

.icon-muted {
    color: var(--border);
}

.grid-full-width {
    grid-column: 1 / -1;
}

.pt-1-5 {
    padding-top: 1.5rem;
}

.grid-1 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
}

.modal-body .form-grid.grid-1,
.modal-body .form-grid.grid-2,
.modal-body .activity-form-grid,
.modal-body .settings-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
}

.grid-2 > .col-md-6,
.grid-2 > .col-md-12,
.grid-2 > .grid-full-width,
.activity-form-grid > .col-md-6,
.activity-form-grid > .col-md-12,
.activity-form-grid > .grid-full-width,
.settings-form-grid > .col-full,
.settings-form-grid > .col-md-6,
.settings-form-grid > .grid-full-width {
    max-width: none;
    width: 100%;
}

.form-grid.grid-2 > .col-md-6,
.form-grid.grid-2 > .col-md-12,
.form-grid.grid-2 > .grid-full-width,
.activity-form-grid > .col-md-6,
.activity-form-grid > .col-md-12,
.activity-form-grid > .grid-full-width,
.settings-form-grid > .col-full,
.settings-form-grid > .col-md-6,
.settings-form-grid > .grid-full-width {
    flex: none;
}

.modal-body .form-grid.grid-1 > .grid-full-width,
.modal-body .form-grid.grid-2 > .grid-full-width,
.modal-body .form-grid.grid-1 > .col-md-12,
.modal-body .form-grid.grid-2 > .col-md-12,
.modal-body .activity-form-grid > .grid-full-width,
.modal-body .activity-form-grid > .col-md-12,
.modal-body .settings-form-grid > .col-full {
    grid-column: 1 / -1;
}

@media (max-width: 768px) {
    .grid-2,
    .modal-body .form-grid.grid-1,
    .modal-body .form-grid.grid-2,
    .modal-body .activity-form-grid,
    .modal-body .settings-form-grid {
        grid-template-columns: 1fr !important;
    }
}

.role-badge-active {
    background: rgba(46, 125, 50, 0.1);
    color: #2e7d32;
    border: none;
}

.role-badge-inactive {
    background: rgba(198, 40, 40, 0.1);
    color: #c62828;
    border: none;
}

.role-badge-outline {
    background: var(--bg-main);
    color: var(--text-main);
    border: 1px solid var(--border);
}

/* Grid View Styling */
.portal-table-wrapper {
    display: block;
}

.portal-grid-wrapper {
    display: none;
}

html[data-view-mode="table"] .portal-table-wrapper {
    display: block !important;
}

html[data-view-mode="table"] .portal-grid-wrapper {
    display: none !important;
}

html[data-view-mode="grid"] .portal-table-wrapper {
    display: none !important;
}

html[data-view-mode="grid"] .portal-grid-wrapper {
    display: grid !important;
}

.portal-grid-wrapper {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    padding: 1rem;
    transition: var(--transition);
}

.management-container.view-mode-table .portal-table-wrapper {
    display: block !important;
}

.management-container.view-mode-table .portal-grid-wrapper {
    display: none !important;
}

.management-container.view-mode-grid .portal-table-wrapper {
    display: none !important;
}

.management-container.view-mode-grid .portal-grid-wrapper {
    display: grid !important;
    animation: fadeIn 0.4s ease-out;
}

.management-view-toolbar {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 1rem;
}

.management-view-toolbar .view-mode-toggles {
    box-shadow: var(--shadow-soft);
}

/* Standardized Table Styling */
.portal-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.portal-table th {
    background: var(--bg-main);
    padding: 1rem 1.5rem;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
    text-align: left;
}

.portal-table td {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.portal-table tr:last-child td {
    border-bottom: none;
}

.portal-table tr:hover td {
    background: rgba(13, 18, 31, 0.02);
}

.portal-table-empty-row td {
    padding: 0;
    border-bottom: none;
    background: transparent;
}

.portal-empty-table-state {
    margin: 1.25rem;
    padding: 2rem 1.25rem;
    border: 1px dashed var(--border);
    border-radius: 18px;
    background: var(--bg-main);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    text-align: center;
    min-height: 220px;
}

.portal-empty-table-state-icon {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    color: var(--text-muted);
    border: 1px solid var(--border);
    font-size: 1.3rem;
}

.portal-empty-table-state-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
}

.portal-empty-table-state-text {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.7;
    max-width: 42rem;
}

[data-theme="dark"] .portal-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .portal-grid-wrapper {
        grid-template-columns: 1fr;
        padding: 1rem;
    }
}

/* Universal Table-to-Grid Transformation */
.portal-table-as-grid .portal-table {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    gap: 1rem !important;
    background: transparent !important;
    border: none !important;
    padding: 1rem 0 !important;
}

.portal-table-as-grid .portal-table thead {
    display: none !important;
}

.portal-table-as-grid .portal-table tbody {
    display: contents !important;
}

.portal-table-as-grid .portal-table tr {
    display: flex !important;
    flex-direction: column !important;
    background: var(--bg-card) !important;
    border: 1.5px solid var(--border) !important;
    border-radius: 16px !important;
    padding: 1.1rem !important;
    transition: var(--transition) !important;
    gap: 0.9rem !important;
    position: relative !important;
    height: 100% !important;
    box-shadow: var(--shadow-soft) !important;
}

.portal-table-as-grid .portal-table tr:hover {
    transform: translateY(-5px) !important;
    box-shadow: var(--shadow-hover) !important;
    border-color: var(--primary-light) !important;
}

.portal-table-as-grid .portal-table td {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0 !important;
    border: none !important;
    background: none !important;
    width: 100% !important;
    min-height: auto !important;
}

/* Handle specific cell types for better grid layouts */
.portal-table-as-grid .portal-table td:first-child:not(.col-check) {
    border-bottom: 1px solid var(--border) !important;
    padding-bottom: 0.8rem !important;
    margin-bottom: 0.5rem !important;
    display: block !important;
}

.portal-table-as-grid .portal-table td.col-check {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: auto !important;
    z-index: 10;
}

.portal-table-as-grid .portal-table td:last-child {
    margin-top: auto !important;
    padding-top: 0.9rem !important;
    border-top: 1px dashed var(--border) !important;
    justify-content: flex-end !important;
}

/* Card Labels Fallback (using data-label if present, or general styles) */
.portal-table-as-grid .portal-table td::before {
    content: attr(data-label);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    margin-right: 1rem;
}

.portal-table-as-grid .portal-table td:first-child::before,
.portal-table-as-grid .portal-table td.col-check::before,
.portal-table-as-grid .portal-table td:last-child::before {
    display: none !important;
}

@media (max-width: 480px) {
    .portal-table-as-grid .portal-table {
        grid-template-columns: 1fr !important;
        padding: 1rem 0 !important;
    }
}

/* ==========================================================================
   Centralized Components (Phase 9)
   ========================================================================== */

/* 1. Global Badges & Status Pills */
.badge,
.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.status-pill {
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
}

.badge-success,
.status-active,
.type-success {
    background: #e8f5e9;
    color: #2e7d32;
}

.badge-warning,
.status-pending,
.type-warning {
    background: #fff3e0;
    color: #ef6c00;
}

.badge-error,
.badge-danger,
.type-error,
.status-inactive {
    background: #ffebee;
    color: #c62828;
}

.badge-info,
.type-info {
    background: #e3f2fd;
    color: #1565c0;
}

.badge-priority-high,
.priority-high {
    background: #fff7ed;
    color: #c2410c;
    border: 1px solid #ffedd5;
}

.badge-priority-urgent,
.priority-urgent {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fee2e2;
}

.badge-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.badge-minimal {
    background: var(--bg-main);
    color: var(--text-muted);
    border: none;
}


/* 2. Global Modal System */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(13, 18, 31, 0.4);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1100;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background: var(--bg-card);
    width: 90%;
    max-width: 800px;
    max-height: calc(100vh - 2rem);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    transform: translateY(20px);
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
}

.modal-overlay.active .modal-container {
    transform: translateY(0);
}

.modal-header {
    padding: 1.5rem 2rem;
    background: var(--bg-main);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--primary);
}

.modal-body {
    padding: 1.5rem;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-bottom: 1.75rem;
}

.modal-footer {
    padding: 1.25rem 1.5rem;
    background: var(--bg-main);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* 3. Global Search & Filter Bar */
/* 3. Global Search & Filter Bar */
.management-search-card {
    margin-bottom: 1.5rem;
}

.search-bar-container,
.filter-bar {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.filter-bar {
    align-items: flex-end;
    flex-wrap: wrap;
}

.search-input-wrapper {
    position: relative;
    flex: 1;
}

.filter-item {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex: 1;
    min-width: 150px;
}

.filter-item.filter-actions {
    flex: 0;
    min-width: auto;
}

.filter-item label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.filter-item select,
.filter-item input,
.filter-item .premium-input {
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.65rem 1rem;
    color: var(--text-main);
    font-size: 0.85rem;
    width: 100%;
    transition: var(--transition);
}

.search-input-wrapper i {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-input-wrapper .portal-input {
    padding-left: 3rem !important;
}

.btn-search {
    /* Inherits standard .btn padding, just adding horizontal emphasis */
    padding-left: 2.5rem;
    padding-right: 2.5rem;
}

/* 4. Insights & Stats Grid */
.stats-grid,
.insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.insight-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: var(--transition);
    box-shadow: var(--shadow-soft);
}

.insight-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.insight-label {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.insight-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--primary);
}


/* Grid Selection UI */
.grid-select-all {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.grid-select-all-text {
    margin-left: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
}

@media (max-width: 768px) {

    .search-bar-container {
        flex-direction: column;
    }

    .btn-search {
        width: 100%;
    }
}

/* 4. Global Notifications UI */
.notice-full-list {
    display: flex;
    flex-direction: column;
}

.notice-row {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
    position: relative;
}

.notice-row:last-child {
    border-bottom: none;
}

.notice-row.unread {
    background: rgba(13, 71, 161, 0.02);
}

.notice-row.unread::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary);
}

[dir="rtl"] .notice-row.unread::before {
    left: auto;
    right: 0;
}

.notice-body {
    flex: 1;
}

.notice-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.notice-type-badge {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 4px;
}

.notice-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.notice-item-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.notice-item-msg {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-muted);
}

.notice-actions {
    display: flex;
    align-items: flex-start;
}

/* 5. Global Kanban Board UI */
.kanban-board {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    padding: 1.5rem 0.5rem;
    min-height: calc(100vh - 280px);
    align-items: flex-start;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.kanban-board::-webkit-scrollbar {
    height: 6px;
}

.kanban-board::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}

.kanban-column {
    background: rgba(248, 250, 252, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    min-width: 340px;
    max-width: 340px;
    display: flex;
    flex-direction: column;
    max-height: 100%;
    border: 1px solid var(--border);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    transition: var(--transition);
}

[data-theme="dark"] .kanban-column {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(255, 255, 255, 0.05);
}

.kanban-column-header {
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    position: sticky;
    top: 0;
    z-index: 10;
    background: transparent;
}

.kanban-column-header i {
    font-size: 1.1rem;
    padding: 8px;
    border-radius: 10px;
    background: #fff;
    box-shadow: var(--shadow-soft);
}

[data-theme="dark"] .kanban-column-header i {
    background: var(--primary-light);
}

.kanban-column-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
    flex: 1;
    letter-spacing: -0.01em;
}

.kanban-column-header .task-count {
    background: var(--primary);
    color: #fff;
    padding: 0.2rem 0.65rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.kanban-tasks {
    padding: 0.75rem 1.25rem;
    min-height: 200px;
    flex: 1;
    overflow-y: auto;
}

.kanban-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    border: 1px solid var(--border);
    cursor: grab;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

[data-theme="dark"] .kanban-card {
    border-color: rgba(255, 255, 255, 0.08);
}

.kanban-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-color: var(--primary);
}

.kanban-card-header h5 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.4;
    transition: color 0.2s;
    flex: 1;
}

.kanban-edit-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 4px;
    border-radius: 6px;
    transition: var(--transition);
    opacity: 0;
}

.kanban-card:hover .kanban-edit-btn {
    opacity: 1;
}

.kanban-card:hover .kanban-card-header h5 {
    color: var(--primary);
}

.kanban-card-body p {
    margin: 0;
    font-size: 0.825rem;
    color: var(--text-muted);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    opacity: 0.9;
}

.kanban-card-footer {
    margin-top: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    padding-top: 1rem;
}

.kanban-user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    vertical-align: middle;
    margin-right: 8px;
}

@media (max-width: 768px) {
    .kanban-board {
        gap: 1.25rem;
        padding: 1rem;
    }

    .kanban-column {
        min-width: 300px;
    }
}

/* 6. Global Messaging UI */
.messages-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1rem 0;
}

.msg-wrapper {
    display: flex;
    width: 100%;
}

.msg-me {
    justify-content: flex-end;
}

.msg-them {
    justify-content: flex-start;
}

.msg-bubble {
    max-width: 80%;
    padding: 1rem 1.25rem;
    border-radius: 16px;
    position: relative;
    box-shadow: var(--shadow-soft);
}

.msg-me .msg-bubble {
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.msg-them .msg-bubble {
    background: var(--bg-card);
    color: var(--text-main);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
}

.msg-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.msg-text {
    font-size: 0.95rem;
    line-height: 1.5;
}

@media (max-width: 600px) {
    .msg-bubble {
        max-width: 100% !important;
    }

    .msg-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
}

/* 7. Premium Cards & Lists */
.card-header-premium {
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Section toggle inside dark card header needs light colors */
.card-header-premium .section-toggle-premium {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    color: rgba(255, 255, 255, 0.85);
    flex-shrink: 0;
    margin-left: auto;
}

.card-header-premium .section-toggle-premium:hover {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
    transform: scale(1.05);
}

.card-header-premium i {
    font-size: 1.25rem;
    opacity: 0.9;
}

.card-header-premium h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.card-header-premium span {
    font-size: 0.75rem;
    opacity: 0.8;
    display: block;
}

.card-content {
    padding: 1.75rem 1.5rem;
}

/* Stable Drag-and-Drop Reordering Styles */
.sortable-list-premium {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 0.5rem;
}

.sortable-item-premium {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1rem 1.5rem;
    gap: 1.5rem;
    transition: box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
    box-shadow: var(--shadow-soft);
    position: relative;
    cursor: grab;
    user-select: none;
    touch-action: none;
}

.sortable-item-premium:active {
    cursor: grabbing;
}

.sortable-item-premium:hover {
    border-color: var(--primary);
    background: var(--bg-card);
    box-shadow: var(--shadow-hover);
}

.drag-handle-premium {
    cursor: grab;
    width: 32px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    border-radius: 8px;
    transition: all 0.2s ease;
    background: rgba(0, 0, 0, 0.02);
}

.item-content-premium {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex: 1;
}

.sortable-ghost-premium {
    opacity: 0.3;
    background: var(--primary-light) !important;
    border: 2px dashed var(--primary) !important;
}

.sortable-chosen-premium {
    background: var(--bg-card) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2) !important;
    border-color: var(--primary) !important;
}

.sortable-drag-premium {
    opacity: 0.95 !important;
    transform: scale(1.02) !important;
    cursor: grabbing !important;
}

.item-icon-premium {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-main);
    border-radius: 12px;
    color: var(--primary);
    font-size: 1.2rem;
}

/* Bilingual & RTL Support */
.bilingual-inputs {
    display: flex;
    gap: 1rem;
}

.rtl-input {
    direction: rtl;
    text-align: right;
}

@media (max-width: 768px) {
    .card-header-premium {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .bilingual-inputs {
        flex-direction: column;
    }
}

/* 8. Global Tab Navigation */
.tab-nav {
    display: flex;
    gap: 0.5rem;
    background: var(--bg-main);
    padding: 0.4rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    margin-bottom: 1.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab-nav::-webkit-scrollbar {
    height: 4px;
}

.tab-btn {
    padding: var(--btn-sm-padding-y) var(--btn-sm-padding-x);
    border: none;
    background: none;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 10px;
    transition: var(--transition);
    white-space: nowrap;
    line-height: var(--btn-line-height, 1.25);
}

.tab-btn.active {
    background: #fff;
    color: var(--primary);
    box-shadow: var(--shadow-soft);
}

[data-theme="dark"] .tab-btn.active {
    background: var(--bg-card);
}

/* 9. Analytical Performance Badges */
.performance-badge {
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    display: inline-block;
    white-space: nowrap;
    border: 1px solid transparent;
}

.performance-potential {
    background: rgba(46, 204, 113, 0.1);
    color: #2ecc71;
    border-color: rgba(46, 204, 113, 0.2);
}

.performance-bad {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
    border-color: rgba(231, 76, 60, 0.2);
}

.performance-good {
    background: rgba(13, 71, 161, 0.1);
    color: var(--primary);
    border-color: rgba(13, 71, 161, 0.2);
}

/* 10. Super Dashboard Premium Aesthetic (Phase 10) */
:root {
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(255, 255, 255, 0.5);
    --shadow-premium: 0 12px 40px rgba(13, 18, 31, 0.06);
    --shadow-inner: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

[data-theme="dark"] {
    --glass-bg: rgba(26, 34, 53, 0.75);
    --glass-border: rgba(255, 255, 255, 0.1);
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-premium);
}

.portal-card-premium {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: var(--shadow-premium);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.portal-card-premium:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-light);
}

/* Premium Stats Layout */
.portal-stats-grid-premium {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
    align-items: stretch;
}

.dashboard-counters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    align-items: stretch;
}

.portal-stat-card-premium {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 0.9rem 1rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-premium);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
    min-height: 0;
    height: auto;
    overflow: hidden;
}

.portal-stat-card-premium:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary);
}

.stat-premium-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.stat-premium-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1.05;
    margin: 0;
}

.stat-premium-value {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.1;
    margin: 0;
}

.stat-premium-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    background: var(--bg-main);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.portal-stats-grid-premium .portal-stat-card-premium,
.stats-grid .card,
.dashboard-counters-grid > .dashboard-counter-card {
    color: var(--text-main);
}

.portal-stats-grid-premium .stat-premium-value,
.stats-grid .stat-number,
.dashboard-counters-grid .stat-number,
.dashboard-counters-grid .stat-premium-value {
    font-size: 1.2rem !important;
    font-weight: 800 !important;
    color: var(--text-main) !important;
    line-height: 1.1 !important;
    margin: 0 !important;
}

.portal-stats-grid-premium .stat-premium-icon,
.stats-grid .stat-icon,
.dashboard-counters-grid .stat-icon {
    background: var(--bg-main) !important;
    color: var(--text-muted) !important;
    border: 1px solid var(--border) !important;
    box-shadow: none !important;
}

.portal-stats-grid-premium .stat-premium-label,
.stats-grid .stat-title,
.dashboard-counters-grid .stat-title,
.dashboard-counters-grid .stat-premium-label {
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    color: var(--text-muted) !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1.05 !important;
    margin: 0 !important;
}

.dashboard-counters-grid > .dashboard-counter-card {
    min-height: 0;
    height: auto;
    padding: 0.9rem 1rem;
    border-radius: 18px;
    display: flex;
    align-items: stretch;
    overflow: hidden;
}

.dashboard-counters-grid > .dashboard-counter-card .stat-card-inner {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

/* Premium Item Card (For Grid Views) */
.portal-item-card-premium {
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border);
    padding: 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    transition: var(--transition);
    box-shadow: var(--shadow-soft);
}

.portal-item-card-premium:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary);
}

.item-card-header-premium {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.item-card-icon-premium {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--bg-main);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.45rem;
    color: var(--primary);
    border: 1px solid var(--border);
}

.item-card-details-premium {
    flex: 1;
}

.item-card-title-premium {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.15rem;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.item-card-meta-premium {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.item-card-body-premium {
    padding: 1rem 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.portal-item-card-premium .grid-info-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.portal-item-card-premium .grid-detail-item {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.portal-item-card-premium .grid-info-item > [class*="info-icon"] {
    flex-shrink: 0;
}

.portal-item-card-premium .grid-detail-icon {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--primary-rgb, 13, 18, 31), 0.08);
    color: var(--primary);
    flex-shrink: 0;
}

.portal-item-card-premium .grid-detail-stack {
    min-width: 0;
    flex: 1;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.15rem 0.35rem;
    max-width: 100%;
    overflow: hidden;
}

.portal-item-card-premium .grid-detail-stack span,
.portal-item-card-premium .grid-detail-stack strong {
    display: inline;
    margin: 0;
    line-height: 1.45;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
}

.portal-item-card-premium .grid-detail-stack span {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
}

.portal-item-card-premium .grid-detail-stack strong {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main);
    word-break: break-word;
}

.portal-item-card-premium .grid-info-item > [class*="info-stack"],
.portal-item-card-premium .grid-info-item .grid-info-item-content {
    min-width: 0;
    flex: 1;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.15rem 0.35rem;
    max-width: 100%;
    overflow: hidden;
}

.portal-item-card-premium .grid-info-item > [class*="info-stack"] span,
.portal-item-card-premium .grid-info-item > [class*="info-stack"] strong,
.portal-item-card-premium .grid-info-item .grid-info-item-content span,
.portal-item-card-premium .grid-info-item .grid-info-item-content strong {
    display: inline;
    margin: 0;
    line-height: 1.45;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
}

.portal-item-card-premium .grid-info-item > [class*="info-stack"] span,
.portal-item-card-premium .grid-info-item .grid-info-item-content span {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
}

.portal-item-card-premium .grid-info-item > [class*="info-stack"] strong,
.portal-item-card-premium .grid-info-item .grid-info-item-content strong {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main);
    word-break: break-word;
}

/* Icon-only row and card actions */
.action-btns,
.table-row-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: nowrap;
}

.action-btns .btn,
.table-row-actions .btn {
    min-width: 40px;
    height: 40px;
    padding: 0 0.85rem;
    justify-content: center;
    gap: 0;
    white-space: nowrap;
}

.action-btns .btn,
.table-row-actions .btn {
    font-size: 0;
    line-height: 0;
}

.action-btns .btn i,
.table-row-actions .btn i {
    font-size: 0.95rem;
    line-height: 1;
}

.action-btns .btn span,
.table-row-actions .btn span {
    display: none;
}

/* Global Portal Header Structure */
.portal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    gap: 1.5rem;
}

.portal-header-info {
    flex: 1;
}

.portal-header-info > p,
.dashboard-header-text > p,
.admin-profile-summary,
.user-profile-summary,
.organisation-profile-panel-subtitle,
.admin-profile-panel-subtitle,
.user-profile-panel-subtitle {
    display: none !important;
}

.portal-header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

@media (max-width: 768px) {
    .portal-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .portal-header-actions {
        width: 100%;
    }

    .portal-header-actions .btn {
        flex: 1;
        justify-content: center;
    }
}


/* Premium Form Elements */
.portal-input-premium {
    width: 100%;
    min-height: 36px;
    padding: 0.4rem 0.65rem;
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.9rem;
    line-height: 1.35;
    transition: var(--transition);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
}

.portal-input-premium:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-card);
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb, 13, 18, 31), 0.1);
}

[data-theme="dark"] .portal-input-premium {
    background: rgba(0, 0, 0, 0.2);
}

.portal-input-premium option {
    background: var(--bg-card);
    color: var(--text-main);
}

.portal-label-premium {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.portal-form-hint {
    margin-top: 0.35rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.45;
}

.portal-form-actions {
    margin-top: 0.6rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    justify-content: flex-end;
    width: 100%;
}

.portal-form-actions .btn {
    min-width: 0;
    flex: 1 1 0;
    justify-content: center;
    padding-left: 0.85rem;
    padding-right: 0.85rem;
    white-space: nowrap;
}

.form-group-compact {
    margin-bottom: 0.5rem;
}

.form-group-compact .portal-label-premium {
    margin-bottom: 0.25rem;
}

.form-group-compact .portal-form-hint {
    margin-top: 0.25rem;
}

.form-group-alone {
    grid-column: 1 / -1;
    width: 100%;
    max-width: none;
    flex: none;
}

.form-group-alone .portal-input-premium,
.form-group-alone .portal-input,
.form-group-alone select,
.form-group-alone textarea {
    width: 100%;
}

/* ==========================================================================
   Mobile Optimization (Phase 14)
   ========================================================================== */

@media (max-width: 991px) {
    .portal-stats-grid-premium {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .management-container {
        padding: 1rem;
    }

    .portal-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.25rem;
    }

    .portal-header-info h2 {
        font-size: 1.5rem;
    }

    .portal-header-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .portal-header-actions .btn {
        flex: 1;
        min-width: calc(50% - 0.5rem);
        justify-content: center;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.75rem;
    }

    .portal-stats-grid-premium {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.75rem;
    }

    .portal-stat-card-premium {
        padding: 1rem;
    }

    .stat-premium-value {
        font-size: 1.35rem;
    }

    .stat-premium-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .portal-stats-grid-premium,
    .stats-grid {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        gap: 0.75rem;
        padding-bottom: 0.35rem;
        scroll-snap-type: x proximity;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .portal-stats-grid-premium::-webkit-scrollbar,
    .stats-grid::-webkit-scrollbar {
        display: none;
    }

    .portal-stats-grid-premium > *,
    .stats-grid > * {
        flex: 0 0 clamp(220px, 72vw, 280px);
        min-width: clamp(220px, 72vw, 280px);
        scroll-snap-align: start;
    }

    .glass-card, 
    .portal-card {
        padding: 1.25rem !important;
        border-radius: 16px !important;
    }

    .portal-table-wrapper {
        margin: 0 -1.25rem;
        width: calc(100% + 2.5rem);
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .portal-table th, 
    .portal-table td {
        padding: 1rem;
        white-space: nowrap;
    }

    /* Modal Adjustments */
    .modal-container {
        width: 95%;
        margin: 1rem;
        max-height: calc(100vh - 2rem);
    }

    .modal-header, 
    .modal-body, 
    .modal-footer {
        padding: 1.25rem;
    }

    .modal-footer {
        flex-direction: column;
    }

    .modal-footer .btn {
        width: 100%;
    }

    .portal-form-actions {
        flex-direction: column;
    }

    .portal-form-actions .btn {
        width: 100%;
        min-width: 0;
        flex: 1 1 100%;
    }

    /* AI Insight Grids */
    .insights-top-grid, 
    .campaigns-grid {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 480px) {
    .portal-header-actions .btn {
        min-width: 100%;
    }

    .filter-bar {
        grid-template-columns: 1fr !important;
    }

    .stats-grid,
    .portal-stats-grid-premium {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.65rem;
    }
}
