/* ═══════════════════════════════════════════════════════════
   status-colors.css — Single source of truth for all
   status-related colors via CSS custom properties.
   ═══════════════════════════════════════════════════════════ */

/* ── Master color definitions ── */
:root {
    /* Entity / reservation status colors (fill + text pairs) */
    --status-available-fill:   #22c55e;
    --status-available-stroke: #166534;
    --status-available-bg:     #dcfce7;
    --status-available-text:   #166534;

    --status-reserved-fill:    #ef4444;
    --status-reserved-stroke:  #991b1b;
    --status-reserved-bg:      #fef2f2;
    --status-reserved-text:    #991b1b;

    --status-pending-fill:     #eab308;
    --status-pending-stroke:   #854d0e;
    --status-pending-bg:       #fef9c3;
    --status-pending-text:     #854d0e;

    --status-maintenance-fill:   #f97316;
    --status-maintenance-stroke: #c2410c;
    --status-maintenance-bg:     #fff7ed;
    --status-maintenance-text:   #c2410c;

    --status-unavailable-fill:   #9ca3af;
    --status-unavailable-stroke: #6b7280;
    --status-unavailable-bg:     #f3f4f6;
    --status-unavailable-text:   #6b7280;

    --status-starting-soon-fill:   #facc15;
    --status-starting-soon-stroke: #a16207;
    --status-starting-soon-bg:     #fef9c3;
    --status-starting-soon-text:   #a16207;

    --status-partial-fill:   #c4b5fd;
    --status-partial-stroke: #7c3aed;
    --status-partial-bg:     #ede9fe;
    --status-partial-text:   #5b21b6;

    --status-completed-fill: #6366f1;
    --status-completed-bg:   #e0e7ff;
    --status-completed-text: #3730a3;

    --status-cancelled-bg:   #f3f4f6;
    --status-cancelled-text: #6b7280;

    --status-declined-fill:  #ef4444;
    --status-declined-bg:    #fef2f2;
    --status-declined-text:  #991b1b;

    /* Guest reservation colors */
    --guest-fill:   #9333ea;
    --guest-bg:     #f3e8ff;
    --guest-text:   #581c87;

    /* Calendar Gantt-bar shades (higher-contrast for small cells) */
    --cal-available-bg:    #dcfce7;
    --cal-reserved-bg:     #fecaca;
    --cal-reserved-border: #dc2626;
    --cal-pending-bg:      #fef08a;
    --cal-pending-border:  #ca8a04;
    --cal-maintenance-bg:  #fed7aa;
    --cal-maintenance-border: #ea580c;
    --cal-unavailable-bg:  #e5e7eb;

    /* Aliases used by entity card borders */
    --dot-color-AVAILABLE:     var(--status-available-fill);
    --dot-color-RESERVED:      var(--status-reserved-fill);
    --dot-color-PENDING:       var(--status-pending-fill);
    --dot-color-MAINTENANCE:   var(--status-maintenance-fill);
    --dot-color-UNAVAILABLE:   var(--status-unavailable-fill);
    --dot-color-STARTING_SOON: var(--status-starting-soon-fill);
    --dot-color-PARTIAL:       var(--status-partial-fill);
}

