/* ==========================================================
   Media Server UI Styles
   Cleaned and consolidated
   ========================================================== */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    background: #f6f7f9;
    color: #1f2937;
}

.app-layout {
    display: flex;
    min-height: 100vh;
}

.brand {
    padding: 0 12px 28px;
    font-size: 20px;
    font-weight: 700;
}

.nav-item {
    display: block;
    padding: 11px 12px;
    border-radius: 7px;
    color: #9ca3af;
    text-decoration: none;
}

.nav-item:hover {
    background: #1f2937;
    color: #ffffff;
}

.nav-item.active {
    background: #2563eb;
    color: #ffffff;
}

.main-content {
    flex: 1;
    min-width: 0;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 76px;
    padding: 0 32px;
    border-bottom: 1px solid #e5e7eb;
    background: #ffffff;
}

.topbar h1 {
    margin: 0;
    font-size: 22px;
}

.server-status {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #4b5563;
    font-size: 14px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
}

.page-content {
    padding: 32px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 38px;
    padding: 8px 14px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease,
        box-shadow 0.15s ease;
}

.button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.button-primary {
    border-color: #2563eb;
    background: #2563eb;
    color: #ffffff;
}

.button-primary:hover {
    border-color: #1d4ed8;
    background: #1d4ed8;
}

.button-secondary {
    border-color: #d1d5db;
    background: #ffffff;
    color: #374151;
}

.button-secondary:hover {
    background: #f9fafb;
}

.button-small {
    min-height: 32px;
    padding: 6px 10px;
    font-size: 12px;
}

.panel {
    padding: 24px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #ffffff;
}

.panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.panel-header h2 {
    margin: 0 0 6px;
    color: #111827;
    font-size: 18px;
}

.panel-header p {
    margin: 0;
    color: #6b7280;
    font-size: 14px;
    line-height: 1.5;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    padding: 22px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #ffffff;
}

.stat-label {
    display: block;
    margin-bottom: 10px;
    color: #6b7280;
    font-size: 14px;
}

.stat-value {
    font-size: 30px;
    font-weight: 700;
}

.page-toolbar,
.project-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.page-toolbar h2 {
    margin: 0 0 4px;
}

.page-toolbar p {
    margin: 0;
    color: #6b7280;
}

.project-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.project-toolbar-actions form {
    margin: 0;
}

.project-id {
    overflow: hidden;
    color: #64748b;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.projects-page {
    width: 100%;
}

.projects-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
}

.projects-header__content h2 {
    margin: 0;
    color: #0f172a;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.projects-header__content p {
    margin: 6px 0 0;
    color: #64748b;
    font-size: 14px;
    line-height: 1.5;
}

.projects-add-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.projects-add-button__icon {
    font-size: 18px;
    font-weight: 400;
    line-height: 1;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    gap: 20px;
}

.project-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
    transition: transform 0.2s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease;
}

.project-card:hover {
    transform: translateY(-3px);
    border-color: #cbd5e1;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.project-card__main {
    display: block;
    flex: 1;
    padding: 22px 22px 20px;
    color: inherit;
    text-decoration: none;
}

.project-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 20px;
}

.project-card__identity {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 13px;
}

.project-card__avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border: 1px solid #dbeafe;
    border-radius: 12px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 17px;
    font-weight: 700;
}

.project-card__title {
    min-width: 0;
}

.project-card__title h3 {
    margin: 0 0 6px;
    overflow: hidden;
    color: #0f172a;
    font-size: 16px;
    font-weight: 650;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #64748b;
    font-size: 12px;
    font-weight: 500;
}

.project-status__dot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: #94a3b8;
}

.project-status--active {
    color: #15803d;
}

.project-status--active .project-status__dot {
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.12);
}

.project-status--inactive {
    color: #64748b;
}

.project-card__id {
    padding: 11px 13px;
    border: 1px solid #f1f5f9;
    border-radius: 9px;
    background: #f8fafc;
}

.project-card__id-label {
    display: block;
    margin-bottom: 4px;
    color: #94a3b8;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.project-card__id-value {
    display: block;
    overflow: hidden;
    color: #64748b;
    font-family: ui-monospace,
        SFMono-Regular,
        Menlo,
        Monaco,
        Consolas,
        monospace;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-card__stats {
    display: grid;
    grid-template-columns: 0.8fr 0.8fr 1.4fr;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid #f1f5f9;
}

.project-stat:first-child {
    padding-left: 0;
}

.project-stat + .project-stat {
    border-left: 1px solid #f1f5f9;
}

.project-stat__value {
    overflow: hidden;
    color: #0f172a;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-stat__value--trash {
    color: #c2410c;
}

.project-stat__date {
    font-size: 13px;
    font-weight: 600;
}

.project-stat__label {
    margin-top: 4px;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 500;
}

.project-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 52px;
    padding: 10px 14px 10px 22px;
    border-top: 1px solid #f1f5f9;
    background: #fcfcfd;
}

.project-card__open {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #475569;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.15s ease;
}

.project-card__open:hover {
    color: #2563eb;
}

.project-card__open-arrow {
    font-size: 16px;
    transition: transform 0.15s ease;
}

.project-card__open:hover .project-card__open-arrow {
    transform: translateX(3px);
}

