/* Shared management UI styles */
/* NOTE: Icon/button styling is centralised in /css/admin-actions.css.
   Always use .action-icon + semantic modifiers instead of creating
   new wide coloured buttons on management pages. */

/* Global h1 title styling - 25% smaller than default 2em */
h1 {
    font-size: 1.5em !important;
}

.manage-bottom-nav {
	position: fixed;
	bottom: 0;
	width: 100%;
	left: 0;
	right: 0;
	--manage-bottom-nav-top-gap: 4px;
	--manage-bottom-nav-width: clamp(320px, 100%, var(--body-max-width, 500px));
	padding: var(--manage-bottom-nav-top-gap) 0 23px 0;
	display: block;
	z-index: 9997;
	background: #ffffff;
}

.manage-bottom-nav::after {
	content: '';
	position: absolute;
	top: 0;
	left: 50%;
	transform: translateX(-50%);
	width: var(--manage-bottom-nav-width);
	height: 2px;
	background: white;
	pointer-events: none;
	z-index: 1;
}

.manage-bottom-nav__inner {
	width: var(--manage-bottom-nav-width);
	--manage-bottom-nav-gutter: 12px;
	padding: 0 var(--manage-bottom-nav-gutter);
	margin: 0 auto;
	box-sizing: border-box;
	position: relative;
	z-index: 2;
}

.manage-bottom-nav__wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding-top: 8px;
}

