/* ═══════════════════════════════════════════════════════════════
   Reminder SaaS — Main Stylesheet
   ═══════════════════════════════════════════════════════════════ */

:root {
    /* Colors */
    --rs-primary:       #2563eb;
    --rs-primary-hover: #1d4ed8;
    --rs-primary-light: #eff6ff;
    --rs-danger:        #ef4444;
    --rs-danger-hover:  #dc2626;
    --rs-success:       #22c55e;
    --rs-warning:       #f59e0b;

    /* Neutrals */
    --rs-white:         #ffffff;
    --rs-gray-50:       #f9fafb;
    --rs-gray-100:      #f3f4f6;
    --rs-gray-200:      #e5e7eb;
    --rs-gray-300:      #d1d5db;
    --rs-gray-400:      #9ca3af;
    --rs-gray-500:      #6b7280;
    --rs-gray-600:      #4b5563;
    --rs-gray-700:      #374151;
    --rs-gray-800:      #1f2937;
    --rs-gray-900:      #111827;

    /* Typography */
    --rs-font:          -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    --rs-font-mono:     'SF Mono', SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace;

    /* Sizing */
    --rs-sidebar-width: 220px;
    --rs-topbar-height: 48px;
    --rs-radius:        6px;
    --rs-radius-lg:     10px;

    /* Shadows */
    --rs-shadow-sm:     0 1px 2px rgba(0,0,0,0.05);
    --rs-shadow:        0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --rs-shadow-md:     0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
}

/* ── Reset ─────────────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--rs-font);
    color: var(--rs-gray-800);
    background: var(--rs-gray-50);
    line-height: 1.5;
}

a {
    color: var(--rs-primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ── Form Elements ─────────────────────────────────────────────── */
.rs-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--rs-gray-700);
    margin-bottom: 4px;
}

.rs-input,
.rs-select,
.rs-textarea {
    display: block;
    width: 100%;
    padding: 8px 12px;
    font-size: 0.875rem;
    font-family: var(--rs-font);
    color: var(--rs-gray-800);
    background: var(--rs-white);
    border: 1px solid var(--rs-gray-300);
    border-radius: var(--rs-radius);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.rs-input:focus,
.rs-select:focus,
.rs-textarea:focus {
    outline: none;
    border-color: var(--rs-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.rs-input--sm {
    width: 80px;
    display: inline-block;
}

.rs-select--sm {
    width: auto;
    display: inline-block;
}

.rs-textarea {
    resize: vertical;
    min-height: 60px;
}

.rs-form-group {
    margin-bottom: 16px;
}

.rs-form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.rs-form-errors {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: var(--rs-danger);
    padding: 10px 14px;
    border-radius: var(--rs-radius);
    margin-bottom: 16px;
    font-size: 0.875rem;
}

.rs-form-errors p {
    margin: 2px 0;
}

.rs-form-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #16a34a;
    padding: 10px 14px;
    border-radius: var(--rs-radius);
    margin-bottom: 16px;
    font-size: 0.875rem;
}

.rs-help-text {
    font-size: 0.75rem;
    color: var(--rs-gray-400);
    margin-top: 4px;
}

/* ── Buttons ───────────────────────────────────────────────────── */
.rs-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: var(--rs-font);
    border: 1px solid var(--rs-gray-300);
    border-radius: var(--rs-radius);
    background: var(--rs-white);
    color: var(--rs-gray-700);
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    gap: 6px;
    line-height: 1.4;
}

.rs-btn:hover {
    background: var(--rs-gray-50);
    text-decoration: none;
}

.rs-btn--primary {
    background: var(--rs-primary);
    color: var(--rs-white);
    border-color: var(--rs-primary);
}

.rs-btn--primary:hover {
    background: var(--rs-primary-hover);
    border-color: var(--rs-primary-hover);
}

.rs-btn--secondary {
    background: var(--rs-white);
    color: var(--rs-gray-600);
}

.rs-btn--danger {
    background: var(--rs-danger);
    color: var(--rs-white);
    border-color: var(--rs-danger);
}

.rs-btn--danger:hover {
    background: var(--rs-danger-hover);
}

.rs-btn--full {
    width: 100%;
}

.rs-btn--sm {
    padding: 4px 10px;
    font-size: 0.8rem;
}

.rs-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.rs-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: none;
    border: 1px solid transparent;
    border-radius: var(--rs-radius);
    cursor: pointer;
    font-size: 1.1rem;
    color: var(--rs-gray-500);
    transition: all 0.15s;
}