.project-card__trash {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    padding: 5px 9px;
    border-radius: 8px;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.15s ease,
        color 0.15s ease;
}

.project-card__trash:hover {
    background: #f1f5f9;
    color: #475569;
}

.project-card__trash--has-items {
    color: #c2410c;
}

.project-card__trash--has-items:hover {
    background: #fff7ed;
    color: #9a3412;
}

.project-card__trash-icon {
    font-size: 14px;
    line-height: 1;
}

.project-card__trash-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border-radius: 999px;
    background: #ffedd5;
    color: #c2410c;
    font-size: 10px;
    font-weight: 700;
}

.projects-empty {
    display: flex;
    align-items: center;
    flex-direction: column;
    max-width: 520px;
    margin: 70px auto;
    padding: 48px 32px;
    border: 1px dashed #cbd5e1;
    border-radius: 18px;
    background: #ffffff;
    text-align: center;
}

.projects-empty__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    margin-bottom: 18px;
    border-radius: 14px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 26px;
}

.projects-empty h3 {
    margin: 0;
    color: #0f172a;
    font-size: 18px;
    font-weight: 700;
}

.projects-empty p {
    max-width: 380px;
    margin: 8px 0 22px;
    color: #64748b;
    font-size: 13px;
    line-height: 1.6;
}

.project-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px;
    margin-top: 24px;
}

.media-card {
    position: relative;
    overflow: visible;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #ffffff;
}

.media-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 160px;
    overflow: hidden;
    border-bottom: 1px solid #e5e7eb;
    border-radius: 10px 10px 0 0;
    background: #f3f4f6;
}

.media-preview-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-placeholder {
    color: #9ca3af;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.media-card-body {
    overflow: visible;
    padding: 14px;
}

.media-name {
    overflow: hidden;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.media-info {
    display: flex;
    align-items: center;
    min-height: 20px;
    gap: 10px;
    color: #6b7280;
    font-size: 12px;
}

.media-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
}

.media-footer-info {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 8px;
}

.media-actions,
.trash-actions {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    gap: 6px;
}

.status-badge {
    padding: 4px 7px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

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

.status-processing {
    background: #dbeafe;
    color: #1e40af;
}

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

.status-failed {
    background: #fee2e2;
    color: #991b1b;
}

.status-deleted {
    background: #ffedd5;
    color: #9a3412;
}

.variant-count {
    color: #6b7280;
    font-size: 11px;
}

.media-copy-button {
    height: 30px;
    padding: 0 10px;
    border: 1px solid #d7dce3;
    border-radius: 6px;
    background: #ffffff;
    color: #344054;
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease,
        border-color 0.15s ease;
}

.media-copy-button:hover {
    border-color: #c7ced8;
    background: #f8fafc;
}

.media-copy-button.is-copied {
    color: #15803d;
}

.media-menu {
    position: relative;
}

.media-menu-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid #d7dce3;
    border-radius: 6px;
    background: #ffffff;
    color: #475467;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.media-menu-button:hover {
    background: #f8fafc;
}

.media-menu-dropdown {
    position: absolute;
    right: 0;
    bottom: calc(100% + 8px);
    z-index: 100;
    display: none;
    width: 210px;
    padding: 6px;
    border: 1px solid #e4e7ec;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 12px 28px rgba(16, 24, 40, 0.14);
}

.media-menu.is-open .media-menu-dropdown {
    display: block;
}

.media-menu-item {
    display: block;
    width: 100%;
    padding: 8px 10px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: #344054;
    font-family: inherit;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.4;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.media-menu-item:hover {
    background: #f2f4f7;
    color: #101828;
    text-decoration: none;
}

.media-menu-item.is-copied {
    color: #15803d;
    font-weight: 600;
}

.media-menu-divider {
    height: 1px;
    margin: 5px 4px;
    background: #eaecf0;
}

.trash-count {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 10px;
    border-radius: 999px;
    background: #f8fafc;
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
}

.media-card-trash {
    border-color: #e5e7eb;
}

.trash-meta {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
}

.trash-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 3px 0;
    color: #64748b;
    font-size: 11px;
}

.trash-meta-label {
    color: #94a3b8;
}

.trash-empty {
    grid-column: 1 / -1;
}

.trash-empty strong {
    display: block;
    margin-bottom: 6px;
    color: #111827;
    font-size: 16px;
}

.trash-empty p {
    margin: 0 0 18px;
}

.form-page {
    max-width: 720px;
}

.form-panel {
    padding: 28px;
}

.project-form {
    margin-top: 24px;
}

.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    color: #111827;
    font-size: 14px;
    font-weight: 600;
}

.form-input {
    width: 100%;
    height: 44px;
    padding: 0 12px;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    background: #ffffff;
    color: #111827;
    font: inherit;
}

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

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.form-checkbox {
    width: 16px;
    height: 16px;
}

