/* ── Promotion Management — Dark Card UI (pm- prefix) ──────────────── */
/* Matches OrderManagement / FoodSubscription card patterns            */

/* ── Create/Edit Modal Form Sections ─────────────────────────────── */
.pm-form-section {
    padding-bottom: 0.25rem;
}

.pm-form-section-title {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    color: #2DD4BF;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.6rem 0.5rem 0.1rem;
    border-top: 1px solid #26302D;
}

.pm-form-section:first-child .pm-form-section-title { border-top: none; }
.pm-form-section-title i { font-size: 0.8rem; }

.pm-discount-hint { display: block; }

/* ── Page Container ─────────────────────────────────────────────── */
.pm-page {
    background: #070B0A;
    min-height: 100vh;
    padding-bottom: 2rem;
}

/* ── Header ───────────────────────────────────────────────────────── */
.pm-header {
    position: sticky;
    top: 0;
    z-index: 200;
    background: #070B0A;
    border-bottom: 2px solid #26302D;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.pm-header-info { flex: 1; min-width: 0; }

.pm-header-title {
    color: #fff;
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pm-header-title i { color: #2DD4BF; font-size: 1.125rem; }

/* ── Stats Bar ────────────────────────────────────────────────────── */
.pm-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding: 1rem 1.25rem;
    border-bottom: 2px solid #26302D;
}

.pm-stat-card {
    background: #171D1B;
    border-radius: 14px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.pm-stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.pm-stat-icon--active { background: rgba(45, 212, 191, 0.12); color: #2DD4BF; }
.pm-stat-icon--total { background: rgba(59, 130, 246, 0.12); color: #3B82F6; }
.pm-stat-icon--scheduled { background: rgba(245, 158, 11, 0.12); color: #F59E0B; }
.pm-stat-icon--expired { background: rgba(239, 68, 68, 0.12); color: #EF4444; }

.pm-stat-value {
    color: #fff;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
}

.pm-stat-label {
    color: #78827F;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 4px;
}

/* ── Toolbar ────────────────────────────────────────────────────────── */
.pm-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    border-bottom: 2px solid #26302D;
    flex-wrap: wrap;
}

.pm-filter-select {
    padding: 0.5rem 1rem;
    background: #171D1B;
    border: 1px solid #26302D;
    border-radius: 0.5rem;
    color: #fff;
    font-size: 0.875rem;
    outline: none;
    cursor: pointer;
    font-family: inherit;
    box-sizing: border-box;
}

.pm-filter-select:focus { border-color: #2DD4BF; }

/* ── Buttons ────────────────────────────────────────────────────────── */
.pm-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 8px;
    font-size: 0.813rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.pm-btn--primary {
    background: #2DD4BF;
    color: #070B0A;
}

.pm-btn--primary:hover { background: #14B8A6; }

.pm-btn--back {
    background: #171D1B;
    color: #D1D5DB;
    border: 1px solid #26302D;
}

.pm-btn--back:hover { background: #26302D; color: #fff; }

.pm-btn--sm {
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 6px;
}

.pm-btn--edit {
    background: rgba(59, 130, 246, 0.14);
    color: #3B82F6;
}

.pm-btn--edit:hover { background: rgba(59, 130, 246, 0.24); }

.pm-btn--toggle {
    background: rgba(45, 212, 191, 0.12);
    color: #2DD4BF;
}

.pm-btn--toggle:hover { background: rgba(45, 212, 191, 0.22); }

.pm-btn--danger {
    background: rgba(239, 68, 68, 0.14);
    color: #EF4444;
}

.pm-btn--danger:hover { background: rgba(239, 68, 68, 0.24); }

/* ── Card Grid ──────────────────────────────────────────────────────── */
.pm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
    padding: 1.25rem;
}

/* ── Promotion Card ──────────────────────────────────────────────── */
.pm-card {
    background: #171D1B;
    border-radius: 20px;
    padding: 22px;
    box-shadow: 0px 6px 20px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease;
    border: none;
    position: relative;
    min-width: 0;
}

.pm-card:hover { transform: translateY(-4px); }

/* Hide borders on ALL structural card elements — matches OrderManagement pattern */
.pm-card *,
.pm-card *::before,
.pm-card *::after {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background-image: none !important;
}

.pm-card-top,
.pm-card-header,
.pm-card-body,
.pm-card-actions {
    background: transparent !important;
}

.pm-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.pm-card-type {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    flex-shrink: 0;
}

.pm-card-info { flex: 1; min-width: 0; }

.pm-card-info h3 {
    color: #FFFFFF;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 2px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pm-card-discount {
    font-size: 13px;
    font-weight: 700;
    color: #2DD4BF;
}

/* ── Status Badge ──────────────────────────────────────────────────── */
.pm-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.pm-status-badge--active { background: rgba(34, 197, 94, 0.14); color: #22C55E; }
.pm-status-badge--inactive { background: rgba(107, 114, 128, 0.14); color: #78827F; }
.pm-status-badge--scheduled { background: rgba(59, 130, 246, 0.14); color: #3B82F6; }
.pm-status-badge--expired { background: rgba(239, 68, 68, 0.14); color: #EF4444; }

/* ── Card Body ────────────────────────────────────────────────────── */
.pm-card-body {
    margin-bottom: 14px;
}

.pm-card-desc {
    font-size: 13px;
    color: #B7C0BD;
    margin: 0 0 10px 0;
    line-height: 1.4;
}

.pm-card-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: #78827F;
    margin-bottom: 10px;
}

.pm-card-meta i { margin-right: 4px; }

.pm-card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.pm-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
}

.pm-badge--code { background: rgba(59, 130, 246, 0.14); color: #3B82F6; }
.pm-badge--new { background: rgba(245, 158, 11, 0.14); color: #F59E0B; }

/* ── Card Actions ─────────────────────────────────────────────────── */
.pm-card-actions {
    display: flex;
    gap: 8px;
    padding-top: 14px;
    border-top: 1px solid #171D1B !important;  /* override the border:none above */
}

/* ── Empty & Loading ─────────────────────────────────────────────────── */
.pm-empty {
    text-align: center;
    padding: 60px 20px;
    color: #78827F;
}

.pm-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
}

.pm-empty-title {
    font-size: 18px;
    color: #B7C0BD;
    margin: 0 0 8px;
}

.pm-empty-desc {
    font-size: 14px;
    color: #78827F;
    margin: 0 0 20px;
}

.pm-loading {
    text-align: center;
    padding: 40px;
    color: #78827F;
    font-size: 14px;
}

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .pm-header { flex-direction: column; gap: 12px; align-items: flex-start; }
    .pm-stats { grid-template-columns: repeat(2, 1fr); }
    .pm-grid { grid-template-columns: 1fr; padding: 1rem; gap: 14px; }
    .pm-toolbar { flex-wrap: wrap; }
    .pm-filter-select { flex: 1; min-width: 0; }
    .pm-stat-card { padding: 12px; }
}

@media (max-width: 480px) {
    .pm-header { padding: 0.875rem 1rem; }
    .pm-stats { grid-template-columns: 1fr 1fr; padding: 0.75rem 1rem; gap: 10px; }
    .pm-grid { padding: 0.75rem; }
    .pm-card { padding: 16px; }
    .pm-card-actions { flex-wrap: wrap; }
    .pm-page { padding-bottom: calc(2rem + 65px); }
}