/* ============================================
   DETALHE EQUIPA - Mobile-First Design
   ============================================ */

:root {
    --dark-bg: #0a0a0a;
    --card-bg: #141414;
    --card-bg-lighter: #1c1c1c;
    --border-color: #2a2a2a;
    --text-light: rgba(255, 255, 255, 0.95);
    --text-muted: rgba(255, 255, 255, 0.55);
    --primary-color: #ee8a04;
    --primary-hover: #ff9d2f;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: var(--dark-bg);
    color: var(--text-light);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

/* ============================================
   TOP NAVIGATION BAR
   ============================================ */

.equipa-top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 100%);
}

.nav-back-btn,
.nav-share-btn {
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    text-decoration: none;
}

.nav-back-btn svg,
.nav-share-btn svg {
    width: 20px;
    height: 20px;
}

.nav-back-btn:active,
.nav-share-btn:active {
    background: rgba(238, 138, 4, 0.7);
    transform: scale(0.95);
}

/* ============================================
   BANNER / HEADER SECTION
   ============================================ */

.equipa-banner {
    position: relative;
    width: 100%;
    min-height: 220px;
    background: var(--card-bg);
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 16px;
}

.banner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom,
        rgba(0,0,0,0.2) 0%,
        rgba(0,0,0,0.5) 40%,
        rgba(10,10,10,0.95) 100%
    );
}

.banner-content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 0 16px;
    width: 100%;
}

/* Team Logo */
.equipa-logo-wrapper {
    width: 72px;
    height: 72px;
    margin: 0 auto 6px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--card-bg);
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.equipa-logo-large {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Team Name - Dynamic sizing */
.equipa-nome {
    font-size: clamp(0.9rem, 5vw, 1.25rem);
    font-weight: 600;
    margin: 0 0 2px 0;
    color: white;
    letter-spacing: -0.2px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    padding: 0 10px;
}

.equipa-nome.name-long {
    font-size: clamp(0.75rem, 4vw, 1rem);
}

.equipa-nome.name-very-long {
    font-size: clamp(0.65rem, 3.5vw, 0.85rem);
    line-height: 1.3;
}

/* Team Location - In content section */
.equipa-distrito {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin: 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 16px;
}

.equipa-distrito svg {
    width: 12px;
    height: 12px;
    opacity: 0.6;
}

/* Stats */
.equipa-stats {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 2px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-number {
    font-size: 1rem;
    font-weight: 600;
    color: white;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: lowercase;
}

/* ============================================
   MAIN CONTENT
   ============================================ */

.equipa-content {
    padding: 0 14px 90px;
    max-width: 500px;
    margin: 0 auto;
}

/* Content Sections */
.content-section {
    margin-bottom: 20px;
}

.section-title {
    font-family: 'Oswald', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    margin: 0 0 10px 0;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.section-text {
    font-family: 'Open Sans', sans-serif;
    font-size: 0.8rem;
    font-weight: 300;
    line-height: 1.6;
    color: var(--text-muted);
    margin: 0;
    letter-spacing: 0.3px;
}

/* Social Link Button */
.social-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.15s;
}

.social-link-btn:active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: scale(0.98);
}

.social-link-btn svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
}

/* ============================================
   MEMBERS GRID
   ============================================ */

.members-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

@media (max-width: 360px) {
    .members-grid {
        grid-template-columns: 1fr;
    }
}

/* Member Card */
.member-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    position: relative;
}

.member-card:active {
    border-color: var(--primary-color);
    background: var(--card-bg-lighter);
    transform: scale(0.98);
}

.member-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--border-color);
    flex-shrink: 0;
}

.member-info {
    flex: 1;
    min-width: 0;
}

.member-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
    margin: 0 0 1px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.member-role {
    font-size: 0.7rem;
    color: var(--primary-color);
    margin: 0;
}

/* Rank Badge */
.member-rank-badge {
    position: absolute;
    bottom: 10px;
    right: 6px;
    width: 20px;
    height: 20px;
}