.form-help {
    margin: 7px 0 0 24px;
    color: #6b7280;
    font-size: 13px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.field-errors,
.form-errors {
    margin-top: 7px;
    color: #dc2626;
    font-size: 13px;
}

.field-errors ul,
.form-errors ul {
    margin: 0;
    padding-left: 18px;
}

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

.media-empty {
    grid-column: 1 / -1;
}

@media (max-width: 900px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .projects-header {
        align-items: stretch;
        flex-direction: column;
    }

    .projects-add-button {
        width: 100%;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .project-toolbar,
    .page-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .project-toolbar-actions {
        justify-content: flex-end;
    }
}

@media (max-width: 640px) {
    .sidebar {
        width: 180px;
    }

    .topbar {
        padding: 0 20px;
    }

    .page-content {
        padding: 20px;
    }

    .stats-grid,
    .project-stats {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .project-card__main {
        padding: 18px 18px 16px;
    }

    .project-card__stats {
        grid-template-columns: repeat(2, 1fr);
        row-gap: 18px;
    }

    .project-stat {
        padding: 0 10px;
    }

    .project-stat--date {
        grid-column: 1 / -1;
        padding: 14px 0 0;
        border-top: 1px solid #f1f5f9;
        border-left: 0 !important;
    }

    .project-card__footer {
        padding: 10px 14px 10px 18px;
    }

    .media-grid {
        grid-template-columns: 1fr;
    }

    .media-menu-dropdown {
        width: 190px;
    }
}

.media-preview-audio {
    width: 100%;
    height: 100%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px;
    box-sizing: border-box;
    background: #f6f7f9;
}

.audio-preview-icon {
    display: none;
}

.audio-preview-content {
    width: 100%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.audio-preview-label {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
}

.audio-preview-player {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: 36px;
}

.sidebar {
    width: 240px;
    flex-shrink: 0;
    padding: 24px 16px;
    background: #111827;
    color: #ffffff;
    display: flex;
    flex-direction: column;
}

.navigation {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.sidebar-user {
    margin-top: auto;
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.sidebar-user-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    font-size: 14px;
    font-weight: 700;
}

.sidebar-user-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sidebar-user-details strong {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-details span {
    margin-top: 2px;
    font-size: 11px;
    opacity: 0.6;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.logout-form {
    margin-top: 12px;
}

.logout-button {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease,
        border-color 0.15s ease;
}

.logout-button:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.16);
}

.auth-page {
    min-height: 100vh;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    background: radial-gradient(
            circle at top left,
            rgba(37, 99, 235, 0.08),
            transparent 35%
        ),
        #f6f8fb;
    color: #1f2937;
}

.auth-container {
    width: 100%;
    max-width: 440px;
}

.auth-card {
    width: 100%;
    padding: 42px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08),
        0 4px 12px rgba(15, 23, 42, 0.04);
}

.auth-header {
    margin-bottom: 32px;
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    margin-bottom: 26px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #2563eb;
}

.auth-brand::before {
    content: "";
    width: 10px;
    height: 10px;
    margin-right: 9px;
    border-radius: 3px;
    background: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.auth-header h1 {
    margin: 0;
    font-size: 28px;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: #111827;
}

.auth-header p {
    margin: 10px 0 0;
    font-size: 14px;
    line-height: 1.6;
    color: #6b7280;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.auth-field label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.auth-field .form-control {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    box-sizing: border-box;
    border: 1px solid #d1d5db;
    border-radius: 9px;
    background: #ffffff;
    color: #111827;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s ease,
        box-shadow 0.15s ease,
        background 0.15s ease;
}

.auth-field .form-control::placeholder {
    color: #9ca3af;
}

.auth-field .form-control:hover {
    border-color: #9ca3af;
}

.auth-field .form-control:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.auth-submit {
    width: 100%;
    min-height: 46px;
    margin-top: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 9px;
    background: #2563eb;
    color: #ffffff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease,
        transform 0.1s ease,
        box-shadow 0.15s ease;
}

.auth-submit:hover {
    background: #1d4ed8;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.2);
}

.auth-submit:active {
    transform: translateY(1px);
    box-shadow: none;
}

.auth-error {
    padding: 12px 14px;
    border: 1px solid #fecaca;
    border-radius: 9px;
    background: #fef2f2;
    color: #b91c1c;
    font-size: 13px;
    line-height: 1.5;
}

.auth-field-error {
    font-size: 12px;
    line-height: 1.4;
    color: #dc2626;
}

.auth-submit:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.25);
    outline-offset: 2px;
}

@media (max-width: 520px) {
    .auth-page {
        align-items: flex-start;
        padding: 40px
            16px;
    }

    .auth-card {
        padding: 30px 24px;
        border-radius: 14px;
    }

    .auth-header {
        margin-bottom: 28px;
    }

    .auth-header h1 {
        font-size: 25px;
    }
}

.members-page,
.access-page {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.members-page-header,
.access-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.members-page-heading,
.access-page-heading {
    display: flex;
    align-items: center;
    gap: 16px;
}

.members-page-icon,
.access-page-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 54px;
    width: 54px;
    height: 54px;
    border-radius: 14px;
    background: #eef2ff;
    color: #4f46e5;
    font-size: 24px;
}

.members-page-heading h1,
.access-page-heading h1 {
    margin: 0;
    color: #111827;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.members-page-heading p,
.access-page-heading p {
    margin: 5px 0 0;
    color: #64748b;
    font-size: 14px;
    line-height: 1.5;
}

.members-page-heading p strong,
.access-page-heading p strong {
    color: #475569;
    font-weight: 600;
}

.members-card,
.access-card {
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03),
        0 6px 20px rgba(15, 23, 42, 0.04);
}

.members-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 76px;
    gap: 20px;
    padding: 18px 22px;
    border-bottom: 1px solid #e8edf4;
}

.members-project-title {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 12px;
}

.members-project-title h2 {
    overflow: hidden;
    margin: 0;
    color: #111827;
    font-size: 18px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.members-count {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    padding: 4px 9px;
    border-radius: 999px;
    background: #eef2ff;
    color: #4f46e5;
    font-size: 12px;
    font-weight: 600;
}

.members-add-button,
.access-submit {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.button-icon {
    font-size: 18px;
    line-height: 1;
}

.members-table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.members-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.members-table th {
    padding: 13px 18px;
    border-bottom: 1px solid #e8edf4;
    background: #f8fafc;
    color: #475569;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

.members-table td {
    padding: 16px 18px;
    border-bottom: 1px solid #edf1f5;
    color: #334155;
    vertical-align: middle;
}

.members-table tbody tr {
    transition: background-color 0.15s ease;
}

.members-table tbody tr:hover {
    background: #fafcff;
}

.members-table tbody tr:last-child td {
    border-bottom: 0;
}

.member-user,
.member-added-by {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 11px;
}

.member-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #e0e7ff;
    color: #4338ca;
    font-size: 13px;
    font-weight: 700;
}

.member-avatar-small {
    flex-basis: 32px;
    width: 32px;
    height: 32px;
    font-size: 11px;
}

.member-user-details,
.member-added-by > div:last-child {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 3px;
}

.member-user-details strong,
.member-added-by strong {
    overflow: hidden;
    color: #172033;
    font-size: 14px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.member-user-details span,
.member-added-by span {
    overflow: hidden;
    color: #8491a5;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.member-email {
    color: #475569;
}

.member-date {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.member-date span {
    color: #334155;
}

.member-date small {
    color: #94a3b8;
    font-size: 12px;
}

.member-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 10px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.member-status-dot {
    flex: 0 0 7px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #94a3b8;
}

.member-status-active {
    background: #ecfdf3;
    color: #15803d;
}

.member-status-active .member-status-dot {
    background: #22c55e;
}

.members-actions-column {
    width: 130px;
    text-align: center !important;
    white-space: nowrap;
}

.member-remove-form {
    margin: 0;
}

.member-remove-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 7px 12px;
    border: 1px solid #fecaca;
    border-radius: 8px;
    background: #ffffff;
    color: #dc2626;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease,
        box-shadow 0.15s ease;
}

.member-remove-button:hover {
    border-color: #fca5a5;
    background: #fef2f2;
    color: #b91c1c;
}

.member-remove-button:active {
    background: #fee2e2;
}

.member-remove-button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.member-current-user {
    display: inline-flex;
    align-items: center;
    padding: 5px 9px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.member-muted {
    color: #94a3b8;
}

.members-empty {
    display: flex;
    align-items: center;
    flex-direction: column;
    padding: 60px 24px;
    text-align: center;
}

.members-empty-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin-bottom: 15px;
    border-radius: 16px;
    background: #eef2ff;
    font-size: 24px;
}

.members-empty h3 {
    margin: 0 0 7px;
    color: #111827;
    font-size: 17px;
    font-weight: 700;
}

.members-empty p {
    max-width: 380px;
    margin: 0 0 20px;
    color: #64748b;
    font-size: 14px;
    line-height: 1.5;
}

.members-page-footer {
    display: flex;
    justify-content: flex-end;
}

.access-card-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr)
        320px;
    min-height: 300px;
}

.access-form-section {
    padding: 30px;
}

.access-form-heading {
    margin-bottom: 25px;
}

.access-form-heading h2 {
    margin: 0;
    color: #111827;
    font-size: 18px;
    font-weight: 700;
}

.access-form-heading p {
    margin: 6px 0 0;
    color: #64748b;
    font-size: 14px;
    line-height: 1.5;
}

.access-field {
    max-width: 720px;
}

.access-label {
    display: block;
    margin-bottom: 8px;
    color: #334155;
    font-size: 13px;
    font-weight: 600;
}

.access-select-wrapper {
    position: relative;
}

.access-select-wrapper select {
    width: 100%;
    height: 46px;
    padding: 0 42px 0 14px;
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    outline: none;
    background: #ffffff;
    color: #1e293b;
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.access-select-wrapper::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 16px;
    width: 7px;
    height: 7px;
    border-right: 2px solid #64748b;
    border-bottom: 2px solid #64748b;
    transform: translateY(-70%)
        rotate(45deg);
    pointer-events: none;
}

.access-select-wrapper select:hover {
    border-color: #94a3b8;
}

.access-select-wrapper select:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.access-help {
    margin-top: 7px;
    color: #94a3b8;
    font-size: 12px;
}

.access-error {
    margin-top: 7px;
    color: #dc2626;
    font-size: 12px;
    font-weight: 500;
}

.form-alert {
    margin-bottom: 20px;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
}

.form-alert-error {
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #b91c1c;
}

.access-info {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 30px;
    border-left: 1px solid #edf1f5;
    background: #fbfcff;
    text-align: center;
}

.access-info-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
    margin-bottom: 18px;
    border-radius: 50%;
    background: #eef2ff;
    color: #4f46e5;
    font-size: 26px;
    font-weight: 700;
}

.access-info h3 {
    margin: 0 0 8px;
    color: #111827;
    font-size: 16px;
    font-weight: 700;
}

.access-info > p {
    max-width: 250px;
    margin: 0;
    color: #64748b;
    font-size: 13px;
    line-height: 1.6;
}

.access-info-note {
    display: flex;
    align-items: flex-start;
    width: 100%;
    gap: 9px;
    margin-top: 22px;
    padding: 11px 12px;
    border: 1px solid #e0e7ff;
    border-radius: 9px;
    background: #f5f7ff;
    color: #64748b;
    font-size: 11px;
    line-height: 1.5;
    text-align: left;
}

.access-info-note-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #e0e7ff;
    color: #4f46e5;
    font-size: 11px;
    font-weight: 700;
}

.access-card-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 17px 22px;
    border-top: 1px solid #e8edf4;
    background: #ffffff;
}

