/* ========== ORGANIZATIONS PAGE STYLES ========== */
/* Page-specific styles only - common styles in app-theme.css */

/* ========== PAGE CONTAINER ========== */
.organization-container {
    padding: clamp(1rem, 2vw, 1.5rem);
    max-width: 1720px;
    margin: 0 auto;
}

body.theme-body .organization-container > .page-header {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 1.5rem;
    padding: 1.15rem 1.25rem !important;
    border-color: rgba(0, 188, 212, 0.28) !important;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
}

.organization-container > .page-header h1 {
    margin: 0;
    font-weight: 500;
    letter-spacing: 0;
}

.organization-container > .page-header p {
    font-size: 0.92rem;
    font-weight: 500;
}

body.theme-body .organization-container .info-card {
    padding: 1.35rem;
    border-color: rgba(0, 188, 212, 0.2) !important;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.24);
}

/* ========== ORGANIZATIONS PAGE SPECIFIC ========== */
.organizations-page {
    padding: 1rem;
}

.organizations-page .page-header-card {
    margin-bottom: 1.5rem;
}

.organizations-page .page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.organizations-page .header-icon {
    font-size: 2rem;
    margin-right: 1rem;
    color: #00bcd4;
}

.organizations-page .header-text h1 {
    margin: 0;
    font-size: 1.5rem;
}

.organizations-page .header-text p {
    margin: 0.25rem 0 0 0;
    opacity: 0.8;
}

.organizations-page .header-button i {
    margin-right: 0.5rem;
}

/* ========== ORGANIZATIONS GRID ========== */
.organizations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    padding: 1rem 0;
}

/* ========== ORGANIZATION CARD ========== */
.org-card-item {
    display: flex;
}

.org-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(0, 188, 212, 0.1);
    border-radius: 8px;
    width: 100%;
    transition: all 0.3s ease;
}

.org-card:hover {
    border-color: rgba(0, 188, 212, 0.3);
    background: rgba(0, 188, 212, 0.03);
}

.org-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.org-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.org-icon {
    width: 40px;
    height: 40px;
    background: rgba(0, 188, 212, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #00bcd4;
    font-size: 1.1rem;
}

.org-details h6 {
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    font-weight: 500;
}

.org-details small {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.75rem;
}

.org-status .badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.org-card-content {
    padding: 1rem;
}

.org-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.org-stats .stat-item {
    background: rgba(0, 188, 212, 0.05);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    min-width: auto;
}

.org-stats .stat-label {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.7rem;
    text-transform: uppercase;
}

.org-stats .stat-value {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    font-size: 1rem;
}

.org-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.org-actions .e-btn {
    flex: 1;
    min-width: 0;
}

/* ========== INVITE STATUS BADGES ========== */
.badge-pending {
    background: rgba(255, 152, 0, 0.15);
    color: #ff9800;
    border: 1px solid rgba(255, 152, 0, 0.3);
}

.badge-gmail-auth-required {
    background: rgba(244, 67, 54, 0.15);
    color: #f44336;
    border: 1px solid rgba(244, 67, 54, 0.3);
}

.badge-sent {
    background: rgba(33, 150, 243, 0.15);
    color: #2196f3;
    border: 1px solid rgba(33, 150, 243, 0.3);
}

.badge-accepted {
    background: rgba(76, 175, 80, 0.15);
    color: #4caf50;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.badge-rejected {
    background: rgba(244, 67, 54, 0.15);
    color: #f44336;
    border: 1px solid rgba(244, 67, 54, 0.3);
}

/* ========== USERS SECTION ========== */
.users-section {
    margin-top: 1.5rem;
}

.users-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    padding: 0.7rem 0.85rem;
    border: 1px solid rgba(0, 188, 212, 0.24);
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
}

body.theme-body .organization-container .users-header {
    background: var(--surface-solid-accent) !important;
}

.users-header .section-title {
    margin: 0;
    line-height: 1.2;
}

.users-header-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
    min-width: 0;
}

/* ========== USERS GRID ========== */
.users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
    gap: 0.75rem;
    margin-top: 0.75rem;
    align-items: stretch;
}

