/* Layout & Container */
/* Layout & Container */
.tenant-layout {
    display: flex;
    height: calc(100vh - 60px);
    /* Fixed height to viewport minus header */
    overflow: hidden;
    /* Prevent window scrollbar */
    background-color: #f4f6f9;
}

/* Sidebar Styles */
.tenant-sidebar {
    width: 250px;
    background-color: #fff;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.sidebar-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: #2c3e50;
}

.sidebar-nav {
    padding: 15px 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.nav-btn {
    display: block;
    width: 100%;
    text-align: left;
    padding: 12px 20px;
    background: none;
    border: none;
    font-size: 1rem;
    color: #555;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 4px solid transparent;
}

.nav-btn:hover {
    background-color: #f8f9fa;
    color: #2c3e50;
}

.nav-btn.active {
    background-color: #e8f4fd;
    color: #3498db;
    border-left-color: #3498db;
    font-weight: 600;
}

/* Main Content Area */
.tenant-main-content {
    flex-grow: 1;
    padding: 40px;
    overflow-y: auto;
}

/* Tab Visibility */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
    max-width: 1600px;
    /* Center content on ultra-wide screens */
    margin: 0 auto;
    /* Center horizontally */
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.content-header {
    margin-bottom: 30px;
}

.content-header h2 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: #2c3e50;
}

.content-header p {
    color: #666;
    font-size: 1.1rem;
}

/* Single Card View (for Join/Create Tabs) */
.tenant-card.single-view-card {
    max-width: 600px;
    /* margin: 0 auto; Optional: center the card */
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 10px 15px rgba(0, 0, 0, 0.1);
    padding: 30px;
}

/* Reusing Form Styles from previous iteration */
.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-row .form-group {
    flex: 1;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #34495e;
}

input[type="text"],
input[type="email"] {
    width: 100%;
    padding: 12px 15px;
    font-size: 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

input[type="text"]:focus,
input[type="email"]:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.btn-primary {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    width: 100%;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-primary:active {
    transform: scale(0.98);
}

/* Tenant List Wrapper */
.tenant-items-wrapper {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Individual Item Block */
.tenant-item-block {
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* Center vertically */
    transition: box-shadow 0.2s, transform 0.1s;
}

.tenant-item-block:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    /* Subtle lift effect */
    border-color: #d0d0d0;
}

/* Item Content (Left Side) */
.item-content {
    flex-grow: 1;
    /* Take up available space */
    display: flex;
    flex-direction: column;
    gap: 8px;
    /* Spacing between rows */
}

/* Rows within Item */
.item-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Primary Row: Name & Role */
.primary-row .org-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2c3e50;
}

.role-badge {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.role-badge.owner {
    background-color: #e8f8f5;
    color: #27ae60;
    border: 1px solid #c9ebdd;
}

.role-badge.member {
    background-color: #e8f4fd;
    color: #3498db;
    border: 1px solid #d6eaf8;
}

/* Secondary Row: ID & Label */
.secondary-row {
    font-size: 0.9rem;
    color: #7f8c8d;
}

.secondary-row .id-label {
    font-weight: 500;
}

.secondary-row .tenant-id-text {
    font-family: 'Consolas', 'Monaco', monospace;
    color: #555;
}

/* Copy Icon */
.copy-icon {
    display: inline-flex;
    align-items: center;
    color: #95a5a6;
    cursor: pointer;
    transition: color 0.2s;
}

.copy-icon:hover {
    color: #3498db;
}

/* Action Section (Right Side) */
.item-actions {
    padding-left: 20px;
    /* Separator space */
    border-left: 1px solid #f0f0f0;
    /* Divider line */
    margin-left: 20px;
}

.btn-icon-remove {
    background: none;
    border: 1px solid transparent;
    /* Hit target */
    padding: 8px;
    color: #e74c3c;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-icon-remove:hover {
    background-color: #fce4e4;
    color: #c0392b;
    border-color: #f5b7b1;
}

/* OVERRIDE: Global Container Constraint */
/* Adjusted width based on user feedback (was 1600px, now 1200px) */


/* Re-apply overflow hidden to wrapper if needed to contain the rounded corners */