@media (max-width: 900px) {
    .members-card-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .members-table {
        min-width: 850px;
    }

    .access-card-body {
        grid-template-columns: 1fr;
    }

    .access-info {
        border-top: 1px solid #edf1f5;
        border-left: 0;
    }
}

@media (max-width: 600px) {
    .members-page-heading,
    .access-page-heading {
        align-items: flex-start;
    }

    .members-page-icon,
    .access-page-icon {
        flex-basis: 46px;
        width: 46px;
        height: 46px;
    }

    .members-page-heading h1,
    .access-page-heading h1 {
        font-size: 22px;
    }

    .members-card-header {
        padding: 16px;
    }

    .members-add-button {
        width: 100%;
    }

    .access-form-section {
        padding: 22px;
    }

    .access-card-footer {
        flex-direction: column-reverse;
    }

    .access-card-footer .button {
        width: 100%;
    }

    .members-page-footer .button {
        width: 100%;
    }
}

.users-page {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.users-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 4px 0;
}

.users-page-heading {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.users-page-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #ffffff;
    font-size: 22px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.users-page-heading h1 {
    margin: 0;
    color: #111827;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.25;
}

.users-page-heading p {
    margin: 5px 0 0;
    color: #6b7280;
    font-size: 14px;
    line-height: 1.5;
}

.users-page-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.users-add-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
}

