/* Tasclass v0.1.0 - base styles */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body.tc-body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f4f5fb;
    color: #222;
    direction: rtl;
}

.tc-header {
    background: #1f2937;
    color: #fff;
    padding: 0.75rem 1rem;
}

.tc-header-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.tc-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
}

.tc-logo-icon {
    font-size: 1.4rem;
}

.tc-logo-text {
    font-size: 1.1rem;
}

.tc-header-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
}

.tc-version {
    opacity: 0.8;
}

.tc-nav {
    margin-top: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.tc-nav-link {
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    color: #e5e7eb;
    text-decoration: none;
    font-size: 0.85rem;
}

.tc-nav-link.is-active,
.tc-nav-link:hover {
    background: #111827;
    color: #fff;
}

.tc-main {
    padding: 1rem;
    max-width: 1024px;
    margin: 0 auto;
}

.tc-panel {
    background: #fff;
    border-radius: 0.75rem;
    padding: 1.25rem 1.25rem 1.5rem;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.tc-panel-title {
    margin: 0 0 0.35rem;
    font-size: 1.3rem;
}

.tc-panel-subtitle {
    margin: 0 0 1rem;
    font-size: 0.95rem;
    color: #4b5563;
}

.tc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin-top: 0.75rem;
}

.tc-card {
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
    padding: 1rem;
    background: #f9fafb;
    transition: box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}

.tc-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.tc-card:hover {
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
    border-color: #d1d5db;
}

.tc-card-title {
    margin: 0 0 0.35rem;
    font-size: 1rem;
}

.tc-card-text {
    margin: 0;
    font-size: 0.9rem;
    color: #4b5563;
}

.tc-auth {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 140px);
}

.tc-auth-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 1rem;
    padding: 1.5rem 1.25rem 1.75rem;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
}

.tc-auth-title {
    margin: 0 0 0.35rem;
    font-size: 1.4rem;
}

.tc-auth-subtitle {
    margin: 0 0 1rem;
    font-size: 0.9rem;
    color: #6b7280;
}

.tc-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.tc-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.9rem;
}

.tc-field-label {
    color: #374151;
}

.tc-input {
    border-radius: 0.55rem;
    border: 1px solid #d1d5db;
    padding: 0.55rem 0.6rem;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tc-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.4);
}

.tc-password-wrapper {
    display: flex;
    align-items: center;
    border-radius: 0.55rem;
    border: 1px solid #d1d5db;
    background: #fff;
}

.tc-input-password {
    border: none;
    flex: 1;
    box-shadow: none;
}

.tc-input-password:focus {
    outline: none;
}

.tc-password-toggle {
    border: none;
    background: transparent;
    padding: 0 0.5rem;
    cursor: pointer;
    font-size: 1rem;
}

.tc-auth-actions {
    margin-top: 0.75rem;
}

.tc-btn {
    border-radius: 999px;
    border: none;
    padding: 0.55rem 1.1rem;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.tc-btn-block {
    width: 100%;
}

.tc-btn-primary {
    background: #2563eb;
    color: #fff;
}

.tc-btn-primary:hover {
    background: #1d4ed8;
}

.tc-btn-secondary {
    background: #f97316;
    color: #fff;
}

.tc-btn-secondary:hover {
    background: #ea580c;
}

.tc-btn-ghost {
    background: transparent;
    color: #e5e7eb;
    border: 1px solid rgba(249, 250, 251, 0.3);
}

.tc-btn-ghost:hover {
    background: rgba(17, 24, 39, 0.4);
}

.tc-alert {
    border-radius: 0.5rem;
    padding: 0.6rem 0.75rem;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.tc-alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

.tc-alert-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
}

.tc-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

.tc-modal {
    background: #fff;
    border-radius: 0.9rem;
    padding: 1rem 1.1rem 1.2rem;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.5);
}

.tc-modal-wide {
    max-width: 760px;
}

