:root {
    --rb-primary: #ff6a00;
    --rb-primary-600: #e85f00;
    --rb-primary-50: #fff4ec;
    --rb-bg: #f7f7f9;
    --rb-surface: #ffffff;
    --rb-border: #eceef2;
    --rb-text: #18181b;
    --rb-text-muted: #6b7280;
    --rb-shadow: 0 1px 2px rgba(16,24,40,0.04), 0 1px 3px rgba(16,24,40,0.06);
    --rb-shadow-lg: 0 4px 24px rgba(16,24,40,0.06), 0 1px 3px rgba(16,24,40,0.04);
    --rb-radius: 14px;
    --rb-radius-sm: 10px;
    --rb-sidebar-w: 240px;
    --rb-navbar-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--rb-bg); color: var(--rb-text); font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.5; }

/* ---------- Layout shell ---------- */
.rb-app { display: flex; min-height: 100vh; }
.rb-main { flex: 1; margin-left: var(--rb-sidebar-w); display: flex; flex-direction: column; min-width: 0; }
.rb-content { padding: 32px 40px 48px; flex: 1; }

/* ---------- Sidebar ---------- */
.rb-sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: var(--rb-sidebar-w);
    background: var(--rb-surface);
    border-right: 1px solid var(--rb-border);
    display: flex; flex-direction: column;
    padding: 20px 16px;
    z-index: 20;
}
.rb-brand {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px 24px;
    text-decoration: none; color: var(--rb-text);
    font-weight: 700; font-size: 18px;
}
.rb-brand-mark {
    width: 32px; height: 32px; border-radius: 8px;
    background: var(--rb-primary); color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 16px;
}
.rb-nav { display: flex; flex-direction: column; gap: 2px; }
.rb-nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: var(--rb-radius-sm);
    color: var(--rb-text-muted); text-decoration: none;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}
.rb-nav-item i { font-size: 18px; width: 20px; text-align: center; }
.rb-nav-item:hover { background: var(--rb-bg); color: var(--rb-text); }
.rb-nav-item.is-active { background: var(--rb-primary-50); color: var(--rb-primary); }
.rb-sidebar-footer { margin-top: auto; padding: 12px; color: var(--rb-text-muted); }

/* ---------- Navbar ---------- */
.rb-navbar {
    height: var(--rb-navbar-h);
    background: var(--rb-surface);
    border-bottom: 1px solid var(--rb-border);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 40px;
    position: sticky; top: 0; z-index: 10;
}
.rb-company { font-weight: 600; color: var(--rb-text); }
.rb-user {
    display: inline-flex; align-items: center; gap: 10px;
    background: transparent; border: 1px solid var(--rb-border);
    padding: 6px 12px; border-radius: 999px; cursor: pointer;
    color: var(--rb-text);
}
.rb-user:hover { background: var(--rb-bg); }
.rb-avatar {
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--rb-primary); color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 13px;
}
.rb-user-email { font-size: 13px; color: var(--rb-text-muted); }
.rb-dropdown { border-radius: 12px; border: 1px solid var(--rb-border); box-shadow: var(--rb-shadow-lg); min-width: 240px; }

/* ---------- Page header ---------- */
.rb-page-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 16px; margin-bottom: 24px;
}
.rb-page-title { font-size: 24px; font-weight: 700; margin: 0; letter-spacing: -0.01em; }
.rb-page-subtitle { color: var(--rb-text-muted); margin: 4px 0 0; }
.rb-page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Card ---------- */
.rb-card {
    background: var(--rb-surface);
    border: 1px solid var(--rb-border);
    border-radius: var(--rb-radius);
    box-shadow: var(--rb-shadow);
    padding: 24px;
}
.rb-card-tight { padding: 0; }
.rb-card-head { padding: 18px 24px; border-bottom: 1px solid var(--rb-border); display: flex; align-items: center; justify-content: space-between; }
.rb-card-head h2 { font-size: 16px; font-weight: 600; margin: 0; }
.rb-card-body { padding: 8px 0; }

/* ---------- Stat card ---------- */
.rb-stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 20px; margin-bottom: 24px; }
.rb-stat { padding: 20px; }
.rb-stat-head { display: flex; align-items: center; justify-content: space-between; color: var(--rb-text-muted); font-size: 13px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; }
.rb-stat-icon { color: var(--rb-primary); font-size: 18px; }
.rb-stat-value { font-size: 30px; font-weight: 700; margin-top: 10px; letter-spacing: -0.02em; }
.rb-stat-hint { color: var(--rb-text-muted); font-size: 13px; margin-top: 4px; }

/* ---------- Table ---------- */
.rb-table-wrap { overflow-x: auto; }
.rb-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.rb-table th, .rb-table td { padding: 14px 24px; text-align: left; vertical-align: middle; }
.rb-table thead th {
    font-size: 12px; font-weight: 600; color: var(--rb-text-muted);
    text-transform: uppercase; letter-spacing: 0.05em;
    border-bottom: 1px solid var(--rb-border); background: #fafafb;
}
.rb-table tbody td { border-bottom: 1px solid var(--rb-border); font-size: 14px; }
.rb-table tbody tr:last-child td { border-bottom: none; }
.rb-table tbody tr:hover { background: var(--rb-bg); }