.users-add-button .button-icon {
    font-size: 18px;
    line-height: 1;
}

.users-card {
    overflow: hidden;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03),
        0 4px 16px rgba(15, 23, 42, 0.025);
}

.users-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 22px;
    border-bottom: 1px solid #e5e7eb;
}

.users-card-header h2 {
    margin: 0;
    color: #111827;
    font-size: 17px;
    font-weight: 700;
}

.users-card-header p {
    margin: 4px 0 0;
    color: #6b7280;
    font-size: 13px;
}

.users-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 5px 11px;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    background: #f9fafb;
    color: #4b5563;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.users-table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    table-layout: auto;
}

.users-table th {
    padding: 12px 20px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
    color: #6b7280;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

.users-table td {
    padding: 16px 20px;
    border-bottom: 1px solid #eef0f3;
    color: #374151;
    font-size: 14px;
    vertical-align: middle;
}

.users-table tbody tr {
    transition: background-color 120ms ease;
}

.users-table tbody tr:hover {
    background: #fafbfc;
}

.users-table tbody tr:last-child td {
    border-bottom: 0;
}

.users-user {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 220px;
}

.users-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #f3f4f6;
    color: #374151;
    font-size: 14px;
    font-weight: 700;
}

.users-user-details {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.users-user-details strong {
    overflow: hidden;
    max-width: 280px;
    color: #111827;
    font-size: 14px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.users-user-details span {
    overflow: hidden;
    max-width: 280px;
    color: #6b7280;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.users-role {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 9px;
    border: 1px solid #dbe3ef;
    border-radius: 999px;
    background: #f8fafc;
    color: #475569;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.users-role-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #64748b;
}

.users-role-system {
    border-color: #ddd6fe;
    background: #f5f3ff;
    color: #6d28d9;
}

.users-role-system .users-role-dot {
    background: #8b5cf6;
}

.users-role-none {
    border-color: #e5e7eb;
    background: #f9fafb;
    color: #9ca3af;
}

.users-role-none .users-role-dot {
    background: #9ca3af;
}

.users-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.users-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.users-status-active {
    border: 1px solid #bbf7d0;
    background: #f0fdf4;
    color: #15803d;
}

.users-status-active .users-status-dot {
    background: #22c55e;
}

.users-status-inactive {
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    color: #6b7280;
}

.users-status-inactive .users-status-dot {
    background: #9ca3af;
}

.users-date {
    display: flex;
    flex-direction: column;
    gap: 2px;
    white-space: nowrap;
}

.users-date span {
    color: #374151;
    font-size: 13px;
    font-weight: 500;
}

.users-date small {
    color: #9ca3af;
    font-size: 11px;
}

.users-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 64px 24px;
    text-align: center;
}

.users-empty-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    margin-bottom: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #f9fafb;
    font-size: 22px;
}

.users-empty h3 {
    margin: 0;
    color: #111827;
    font-size: 16px;
    font-weight: 700;
}

