/* ============================================================
   Monday design system — shared tokens + utilities
   Loaded globally from App.razor. Page-scoped CSS keeps only
   layout-specific rules; do not redeclare --md-* tokens there.
   ============================================================ */

:root {
    --md-blue: #0073ea;
    --md-blue-hover: #0060d1;
    --md-blue-soft: #cce4fa;
    --md-green: #00c875;
    --md-green-soft: #ccf2e1;
    --md-green-deep: #00854d;
    --md-orange: #fdab3d;
    --md-orange-soft: #ffe3bc;
    --md-orange-deep: #a25e0f;
    --md-red: #e44258;
    --md-red-hover: #c8384c;
    --md-red-soft: #fbd9de;
    --md-purple: #a25ddc;
    --md-purple-soft: #e9d7f7;
    --md-yellow: #fdcb00;
    --md-text: #323338;
    --md-text-soft: #676879;
    --md-text-muted: #9699a6;
    --md-bg: #f6f7fb;
    --md-surface: #ffffff;
    --md-surface-soft: #fafbfc;
    --md-border: #e6e9ef;
    --md-border-soft: #edeff5;
    --md-radius-sm: 8px;
    --md-radius-md: 10px;
    --md-radius-lg: 14px;
    --md-radius-pill: 999px;
    --md-shadow-sm: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 3px rgba(15, 23, 42, .04);
    --md-shadow-md: 0 4px 12px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .04);
    --md-shadow-lg: 0 14px 36px rgba(15, 23, 42, .12);
    --md-ease: cubic-bezier(.4, 0, .2, 1);
}

/* ------------------------------------------------------------
   Page chrome
   ------------------------------------------------------------ */
.page-eyebrow {
    display: inline-block;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--md-blue);
    margin-bottom: .25rem;
}

.company-details-page .page-eyebrow {
    margin-bottom: .35rem;
}

.page-title {
    font-size: 1.875rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--md-text);
}

.department-list-page .page-title {
    letter-spacing: -0.01em;
}

.page-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 .65rem;
    border-radius: 999px;
    background: var(--md-blue-soft);
    color: var(--md-blue);
    font-size: .875rem;
    font-weight: 700;
}

.min-w-0 {
    min-width: 0;
}

/* ------------------------------------------------------------
   Surfaces
   ------------------------------------------------------------ */
.monday-surface {
    background: var(--md-surface);
    position: relative;
    overflow: hidden;
}

.monday-surface::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle at 1px 1px, rgba(50, 51, 56, .035) 1px, transparent 0);
    background-size: 18px 18px;
    pointer-events: none;
    z-index: 0;
}

.monday-surface > * {
    position: relative;
    z-index: 1;
}

.teams-list-page .monday-surface,
.department-teams-page .monday-surface,
.department-team-details-page .monday-surface {
    border: 1px solid var(--md-border);
    border-radius: 1rem;
}

.teams-list-page .monday-surface::after,
.department-teams-page .monday-surface::after,
.department-team-details-page .monday-surface::after {
    opacity: .75;
}

.department-list-page .monday-surface,
.department-details-page .monday-surface {
    border-radius: 14px !important;
    background-color: var(--md-surface);
}

.department-list-page .monday-surface::after,
.department-details-page .monday-surface::after {
    opacity: .85;
}

/* ------------------------------------------------------------
   Color tiles
   ------------------------------------------------------------ */
.tile-blue { background: var(--md-blue-soft); color: var(--md-blue); }
.tile-green { background: var(--md-green-soft); color: var(--md-green-deep); }
.tile-purple { background: var(--md-purple-soft); color: var(--md-purple); }
.tile-orange { background: var(--md-orange-soft); color: var(--md-orange-deep); }
.tile-danger { background: #fde8e8; color: #c62828; }

.department-list-page .tile-green,
.department-details-page .tile-green,
.company-details-page .tile-green,
.company-create-page .tile-green {
    color: var(--md-green);
}

/* ------------------------------------------------------------
   Buttons — solid primary (dept / company); teams use gradient
   ------------------------------------------------------------ */
.btn-monday-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    background-color: var(--md-blue);
    border: 1px solid var(--md-blue);
    color: #fff;
    font-weight: 600;
    border-radius: 8px;
    padding: .55rem 1.15rem;
    font-size: .9rem;
    box-shadow: 0 1px 2px rgba(0, 115, 234, .2);
    transition: background-color .15s var(--md-ease), box-shadow .15s var(--md-ease), transform .15s ease;
}