.manage-bottom-nav__left,
.manage-bottom-nav__center,
.manage-bottom-nav__right {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.manage-bottom-nav__left {
    flex: 1;
    transform: translateX(-12px);
}

.manage-bottom-nav__right {
    flex: 1;
}

.manage-bottom-nav__center {
    justify-content: center;
    flex: 0 0 auto;
}

.manage-bottom-nav__right {
    justify-content: flex-end;
    transform: translateX(3px);
}

.manage-bottom-nav__action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #2563eb;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

.manage-bottom-nav__action--secondary {
    color: #4b5563;
}

.manage-bottom-nav__action--danger {
    color: #dc2626;
}

.manage-bottom-nav__action--icon {
    width: 34px;
    height: 34px;
    justify-content: center;
    border: none;
    border-radius: 0;
    color: #111827;
    font-size: 18px;
    font-weight: 600;
    line-height: 1;
    padding: 0;
}

.manage-bottom-nav__action--icon svg {
    width: 18px;
    height: 18px;
}

.manage-bottom-nav__action--icon img {
    border: none;
    border-radius: 0;
}

.manage-bottom-nav__action--icon:hover {
    background: #f3f4f6;
    border-radius: 50%;
    color: #111827;
    text-decoration: none;
}

.manage-bottom-nav__action--icon:focus-visible {
    background: #f3f4f6;
    border-radius: 50%;
    color: #111827;
    text-decoration: none;
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.manage-bottom-nav__action:not(.manage-bottom-nav__action--icon):hover,
.manage-bottom-nav__action:not(.manage-bottom-nav__action--icon):focus-visible {
    text-decoration: underline;
    outline: none;
}

.manage-bottom-nav__menu-toggle {
    position: relative;
}

.manage-bottom-nav__submenu-toggle {
    position: relative;
    display: inline-flex;
}

.manage-bottom-nav__quick-container {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.manage-bottom-nav__quick-menu {
    position: absolute;
    bottom: calc(100% + 14px);
    left: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 999px;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
    z-index: 1200;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.manage-bottom-nav__quick-menu.is-open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.manage-bottom-nav__quick-action {
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #111827;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.manage-bottom-nav__quick-action:hover {
    background: #f3f4f6;
}

.manage-bottom-nav__quick-action:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.manage-bottom-nav__quick-action svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
}

.manage-bottom-nav__menu-button {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    padding: 0;
}

.manage-bottom-nav__menu-button span {
    width: 18px;
    height: 2px;
    background: #1f2937;
    border-radius: 999px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.manage-bottom-nav__menu-button[aria-expanded="true"] {
    box-shadow: none;
}

.manage-bottom-nav__menu-button[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.manage-bottom-nav__menu-button[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.manage-bottom-nav__menu-button[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

.manage-bottom-nav__menu-button:hover {
    background: #f3f4f6;
}

.manage-bottom-nav__menu-button:focus-visible {
    background: #f3f4f6;
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.manage-bottom-nav__menu {
    position: absolute;
    bottom: calc(100% + 12px);
    right: 0;
    min-width: 220px;
    max-width: min(300px, 86vw);
    max-height: min(60vh, 520px);
    overflow-y: hidden;
    overflow-x: hidden;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-right: none;
    border-radius: 14px;
    box-shadow: -8px -8px 24px rgba(15, 23, 42, 0.12), 0 24px 24px -48px rgba(15, 23, 42, 0.12);
    clip-path: inset(-100px 0 -100px -100px);
    padding: 8px 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.manage-bottom-nav__submenu {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 0;
    min-width: 170px;
    max-width: min(240px, 78vw);
    max-height: min(60vh, 520px);
    overflow-y: auto;
    overflow-x: hidden;
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 8px 0 0 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    padding: 0;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
    z-index: 10;
}

.manage-bottom-nav__submenu.is-open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.manage-bottom-nav__submenu .manage-bottom-nav__menu-item {
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    text-align: right;
    color: #333;
}

.manage-bottom-nav__submenu .manage-bottom-nav__menu-item:hover,
.manage-bottom-nav__submenu .manage-bottom-nav__menu-item:focus-visible {
    background: #f8f9fa;
    color: #333;
}

.manage-bottom-nav__submenu .manage-bottom-nav__menu-item:last-child {
    border-bottom: none;
}

.manage-bottom-nav[data-menu-style="classic"] .manage-bottom-nav__menu {
    bottom: calc(100% + 12px);
    right: calc(-1 * var(--manage-bottom-nav-gutter, 12px));
    min-width: 150px;
    max-width: min(220px, 78vw);
    border: 1px solid #dee2e6;
    border-bottom: none;
    border-right: none;
    border-radius: 8px 0 0 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    padding: 0;
    transform: translateY(0);
}

.manage-bottom-nav__menu.is-open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.manage-bottom-nav__menu-item {
    display: block;
    width: 100%;
    box-sizing: border-box;
    border: none;
    background: transparent;
    color: #1f2937;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.2;
    text-align: right;
    padding: 10px 18px;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.2s ease, color 0.2s ease;
    border-bottom: 1px solid #eef2f7;
}

.manage-bottom-nav[data-menu-style="classic"] .manage-bottom-nav__menu-item {
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    text-align: right;
    color: #333;
}

.manage-bottom-nav[data-menu-style="classic"] .manage-bottom-nav__menu-item:hover,
.manage-bottom-nav[data-menu-style="classic"] .manage-bottom-nav__menu-item:focus-visible {
    background: #f8f9fa;
    color: #333;
}

.manage-bottom-nav__menu-item:hover,
.manage-bottom-nav__menu-item:focus-visible {
    background: #f3f4f6;
    color: #1d4ed8;
    outline: none;
}

.manage-bottom-nav__menu-item:first-child {
    border-radius: 12px 12px 0 0;
    border-bottom: none;
}

.manage-bottom-nav__menu-item:last-child {
    border-radius: 0 0 12px 12px;
    border-bottom: none;
}

.manage-bottom-nav[data-menu-style="classic"] .manage-bottom-nav__menu-item:first-child,
.manage-bottom-nav[data-menu-style="classic"] .manage-bottom-nav__menu-item:last-child {
    border-radius: 0;
}

.manage-bottom-nav[data-menu-style="classic"] .manage-bottom-nav__menu-item:first-child {
    border-bottom: 1px solid #eee;
}

.manage-bottom-nav[data-menu-style="classic"] .manage-bottom-nav__menu-item:last-child {
    border-bottom: none;
}

@media (max-width: 980px) {
    .manage-bottom-nav__inner {
        max-width: 92vw;
    }
}

@media (max-width: 640px) {
    .manage-bottom-nav {
        bottom: 0 !important;
    }

    .manage-bottom-nav__inner {
        padding-bottom: calc(env(safe-area-inset-bottom, 0px));
    }
    
    .manage-bottom-nav__wrapper {
        flex-direction: row;
        align-items: center;
        flex-wrap: nowrap;
    }

    .manage-bottom-nav__left {
        flex-wrap: nowrap;
        transform: translateX(-16px);
    }

    .manage-bottom-nav__center {
        flex-shrink: 0;
    }

    .manage-bottom-nav__right {
        justify-content: flex-end;
        flex-shrink: 0;
        transform: translateX(10px);
    }

    .manage-bottom-nav__action {
        white-space: nowrap;
    }
}

.list-details-actions,
.summary-action-icons,
.yzy-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.list-details-actions {
    transform: translateY(10px);
    opacity: 0;
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}

.list-details.active .list-details-actions {
    transform: translateY(0);
    opacity: 1;
    transition-delay: 0.4s;
}

/* Override shared icon tokens for compact management grids */
.summary-action-icons,
.members-container,
.lists-container,
.yzy-card-actions {
    --action-icon-size: 32px;
    --action-icon-bg: transparent;
    --action-icon-hover-bg: #111827;
    --action-icon-color: #4b5563;
    --action-icon-hover-color: #ffffff;
}

.list-details.active .action-icon {
    transform: translateY(0);
    opacity: 1;
}

.yzy-card-actions + .yzy-card-actions {
    margin-top: 10px;
}

.card-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.project-details-toggle {
    position: relative;
}

.card-toggle:hover,
.card-toggle.expanded {
    background: #2563eb;
    border-color: #1d4ed8;
    color: #ffffff;
}

.card-toggle .toggle-icon {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-toggle.expanded .toggle-icon {
    transform: rotate(180deg);
}

.section-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid #d1d5db;
    color: #6b7280;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.section-toggle-btn .toggle-icon {
    transition: transform 0.3s ease;
}

.section-toggle-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
    color: #111827;
}

.section-toggle-btn.expanded .toggle-icon {
    transform: rotate(180deg);
}

@media (max-width: 640px) {
    .list-details-actions,
    .summary-action-icons,
    .yzy-card-actions {
        gap: 8px;
    }

    .card-toggle,
    .section-toggle-btn {
        width: 32px;
        height: 32px;
    }

    .card-toggle .toggle-icon,
    .section-toggle-btn .toggle-icon {
        width: 16px;
        height: 16px;
    }
}

.project-action-panel {
    width: 100%;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transform: translateY(-12px);
    transition: max-height 0.32s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.28s ease, transform 0.28s ease;
    pointer-events: none;
    margin-top: 0;
}

.project-action-panel.is-open {
    max-height: 640px;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    margin-top: 20px;
}

.project-action-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 22px 26px;
}

.project-action-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.project-action-title {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 650;
    color: #111827;
}

.project-action-subtitle {
    margin: 6px 0 0;
    font-size: 0.9rem;
    color: #6b7280;
}

.project-action-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.project-action-options {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    border: none;
    margin: 0;
    padding: 0;
}

.project-action-options-title {
    width: 100%;
    margin: 0 0 6px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9ca3af;
}

.project-action-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    background: #f9fafb;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    font-size: 0.9rem;
    color: #374151;
    user-select: none;
}

.project-action-option:hover {
    border-color: #2563eb;
    background: #eff6ff;
    box-shadow: 0 3px 8px rgba(37, 99, 235, 0.1);
}

.project-action-option input {
    margin: 0;
}

.project-action-options[hidden] {
    display: none;
}

.project-action-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 8px;
    border-top: 1px solid #e5e7eb;
}

.project-action-dismiss {
    --action-icon-size: 32px;
}

/* Specific styles for project action panel form fields */
.project-action-panel .form-row {
    margin-bottom: 16px;
}

.project-action-panel .form-row label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: #374151;
    font-size: 14px;
}

.project-action-panel .form-row input,
.project-action-panel .form-row textarea {
    width: 100%;
    max-width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: #fff;
    box-sizing: border-box;
}

.project-action-panel .form-row input:focus,
.project-action-panel .form-row textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.project-action-panel .form-row textarea {
    resize: vertical;
    min-height: 80px;
}

@media (max-width: 640px) {
    .project-action-form {
        padding: 18px;
        gap: 16px;
    }

    .project-action-footer {
        flex-direction: column-reverse;
        align-items: stretch;
    }
}


/* Member card styles */
.members-container {
    padding: 24px;
}

.members-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e5e7eb;
}

.members-header h3 {
    margin: 0;
    color: #1f2937;
    font-size: 1.1rem;
}

.members-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.member-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.member-card:hover {
    border-color: #d1d5db;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1);
}

.member-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1 1 auto;
}

.member-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #2563eb;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
}

.member-details {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 8px;
    align-items: baseline;
}

.member-name {
    display: inline-block;
    font-weight: 600;
    color: #1f2937;
    order: 1;
}

.member-status {
    display: inline-block;
    width: fit-content;
    font-size: 0.8rem;
    padding: 1px 4px;
    border-radius: 999px;
    text-transform: uppercase;
    font-weight: 500;
    background: #e5e7eb;
    color: #374151;
    line-height: 1.2;
    white-space: nowrap;
    order: 2;
}

.member-role {
    font-size: 0.8rem;
    padding: 1px 0;
    color: #6b7280;
    order: 3;
    flex-basis: 100%;
}

.member-status.status-accepted,
.member-status.status-active {
    background: #dcfce7;
    color: #166534;
}

.member-status.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.member-status.status-revoked {
    background: #fee2e2;
    color: #b91c1c;
}

.member-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.member-added {
    font-size: 0.8rem;
    color: #6b7280;
}

/* Project list card styles */
.lists-container {
    padding: 24px;
}

.lists-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 12px;
}

.lists-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.list-card {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.list-card:hover {
    border-color: #d1d5db;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1);
}

.list-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex: 1 1 auto;
}

.list-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.list-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.list-name {
    margin: 0;
    color: #1f2937;
    font-size: 1.05rem;
    font-weight: 600;
}

.list-description {
    color: #6b7280;
    font-size: 0.9rem;
}

.list-meta {
    font-size: 0.8rem;
    color: #6b7280;
}

.list-status {
    font-size: 0.8rem;
    padding: 2px 8px;
    border-radius: 999px;
    text-transform: uppercase;
    font-weight: 600;
    background: #e5e7eb;
    color: #374151;
}

.list-status.status-active {
    background: #dcfce7;
    color: #166534;
}

.list-status.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.list-status.status-inactive,
.list-status.status-deleted {
    background: #fee2e2;
    color: #b91c1c;
}

.list-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.list-added {
    font-size: 0.8rem;
    color: #6b7280;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
}

.empty-state p {
    margin: 0;
    font-style: italic;
}

.project-details-toggle {
    position: relative;
}
.section {
    position: relative;
}

.collapsible-section {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
}

.collapsible-section .card-toggle {
    margin-left: auto;
}