.users-empty p {
    max-width: 360px;
    margin: 7px 0 20px;
    color: #6b7280;
    font-size: 13px;
    line-height: 1.6;
}

@media (max-width: 900px) {
    .users-page-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .users-page-actions {
        width: 100%;
    }

    .users-add-button {
        width: 100%;
    }

    .users-table {
        min-width: 760px;
    }
}

@media (max-width: 640px) {
    .users-page {
        gap: 18px;
    }

    .users-page-heading {
        align-items: flex-start;
    }

    .users-page-icon {
        width: 44px;
        height: 44px;
        flex-basis: 44px;
        border-radius: 12px;
    }

    .users-page-heading h1 {
        font-size: 21px;
    }

    .users-card {
        border-radius: 12px;
    }

    .users-card-header {
        align-items: flex-start;
        flex-direction: column;
        padding: 17px;
    }

    .users-table th,
    .users-table td {
        padding-left: 16px;
        padding-right: 16px;
    }
}

.users-edit-button:focus-visible,
.users-status-button:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

@media (max-width: 900px) {
    .users-actions-column {
        width: auto;
    }

    .users-row-actions {
        flex-wrap: wrap;
    }
}

.user-password-page {
    width: 100%;
    max-width: 760px;
}

.user-password-header {
    margin-bottom: 24px;
}

.user-password-heading {
    display: flex;
    align-items: center;
    gap: 14px;
}

.user-password-heading h1 {
    margin: 0 0 4px;
    color: #0f172a;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.user-password-heading p {
    margin: 0;
    color: #64748b;
    font-size: 14px;
}

.user-password-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border: 1px solid #dbeafe;
    border-radius: 12px;
    background: #eff6ff;
    font-size: 20px;
}

.user-password-card {
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04),
        0 4px 14px rgba(15, 23, 42, 0.03);
}

.user-password-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.user-password-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 50%;
    background: #e0e7ff;
    color: #4338ca;
    font-size: 15px;
    font-weight: 700;
}

.user-password-user-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.user-password-user-details strong {
    overflow: hidden;
    color: #0f172a;
    font-size: 14px;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-password-user-details span {
    overflow: hidden;
    color: #64748b;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-password-notice {
    display: flex;
    gap: 12px;
    margin: 24px 24px 0;
    padding: 14px 16px;
    border: 1px solid #dbeafe;
    border-radius: 10px;
    background: #f8fbff;
}

.user-password-notice-icon {
    flex: 0 0 auto;
    font-size: 17px;
}

.user-password-notice strong {
    display: block;
    margin-bottom: 3px;
    color: #1e3a8a;
    font-size: 13px;
    font-weight: 650;
}

.user-password-notice p {
    margin: 0;
    color: #475569;
    font-size: 12px;
    line-height: 1.55;
}

.user-password-form {
    padding: 24px;
}

.user-password-form .form-group {
    margin-bottom: 20px;
}

.user-password-form .form-group:last-of-type {
    margin-bottom: 0;
}

.user-password-form .form-input {
    width: 100%;
}

.user-password-form .access-error {
    margin-top: 6px;
    color: #dc2626;
    font-size: 12px;
    line-height: 1.4;
}

.user-password-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

@media (max-width: 640px) {
    .user-password-heading {
        align-items: flex-start;
    }

    .user-password-user {
        padding: 18px;
    }

    .user-password-notice {
        margin: 18px
            18px
            0;
    }

    .user-password-form {
        padding: 18px;
    }

    .user-password-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .user-password-actions .button {
        width: 100%;
        justify-content: center;
    }
}

.users-actions-column {
    width: 340px;
    text-align: right !important;
}

.users-row-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    white-space: nowrap;
}

.users-inline-form {
    display: inline-flex;
    margin: 0;
    padding: 0;
}

.users-edit-button,
.users-password-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 6px 12px;
    border-radius: 8px;
    background: #ffffff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    transition: background-color 120ms ease,
        border-color 120ms ease,
        color 120ms ease,
        box-shadow 120ms ease;
}

.users-edit-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 6px 12px;
    border-radius: 8px;
    background: #ffffff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    transition: background-color 120ms ease,
        border-color 120ms ease,
        color 120ms ease,
        box-shadow 120ms ease;
    border: 1px solid #dbe3ee;
    color: #334155;
}

.users-edit-button:hover {
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
    border-color: #cbd5e1;
    background: #f8fafc;
    color: #0f172a;
    text-decoration: none;
}

.users-password-button {
    border: 1px solid #dbeafe;
    color: #2563eb;
}

.users-password-button:hover {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
    text-decoration: none;
}

.users-status-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 6px 12px;
    border-radius: 8px;
    background: #ffffff;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background-color 120ms ease,
        border-color 120ms ease,
        color 120ms ease,
        box-shadow 120ms ease;
}

.users-status-button-danger {
    border: 1px solid #fecaca;
    color: #dc2626;
}

.users-status-button-danger:hover {
    box-shadow: 0 1px 2px rgba(220, 38, 38, 0.06);
    border-color: #fca5a5;
    background: #fef2f2;
    color: #b91c1c;
}

.users-status-button-success {
    border: 1px solid #bbf7d0;
    color: #15803d;
}

