/* ============================================
   MOS Loyalty Portal — Global Styles
   Font: Poppins | Modern flat design
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.9375rem;
    color: #1e293b;
    background: #f1f5f9;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 20px;
}

h1 { font-size: 1.625rem; }
h2 { font-size: 1.2rem; margin-top: 32px; }

a { color: #2563eb; text-decoration: none; }
a:hover { color: #1d4ed8; }

/* --- Stats Grid --- */
.stats-grid {
    display: flex;
    gap: 20px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.stat-card {
    background: #fff;
    padding: 24px 28px;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.03);
    min-width: 160px;
    border: 1px solid #e2e8f0;
}

.stat-value {
    font-size: 2.25rem;
    font-weight: 700;
    color: #2563eb;
    line-height: 1;
}

.stat-label {
    color: #64748b;
    font-size: 0.8125rem;
    font-weight: 500;
    margin-top: 6px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* --- Data Tables --- */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.03);
    border: 1px solid #e2e8f0;
    margin-bottom: 24px;
}

.data-table th,
.data-table td {
    padding: 14px 20px;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
}

.data-table th {
    background: #f8fafc;
    font-weight: 600;
    font-size: 0.75rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr:hover {
    background: #f8fafc;
}

.data-table a {
    color: #2563eb;
    font-weight: 500;
}

.data-table a:hover {
    text-decoration: underline;
}

.data-table .code {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-weight: 600;
    color: #334155;
}

.data-table code {
    background: #f1f5f9;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
}

.row-inactive {
    opacity: 0.45;
}

/* --- Badges --- */
.badge-active {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #ecfdf5;
    color: #059669;
}

.badge-inactive {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #fef2f2;
    color: #dc2626;
}

.badge-available {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #eff6ff;
    color: #2563eb;
}

.badge-disabled {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #fef2f2;
    color: #dc2626;
}

/* --- Buttons --- */
.btn-primary {
    padding: 10px 22px;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
}

.btn-primary:hover:not(:disabled) {
    background: #1d4ed8;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-small {
    padding: 5px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    font-size: 0.8125rem;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    color: #475569;
    margin-right: 4px;
    transition: all 0.15s;
}

.btn-small:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.btn-success-text {
    color: #059669;
    border-color: #a7f3d0;
}

.btn-danger {
    color: #dc2626;
    border-color: #fecaca;
}

.btn-danger:hover {
    background: #fef2f2;
    border-color: #dc2626;
}

.btn-danger-sm {
    padding: 5px 14px;
    background: #dc2626;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8125rem;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    transition: background 0.15s;
}

.btn-danger-sm:hover {
    background: #b91c1c;
}

.btn-copy {
    padding: 8px 20px;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
}

.btn-copy:hover {
    background: #1d4ed8;
}

.btn-close-key,
.btn-close {
    padding: 8px 20px;
    background: #fff;
    color: #475569;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
}

.btn-close-key:hover,
.btn-close:hover {
    background: #f8fafc;
}

/* --- Forms --- */
.form-card {
    background: #fff;
    padding: 28px;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.03);
    border: 1px solid #e2e8f0;
    margin-bottom: 28px;
}

.form-card h2 {
    margin-top: 0;
    margin-bottom: 20px;
}

.form-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.form-group {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    display: block;
    font-weight: 500;
    font-size: 0.8125rem;
    color: #475569;
}

.form-group-btn {
    align-self: flex-end;
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.9375rem;
    font-family: 'Poppins', sans-serif;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
    background: #fff;
    color: #1e293b;
}

.form-input:focus {
    border-color: #2563eb;
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-input::placeholder {
    color: #94a3b8;
}

.import-form {
    background: #fff;
    padding: 24px;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.03);
    border: 1px solid #e2e8f0;
    margin-bottom: 24px;
}

.filter-row {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.search-bar {
    margin-bottom: 20px;
}

/* --- Detail Cards --- */
.detail-card {
    background: #fff;
    padding: 24px 28px;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.03);
    border: 1px solid #e2e8f0;
    margin-bottom: 24px;
}