.member-rank-badge img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ============================================
   LOADING & EMPTY STATES
   ============================================ */

.loading-members,
.no-members {
    text-align: center;
    padding: 30px 16px;
    color: var(--text-muted);
}

.loading-members p,
.no-members p {
    margin: 10px 0 0 0;
    font-size: 0.8rem;
}

/* Gun Loader Animation */
.gun-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.gun {
    font-size: 1.5rem;
    animation: gunShake 0.5s infinite;
}

.bullets {
    display: flex;
    gap: 5px;
    margin-top: 6px;
}

.bullet {
    width: 5px;
    height: 5px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: bulletFade 1s infinite;
}

.bullet:nth-child(2) {
    animation-delay: 0.2s;
}

.bullet:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes gunShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    75% { transform: translateX(2px); }
}

@keyframes bulletFade {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1); }
}

/* ============================================
   EDIT EQUIPA BUTTON
   ============================================ */

.equipa-actions-own {
    display: flex;
    padding: 0 0 8px 0;
}

.btn-edit-equipa {
    flex: 1;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    font-family: 'Oswald', sans-serif;
    transition: all 0.15s;
    background: #333333;
    color: #fff;
    letter-spacing: 0.5px;
}

.btn-edit-equipa:active {
    opacity: 0.9;
    transform: scale(0.98);
}

/* ============================================
   CANDIDATURA MODAL
   ============================================ */

.candidatar-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0,0,0,0.7);
    align-items: flex-end;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.candidatar-modal.show { display: flex; }

.candidatar-modal-content {
    background: #111;
    width: 100%;
    max-width: 500px;
    border-radius: 20px 20px 0 0;
    border: 1px solid #222;
    border-bottom: none;
    animation: slideUp 0.3s cubic-bezier(0.32,0.72,0,1);
    max-height: 92vh;
    overflow-y: auto;
    padding-bottom: env(safe-area-inset-bottom, 16px);
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}

.candidatar-drag-handle {
    width: 36px;
    height: 4px;
    background: #333;
    border-radius: 2px;
    margin: 10px auto 0;
}

.candidatar-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 12px;
}

.candidatar-modal-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Oswald', sans-serif;
    font-size: 1rem;
    font-weight: 400;
    color: #fff;
    letter-spacing: 0.5px;
}

.candidatar-modal-close {
    background: #222;
    border: none;
    color: #888;
    font-size: 1rem;
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: all 0.2s;
}

.candidatar-modal-close:hover { background: #333; color: #fff; }

/* Identity card */
.candidatar-identity {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 16px 16px;
    padding: 12px 14px;
    background: #1a1a1a;
    border-radius: 12px;
    border: 1px solid #2a2a2a;
}

.candidatar-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: #222;
}