.btn-monday-primary:hover:not(:disabled) {
    background-color: var(--md-blue-hover);
    border-color: var(--md-blue-hover);
    color: #fff;
    box-shadow: 0 6px 16px rgba(0, 115, 234, .28);
}

.btn-monday-primary:disabled {
    opacity: .65;
    cursor: not-allowed;
    background-color: var(--md-blue);
    border-color: var(--md-blue);
    color: #fff;
}

.teams-list-page .btn-monday-primary,
.department-teams-page .btn-monday-primary,
.department-team-details-page .btn-monday-primary {
    gap: .5rem;
    background: linear-gradient(135deg, #0073ea 0%, #0060d1 100%);
    border: none;
    padding: .65rem 1.15rem;
    border-radius: .75rem;
    box-shadow: 0 8px 20px rgba(0, 115, 234, .22);
    font-size: inherit;
    justify-content: initial;
}

.teams-list-page .btn-monday-primary:hover:not(:disabled),
.department-teams-page .btn-monday-primary:hover:not(:disabled),
.department-team-details-page .btn-monday-primary:hover:not(:disabled) {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(0, 115, 234, .28);
    background: linear-gradient(135deg, #0073ea 0%, #0060d1 100%);
    border: none;
}

.btn-monday-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    background-color: var(--md-surface);
    color: var(--md-text);
    border: 1px solid var(--md-border);
    border-radius: 8px;
    padding: .45rem .9rem;
    font-weight: 600;
    text-decoration: none;
}

.teams-list-page .btn-monday-ghost,
.department-teams-page .btn-monday-ghost,
.department-team-details-page .btn-monday-ghost,
.teams-list-page .back-link,
.department-teams-page .back-link,
.department-team-details-page .back-link {
    color: var(--md-blue);
    text-decoration: none;
    font-weight: 600;
    background: transparent;
    border: none;
    padding: 0;
    justify-content: initial;
}

.teams-list-page .back-link:hover,
.department-teams-page .back-link:hover,
.department-team-details-page .back-link:hover {
    color: var(--md-blue-hover);
}

/* ------------------------------------------------------------
   Chips
   ------------------------------------------------------------ */
.md-chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .25rem .65rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 600;
}

.chip-muted {
    background: #f0f3f8;
    color: #676879;
}

.chip-blue { background: var(--md-blue-soft); color: var(--md-blue); }
.chip-green { background: var(--md-green-soft); color: var(--md-green-deep); }
.chip-purple { background: var(--md-purple-soft); color: var(--md-purple); }
.chip-orange { background: var(--md-orange-soft); color: var(--md-orange-deep); }
.chip-red { background: var(--md-red-soft); color: var(--md-red); }

/* ------------------------------------------------------------
   Teams listing / cards (TeamsList + DepartmentTeams)
   ------------------------------------------------------------ */
.teams-list-page,
.department-teams-page {
    min-height: 100vh;
    color: var(--md-text);
}

.teams-hero {
    padding: 1.35rem 1.5rem 0;
    background-image: linear-gradient(135deg, #f6faff 0%, #fff 55%);
    box-shadow: 0 10px 28px rgba(50, 51, 56, .05);
}

.teams-hero-body {
    padding-bottom: 1.25rem;
}

.teams-hero-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.45rem;
}

.teams-hero-copy {
    max-width: 38rem;
    line-height: 1.5;
}

.teams-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .75rem;
    margin: 0 -1.5rem;
    padding: 1rem 1.5rem 1.15rem;
    border-top: 1px solid rgba(230, 233, 239, .9);
    background: rgba(255, 255, 255, .55);
}

.teams-stat {
    display: flex;
    align-items: center;
    gap: .75rem;
    min-width: 0;
}