/* ---------- Badges ---------- */
.rb-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 10px; border-radius: 999px;
    font-size: 12px; font-weight: 600;
    border: 1px solid transparent;
}
.rb-badge-scheduled { background: #eef2ff; color: #4338ca; border-color: #e0e7ff; }
.rb-badge-confirmed { background: #ecfdf5; color: #047857; border-color: #d1fae5; }
.rb-badge-cancelled { background: #f3f4f6; color: #4b5563; border-color: #e5e7eb; }
.rb-badge-no-show   { background: #fef2f2; color: #b91c1c; border-color: #fee2e2; }
.rb-badge-info      { background: #eff6ff; color: #1d4ed8; border-color: #dbeafe; }
.rb-badge-default   { background: var(--rb-bg); color: var(--rb-text-muted); border-color: var(--rb-border); }

/* ---------- Buttons ---------- */
.rb-btn-primary, .btn-primary.rb-btn-primary {
    background: var(--rb-primary); border-color: var(--rb-primary); color: #fff;
    border-radius: 10px; padding: 8px 16px; font-weight: 600;
}
.rb-btn-primary:hover, .btn-primary.rb-btn-primary:hover { background: var(--rb-primary-600); border-color: var(--rb-primary-600); color: #fff; }
.rb-btn-ghost {
    background: var(--rb-surface); border: 1px solid var(--rb-border); color: var(--rb-text);
    border-radius: 10px; padding: 8px 14px; font-weight: 500;
}
.rb-btn-ghost:hover { background: var(--rb-bg); color: var(--rb-text); }
.rb-btn-sm { padding: 4px 10px; font-size: 12px; border-radius: 8px; }

/* ---------- Forms ---------- */
.rb-form-label { font-weight: 600; font-size: 13px; margin-bottom: 6px; color: var(--rb-text); }
.rb-form-control,
.form-control, .form-select {
    border-radius: 10px; border-color: var(--rb-border);
    padding: 9px 12px; font-size: 14px;
}
.form-control:focus, .form-select:focus {
    border-color: var(--rb-primary); box-shadow: 0 0 0 3px rgba(255,106,0,0.15);
}
.rb-form-hint { color: var(--rb-text-muted); font-size: 12px; margin-top: 4px; }

/* ---------- Alerts ---------- */
.rb-alert { border-radius: 12px; border: 1px solid var(--rb-border); }

/* ---------- Empty state ---------- */
.rb-empty { text-align: center; padding: 64px 24px; }
.rb-empty-icon {
    width: 56px; height: 56px; border-radius: 14px;
    background: var(--rb-primary-50); color: var(--rb-primary);
    font-size: 24px; display: inline-flex; align-items: center; justify-content: center;
    margin-bottom: 16px;
}
.rb-empty-title { font-size: 18px; font-weight: 600; margin: 0 0 6px; }
.rb-empty-body { color: var(--rb-text-muted); margin: 0 0 20px; }

/* ---------- Filter bar ---------- */
.rb-filter-bar { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; align-items: flex-end; }
.rb-filter-bar .form-control, .rb-filter-bar .form-select { min-width: 160px; }

/* ---------- Pagination ---------- */
.rb-pagination { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; color: var(--rb-text-muted); font-size: 13px; border-top: 1px solid var(--rb-border); }
.rb-pagination a, .rb-pagination span {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 6px 10px; border-radius: 8px;
    color: var(--rb-text); text-decoration: none;
    border: 1px solid var(--rb-border);
}
.rb-pagination a:hover { background: var(--rb-bg); }
.rb-pagination .is-disabled { color: var(--rb-text-muted); border-color: var(--rb-border); pointer-events: none; opacity: 0.6; }

/* ---------- Login ---------- */
.rb-login {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(180deg, #fff 0%, #fff4ec 100%);
    padding: 24px;
}
.rb-login-card {
    background: var(--rb-surface);
    border: 1px solid var(--rb-border);
    border-radius: 18px; box-shadow: var(--rb-shadow-lg);
    padding: 40px; width: 100%; max-width: 400px;
}
.rb-login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; font-weight: 700; font-size: 20px; }

/* ---------- Helpers ---------- */
.rb-grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; }
.rb-muted { color: var(--rb-text-muted); }
.rb-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.rb-preview {
    background: #fef7f0; border: 1px solid #ffd5b3; border-radius: 12px;
    padding: 16px; white-space: pre-wrap; font-size: 14px; color: #7a3a00;
    min-height: 120px;
}

/* ---------- Responsive ---------- */
@media (max-width: 992px) {
    .rb-stat-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .rb-grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .rb-sidebar { transform: translateX(-100%); transition: transform 0.2s; }
    .rb-sidebar.is-open { transform: translateX(0); }
    .rb-main { margin-left: 0; }
    .rb-content { padding: 20px; }
    .rb-navbar { padding: 0 20px; }
}