.users-status-button-success:hover {
    box-shadow: 0 1px 2px rgba(22, 163, 74, 0.06);
    border-color: #86efac;
    background: #f0fdf4;
    color: #166534;
}

.users-current-user,
.users-protected {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.users-current-user {
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    color: #2563eb;
}

.users-protected {
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #64748b;
}

.users-edit-button:focus-visible,
.users-password-button:focus-visible,
.users-status-button:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

@media (max-width: 1100px) {
    .users-actions-column {
        width: auto;
    }

    .users-row-actions {
        flex-wrap: wrap;
    }
}

.audit-page {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.audit-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.audit-page-heading {
    display: flex;
    align-items: center;
    gap: 14px;
}

.audit-page-heading h1 {
    margin: 0;
    color: #0f172a;
    font-size: 26px;
    font-weight: 700;
}

.audit-page-heading p {
    margin: 5px 0 0;
    color: #64748b;
    font-size: 14px;
}

.audit-page-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    border: 1px solid #dbeafe;
    border-radius: 12px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 22px;
}

.audit-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.audit-filter-card {
    padding: 18px 20px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #ffffff;
}

.audit-filter-form {
    display: grid;
    grid-template-columns: minmax(260px, 1fr)
        minmax(220px, 280px)
        auto;
    align-items: end;
    gap: 16px;
}

.audit-filter-search,
.audit-filter-action {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.audit-filter-search label,
.audit-filter-action label {
    color: #334155;
    font-size: 12px;
    font-weight: 600;
}

.audit-filter-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.audit-card {
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #ffffff;
}

.audit-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 22px;
    border-bottom: 1px solid #e2e8f0;
}

.audit-card-header h2 {
    margin: 0;
    color: #0f172a;
    font-size: 17px;
    font-weight: 700;
}

.audit-card-header p {
    margin: 4px 0 0;
    color: #64748b;
    font-size: 13px;
}

.audit-count {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border: 1px solid #dbeafe;
    border-radius: 999px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 11px;
    font-weight: 700;
}

.audit-table-wrapper {
    overflow-x: auto;
}

.audit-table {
    width: 100%;
    border-collapse: collapse;
}

.audit-table th {
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.audit-table td {
    padding: 15px 16px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    font-size: 13px;
    vertical-align: middle;
}

.audit-table tbody tr:last-child td {
    border-bottom: 0;
}

.audit-table tbody tr:hover {
    background: #fafcff;
}

.audit-event {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 180px;
}

.audit-event-icon {
    width: 9px;
    height: 9px;
    flex: 0 0 9px;
    border-radius: 50%;
    background: #94a3b8;
}

.audit-event-success {
    background: #22c55e;
}

.audit-event-danger {
    background: #ef4444;
}

.audit-event-warning {
    background: #f59e0b;
}

.audit-event-role {
    background: #8b5cf6;
}

.audit-event strong {
    display: block;
    color: #0f172a;
    font-size: 13px;
    font-weight: 650;
}

.audit-event small {
    display: block;
    margin-top: 2px;
    color: #94a3b8;
    font-size: 10px;
}

.audit-identity {
    min-width: 180px;
}

.audit-identity strong {
    display: block;
    color: #334155;
    font-size: 12px;
    font-weight: 600;
}

.audit-identity small {
    display: block;
    margin-top: 3px;
    color: #94a3b8;
    font-size: 10px;
}

.audit-details-cell {
    min-width: 180px;
}

.audit-detail {
    display: flex;
    align-items: center;
    gap: 5px;
}

.audit-detail span {
    color: #64748b;
}

.audit-detail strong {
    color: #0f172a;
}

.audit-role-change {
    display: flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
}

.audit-role-change span {
    color: #64748b;
}

.audit-role-change strong {
    color: #7c3aed;
}

.audit-arrow {
    color: #cbd5e1 !important;
}

.audit-change-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.audit-change {
    display: inline-flex;
    gap: 4px;
    padding: 4px 7px;
    border-radius: 6px;
    background: #f1f5f9;
    font-size: 10px;
}

.audit-change strong {
    color: #334155;
}

.audit-change span {
    color: #64748b;
}

.audit-detail-positive {
    color: #15803d;
    font-weight: 600;
}

.audit-detail-negative {
    color: #dc2626;
    font-weight: 600;
}

.audit-detail-warning {
    color: #b45309;
    font-weight: 600;
}

.audit-ip {
    padding: 4px 7px;
    border-radius: 6px;
    background: #f1f5f9;
    color: #475569;
    font-size: 11px;
}

.audit-date {
    min-width: 120px;
}

.audit-date strong {
    display: block;
    color: #334155;
    font-size: 12px;
    font-weight: 600;
}

.audit-date span {
    display: block;
    margin-top: 3px;
    color: #94a3b8;
    font-size: 10px;
}

.audit-muted {
    color: #94a3b8;
}

.audit-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 16px 20px;
    border-top: 1px solid #e2e8f0;
}

.audit-pagination-info {
    color: #64748b;
    font-size: 12px;
}

.audit-pagination-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.audit-empty {
    padding: 60px 24px;
    text-align: center;
}

.audit-empty-icon {
    margin-bottom: 12px;
    color: #94a3b8;
    font-size: 30px;
}

.audit-empty h3 {
    margin: 0;
    color: #0f172a;
    font-size: 16px;
}

.audit-empty p {
    margin: 7px 0 18px;
    color: #64748b;
    font-size: 13px;
}

@media (max-width: 900px) {
    .audit-page-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .audit-filter-form {
        grid-template-columns: 1fr;
    }

    .audit-filter-buttons {
        justify-content: flex-start;
    }
}

.media-upload-form {
    display: flex;
    align-items: center;
    gap: 12px;
}

.media-upload-visibility {
    display: flex;
    align-items: center;
    gap: 8px;
}

.media-upload-visibility-label {
    font-size: 13px;
    font-weight: 600;
}

.media-upload-visibility-option {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    font-size: 13px;
}

.media-upload-visibility-option input {
    margin: 0;
}

.media-upload-modal[hidden] {
    display: none;
}

.media-upload-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.media-upload-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
}