.teams-stat-icon {
    width: 2.35rem;
    height: 2.35rem;
    border-radius: .7rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.teams-stat-value {
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.2;
    color: var(--md-text);
}

.teams-stat-label {
    font-size: .75rem;
    color: var(--md-text-muted);
    line-height: 1.3;
}

.teams-toolbar {
    max-width: 420px;
}

.teams-search .input-group-text {
    background: #fff;
    border-color: var(--md-border);
    color: var(--md-text-muted);
}

.teams-search .form-control {
    border-color: var(--md-border);
    box-shadow: none;
}

.teams-search .form-control:focus {
    border-color: var(--md-blue-soft);
    box-shadow: 0 0 0 .2rem rgba(0, 115, 234, .12);
}

.app-search-input input[type="search"]::-webkit-search-decoration,
.app-search-input input[type="search"]::-webkit-search-cancel-button,
.app-search-input input[type="search"]::-webkit-search-results-button,
.app-search-input input[type="search"]::-webkit-search-results-decoration {
    -webkit-appearance: none;
    appearance: none;
}

.empty-visual {
    position: relative;
    width: 88px;
    height: 88px;
}

.empty-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px dashed rgba(0, 115, 234, .25);
    animation: emptySpin 18s linear infinite;
}

.empty-icon,
.team-icon {
    width: 3rem;
    height: 3rem;
    border-radius: .9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.empty-visual .empty-icon {
    position: absolute;
    inset: 50%;
    transform: translate(-50%, -50%);
    width: 3.4rem;
    height: 3.4rem;
    background: var(--md-green-soft);
    color: var(--md-green-deep);
}

.empty-copy {
    max-width: 26rem;
}

.empty-card {
    max-width: 520px;
}

.empty-icon-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background-color: #f1f2f6;
}

.empty-icon-circle i {
    font-size: 1.5rem;
    color: #9699a6;
}

.team-card {
    transition: transform .2s ease, box-shadow .2s ease;
    cursor: pointer;
}

.team-card:hover,
.team-card:focus-visible {
    transform: translateY(-4px);
    box-shadow: 0 16px 34px rgba(50, 51, 56, .1) !important;
    outline: none;
}

.team-card-accent {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    z-index: 2;
}