.candidatar-identity-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.candidatar-identity-name {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.candidatar-identity-email {
    font-size: 11px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.candidatar-identity-badge {
    width: 22px;
    height: 22px;
    background: rgba(238,138,4,0.12);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Body */
.candidatar-modal-body {
    padding: 0 16px 20px;
}

.candidatar-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 8px;
}

.candidatar-required {
    font-size: 10px;
    color: #ee8a04;
    text-transform: none;
    font-weight: 400;
    letter-spacing: 0;
}

.candidatar-textarea {
    width: 100%;
    min-height: 130px;
    padding: 14px;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    color: #fff;
    font-size: 14px;
    line-height: 1.6;
    resize: none;
    box-sizing: border-box;
    font-family: inherit;
    transition: border-color 0.2s;
    outline: none;
}

.candidatar-textarea:focus {
    border-color: #ee8a04;
}

.candidatar-textarea::placeholder { color: #444; }

.candidatar-char-count {
    font-size: 10px;
    color: #444;
    text-align: right;
    margin: 6px 2px 20px;
}

.candidatar-submit-btn {
    width: 100%;
    padding: 15px;
    background: #ee8a04;
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    font-family: 'Oswald', sans-serif;
    letter-spacing: 0.8px;
    transition: opacity 0.2s;
    margin-bottom: 12px;
}

.candidatar-submit-btn:active { opacity: 0.85; }

.candidatar-cancel-btn {
    width: 100%;
    padding: 10px;
    background: transparent;
    border: none;
    color: #555;
    font-size: 0.85rem;
    cursor: pointer;
    text-align: center;
    font-family: inherit;
}

/* ============================================
   EDIT EQUIPA MODAL
   ============================================ */

.edit-equipa-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    overflow-y: auto;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.edit-equipa-modal.show {
    display: block;
    opacity: 1;
}

.edit-equipa-modal-content {
    background: var(--card-bg);
    margin: 0;
    min-height: 100%;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.edit-equipa-modal-header {
    display: flex;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: var(--card-bg);
    z-index: 10;
}

.edit-equipa-modal-header h2 {
    flex: 1;
    margin: 0;
    font-family: 'Oswald', sans-serif;
    font-size: 1.1rem;
    font-weight: 500;
    color: white;
    text-align: center;
    letter-spacing: 0.5px;
}

.edit-equipa-modal-close {
    position: absolute;
    left: 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.edit-equipa-modal-close:hover {
    color: white;
}

/* Modal Tabs */
.modal-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 52px;
    background: var(--card-bg);
    z-index: 9;
}

.modal-tab {
    flex: 1;
    padding: 12px 14px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.modal-tab.active {
    color: var(--primary-color);
}

.modal-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.edit-equipa-modal-body {
    padding: 16px 14px 30px;
}

/* Compact Form Layout */
.form-row-compact {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 16px;
}

.logo-upload-compact {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.logo-preview-small {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
    background: var(--dark-bg);
}

.btn-change-logo {
    font-size: 0.7rem;
    color: var(--primary-color);
    cursor: pointer;
    padding: 4px 8px;
    background: rgba(238, 138, 4, 0.1);
    border-radius: 4px;
}

.flex-grow {
    flex: 1;
    min-width: 0;
}

.form-row {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

/* Members Tab Styles */
.members-section-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 16px 0 8px;
}

/* Form Styles */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px 14px;
    background: var(--dark-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: white;
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-hint {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin: 6px 0 0 0;
}

/* Image Upload */
.image-upload-container {
    position: relative;
}

.photo-preview {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 12px;
    border: 2px solid var(--border-color);
}

.form-file-input {
    display: none;
}

.file-upload-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--dark-bg);
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.file-upload-label:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.upload-icon {
    font-size: 1.1rem;
}

/* Save Button */
.btn-save-equipa {
    width: 100%;
    padding: 14px 20px;
    background: var(--primary-color);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: 'Oswald', sans-serif;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.15s;
    margin-top: 10px;
}

.btn-save-equipa:active {
    opacity: 0.9;
    transform: scale(0.98);
}

.btn-save-equipa:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   MEMBERS MANAGEMENT IN MODAL
   ============================================ */

.current-members-list {
    background: var(--dark-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 12px;
    max-height: 600px;
    overflow-y: auto;
}

.current-members-list .loading-text {
    color: var(--text-muted);
    font-size: 0.8rem;
    text-align: center;
    margin: 10px 0;
}

.current-members-list .no-members-text {
    color: var(--text-muted);
    font-size: 0.8rem;
    text-align: center;
    margin: 10px 0;
}

.member-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: var(--card-bg);
    border-radius: 6px;
    margin-bottom: 6px;
}

.member-item:last-child {
    margin-bottom: 0;
}

.member-item-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--border-color);
}

.member-item-info {
    flex: 1;
    min-width: 0;
}

.member-item-name {
    font-size: 0.8rem;
    font-weight: 500;
    color: white;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.member-item-email {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-remove-member {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: rgba(220, 38, 38, 0.2);
    color: #dc2626;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    flex-shrink: 0;
}

.btn-remove-member:active {
    background: rgba(220, 38, 38, 0.4);
    transform: scale(0.95);
}

/* Add Member Search */
.add-member-section {
    margin-top: 8px;
}

.search-input-wrapper {
    display: flex;
    gap: 8px;
}

.search-input-wrapper .form-input {
    flex: 1;
}

.btn-search {
    width: 44px;
    height: 44px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--dark-bg);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.btn-search:active {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.search-results {
    background: var(--dark-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-top: 8px;
    max-height: 180px;
    overflow-y: auto;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid var(--border-color);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:active {
    background: var(--card-bg-lighter);
}

.search-result-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--border-color);
}

.search-result-info {
    flex: 1;
    min-width: 0;
}

.search-result-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: white;
    margin: 0;
}

.search-result-email {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin: 0;
}

.btn-add-member {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    background: var(--primary-color);
    color: white;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-add-member:active {
    opacity: 0.8;
    transform: scale(0.95);
}

.btn-add-member:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.search-no-results {
    padding: 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ============================================
   ORG CHART - Hierarchy View
   ============================================ */

.org-chart {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    width: 100%;
}

.org-tier {
    width: 100%;
    text-align: center;
    position: relative;
}

.org-tier-label {
    font-family: 'Oswald', sans-serif;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin: 0 0 8px 0;
    padding: 4px 12px;
    display: inline-block;
    background: rgba(238, 138, 4, 0.08);
    border-radius: 4px;
}

.org-tier-members {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 0;
}

.org-tier-members .member-card {
    width: calc(50% - 4px);
}

@media (max-width: 360px) {
    .org-tier-members .member-card {
        width: 100%;
    }
}

.org-tier[data-tier="1"] .member-card {
    border-color: var(--primary-color);
    border-width: 1.5px;
}

.org-tier-empty {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-style: italic;
    padding: 10px 0;
}

/* Connector line between tiers */
.org-connector {
    width: 2px;
    height: 20px;
    background: var(--border-color);
    margin: 0 auto;
    position: relative;
}

.org-connector::before,
.org-connector::after {
    content: '';
    position: absolute;
    height: 2px;
    background: var(--border-color);
    top: 50%;
}

.org-connector::before {
    left: -16px;
    width: 16px;
}

.org-connector::after {
    right: -16px;
    width: 16px;
}

/* Unassigned members section */
.org-unassigned {
    width: 100%;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px dashed var(--border-color);
}

.org-unassigned-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    text-align: center;
}

.org-unassigned .org-tier-members {
    opacity: 0.7;
}

/* Hierarchy tab styles */
.hierarchy-section {
    margin-bottom: 16px;
}

.hierarchy-section-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 16px 0 8px;
}

.tier-name-inputs {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.tier-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tier-name-row label {
    font-size: 0.75rem;
    color: var(--text-muted);
    min-width: 50px;
    margin: 0;
}

.tier-name-row input {
    flex: 1;
}

.tier-assignment-list {
    background: var(--dark-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px;
    max-height: 400px;
    overflow-y: auto;
}

.tier-assignment-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: var(--card-bg);
    border-radius: 6px;
    margin-bottom: 6px;
}

.tier-assignment-item:last-child {
    margin-bottom: 0;
}

.tier-assignment-item .member-item-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--border-color);
    flex-shrink: 0;
}

.tier-assignment-item .member-item-info {
    flex: 1;
    min-width: 0;
}

.tier-assignment-item .member-item-name {
    font-size: 0.8rem;
    font-weight: 500;
    color: white;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tier-select {
    width: 80px;
    padding: 6px 8px;
    background: var(--dark-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: white;
    font-size: 0.75rem;
    font-family: inherit;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
    padding-right: 22px;
    flex-shrink: 0;
}

.tier-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* ============================================
   FOOTER SPACING
   ============================================ */

#footer {
    margin-top: 0;
}