/* ========== USER CARD ========== */
.user-card {
    border: 1px solid rgba(0, 188, 212, 0.1);
    border-radius: 8px;
    padding: 0;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

body.theme-body .organization-container .user-card {
    background: var(--surface-solid-base) !important;
    border-color: rgba(0, 188, 212, 0.2) !important;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
}

.user-card:hover {
    border-color: rgba(0, 188, 212, 0.3);
}

body.theme-body .organization-container .user-card:hover {
    background: var(--surface-solid-base) !important;
    border-color: rgba(0, 188, 212, 0.36) !important;
}

body.theme-body .organization-container .user-card:hover .user-card-header {
    background: var(--surface-solid-accent-strong) !important;
}

.user-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    margin: 0;
    padding: 0.75rem;
    border-bottom: 1px solid rgba(0, 188, 212, 0.18);
}

body.theme-body .organization-container .user-card-header {
    background: var(--surface-solid-accent) !important;
}

/* ========== USER AVATAR ========== */
.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: rgba(0, 188, 212, 0.1);
    border: 1px solid rgba(0, 188, 212, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-avatar i {
    font-size: 1.25rem;
    color: #00bcd4;
}

.user-avatar.owner {
    background: rgba(255, 152, 0, 0.1);
    border-color: rgba(255, 152, 0, 0.3);
}

.user-avatar.owner i {
    color: #ff9800;
}

/* ========== USER HEADER INFO ========== */
.user-header-info {
    flex: 1;
    min-width: 0;
}

.user-name-row {
    display: flex;
    align-items: center;
    gap: 0.35rem 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.25rem;
    min-width: 0;
}

.user-name {
    color: rgba(255, 255, 255, 0.95);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
}

.user-email {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.user-card .status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.25rem;
    padding: 0.12rem 0.45rem;
    border-radius: 999px;
    font-size: 0.62rem;
    line-height: 1;
}

.user-card .status-active {
    background: rgba(76, 175, 80, 0.14);
    border: 1px solid rgba(76, 175, 80, 0.32);
}

.user-card .status-inactive {
    background: rgba(244, 67, 54, 0.14);
    border: 1px solid rgba(244, 67, 54, 0.32);
}

.user-card .status-owner {
    background: rgba(255, 193, 7, 0.16);
    border: 1px solid rgba(255, 193, 7, 0.34);
}

/* ========== USER CARD BODY ========== */
.user-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0.75rem;
}

.user-meta {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex: 1;
}

.meta-row {
    display: grid;
    grid-template-columns: minmax(6rem, 0.42fr) minmax(0, 1fr);
    justify-content: stretch;
    align-items: start;
    gap: 0.75rem;
    min-width: 0;
}

.meta-label {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.35;
    padding-top: 0.05rem;
}