.tc-modal-title {
    margin: 0 0 0.6rem;
    font-size: 1.1rem;
}

.tc-modal-text {
    margin: 0 0 0.75rem;
    font-size: 0.9rem;
    color: #4b5563;
    white-space: pre-wrap;
}

.tc-modal-actions {
    margin-top: 0.9rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.tc-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.5rem;
    margin-bottom: 0.75rem;
}

.tc-tab-link {
    border-radius: 999px;
    padding: 0.35rem 0.8rem;
    font-size: 0.85rem;
    text-decoration: none;
    border: 1px solid #e5e7eb;
    color: #374151;
    background: #f9fafb;
}

.tc-tab-link.is-active {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

.tc-settings-content {
    margin-top: 0.5rem;
}

.tc-user-modal-grid {
    display: grid;
    grid-template-columns: minmax(0, 180px) minmax(0, 1fr);
    gap: 1rem;
    margin-top: 0.5rem;
}

.tc-user-modal-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.tc-user-modal-right {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.tc-field-row {
    display: flex;
    gap: 0.75rem;
}

.tc-field-row .tc-field {
    flex: 1;
}

.tc-field-row-name-phone .tc-field:first-child {
    flex: 0.6;
}

.tc-field-row-name-phone .tc-field:last-child {
    flex: 0.4;
    min-width: 120px;
}

/* Limit width of file inputs inside modals so they do not span entire card */
.tc-field input[type="file"] {
    max-width: 260px;
}

.tc-form-horizontal {
    margin-top: 0.5rem;
}

.tc-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem 1rem;
}

.tc-users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 0.9rem;
    margin-top: 0.75rem;
}

.tc-user-card {
    border-radius: 0.85rem;
    border: 1px solid #e5e7eb;
    padding: 0.8rem 0.75rem;
    background: #f9fafb;
    display: flex;
    align-items: center;
}