.accent-blue .team-card-accent { background: linear-gradient(90deg, #0073ea, #5f88ff); }
.accent-green .team-card-accent { background: linear-gradient(90deg, #00c875, #66e0a8); }
.accent-purple .team-card-accent { background: linear-gradient(90deg, #a25ddc, #c99aef); }
.accent-orange .team-card-accent { background: linear-gradient(90deg, #fdab3d, #ffc878); }

.team-name {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.team-description {
    line-height: 1.45;
    min-height: 3.2em;
}

.team-link-label {
    color: var(--md-blue);
    font-size: .85rem;
    font-weight: 600;
    white-space: nowrap;
    transition: gap .15s ease;
}

.team-card:hover .team-link-label i {
    transform: translateX(2px);
}

.team-link-label i {
    display: inline-block;
    transition: transform .15s ease;
}

.avatar-stack {
    display: flex;
    align-items: center;
}

.avatar-stack-item {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .7rem;
    color: #fff;
    margin-left: -8px;
    box-shadow: 0 2px 6px rgba(50, 51, 56, .12);
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}

.avatar-stack-item:first-child {
    margin-left: 0;
}

.avatar-stack-item.tone-a { background: linear-gradient(135deg, #5f88ff, #0073ea); }
.avatar-stack-item.tone-b { background: linear-gradient(135deg, #66e0a8, #00c875); }
.avatar-stack-item.tone-c { background: linear-gradient(135deg, #c99aef, #a25ddc); }
.avatar-stack-item.tone-d { background: linear-gradient(135deg, #ffc878, #fdab3d); }

.avatar-stack-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    border-radius: 50%;
}

.avatar-stack-initials {
    width: 100%;
    height: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: .02em;
    line-height: 1;
    color: #fff;
}

.avatar-stack-more {
    margin-left: .35rem;
    font-size: .72rem;
    font-weight: 700;
    color: #676879;
    background: #f0f3f8;
    border-radius: 999px;
    padding: .15rem .45rem;
}

.modal-picker-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.loading-dots span {
    width: .55rem;
    height: .55rem;
    border-radius: 50%;
    background: var(--md-blue);
    animation: teamPulse 1.2s infinite ease-in-out;
}

.loading-dots span:nth-child(2) { animation-delay: .15s; }
.loading-dots span:nth-child(3) { animation-delay: .3s; }

@keyframes teamPulse {
    0%, 80%, 100% { opacity: .25; transform: scale(.85); }
    40% { opacity: 1; transform: scale(1); }
}

@keyframes emptySpin {
    to { transform: rotate(360deg); }
}

/* Task details: Comments / Attachments / Activity feed */
.px-details-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-bottom: .85rem;
    padding: .3rem;
    border-radius: .75rem;
    background: #f4f6fa;
}

.px-details-tabs .nav-item {
    margin: 0;
}

.px-details-tabs .nav-link,
.px-details-tabs button {
    border: 0;
    border-radius: .55rem;
    padding: .4rem .85rem;
    font-size: .82rem;
    font-weight: 600;
    color: #676879;
    background: transparent;
}

.px-details-tabs .nav-link.active,
.px-details-tabs button.active {
    color: #fff;
    background: #0073ea;
    box-shadow: 0 1px 2px rgba(0, 115, 234, .25);
}

.px-feed-panel {
    border: 1px solid #e6e9ef;
    border-radius: .85rem;
    background: #fff;
}

.px-feed-panel .card-body {
    padding: 1rem 1.1rem;
}

.px-feed-wrap {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    max-height: 360px;
    overflow-y: auto;
    padding-right: .15rem;
}

.px-feed-item {
    display: flex;
    gap: .75rem;
    align-items: flex-start;
    padding: .8rem .85rem;
    border: 1px solid #edeff5;
    border-radius: .75rem;
    background: #fafbfc;
}

.px-feed-item:hover {
    border-color: #dde3ee;
    background: #f6f8fc;
}

.px-feed-avatar {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 50%;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #5f88ff;
    color: #fff;
    flex-shrink: 0;
}

.px-feed-icon {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: .65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eef3fb;
    color: #0073ea;
    flex-shrink: 0;
    font-size: .95rem;
}

.px-feed-body {
    min-width: 0;
    flex: 1 1 auto;
}

.px-feed-meta {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: .5rem;
    margin-bottom: .2rem;
}

.px-feed-author {
    font-size: .86rem;
    font-weight: 650;
    color: #323338;
    margin: 0;
    line-height: 1.25;
}

.px-feed-time {
    font-size: .74rem;
    color: #9699a6;
    white-space: nowrap;
    flex-shrink: 0;
}

.px-feed-text {
    font-size: .9rem;
    color: #323338;
    line-height: 1.45;
    word-break: break-word;
    margin: 0;
}

.px-feed-text a {
    color: #0073ea;
}

.px-feed-sub {
    font-size: .78rem;
    color: #676879;
    margin: 0;
}

.px-feed-actions {
    display: flex;
    align-items: center;
    gap: .35rem;
    flex-shrink: 0;
    margin-left: .25rem;
}

.px-feed-actions .btn {
    width: 30px;
    height: 30px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: .5rem;
}

.px-activity-line {
    font-size: .88rem;
    color: #323338;
    line-height: 1.4;
    margin: 0;
}

.px-activity-line .actor {
    font-weight: 650;
}

.px-activity-line .action {
    color: #505258;
}

.px-create-attachment-box {
    padding: .85rem;
    border: 1px dashed #cfd6e4;
    border-radius: .75rem;
    background: #f8fafc;
    margin-bottom: .9rem;
}

@media (max-width: 991.98px) {
    .teams-stats {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 575.98px) {
    .page-title {
        font-size: 1.5rem;
    }

    .teams-hero {
        padding: 1.1rem 1.1rem 0;
    }

    .teams-stats {
        margin: 0 -1.1rem;
        padding: .9rem 1.1rem 1rem;
    }
}