.media-upload-modal-dialog {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 480px;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 20px 50px
        rgba(15, 23, 42, 0.20);
    overflow: hidden;
}

.media-upload-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 22px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.media-upload-modal-header h3 {
    margin: 0 0 5px;
    font-size: 20px;
}

.media-upload-modal-header p {
    margin: 0;
    font-size: 14px;
    color: #64748b;
}

.media-upload-modal-close {
    border: 0;
    background: transparent;
    font-size: 26px;
    cursor: pointer;
    color: #64748b;
}

.media-upload-modal-body {
    padding: 24px;
}

.media-upload-visibility-title {
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 600;
}

.media-upload-visibility-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px;
    margin-bottom: 10px;
    border: 1px solid #dbe1e8;
    border-radius: 10px;
    cursor: pointer;
}

.media-upload-visibility-card:hover {
    background: #f8fafc;
}

.media-upload-visibility-card input {
    margin-top: 4px;
}

.media-upload-visibility-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.media-upload-visibility-content strong {
    font-size: 14px;
}

.media-upload-visibility-content small {
    font-size: 13px;
    line-height: 1.4;
    color: #64748b;
}

.media-upload-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
}

.media-upload-modal-open {
    overflow: hidden;
}

.project-subnav {
    margin-bottom: 24px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
}

.project-subnav-header {
    padding: 14px 20px 10px;
}

.project-subnav-header .project-id {
    font-size: 12px;
    color: #64748b;
}

.project-subnav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 52px;
    padding: 0 14px 0 20px;
    border-top: 1px solid #f1f5f9;
}

.project-subnav-links {
    display: flex;
    align-items: stretch;
    gap: 28px;
    min-height: 52px;
}

.project-subnav-link {
    position: relative;
    display: flex;
    align-items: center;
    padding: 0 2px;
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    text-decoration: none;
    transition: color 0.15s ease;
}

.project-subnav-link:hover {
    color: #0f172a;
}

.project-subnav-link.active {
    color: #2563eb;
    font-weight: 600;
}

.project-subnav-link.active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2px;
    border-radius: 2px 2px 0 0;
    background: #2563eb;
}

.project-subnav-actions {
    display: flex;
    align-items: center;
    margin-left: 24px;
}

.project-subnav-actions form {
    margin: 0;
}

@media (max-width: 800px) {
    .project-subnav-bar {
        align-items: stretch;
        flex-direction: column;
        padding: 0;
    }

    .project-subnav-links {
        overflow-x: auto;
        padding: 0 16px;
        gap: 22px;
    }

    .project-subnav-link {
        white-space: nowrap;
    }

    .project-subnav-actions {
        margin: 0;
        padding: 12px 16px;
        border-top: 1px solid #f1f5f9;
    }

    .project-subnav-actions .button {
        width: 100%;
    }

    .project-subnav-actions form {
        width: 100%;
    }
}

.project-stats-compact {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 20px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
}

.project-stat {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 64px;
    padding: 12px 20px;
    border-right: 1px solid #e5e7eb;
}

.project-stat:last-child {
    padding-right: 0;
    border-right: 0;
}

.project-stat-label {
    font-size: 13px;
    color: #64748b;
}

.project-stat-value {
    font-size: 22px;
    line-height: 1;
    color: #0f172a;
}

@media (max-width: 800px) {
    .project-stats-compact {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .project-stat:nth-child(2) {
        border-right: 0;
    }

    .project-stat:nth-child(-n/**/+2) {
        border-bottom: 1px solid #e5e7eb;
    }
}

@media (max-width: 480px) {
    .project-stats-compact {
        grid-template-columns: 1fr;
    }

    .project-stat {
        border-right: 0;
        border-bottom: 1px solid #e5e7eb;
    }

    .project-stat:last-child {
        border-bottom: 0;
    }
}

.media-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid #e5e7eb;
}

.media-pagination-info {
    font-size: 13px;
    color: #64748b;
}

.media-pagination-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.media-pagination-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid #dbe1ea;
    border-radius: 7px;
    background: #ffffff;
    color: #334155;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: border-color 0.15s ease,
        background-color 0.15s ease;
}

.media-pagination-button:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.media-pagination-button.active {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
}

.media-pagination-button.disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

@media (max-width: 700px) {
    .media-pagination {
        flex-direction: column;
        align-items: flex-start;
    }

    .media-pagination-controls {
        flex-wrap: wrap;
    }
}