/* ========== Status badges (reservation & entity) ========== */
.status {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-PENDING       { background: var(--status-pending-bg);       color: var(--status-pending-text); }
.status-ACCEPTED      { background: var(--status-available-bg);     color: var(--status-available-text); }
.status-APPROVED      { background: var(--status-available-bg);     color: var(--status-available-text); }
.status-CONFIRMED     { background: var(--status-available-bg);     color: var(--status-available-text); }
.status-DECLINED      { background: var(--status-declined-bg);      color: var(--status-declined-text); }
.status-CANCELLED     { background: var(--status-cancelled-bg);     color: var(--status-cancelled-text); }
.status-COMPLETED     { background: var(--status-completed-bg);     color: var(--status-completed-text); }
.status-AVAILABLE     { background: var(--status-available-bg);     color: var(--status-available-text); }
.status-RESERVED      { background: var(--status-reserved-bg);      color: var(--status-reserved-text); }
.status-STARTING_SOON { background: var(--status-starting-soon-bg); color: var(--status-starting-soon-text); }
.status-MAINTENANCE   { background: var(--status-maintenance-bg);   color: var(--status-maintenance-text); }
.status-UNAVAILABLE   { background: var(--status-unavailable-bg);   color: var(--status-unavailable-text); }
.status-PARTIAL       { background: var(--status-partial-bg);       color: var(--status-partial-text); }

/* ========== Entity status SVG fills ========== */
.entity-available    { fill: var(--status-available-fill);     stroke: var(--status-available-stroke); }
.entity-reserved     { fill: var(--status-reserved-fill);      stroke: var(--status-reserved-stroke); }
.entity-pending      { fill: var(--status-pending-fill);       stroke: var(--status-pending-stroke); }
.entity-maintenance  { fill: var(--status-maintenance-fill);   stroke: var(--status-maintenance-stroke); }
.entity-unavailable  { fill: var(--status-unavailable-fill);   stroke: var(--status-unavailable-stroke); }
.entity-starting-soon { fill: var(--status-starting-soon-fill); stroke: var(--status-starting-soon-stroke); }
.entity-partial      { fill: var(--status-partial-fill);       stroke: var(--status-partial-stroke); }

/* ========== Entity status dots ========== */
.entity-status-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 0.4rem;
    vertical-align: middle;
}

.dot-AVAILABLE     { background: var(--status-available-fill); }
.dot-RESERVED      { background: var(--status-reserved-fill); }
.dot-PENDING       { background: var(--status-pending-fill); }
.dot-MAINTENANCE   { background: var(--status-maintenance-fill); }
.dot-UNAVAILABLE   { background: var(--status-unavailable-fill); }
.dot-STARTING_SOON { background: var(--status-starting-soon-fill); }
.dot-PARTIAL       { background: var(--status-partial-fill); }

/* ========== Role badges ========== */
.status-ADMIN     { background: #fef3c7; color: #92400e; }
.status-OPERATOR  { background: #dbeafe; color: #1e40af; }
.status-REQUESTER { background: var(--status-available-bg); color: var(--status-available-text); }
.status-VIEWER    { background: var(--status-unavailable-bg); color: #374151; }

/* ========== Seminar room: currently-busy indicator ========== */
.entity-card.busy-now {
    border-left: 3px solid var(--status-reserved-fill);
}
.entity-card.busy-now .book-btn {
    opacity: 0.7;
}

/* ========== Hotel availability indicators ========== */
.avail-indicator {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-radius: 6px;
    border-left: 5px solid transparent;
}

.avail-dot {
    width: 20px;
    height: 20px;
    min-width: 20px;
    border-radius: 50%;
    flex-shrink: 0;
}

.avail-high {
    background: var(--status-available-bg);
    color: var(--status-available-text);
    border-left-color: var(--status-available-fill);
}
.avail-high .avail-dot { background: var(--status-available-fill); }

.avail-some {
    background: var(--status-maintenance-bg);
    color: #9a3412;
    border-left-color: var(--status-maintenance-fill);
}
.avail-some .avail-dot { background: var(--status-maintenance-fill); }

.avail-low {
    background: var(--status-reserved-bg);
    color: var(--status-reserved-text);
    border-left-color: var(--status-reserved-fill);
}
.avail-low .avail-dot { background: var(--status-reserved-fill); }

.avail-none {
    background: #fecaca;
    color: #7f1d1d;
    border-left-color: #dc2626;
}
.avail-none .avail-dot { background: #dc2626; }

/* ========== Reservation type badges ========== */
.badge-recurring {
    display: inline-block;
    background: var(--status-completed-bg);
    color: var(--status-completed-text);
    font-size: 0.7rem;
    padding: 1px 6px;
    border-radius: 10px;
    font-weight: 600;
}

.badge-guest {
    display: inline-block;
    background: var(--guest-bg);
    color: var(--guest-text);
    font-size: 0.7rem;
    padding: 1px 6px;
    border-radius: 10px;
    font-weight: 600;
}

.badge-conflict {
    display: inline-block;
    background: #fef3c7;
    color: #92400e;
    font-size: 0.7rem;
    padding: 1px 6px;
    border-radius: 10px;
    font-weight: 600;
}

tr.row-has-conflict {
    background: #fffbeb;
}

.badge-edited {
    display: inline-block;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 0.7rem;
    padding: 1px 6px;
    border-radius: 10px;
    font-weight: 600;
}