.tc-user-main {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.tc-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    background: linear-gradient(135deg, #60a5fa, #fb7185);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.tc-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tc-avatar-initials {
    padding: 0.15rem;
}

.tc-avatar-large {
    width: 80px;
    height: 80px;
    font-size: 1.2rem;
}

.tc-user-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.tc-user-name {
    margin: 0;
    font-size: 0.95rem;
}

.tc-user-meta {
    margin: 0;
    font-size: 0.8rem;
    color: #6b7280;
}

.tc-user-roles {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem;
    margin-top: 0.25rem;
}

.tc-chip {
    border-radius: 999px;
    padding: 0.1rem 0.5rem;
    font-size: 0.75rem;
    border: 1px solid #e5e7eb;
}

.tc-chip-role {
    background: #eef2ff;
    border-color: #c7d2fe;
    color: #4338ca;
}

.tc-table-wrapper {
    overflow-x: auto;
}

.tc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.tc-table th,
.tc-table td {
    padding: 0.5rem 0.5rem;
    border-bottom: 1px solid #e5e7eb;
    text-align: right;
}

.tc-table th {
    background: #f9fafb;
    font-weight: 600;
}

.tc-table tr:hover {
    background: #f3f4f6;
}

.tc-teacher-tag {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.1rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: #111827;
}

.tc-teacher-tag.c1 { background: #fee2e2; }
.tc-teacher-tag.c2 { background: #ffedd5; }
.tc-teacher-tag.c3 { background: #fef9c3; }
.tc-teacher-tag.c4 { background: #dcfce7; }
.tc-teacher-tag.c5 { background: #dbeafe; }
.tc-teacher-tag.c6 { background: #f3e8ff; }

.tc-icon-btn {
    border-radius: 999px;
    border: none;
    padding: 0.2rem 0.45rem;
    font-size: 0.85rem;
    cursor: pointer;
    margin-inline-start: 0.15rem;
}

.tc-icon-btn-edit {
    background: #dbeafe;
    color: #1d4ed8;
}

.tc-icon-btn-duplicate {
    background: #ede9fe;
    color: #5b21b6;
}

.tc-icon-btn-delete {
    background: #fee2e2;
    color: #b91c1c;
}

.tc-icon-btn-save {
    background: #22c55e;
    color: #fff;
}

/* Inline edit like folder rename – full text visible, minimal styling */
.tc-task-title-cell .tc-task-edit-form {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    width: 100%;
}

.tc-task-title-cell .tc-inline-edit {
    flex: 1;
    min-width: 0;
    border: 1px solid #93c5fd;
    border-radius: 0.25rem;
    padding: 0.2rem 0.4rem;
    font-size: inherit;
    font-family: inherit;
}

.tc-task-title-cell .tc-inline-edit:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.3);
}

.tc-scroll-highlight {
    animation: tc-scroll-flash 1.5s ease-out;
}

@keyframes tc-scroll-flash {
    0% { background-color: #fef08a; }
    50% { background-color: #fef08a; }
    100% { background-color: transparent; }
}

/* =============================================
   Couch Mode v2 – mobile-first coordinator dashboard
   ============================================= */

.cm {
    max-width: 680px;
    margin: 0 auto;
    padding-bottom: 2rem;
}

/* Header */
.cm-header {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: 1rem;
    padding: 1.25rem 1.25rem 1rem;
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
}

.cm-header::before {
    content: "";
    position: absolute;
    top: -40%;
    left: -20%;
    width: 70%;
    height: 180%;
    background: radial-gradient(ellipse, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.cm-header-inner {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cm-title {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
    color: #f1f5f9;
    letter-spacing: -0.01em;
}

.cm-subtitle {
    margin: 0.2rem 0 0;
    font-size: 0.85rem;
    color: #94a3b8;
}

/* =============================================
   Shared inline refresh button (reusable)
   ============================================= */

.tc-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.tc-title-row h1,
.tc-title-row h2 {
    margin: 0;
}

.tc-refresh-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1.5px solid #d1d5db;
    background: #f9fafb;
    color: #6b7280;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.tc-refresh-btn:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
    color: #374151;
}

.tc-refresh-btn:active {
    transform: scale(0.9);
}

.tc-refresh-btn .tc-refresh-icon {
    transition: transform 0.5s ease;
}

@keyframes tc-spin {
    to { transform: rotate(360deg); }
}

.tc-refresh-btn.is-refreshing .tc-refresh-icon {
    animation: tc-spin 0.7s linear infinite;
}

.tc-refresh-btn.is-refreshing {
    pointer-events: none;
    opacity: 0.6;
}

/* Couch Mode specific refresh (dark bg variant) */
.cm-refresh-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid rgba(148, 163, 184, 0.3);
    background: rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.cm-refresh-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(148, 163, 184, 0.5);
    color: #f1f5f9;
}

.cm-refresh-btn:active {
    transform: scale(0.9);
}

.cm-refresh-icon {
    transition: transform 0.5s ease;
}

@keyframes cm-spin {
    to { transform: rotate(360deg); }
}

.cm-refresh-btn.is-refreshing .cm-refresh-icon {
    animation: cm-spin 0.7s linear infinite;
}

.cm-refresh-btn.is-refreshing {
    pointer-events: none;
    opacity: 0.7;
}

/* Stats bar */
.cm-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-bottom: 0.85rem;
}

.cm-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    padding: 0.7rem 0.35rem;
    border-radius: 0.85rem;
    border: 2px solid transparent;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.cm-stat:active {
    transform: scale(0.96);
}

.cm-stat.is-active {
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.1);
    transform: translateY(-1px);
}

.cm-stat-red             { border-color: #fecaca; }
.cm-stat-red .cm-stat-num   { color: #dc2626; }
.cm-stat-red.is-active   { border-color: #dc2626; background: #fef2f2; }

.cm-stat-orange          { border-color: #fed7aa; }
.cm-stat-orange .cm-stat-num { color: #ea580c; }
.cm-stat-orange.is-active { border-color: #ea580c; background: #fff7ed; }

.cm-stat-blue            { border-color: #bfdbfe; }
.cm-stat-blue .cm-stat-num  { color: #2563eb; }
.cm-stat-blue.is-active  { border-color: #2563eb; background: #eff6ff; }

.cm-stat-gray            { border-color: #e5e7eb; }
.cm-stat-gray .cm-stat-num  { color: #6b7280; }
.cm-stat-gray.is-active  { border-color: #6b7280; background: #f3f4f6; }

.cm-stat-zero {
    opacity: 0.45;
    pointer-events: none;
}

.cm-stat-num {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1;
}

.cm-stat-label {
    font-size: 0.7rem;
    font-weight: 500;
    color: #64748b;
    text-align: center;
    line-height: 1.2;
}

/* Active filter bar */
.cm-active-filter {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.45rem 0.75rem;
    margin-bottom: 0.75rem;
    border-radius: 0.6rem;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    font-size: 0.8rem;
    color: #4338ca;
}

.cm-active-filter-clear {
    background: none;
    border: none;
    color: #4338ca;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.1rem 0.3rem;
    border-radius: 0.3rem;
}

.cm-active-filter-clear:hover {
    background: #c7d2fe;
}

/* Event groups */
.cm-groups {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.cm-group {
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.cm-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    background: linear-gradient(to left, #f8fafc, #f1f5f9);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s;
}

.cm-group-header:hover {
    background: linear-gradient(to left, #f1f5f9, #e2e8f0);
}

.cm-group-info {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 0.6rem;
}

.cm-group-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: #0f172a;
}

.cm-group-count {
    font-size: 0.75rem;
    color: #64748b;
    background: #e2e8f0;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
}

.cm-group-date {
    font-size: 0.75rem;
    color: #94a3b8;
}

.cm-group-chevron {
    font-size: 0.7rem;
    color: #64748b;
    transition: transform 0.3s ease;
}

.cm-group.is-collapsed .cm-group-chevron {
    transform: rotate(-90deg);
}

/* Group body */
.cm-group-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.6rem 0.7rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, padding 0.25s ease;
}

.cm-group-body.is-open {
    max-height: 5000px;
    padding: 0.6rem 0.7rem 0.75rem;
}

/* Task cards */
.cm-card {
    border-radius: 0.85rem;
    border: 1px solid #e2e8f0;
    background: #fff;
    padding: 0.85rem 0.9rem;
    position: relative;
    transition: opacity 0.3s, transform 0.3s, box-shadow 0.2s;
    border-right: 4px solid #e2e8f0;
}

.cm-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    transition: box-shadow 0.25s;
}

.cm-card:hover::before {
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.07);
}

.cm-card-critical {
    border-right-color: #dc2626;
    background: linear-gradient(to left, #fff, #fef2f2);
}

.cm-card-warning {
    border-right-color: #f97316;
    background: linear-gradient(to left, #fff, #fff7ed);
}

.cm-card-alert {
    border-right-color: #eab308;
    background: linear-gradient(to left, #fff, #fefce8);
}

.cm-card-info {
    border-right-color: #3b82f6;
    background: linear-gradient(to left, #fff, #eff6ff);
}

.cm-card-muted {
    opacity: 0.55;
    transform: scale(0.98);
}

.cm-card-muted:hover {
    opacity: 0.85;
}

.cm-card.cm-card-hidden {
    display: none;
}

/* Card content */
.cm-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.cm-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}

.cm-card-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.3;
}

.cm-priority {
    flex-shrink: 0;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
}

.cm-priority-high {
    background: #dc2626;
    color: #fff;
}

/* Teacher row */
.cm-card-teacher {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.cm-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, #818cf8, #c084fc);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
    overflow: hidden;
}

.cm-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cm-teacher-name {
    font-size: 0.85rem;
    color: #475569;
    font-weight: 500;
}

/* Tags */
.cm-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.1rem;
}

.cm-tag {
    border-radius: 999px;
    padding: 0.12rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 500;
    line-height: 1.5;
    white-space: nowrap;
}

.cm-tag-overdue {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.cm-tag-due-today {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.cm-tag-not-confirmed {
    background: #fefce8;
    color: #a16207;
    border: 1px solid #fde68a;
}

.cm-tag-new {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.cm-tag-status-pending {
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #e5e7eb;
}

.cm-tag-status-progress {
    background: #eef2ff;
    color: #4338ca;
    border: 1px solid #c7d2fe;
}

.cm-tag-pinged {
    background: #f8fafc;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

/* Card actions */
.cm-card-actions {
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.cm-ping-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    border: none;
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.cm-ping-btn:hover {
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
    transform: translateY(-1px);
}

.cm-ping-btn:active {
    transform: scale(0.96);
}

.cm-ping-btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.cm-ping-svg {
    flex-shrink: 0;
}

.cm-ping-done {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    color: #16a34a;
    font-weight: 500;
}

.cm-ping-icon {
    font-size: 0.9rem;
}

/* Sending animation */
@keyframes cm-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.cm-ping-btn.is-sending {
    animation: cm-pulse 1s ease-in-out infinite;
    pointer-events: none;
}

/* Empty state */
.cm-empty {
    text-align: center;
    padding: 3rem 1rem;
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}

.cm-empty-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.cm-empty-title {
    margin: 0 0 0.3rem;
    font-size: 1.25rem;
    color: #0f172a;
}

.cm-empty-text {
    margin: 0;
    font-size: 0.9rem;
    color: #64748b;
}

/* Old tags kept for backward compat elsewhere */
.tc-tag {
    border-radius: 999px;
    background: #e5e7eb;
    color: #374151;
    padding: 0.15rem 0.5rem;
    font-size: 0.75rem;
}

.tc-tag-warning {
    background: #fef3c7;
    color: #92400e;
}

/* ========================
   Couch Mode – responsive
   ======================== */

@media (max-width: 480px) {
    .cm {
        padding-bottom: 1.5rem;
    }

    .cm-header {
        border-radius: 0;
        margin: -1rem -1rem 0.75rem;
        padding: 1rem;
    }

    .cm-title {
        font-size: 1.2rem;
    }

    .cm-stats {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.35rem;
    }

    .cm-stat {
        padding: 0.55rem 0.2rem;
        border-radius: 0.7rem;
    }

    .cm-stat-num {
        font-size: 1.25rem;
    }

    .cm-stat-label {
        font-size: 0.6rem;
    }

    .cm-group {
        border-radius: 0.75rem;
    }

    .cm-group-header {
        padding: 0.65rem 0.75rem;
    }

    .cm-card {
        padding: 0.7rem 0.75rem;
        border-radius: 0.7rem;
    }

    .cm-card-actions {
        justify-content: stretch;
    }

    .cm-ping-btn {
        width: 100%;
        justify-content: center;
        padding: 0.55rem;
    }

    .cm-ping-done {
        width: 100%;
        justify-content: center;
    }
}

.tc-empty-state {
    text-align: center;
    padding: 1.5rem 0.5rem;
}

.tc-empty-state h2 {
    margin: 0 0 0.25rem;
}

.tc-empty-state p {
    margin: 0;
    color: #6b7280;
}

.tc-logout-form {
    margin: 0;
}

/* Event details */
.tc-event-header {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    gap: 1rem;
    align-items: stretch;
    margin-bottom: 1rem;
}

.tc-event-main {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.tc-event-title {
    margin: 0;
    font-size: 1.2rem;
}

.tc-event-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.2rem;
}

.tc-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    border-radius: 999px;
    padding: 0.15rem 0.6rem;
    font-size: 0.8rem;
    background: #eff6ff;
    color: #1d4ed8;
}

.tc-pill-muted {
    background: #f3f4f6;
    color: #4b5563;
}

.tc-event-description {
    margin: 0.35rem 0 0;
    font-size: 0.9rem;
    color: #374151;
}

.tc-event-hero {
    border-radius: 0.9rem;
    background: radial-gradient(circle at top left, #fbbf24, #f97316, #f97316);
    position: relative;
    overflow: hidden;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tc-event-hero-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    color: #111827;
}

.tc-event-hero-icon {
    font-size: 2.1rem;
}

.tc-event-hero-label {
    font-size: 0.9rem;
    font-weight: 600;
}

.tc-event-hero::before {
    content: "";
    position: absolute;
    inset: 12% 10%;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

/* Hero customization picker */
.tc-hero-picker {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.tc-hero-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.tc-hero-icon-opt {
    cursor: pointer;
    margin: 0;
}

.tc-hero-icon-opt input {
    display: none;
}

.tc-hero-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    font-size: 1.25rem;
    border-radius: 0.5rem;
    border: 2px solid #e5e7eb;
    background: #f9fafb;
    transition: border-color 0.15s, background 0.15s;
}

.tc-hero-icon-opt input:checked + .tc-hero-icon-btn {
    border-color: #2563eb;
    background: #eff6ff;
}

.tc-hero-icon-opt:hover .tc-hero-icon-btn {
    border-color: #93c5fd;
}

.tc-hero-color-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tc-hero-color-input {
    width: 2.5rem;
    height: 2rem;
    padding: 0.15rem;
    border-radius: 0.35rem;
    border: 1px solid #d1d5db;
    cursor: pointer;
}

/* Event tasks grid */
.tc-event-tasks-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.tc-event-task-card {
    flex: 1 1 280px;
    min-width: 0;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 0.85rem;
    background: #f9fafb;
}

.tc-event-task-cat {
    font-weight: 600;
    font-size: 0.9rem;
    color: #374151;
    margin-bottom: 0.5rem;
}

.tc-event-task-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.tc-event-task-item:last-child {
    border-bottom: none;
}

.tc-event-task-title {
    font-weight: 500;
    margin-bottom: 0.2rem;
}

.tc-event-task-period {
    font-size: 0.8rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
}

.tc-event-task-teachers {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 0.2rem;
}

.tc-event-task-status {
    font-size: 0.75rem;
    color: #9ca3af;
}

/* Event dates: larger font, no time, dd/mm/yyyy */
.tc-event-date-pill {
    font-size: 1.05rem;
}

.tc-event-dates .tc-pill {
    padding: 0.35rem 0.75rem;
}

/* Event tasks table toolbar */
.tc-event-tasks-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    align-items: center;
}

.tc-event-tasks-table-wrap .tc-table-wrapper {
    overflow-x: auto;
}

.tc-event-pool-card {
    margin-bottom: 0.75rem;
    padding: 0.55rem 0.75rem;
    border-radius: 0.75rem;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    cursor: pointer;
    transition: box-shadow 0.16s ease, transform 0.16s ease;
}

.tc-event-pool-card:hover {
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
    transform: translateY(-1px);
}

.tc-event-pool-summary {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: #1f2937;
}

.tc-event-pool-title {
    font-weight: 600;
}

.tc-event-pool-counts {
    color: #374151;
}

.tc-event-pool-panel {
    display: none;
    margin-top: 0.4rem;
}

.tc-event-pool-card.is-open .tc-event-pool-panel {
    display: block;
}

.tc-event-pool-panel .tc-table-wrapper {
    max-height: 340px;
    overflow-y: auto;
}

.tc-event-pool-assign-row[data-assigned="1"] {
    opacity: 0.45;
}

.tc-pool-filter-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    margin-right: 0.25rem;
    color: #111827;
}

.tc-pool-filter-btn:hover {
    color: #1d4ed8;
}

.tc-event-pool-status-menu {
    position: absolute;
    z-index: 60;
    background: #fff;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    box-shadow: 0 8px 20px rgba(15,23,42,0.15);
    padding: 0.25rem 0;
    min-width: 170px;
}

.tc-event-pool-status-menu button {
    display: block;
    width: 100%;
    text-align: right;
    padding: 0.3rem 0.75rem;
    border: none;
    background: transparent;
    font-size: 0.85rem;
    cursor: pointer;
}

.tc-event-pool-status-menu button:hover {
    background: #f3f4f6;
}

.tc-event-pool-table td,
.tc-event-pool-table th {
    font-size: 0.9rem;
}

.tc-bulk-tasks-actions {
    margin-top: 0.4rem;
}

.tc-btn-danger.tc-btn-xs {
    background: #fee2e2;
    color: #b91c1c;
    padding: 0.1rem 0.5rem;
    font-size: 0.8rem;
}

.tc-event-tasks-table th[data-sort] {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.tc-event-tasks-table th[data-sort]:hover {
    background: #f3f4f6;
}

.tc-sort-icon {
    opacity: 0.5;
    font-size: 0.85em;
}

/* Event task list with zebra (legacy) */
.tc-event-tasks-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.tc-event-task-row {
    padding: 0.75rem 0.85rem;
    border-radius: 0.5rem;
}

.tc-event-task-row-odd {
    background: #f9fafb;
}

.tc-event-task-row-even {
    background: #fff;
    border: 1px solid #f3f4f6;
}

.tc-event-task-row-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.tc-event-task-actions {
    margin-right: auto;
}

.tc-event-task-edit-title {
    margin: 0;
    font-weight: 500;
}

/* Task select per-task fields */
.tc-task-select-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f3f4f6;
}

.tc-task-select-fields {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

.tc-task-config-panel {
    display: none;
}

.tc-add-tasks-step {
    min-height: 100px;
}

.tc-task-select-only {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0;
    cursor: pointer;
    font-size: 0.9rem;
}

.tc-task-config-block {
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    background: #f8fafc;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
}

.tc-task-config-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.tc-task-config-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
}

.tc-task-config-fields .tc-field-row {
    margin: 0;
}

/* AirTable-style team picker */
.tc-team-picker-wrap .tc-field-label {
    display: block;
    margin-bottom: 0.25rem;
}

.tc-team-picker {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    min-height: 2.25rem;
    min-width: 160px;
    padding: 0.35rem 0.5rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    position: relative;
}

.tc-team-picker:focus-within {
    border-color: #3b82f6;
    outline: 2px solid rgba(59, 130, 246, 0.2);
}

.tc-team-picker-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.tc-team-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.2rem 0.4rem;
    background: #e0f2fe;
    color: #0369a1;
    border-radius: 0.35rem;
    font-size: 0.85rem;
}

.tc-team-chip-remove {
    padding: 0;
    margin: 0;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    color: #0369a1;
    opacity: 0.8;
}

.tc-team-chip-remove:hover {
    opacity: 1;
}

.tc-team-picker-trigger {
    padding: 0.2rem 0.5rem;
    font-size: 0.85rem;
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
}

.tc-team-picker-trigger:hover {
    color: #3b82f6;
}

.tc-team-picker-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    margin-top: 0.25rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 10;
    display: none;
}

.tc-team-picker-dropdown.is-open {
    display: block;
}

.tc-team-picker-options {
    max-height: 180px;
    overflow-y: auto;
}

.tc-team-picker-opt {
    display: block;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 0.9rem;
}

.tc-team-picker-opt:hover {
    background: #f1f5f9;
}

.tc-team-picker-opt input {
    margin-left: 0.35rem;
}

.tc-task-select-fields .tc-field-label {
    font-size: 0.8rem;
    margin-left: 0.5rem;
}

.tc-select-multi {
    min-width: 120px;
}

.tc-input-sm {
    width: 8rem;
}

/* Task selection modal */
.tc-modal-wide {
    max-width: 480px;
}

.tc-task-select-cat {
    margin-bottom: 1rem;
}

.tc-task-select-all {
    display: block;
    margin-bottom: 0.35rem;
    cursor: pointer;
}

.tc-task-select-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding-right: 0.5rem;
}

.tc-task-select-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    font-size: 0.9rem;
}

@media (max-width: 720px) {
    .tc-event-header {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Accordion for task categories */
.tc-accordion {
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tc-accordion-item {
    border-radius: 0.75rem;
    border: 1px solid #d1d5db;
    overflow: hidden;
    background: #fff;
}

.tc-accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.7rem 0.85rem;
    cursor: pointer;
    background: #f3f4f6;
    border-bottom: 1px solid #e5e7eb;
}

.tc-accordion-item.is-open .tc-accordion-header {
    border-bottom-color: #d1d5db;
}

.tc-accordion-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #111827;
}

.tc-accordion-subtitle {
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: 0.15rem;
}

.tc-accordion-chevron {
    font-size: 1.25rem;
    color: #374151;
    transition: transform 0.25s ease;
}

.tc-accordion-item.is-open .tc-accordion-chevron {
    transform: rotate(180deg);
}

.tc-accordion-body {
    max-height: 0;
    overflow: hidden;
    padding: 0 0.85rem;
    background: #fff;
    transition: max-height 0.35s ease-out;
}

.tc-accordion-item.is-open .tc-accordion-body {
    max-height: 3000px;
    padding: 0.85rem;
    transition: max-height 0.35s ease-out, padding 0.2s ease-out;
}

/* Confirm modal (reusable) */
.tc-confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.tc-confirm-overlay .tc-confirm-modal {
    background: #fff;
    border-radius: 0.75rem;
    padding: 1.25rem 1.5rem;
    max-width: 360px;
    width: 90%;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.tc-confirm-overlay .tc-confirm-title {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
    color: #111827;
}

.tc-confirm-overlay .tc-confirm-message {
    margin: 0 0 1rem;
    font-size: 0.95rem;
    color: #4b5563;
}

.tc-confirm-overlay .tc-confirm-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

/* Calendar */
.tc-calendar-header {
    display: flex;
    flex-direction: column;
}

.tc-calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.tc-calendar-title {
    font-weight: 600;
}

.tc-calendar-grid {
    margin-top: 0.75rem;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

.tc-calendar-row {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.tc-calendar-row-headings {
    background: #f9fafb;
}

.tc-calendar-cell-heading {
    padding: 0.4rem 0.5rem;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 600;
    border-bottom: 1px solid #e5e7eb;
}

.tc-calendar-cell {
    min-height: 72px;
    padding: 0.4rem 0.45rem;
    border-bottom: 1px solid #f3f4f6;
    border-inline-start: 1px solid #f3f4f6;
    font-size: 0.8rem;
    vertical-align: top;
}

.tc-calendar-row .tc-calendar-cell:first-child {
    border-inline-start: none;
}

.tc-calendar-cell.is-other-month {
    background: #f9fafb;
    color: #9ca3af;
}

.tc-calendar-day-number {
    font-weight: 600;
    margin-bottom: 0.15rem;
}

.tc-calendar-events {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.tc-calendar-event {
    display: block;
    border-radius: 999px;
    padding: 0.1rem 0.4rem;
    background: #eff6ff;
    color: #1d4ed8;
    text-decoration: none;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.tc-calendar-event.is-holiday {
    background: #fef3c7;
    color: #92400e;
}

@media (max-width: 640px) {
    .tc-calendar-cell {
        min-height: 60px;
        padding: 0.3rem 0.3rem;
    }

    .tc-calendar-day-number {
        font-size: 0.8rem;
    }

    .tc-calendar-event {
        font-size: 0.75rem;
    }
}

@media (max-width: 600px) {
    .cm-group-body {
        padding: 0.4rem 0.45rem;
    }

    .cm-group-body.is-open {
        padding: 0.4rem 0.45rem 0.55rem;
    }
}