.rs-btn-icon:hover {
    background: var(--rs-gray-100);
    border-color: var(--rs-gray-200);
}

/* ── Checkbox / Radio ──────────────────────────────────────────── */
.rs-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    color: var(--rs-gray-600);
    cursor: pointer;
}

.rs-radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 12px;
}

.rs-radio {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    color: var(--rs-gray-700);
    cursor: pointer;
}

.rs-link {
    color: var(--rs-primary);
    font-size: 0.875rem;
}

.rs-link:hover {
    text-decoration: underline;
}

/* ── Fieldset ──────────────────────────────────────────────────── */
.rs-fieldset {
    border: 1px solid var(--rs-gray-200);
    border-radius: var(--rs-radius);
    padding: 16px;
    margin-bottom: 16px;
}

.rs-legend {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--rs-gray-700);
    padding: 0 6px;
}

.rs-inline-fields {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* ── Badge / Tag ───────────────────────────────────────────────── */
.rs-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--rs-white);
    background: var(--rs-primary);
    border-radius: 99px;
}

.rs-badge--muted {
    background: var(--rs-gray-400);
}

.rs-tag {
    display: inline-block;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--rs-white);
    border-radius: 99px;
    white-space: nowrap;
}

.rs-tag-option {
    display: inline-flex;
    cursor: pointer;
}

.rs-tag-option input {
    display: none;
}

.rs-tag-option input:checked + .rs-tag {
    outline: 2px solid var(--rs-primary);
    outline-offset: 1px;
}

.rs-tags-select {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* ── Priority Dot ──────────────────────────────────────────────── */
.rs-priority {
    font-size: 1.6rem;
    line-height: 1;
}

.rs-priority--low    { color: var(--rs-success); }
.rs-priority--medium { color: var(--rs-warning); }
.rs-priority--high   { color: var(--rs-danger); }

/* ── Enabled Dot ───────────────────────────────────────────────── */
.rs-enabled-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.rs-enabled-dot.is-on  { background: var(--rs-success); }
.rs-enabled-dot.is-off { background: var(--rs-gray-300); }

/* ── Status Badge ──────────────────────────────────────────────── */
.rs-status-badge {
    display: inline-block;
    padding: 2px 10px;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 99px;
}

.rs-status-badge--active   { background: #dcfce7; color: #16a34a; }
.rs-status-badge--paused   { background: #fef3c7; color: #d97706; }
.rs-status-badge--finished { background: var(--rs-gray-100); color: var(--rs-gray-500); }

/* ── Dropdown ──────────────────────────────────────────────────── */
.rs-dropdown {
    display: none;
    position: fixed;
    z-index: 9999;
    background: var(--rs-white);
    border: 1px solid var(--rs-gray-200);
    border-radius: var(--rs-radius);
    box-shadow: var(--rs-shadow-md);
    min-width: 140px;
    padding: 4px 0;
}

.rs-dropdown.is-open {
    display: block;
}

.rs-dropdown__item {
    display: block;
    width: 100%;
    padding: 8px 14px;
    font-size: 0.875rem;
    color: var(--rs-gray-700);
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    text-decoration: none;
    font-family: var(--rs-font);
}

.rs-dropdown__item:hover {
    background: var(--rs-gray-50);
    text-decoration: none;
}

.rs-dropdown__item--danger {
    color: var(--rs-danger);
}

/* ── Days Grid (week selector) ─────────────────────────────────── */
.rs-days-grid {
    display: flex;
    gap: 6px;
    margin-top: 10px;
}

.rs-day-check {
    cursor: pointer;
}

.rs-day-check input {
    display: none;
}

.rs-day-check span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 36px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid var(--rs-gray-200);
    border-radius: var(--rs-radius);
    transition: all 0.15s;
}

.rs-day-check input:checked + span {
    background: var(--rs-primary);
    color: var(--rs-white);
    border-color: var(--rs-primary);
}

/* ── Empty State ───────────────────────────────────────────────── */
.rs-empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--rs-gray-400);
}

/* ── Next Notification Preview ─────────────────────────────────── */
.rs-next-notification {
    padding: 8px 12px;
    background: var(--rs-primary-light);
    border-radius: var(--rs-radius);
    font-size: 0.875rem;
    color: var(--rs-primary);
    font-weight: 500;
}