.detail-row {
    display: flex;
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 600;
    color: #64748b;
    width: 160px;
    flex-shrink: 0;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.balance {
    font-weight: 700;
    color: #2563eb;
    font-size: 1.1rem;
}

.points-positive { color: #059669; font-weight: 600; }
.points-negative { color: #dc2626; font-weight: 600; }

/* --- Messages --- */
.message {
    margin-top: 12px;
    color: #059669;
    font-weight: 500;
}

.message-error {
    margin-top: 12px;
    color: #dc2626;
    font-weight: 500;
}

.success-message {
    background: #ecfdf5;
    color: #059669;
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-weight: 500;
    border: 1px solid #a7f3d0;
}

.error-message {
    background: #fef2f2;
    color: #dc2626;
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-weight: 500;
    border: 1px solid #fecaca;
}

.empty-state {
    color: #94a3b8;
    font-style: italic;
    padding: 20px 0;
}

/* --- API Key Display --- */
.key-created {
    margin-top: 16px;
    padding: 20px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 14px;
}

.key-display {
    background: #0f172a;
    color: #34d399;
    padding: 14px 18px;
    border-radius: 10px;
    margin: 10px 0;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 0.875rem;
    word-break: break-all;
}

.key-actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

/* --- Page Header --- */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.page-header h1,
.page-header h2 {
    margin: 0;
}

/* --- Form Grid --- */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-section {
    margin-bottom: 24px;
}

.form-section h3 {
    font-size: 0.95rem;
    color: #334155;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    gap: 12px;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="url"],
.form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.9375rem;
    font-family: 'Poppins', sans-serif;
    transition: border-color 0.15s, box-shadow 0.15s;
    background: #fff;
    color: #1e293b;
}

.form-group input:focus {
    border-color: #2563eb;
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group input::placeholder {
    color: #94a3b8;
}

.form-hint {
    font-size: 0.75rem;
    color: #94a3b8;
}

.form-hint.file-selected {
    color: #059669;
    font-weight: 500;
}

.form-group input[type="file"] {
    font-size: 0.875rem;
    font-family: 'Poppins', sans-serif;
    color: #475569;
}

.form-actions {
    display: flex;
    gap: 10px;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
}

.btn-secondary {
    padding: 10px 22px;
    background: #fff;
    color: #475569;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-secondary:hover:not(:disabled) {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.color-input {
    display: flex;
    gap: 8px;
    align-items: center;
}

.color-input input[type="color"] {
    width: 40px;
    height: 38px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 2px;
    cursor: pointer;
    flex-shrink: 0;
}

.color-input input[type="text"] {
    flex: 1;
}

.color-swatch {
    display: inline-block;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
    vertical-align: middle;
    margin-right: 6px;
}

.toggle-label {
    font-size: 0.8125rem;
    font-weight: 400;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.toggle-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #2563eb;
}

/* --- Alerts --- */
.alert {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-weight: 500;
}

.alert-error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

/* --- Public Pages (login, check inbox, link expired) --- */
.login-card,
.message-card {
    background: #fff;
    padding: 44px;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.06);
    max-width: 420px;
    width: 100%;
    border: 1px solid #e2e8f0;
}

.login-card h1,
.message-card h1 {
    margin: 0 0 8px;
    font-size: 1.5rem;
    color: #0f172a;
    text-align: center;
}

.login-card p,
.message-card p {
    margin: 0 0 24px;
    color: #64748b;
    text-align: center;
}

.back-link {
    display: inline-block;
    margin-top: 20px;
    color: #2563eb;
    font-weight: 500;
}

.back-link:hover {
    text-decoration: underline;
}

/* --- Inline Form (e.g. add store) --- */
.inline-form {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.inline-form .form-group {
    min-width: 180px;
    flex: 1;
}

.inline-form-actions {
    display: flex;
    gap: 8px;
    padding-bottom: 2px;
}

/* --- Button Sizes --- */
.btn-sm {
    padding: 7px 16px;
    font-size: 0.8125rem;
}

.btn-xs {
    padding: 4px 10px;
    font-size: 0.75rem;
}

/* --- Existing Image Preview --- */
.existing-image {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 6px;
}

.image-preview {
    max-height: 48px;
    max-width: 200px;
    object-fit: contain;
    border-radius: 4px;
}

/* --- Monospace (IDs) --- */
.monospace {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 0.8125rem;
    color: #64748b;
}

/* --- Automation Grid --- */
.automation-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.automation-tile {
    background: #fff;
    padding: 24px 28px;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.03);
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.automation-tile:hover {
    border-color: #2563eb;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.12), 0 4px 16px rgba(0,0,0,0.06);
    transform: translateY(-2px);
}

.automation-tile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.automation-tile-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.automation-tile-icon.icon-welcome {
    background: #eff6ff;
}

.automation-tile-icon.icon-birthday {
    background: #fef3c7;
}

.automation-tile-icon.icon-milestone {
    background: #ecfdf5;
}

.automation-tile-icon.icon-marketing {
    background: #fef3c7;
}

.automation-tile h3 {
    font-size: 1rem;
    margin: 0 0 6px;
    color: #0f172a;
}

.automation-tile p {
    font-size: 0.8125rem;
    color: #64748b;
    margin: 0;
    line-height: 1.5;
}

/* --- Toggle Switch --- */
.toggle-switch-label {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #cbd5e1;
    border-radius: 24px;
    transition: background 0.2s;
}

.toggle-slider::before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}

.toggle-switch input:checked + .toggle-slider {
    background: #2563eb;
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

/* --- Placeholder Info --- */
.placeholder-info {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 20px;
}

.placeholder-info h3 {
    font-size: 0.8125rem;
    color: #475569;
    margin: 0 0 10px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.placeholder-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.placeholder-tag {
    display: inline-block;
    padding: 4px 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 0.8125rem;
    color: #2563eb;
}

.placeholder-clickable {
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.placeholder-clickable:hover {
    background: #eff6ff;
    border-color: #2563eb;
}

.placeholder-hint {
    font-size: 0.75rem;
    color: #94a3b8;
    margin: 0 0 10px;
}

/* --- Email Editor --- */
.editor-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 0;
}

.editor-tab {
    padding: 8px 20px;
    border: 1px solid #e2e8f0;
    border-bottom: none;
    background: #f8fafc;
    color: #64748b;
    font-family: 'Poppins', sans-serif;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    border-radius: 8px 8px 0 0;
}

.editor-tab:first-child {
    border-right: none;
}

.editor-tab.active {
    background: #fff;
    color: #0f172a;
    border-color: #e2e8f0;
    position: relative;
    z-index: 1;
}

.editor-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-bottom: none;
    flex-wrap: wrap;
}

.editor-btn {
    padding: 5px 8px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    font-size: 0.8125rem;
    color: #334155;
    transition: all 0.15s;
    line-height: 1;
    min-width: 28px;
    text-align: center;
}

.editor-btn:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
}

.editor-select {
    padding: 4px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #fff;
    font-family: 'Poppins', sans-serif;
    font-size: 0.75rem;
    color: #334155;
    cursor: pointer;
    max-width: 130px;
}

.editor-select:focus {
    border-color: #2563eb;
    outline: none;
}

.editor-separator {
    width: 1px;
    height: 20px;
    background: #e2e8f0;
    margin: 0 4px;
}

.editor-color-group {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    cursor: pointer;
}

.editor-color-label {
    font-size: 0.8125rem;
    font-weight: 700;
    color: #334155;
    line-height: 1;
}

.editor-color-picker {
    width: 20px;
    height: 20px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 0;
    cursor: pointer;
    background: none;
}

.editor-content {
    border: 1px solid #e2e8f0;
    border-radius: 0 0 10px 10px;
    padding: 20px;
    min-height: 300px;
    background: #fff;
    font-family: Arial, sans-serif;
    font-size: 0.9375rem;
    color: #1e293b;
    outline: none;
    line-height: 1.6;
    overflow-y: auto;
    max-height: 500px;
}

.editor-content:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.editor-content h1,
.editor-content h2,
.editor-content h3 {
    color: #0f172a;
}

.editor-content a {
    color: #2563eb;
}

.editor-html-textarea {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 0.8125rem;
    resize: vertical;
    border-radius: 0 0 10px 10px;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

/* --- Recipient Selector --- */
.recipient-selector {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 20px;
}

.recipient-selector h3 {
    font-size: 0.8125rem;
    color: #475569;
    margin: 0 0 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.recipient-options {
    display: flex;
    gap: 20px;
    margin-bottom: 8px;
}

.recipient-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9375rem;
    color: #1e293b;
    font-weight: 500;
}

.recipient-option input[type="radio"] {
    accent-color: #2563eb;
    width: 16px;
    height: 16px;
}

.recipient-count {
    margin-top: 12px;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.875rem;
    color: #475569;
    display: inline-block;
}

.recipient-count strong {
    color: #2563eb;
}

/* --- Confirm Dialog --- */
.confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.confirm-dialog {
    background: #fff;
    padding: 28px;
    border-radius: 14px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
    max-width: 440px;
    width: 100%;
    border: 1px solid #e2e8f0;
}

.confirm-dialog h3 {
    margin: 0 0 12px;
    font-size: 1.1rem;
    color: #0f172a;
}

.confirm-dialog p {
    color: #475569;
    margin: 0 0 20px;
    line-height: 1.5;
}

.confirm-actions {
    display: flex;
    gap: 10px;
}

/* --- Tab Navigation (GiftcardDetail tabs) --- */
.tab-bar {
    display: flex;
    gap: 0;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 24px;
}

.tab-btn {
    padding: 8px 24px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
    color: #64748b;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
    margin-bottom: -1px;
}

.tab-btn:hover {
    color: #1e293b;
}

.tab-btn.tab-active {
    color: #2563eb;
    border-bottom-color: #2563eb;
    font-weight: 600;
}

/* --- Giftcard type badges --- */
.badge-physical {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 0.8125rem;
    font-weight: 600;
    background: #fef3c7;
    color: #d97706;
}

.badge-digital {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 0.8125rem;
    font-weight: 600;
    background: #eff6ff;
    color: #2563eb;
}

/* --- Stat value color variants for giftcard stats --- */
.stat-value-positive {
    font-size: 2.25rem;
    font-weight: 600;
    color: #059669;
    line-height: 1;
}

.stat-value-negative {
    font-size: 2.25rem;
    font-weight: 600;
    color: #dc2626;
    line-height: 1;
}

/* Live Map — store pulse animation on API activity */
@keyframes store-pulse-anim {
    0%   { r: 8; fill-opacity: 0.8; stroke: #1e40af; fill: #3b82f6; }
    30%  { r: 16; fill-opacity: 0.4; stroke: #f59e0b; fill: #fbbf24; }
    100% { r: 8; fill-opacity: 0.8; stroke: #1e40af; fill: #3b82f6; }
}
.store-pulse {
    animation: store-pulse-anim 1.5s ease-out;
}

/* Sortable table headers */
th.sortable {
    cursor: pointer;
    user-select: none;
}
th.sortable:hover {
    color: #3b82f6;
}

/* --- Responsive: mobile (<768px) --- */
@media (max-width: 768px) {
    .data-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .form-row, .filter-row {
        flex-direction: column;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .inline-form {
        flex-direction: column;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.2rem; }

    .detail-row {
        flex-direction: column;
        gap: 4px;
    }

    .confirm-dialog {
        width: 90vw;
        margin: 16px;
    }

    /* Menu toggle via JS — must be global, not scoped */
    .menu-open .portal-sidebar {
        display: flex !important;
    }

    .menu-open .sidebar-overlay {
        display: block !important;
    }

    /* Leaflet map under mobile menu */
    #live-map, #live-map * {
        z-index: 40 !important;
    }
}