.meta-value {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
    text-align: right;
    line-height: 1.35;
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* ========== USER ACTIONS ========== */
.user-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.65rem;
    padding-top: 0.65rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.user-actions .e-btn {
    min-width: 0;
}

/* ========== GRID STYLING ========== */
.organizations-page .e-grid {
    background: transparent !important;
    border: 1px solid rgba(0, 188, 212, 0.1) !important;
}

.organizations-page .e-grid .e-gridheader {
    background: rgba(0, 188, 212, 0.05) !important;
    border-bottom: 1px solid rgba(0, 188, 212, 0.2) !important;
}

.organizations-page .e-grid .e-headercell {
    background: transparent !important;
    color: #00bcd4 !important;
    font-weight: 500 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    font-size: 0.8rem !important;
}

.organizations-page .e-grid .e-rowcell {
    background: transparent !important;
    color: rgba(255, 255, 255, 0.9) !important;
    border-color: rgba(255, 255, 255, 0.05) !important;
}

.organizations-page .e-grid .e-row:hover .e-rowcell {
    background: rgba(0, 188, 212, 0.05) !important;
}

/* ========== SUPERVISOR MANAGEMENT DIALOG ========== */
.supervisor-manager {
    display: grid;
    gap: 1rem;
    min-width: 0;
}

.supervisor-add-row {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.supervisor-add-field {
    flex: 1 1 320px;
    margin-bottom: 0;
    min-width: min(320px, 100%);
}

.supervisor-management-grid {
    display: grid;
    grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
    gap: 1rem;
    min-width: 0;
}

.supervisor-list-panel,
.supervisor-assignment-panel {
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 0.75rem;
    min-width: 0;
}

.supervisor-list-panel {
    max-height: 420px;
    overflow-y: auto;
}

.supervisor-assignment-panel {
    min-height: 420px;
}

.supervisor-panel-title {
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.supervisor-list-panel .btn-teal {
    width: 100%;
    text-align: left;
    margin-bottom: 0.5rem;
}

.supervisor-assignment-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    margin-bottom: 0.75rem;
}

.supervisor-assignment-list {
    display: grid;
    gap: 0.5rem;
    max-height: 340px;
    overflow-y: auto;
}

.supervisor-assignment-item {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    padding: 0.35rem 0;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .organization-container {
        padding: 1rem;
    }

    .organizations-grid {
        grid-template-columns: 1fr;
    }

    .users-grid {
        grid-template-columns: 1fr;
    }

    .supervisor-add-row {
        align-items: stretch;
    }

    .supervisor-add-row .e-btn {
        width: 100%;
    }

    .supervisor-management-grid {
        grid-template-columns: 1fr;
    }

    .supervisor-list-panel {
        max-height: 260px;
    }

    .supervisor-assignment-panel {
        min-height: 0;
    }

    .supervisor-assignment-header {
        flex-direction: column;
        align-items: stretch;
    }

    .supervisor-assignment-header .e-btn {
        width: 100%;
    }

    .user-actions .e-btn {
        min-height: 44px;
    }
}

@media (max-width: 768px) {
    .organizations-page .mud-input-slot {
        min-height: 44px !important;
    }
}

@media (min-width: 1200px) {
    .users-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    }
}

/* ========== PROFESSIONAL ADMIN DENSITY ========== */
.organizations-page {
    padding: 0.5rem;
}

.organizations-page .page-header-card {
    margin-bottom: 0.75rem;
}

.organizations-page .page-header-card > .e-card-content,
.organizations-page .content-card > .e-card-content {
    padding: 0.8rem 0.9rem !important;
}

.organizations-page .header-icon {
    margin-right: 0.7rem;
    font-size: 1.65rem;
}

.organizations-page .header-text h1 {
    font-size: 1.3rem;
}

.organizations-page .header-text p {
    margin-top: 0.1rem;
    font-size: 0.84rem;
}

.organizations-page .search-section {
    margin-bottom: 0.6rem !important;
}

.organizations-page .organizations-grid {
    gap: 0.75rem;
    padding: 0.25rem 0;
}

.organizations-page .org-card-header,
.organizations-page .org-card-content {
    padding: 0.7rem;
}

.organizations-page .org-icon {
    width: 34px;
    height: 34px;
}

.organizations-page .org-stats {
    gap: 0.45rem;
    margin-bottom: 0.65rem;
}

.organizations-page .org-stats .stat-item {
    padding: 0.3rem 0.5rem;
}

.organizations-page .org-actions {
    gap: 0.35rem;
}

@media (max-width: 768px) {
    .organizations-page {
        padding: 0.15rem;
    }

    .organizations-page .page-header {
        align-items: stretch;
        gap: 0.65rem;
    }

    .organizations-page .header-actions,
    .organizations-page .header-actions .e-btn {
        width: 100%;
    }

    .organizations-page .header-actions .e-btn,
    .organizations-page .org-actions .e-btn {
        min-height: 44px;
    }

    .organizations-page .e-input-group {
        min-height: 44px;
    }

    .organizations-page .page-header-card > .e-card-content,
    .organizations-page .content-card > .e-card-content {
        padding: 0.7rem !important;
    }

    .organizations-page .org-card-header,
    .organizations-page .org-card-content {
        padding: 0.65rem;
    }
}
